import java.awt.event.WindowAdapter;
import java.awt.BorderLayout;
import java.awt.Component;
+import java.awt.Image;
import java.awt.event.WindowEvent;
import java.io.File;
import java.io.FileNotFoundException;
/**
* GpsPrune 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 2006-2013 and made available through the Gnu GPL version 2.
+ * This software is copyright activityworkshop.net 2006-2015 and made available through the Gnu GPL version 2.
* For license details please see the included license.txt.
* GpsPrune is the main entry point to the application, including initialisation and launch
*/
public class GpsPrune
{
/** Version number of application, used in about screen and for version check */
- public static final String VERSION_NUMBER = "14.1";
+ public static final String VERSION_NUMBER = "18";
/** Build number, just used for about screen */
- public static final String BUILD_NUMBER = "265a";
+ public static final String BUILD_NUMBER = "334";
/** Static reference to App object */
private static App APP = null;
}
}
}
- if (showUsage) {
- System.out.println("Possible parameters:"
+ if (showUsage)
+ {
+ System.out.println("GpsPrune - a tool for editing GPS data.\nPossible parameters:"
+ "\n --configfile=<file> used to specify a configuration file"
+ "\n --lang=<code> used to specify language code such as DE"
+ "\n --langfile=<file> used to specify an alternative language file\n");
// Avoid automatically shutting down if window closed
frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE);
- // set icon
- try {
- frame.setIconImage(IconManager.getImageIcon(IconManager.WINDOW_ICON).getImage());
+ // set window icons of different resolutions (1.6+)
+ try
+ {
+ ArrayList<Image> icons = new ArrayList<Image>();
+ String[] resolutions = {"_16", "_20", "_32", "_64", "_128"};
+ for (String r : resolutions) {
+ icons.add(IconManager.getImageIcon(IconManager.WINDOW_ICON + r + ".png").getImage());
+ }
+ Class<?> d = java.awt.Window.class;
+ // This is the same as frame.setIconImages(icons) but is compilable also for java1.5 where this isn't available
+ d.getDeclaredMethod("setIconImages", new Class[]{java.util.List.class}).invoke(frame, icons);
}
- catch (Exception e) {} // ignore
+ catch (Exception e)
+ {
+ // setting a list of icon images didn't work, so try with just one image instead
+ try {
+ frame.setIconImage(IconManager.getImageIcon(IconManager.WINDOW_ICON + "_16.png").getImage());
+ }
+ catch (Exception e2) {}
+ }
+
+ // Set up drag-and-drop handler to accept dropped files
+ frame.setTransferHandler(new FileDropHandler(APP));
// finish off and display frame
frame.pack();