X-Git-Url: https://gitweb.fperrin.net/?a=blobdiff_plain;f=tim%2Fprune%2FGpsPruner.java;h=ac61501a2cadc025315918261f138fcc91f367ef;hb=c0387c124840c9407e040600fda88f3c3e8f6aa6;hp=eafbf1977de170622e3a8ae3fb1290a59bc126ae;hpb=52bf9e8686c916be37a26a0b75340393d4478b05;p=GpsPrune.git diff --git a/tim/prune/GpsPruner.java b/tim/prune/GpsPruner.java index eafbf19..ac61501 100644 --- a/tim/prune/GpsPruner.java +++ b/tim/prune/GpsPruner.java @@ -4,32 +4,44 @@ import java.awt.event.WindowAdapter; import java.awt.BorderLayout; import java.awt.event.WindowEvent; import java.io.File; +import java.io.FileNotFoundException; import java.util.Locale; +import java.util.ArrayList; import javax.swing.JFrame; import javax.swing.JSplitPane; import javax.swing.JToolBar; import javax.swing.WindowConstants; +import tim.prune.config.Config; +import tim.prune.config.ConfigException; import tim.prune.gui.DetailsDisplay; import tim.prune.gui.IconManager; import tim.prune.gui.MenuManager; -import tim.prune.gui.ProfileChart; import tim.prune.gui.SelectorDisplay; import tim.prune.gui.StatusBar; +import tim.prune.gui.Viewport; import tim.prune.gui.map.MapCanvas; +import tim.prune.gui.profile.ProfileChart; /** - * Tool to visualize, edit and prune GPS data + * Prune is a tool to visualize, edit, convert and prune GPS data * Please see the included readme.txt or http://activityworkshop.net - * This software is copyright activityworkshop.net and made available through the Gnu GPL + * This software is copyright activityworkshop.net 2006-2010 and made available through the Gnu GPL version 2. + * For license details please see the included license.txt. + * GpsPruner is the main entry point to the application, including initialisation and launch */ public class GpsPruner { - // Final build of version 6 - public static final String VERSION_NUMBER = "6"; - public static final String BUILD_NUMBER = "117"; + /** Version number of application, used in about screen and for version check */ + public static final String VERSION_NUMBER = "10"; + /** Build number, just used for about screen */ + public static final String BUILD_NUMBER = "189"; + /** Static reference to App object */ private static App APP = null; + /** Program name, used for Frame title and for Macs also on the system bar */ + private static final String PROGRAM_NAME = "Prune"; + /** * Main method @@ -38,31 +50,53 @@ public class GpsPruner public static void main(String[] args) { Locale locale = null; + String localeCode = null; String langFilename = null; String configFilename = null; + ArrayList dataFiles = new ArrayList(); boolean showUsage = false; + + // Mac OSX - specific properties (Mac insists that this is done as soon as possible) + if (System.getProperty("mrj.version") != null) { + System.setProperty("apple.laf.useScreenMenuBar", "true"); // menu at top of screen + System.setProperty("com.apple.mrj.application.apple.menu.about.name", PROGRAM_NAME); + } + // Loop over given arguments, if any for (int i=0; i inDataFiles) { - JFrame frame = new JFrame("Prune"); + // Initialise Frame + JFrame frame = new JFrame(PROGRAM_NAME); APP = new App(frame); // make menu - MenuManager menuManager = new MenuManager(frame, APP, APP.getTrackInfo()); + MenuManager menuManager = new MenuManager(APP, APP.getTrackInfo()); frame.setJMenuBar(menuManager.createMenuBar()); APP.setMenuManager(menuManager); UpdateMessageBroker.addSubscriber(menuManager); @@ -143,6 +197,8 @@ public class GpsPruner UpdateMessageBroker.addSubscriber(rightPanel); MapCanvas mapDisp = new MapCanvas(APP, APP.getTrackInfo()); UpdateMessageBroker.addSubscriber(mapDisp); + Viewport viewport = new Viewport(mapDisp); + APP.setViewport(viewport); ProfileChart profileDisp = new ProfileChart(APP.getTrackInfo()); UpdateMessageBroker.addSubscriber(profileDisp); StatusBar statusBar = new StatusBar(); @@ -179,8 +235,11 @@ public class GpsPruner // finish off and display frame frame.pack(); frame.setSize(650, 450); - frame.show(); + frame.setVisible(true); // Set position of map/profile splitter midPane.setDividerLocation(0.75); + + // Finally, give the files to load to the App + APP.loadDataFiles(inDataFiles); } }