|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectus.zuercher.gpx2map.gui.Main
public class Main
Main is the main entry point into the graphical user interface of gpx2map.
Nested Class Summary | |
---|---|
private static class |
Main.LocalFileFilter
LocalFileFilter is a FileFilter for a JFileChooser . |
Field Summary | |
---|---|
Action |
aboutAction
About action. |
Action |
aboutCloseButtonAction
About close button action. |
private JDialog |
aboutDialog
The about dialog, when open. |
JRadioButton |
allRadio
Bound by all radio button. |
Action |
browseCacheDirAction
Cache directory browse action. |
Action |
browseGpxFileAction
GPX browse file action. |
Action |
browseOutputFileAction
Output file browse action. |
Action |
browseRtePtStyleFileAction
Route-point style file browse action. |
Action |
browseTrkPtStyleFileAction
Track style file browse action. |
Action |
browseWayPtStyleFileAction
Way-point style file browse button action. |
JTextField |
cacheDirField
Cache directory field. |
private static String |
COLOR_BUTTON_POSTFIX
Suffix for marker color buttons. |
private static String |
COLOR_BUTTON_PREFIX
Prefix for marker color buttons. |
JLabel |
coordsNwLabel
Bound by coords northwest label. |
JLabel |
coordsNwLatDegLabel
Bound by coords northwest latitude degrees label. |
JFormattedTextField |
coordsNwLatField
Bound by coords northwest latitude field. |
JLabel |
coordsNwLonDegLabel
Bound by coords northwest longitude degrees label. |
JFormattedTextField |
coordsNwLonField
Bound by coords northwest longitude field. |
JRadioButton |
coordsRadio
Bound by coords radio button. |
ItemListener |
coordsRadioListener
Bound by coords radio button listener. |
JLabel |
coordsSeLabel
Bound by coords southeast label. |
JLabel |
coordsSeLatDegLabel
Bound by coords southeast latitude degrees label. |
JFormattedTextField |
coordsSeLatField
Bound by coords southeast latitude field. |
JLabel |
coordsSeLonDegLabel
Bound by coords southeast longitude degrees label. |
JFormattedTextField |
coordsSeLonField
Bound by coords southeast longitude field. |
private static Color |
DEFAULT_COLOR
Default marker color. |
private ActionListener |
dialogCancelListener
File dialog Cancel listener. |
private boolean |
dialogOk
File dialog result. |
private ActionListener |
dialogOkListener
File dialog OK listener. |
Action |
executeAction
Execute action. |
JComboBox |
fontCombo
Font name combo box. |
JComboBox |
fontSizeCombo
Font size combo box. |
JTextField |
gpxFileField
GPX file field. |
private ItemListener |
gpxFileIgnoreItemListener
|
JCheckBox |
gpxFileIgnoreRtePts
GPX ignore routescheckbox. |
JCheckBox |
gpxFileIgnoreTrkPts
GPX ignore tracks checkbox. |
JCheckBox |
gpxFileIgnoreWayPts
GPX ignore way-points checkbox. |
private MapSourceComboBoxModel.MapSourceChoice |
mapSourceChoice
Currently selected combo choice. |
JComboBox |
mapSourceCombo
Map source combo box. |
Action |
mapSourceComboAction
Map source combo box change action. |
JPanel |
mapSourcePanel
Map source box's panel. |
private List<JComboBox> |
mapSourcePropertyComboFields
|
private List<JLabel> |
mapSourcePropertyLabels
|
private List<JTextField> |
mapSourcePropertyTextFields
|
JTextField |
marginField
Margin field. |
JRadioButton |
metersRadio
Meters radio button. |
JTextField |
outputFileField
Output file field. |
JRadioButton |
pixelsRadio
Pixels radio button. |
private static File |
propertyFile
Properties file. |
private JFrame |
root
Main frame of the application. |
JRadioButton |
routesRadio
Bound by routes radio button. |
private Color |
rtePtColor
Current route-point color. |
Action |
rtePtColorAction
Route-point color action. |
JButton |
rtePtColorButton
Route-point color button. |
JCheckBox |
rtePtLabel
Route-point labelling check box. |
JFormattedTextField |
rtePtSizeField
Route-point marker size field. |
JSpinner |
rtePtSizeSpinner
Route-point marker size spinner. |
JComboBox |
rtePtStyleCombo
Route-point style combo box. |
Action |
rtePtStyleComboAction
Route-point style combo box action. |
JButton |
rtePtStyleFileBrowseButton
Route-point style file browse button. |
JTextField |
rtePtStyleFileField
Route-point style file field. |
Action |
saveSettingsAction
Save setting action. |
private Text |
text
Localized text singleton. |
JRadioButton |
tracksRadio
Bound by tracks radio button. |
private Color |
trkPtColor
Current track color. |
Action |
trkPtColorAction
Track color button action. |
JButton |
trkPtColorButton
Track color button. |
JCheckBox |
trkPtJoin
Track segment joining check box. |
JCheckBox |
trkPtLabel
Track labelling check box. |
JFormattedTextField |
trkPtSizeField
Track style marker size field. |
JSpinner |
trkPtSizeSpinner
Track style marker size spinner. |
JComboBox |
trkPtStyleCombo
Track style combo box. |
Action |
trkPtStyleComboAction
Track style combo box action. |
JButton |
trkPtStyleFileBrowseButton
Track style file browse button. |
JTextField |
trkPtStyleFileField
Track style file field. |
JRadioButton |
wayPointsRadio
Bound by way-points radio button. |
private Color |
wayPtColor
Current way-point color. |
Action |
wayPtColorAction
Way-point color button action. |
JButton |
wayPtColorButton
Way-point color button. |
JFormattedTextField |
wayPtSizeField
Way-point marker size field. |
JSpinner |
wayPtSizeSpinner
Way-point marker size spinner. |
JComboBox |
wayPtStyleCombo
Way-point style combo box. |
Action |
wayPtStyleComboAction
Way-point style combo box action. |
JButton |
wayPtStyleFileBrowseButton
Way-point style file browse button. |
JTextField |
wayPtStyleFileField
Way-point style file field. |
private WindowListener |
windowListener
Listens for window closing events and handles graceful exits. |
Constructor Summary | |
---|---|
private |
Main()
Constructs a new Main object. |
Method Summary | |
---|---|
private void |
about()
|
private Color |
chooseColor(Color initialColor,
String titleKey)
Display a color chooser and return the user's selected Color. |
private String |
chooseDir(String titleKey,
File currentValue)
Displays a directory chooser. |
private String |
chooseFile(String titleKey,
Collection<FileFormatDescriptor> formats,
File currentValue,
boolean save)
Displays a file chooser. |
private String |
chooseFile(String titleKey,
String descKey,
String suffix,
File currentValue,
boolean save)
Displays a file chooser. |
private String |
chooseImageFile(String titleKey,
File currentValue,
boolean ppmOnly,
boolean save)
Display an image file chooser. |
private void |
configureMarkerSpinnerEditor(JSpinner spinner,
JFormattedTextField field)
Configure a spinner and formatted text field to work together. |
private void |
execute()
Applies the GUI settings to the Gpx2Map and generates/plots
the map. |
private File |
getCurrentFile(JTextComponent fileField)
Convert the contents of a JTextComponent into a File . |
private MarkerStyle |
getMarkerStyle(JComboBox styleCombo,
String fileText)
|
private boolean |
loadSettings()
Load current settings from the settings file. |
static void |
main(String[] args)
Main entry point for the Gpx2Map GUI. |
private void |
saveSettings()
Save the current settings for later use. |
private void |
setComboBoxSelection(JComboBox comboBox,
String value)
Iterates over the given JComboBox 's items and marks the item
whose display name matches the given value as selected. |
private void |
showUserInterface()
Display the Gpx2Map user interface. |
static void |
start(String localeName)
Simplified entry point for Main. |
private String |
toHexString(int x)
Convert an integer to a minimum two-digit hex string. |
private void |
updateColor(JButton colorButton,
Color color)
Modifies the color of a "color button." Colors buttons are simply a JButton with an HTML table as the button label content. |
private void |
updateMapSourceProperties()
Update the map source property controls. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final Color DEFAULT_COLOR
private static final File propertyFile
private static String COLOR_BUTTON_PREFIX
private static String COLOR_BUTTON_POSTFIX
private final Text text
private JFrame root
public JTextField gpxFileField
public Action browseGpxFileAction
public JCheckBox gpxFileIgnoreTrkPts
public JCheckBox gpxFileIgnoreRtePts
public JCheckBox gpxFileIgnoreWayPts
private ItemListener gpxFileIgnoreItemListener
public JTextField outputFileField
public Action browseOutputFileAction
public JPanel mapSourcePanel
public JComboBox mapSourceCombo
private MapSourceComboBoxModel.MapSourceChoice mapSourceChoice
public Action mapSourceComboAction
private List<JLabel> mapSourcePropertyLabels
private List<JTextField> mapSourcePropertyTextFields
private List<JComboBox> mapSourcePropertyComboFields
public JTextField cacheDirField
public Action browseCacheDirAction
public JTextField marginField
public JRadioButton metersRadio
public JRadioButton pixelsRadio
public JRadioButton tracksRadio
public JRadioButton routesRadio
public JRadioButton wayPointsRadio
public JRadioButton allRadio
public JRadioButton coordsRadio
public ItemListener coordsRadioListener
public JLabel coordsNwLabel
public JFormattedTextField coordsNwLatField
public JLabel coordsNwLatDegLabel
public JFormattedTextField coordsNwLonField
public JLabel coordsNwLonDegLabel
public JLabel coordsSeLabel
public JFormattedTextField coordsSeLatField
public JLabel coordsSeLatDegLabel
public JFormattedTextField coordsSeLonField
public JLabel coordsSeLonDegLabel
public JComboBox fontCombo
public JComboBox fontSizeCombo
private Color trkPtColor
public JButton trkPtColorButton
public Action trkPtColorAction
public JComboBox trkPtStyleCombo
public Action trkPtStyleComboAction
public JTextField trkPtStyleFileField
public JButton trkPtStyleFileBrowseButton
public Action browseTrkPtStyleFileAction
public JFormattedTextField trkPtSizeField
public JSpinner trkPtSizeSpinner
public JCheckBox trkPtLabel
public JCheckBox trkPtJoin
private Color rtePtColor
public JButton rtePtColorButton
public Action rtePtColorAction
public JComboBox rtePtStyleCombo
public Action rtePtStyleComboAction
public JTextField rtePtStyleFileField
public JButton rtePtStyleFileBrowseButton
public Action browseRtePtStyleFileAction
public JFormattedTextField rtePtSizeField
public JSpinner rtePtSizeSpinner
public JCheckBox rtePtLabel
private Color wayPtColor
public JButton wayPtColorButton
public Action wayPtColorAction
public JComboBox wayPtStyleCombo
public Action wayPtStyleComboAction
public JTextField wayPtStyleFileField
public JButton wayPtStyleFileBrowseButton
public Action browseWayPtStyleFileAction
public JFormattedTextField wayPtSizeField
public JSpinner wayPtSizeSpinner
public Action aboutAction
public Action aboutCloseButtonAction
private JDialog aboutDialog
public Action saveSettingsAction
public Action executeAction
private WindowListener windowListener
private boolean dialogOk
private ActionListener dialogOkListener
private ActionListener dialogCancelListener
Constructor Detail |
---|
private Main()
Method Detail |
---|
public static void start(String localeName)
localeName
- name of a locale (in lang_COUNTRY_variant) format
where lang is the ISO 630 language code (lower case),
COUNTRY is the optional ISO 3166 country code (upper
case), and variant is the optional variant name.
If localeName
is null, the system
default locale is used.public static void main(String[] args)
args
- unusedprivate void showUserInterface()
private void configureMarkerSpinnerEditor(JSpinner spinner, JFormattedTextField field)
spinner
- a JSpinnerfield
- a JFormattedTextField to associate with the JSpinnerprivate void updateMapSourceProperties()
private void updateColor(JButton colorButton, Color color)
colorButton
- the button to modifycolor
- the button's new colorprivate String toHexString(int x)
x
- an integer
private Color chooseColor(Color initialColor, String titleKey)
initialColor
- the chooser's initial colortitleKey
- resource key for the chooser's title, may not required
parameters
private String chooseDir(String titleKey, File currentValue)
titleKey
- resource key of title for the chooser, may not require
parameterscurrentValue
- initial value for the chooser
private String chooseFile(String titleKey, String descKey, String suffix, File currentValue, boolean save)
titleKey
- resource key of title for the chooser, may not require
parametersdescKey
- resource key of file type description (e.g.,
"JPEG Images"); may not require parameterssuffix
- file type suffix (e.g., ".jpeg")currentValue
- current file namesave
- flag indicating whether this is to be a save dialog
private String chooseFile(String titleKey, Collection<FileFormatDescriptor> formats, File currentValue, boolean save)
titleKey
- resource key of title for the chooser, may not require
parametersformats
- FileFormatDescriptor
objects for formats to
accept in the dialog ("all files" is always available);
first entry is the defaultcurrentValue
- current file namesave
- flag indicating whether this is to be a save dialog
private String chooseImageFile(String titleKey, File currentValue, boolean ppmOnly, boolean save)
titleKey
- resource key of title for the chooser, may not require
parameterscurrentValue
- the chooser's starting fileppmOnly
- if true, only Netpbm images will be shown as
a file type optionsave
- flag indicating whether this is to be a save dialog
private void execute()
Gpx2Map
and generates/plots
the map.
private MarkerStyle getMarkerStyle(JComboBox styleCombo, String fileText)
private void about()
private void saveSettings()
private boolean loadSettings() throws StartupException
StartupException
. StartupException is only thrown for cases
where the error demands further investigation:
StartupException
- on some errors, see aboveprivate void setComboBoxSelection(JComboBox comboBox, String value)
JComboBox
's items and marks the item
whose display name matches the given value as selected. If no
matching item is found, the previously selected item remains selected.
comboBox
- the JComboBox
to modifyvalue
- the display name of the item to selectprivate File getCurrentFile(JTextComponent fileField)
JTextComponent
into a File
.
fileField
- the JTextComponent
to convert.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |