public class GPXCreator
extends javax.swing.JComponent
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
private GPXObject |
activeGPXObject |
private javax.swing.tree.DefaultMutableTreeNode |
activeTracksegNode |
private Waypoint |
activeWpt |
private WaypointGroup |
activeWptGrp |
private javax.swing.JButton |
btnCorrectEle |
private javax.swing.JButton |
btnEditProperties |
private javax.swing.JButton |
btnEleChart |
private javax.swing.JButton |
btnFileNew |
private javax.swing.JButton |
btnFileOpen |
private javax.swing.JButton |
btnFileSave |
private javax.swing.JButton |
btnObjectDelete |
private javax.swing.JButton |
btnSpeedChart |
private javax.swing.JFileChooser |
chooserFileOpen |
private javax.swing.JFileChooser |
chooserFileSave |
private javax.swing.JComboBox<java.lang.String> |
comboBoxTileSource |
private javax.swing.JPanel |
containerExplorerHeading |
private javax.swing.JPanel |
containerLeftSidebarBottom |
private javax.swing.JPanel |
containerLeftSidebarTop |
private javax.swing.JPanel |
containerPropertiesHeading |
private javax.swing.tree.DefaultMutableTreeNode |
currSelection |
private boolean |
fileIOHappening |
private java.io.File |
fileOpened |
private java.io.File |
fileSave |
private javax.swing.JFrame |
frame |
private javax.swing.JPanel |
glassPane |
private javax.swing.JLabel |
glassPaneStatus |
private GPXFile |
gpxFileOpened |
private javax.swing.JLabel |
labelExplorerHeading |
private javax.swing.JLabel |
labelPropertiesHeading |
private javax.swing.JLabel |
lblLat |
private javax.swing.JLabel |
lblLon |
private javax.swing.JLabel |
lblMapQuestBike |
private javax.swing.JLabel |
lblMapQuestFoot |
private javax.swing.JLabel |
lblRoutingCancel |
private java.util.List<javax.swing.JLabel> |
lblsRoutingOptions |
private javax.swing.JLabel |
lblYOURSBike |
private javax.swing.JLabel |
lblYOURSFoot |
private static java.lang.String |
lookAndFeel |
private java.awt.Cursor |
mapCursor |
private GPXPanel |
mapPanel |
private boolean |
mouseOverLink |
private javax.swing.JPanel |
panelRoutingCancel |
private javax.swing.JPanel |
panelRoutingOptions |
private PathFinder |
pathFinder |
private PathFinder |
pathFinderMapquest |
private PathFinder |
pathFinderYOURS |
private PathFinder.PathFindType |
pathFindType |
private javax.swing.SwingWorker<java.lang.Void,java.lang.Void> |
pathFindWorker |
private javax.swing.tree.DefaultMutableTreeNode |
root |
private javax.swing.JScrollPane |
scrollPaneExplorer |
private javax.swing.JScrollPane |
scrollPaneProperties |
private java.text.SimpleDateFormat |
sdf |
private javax.swing.JSplitPane |
splitPaneMain |
private javax.swing.JSplitPane |
splitPaneSidebar |
private javax.swing.table.DefaultTableModel |
tableModelProperties |
private javax.swing.JTable |
tableProperties |
private javax.swing.JTextField |
textFieldLat |
private javax.swing.JTextField |
textFieldLon |
private javax.swing.JToggleButton |
tglAddPoints |
private javax.swing.JToggleButton |
tglDelPoints |
private javax.swing.JToggleButton |
tglLatLonFocus |
private javax.swing.JToggleButton |
tglPathFinder |
private javax.swing.JToggleButton |
tglSplitTrackseg |
private javax.swing.JToolBar |
toolBarMain |
private java.awt.Color |
transparentGrey |
private java.awt.Color |
transparentRed |
private java.awt.Color |
transparentYellow |
private javax.swing.JTree |
tree |
private javax.swing.tree.DefaultTreeModel |
treeModel |
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
GPXCreator()
Create the application.
|
Modifier and Type | Method and Description |
---|---|
void |
buildChart(java.lang.String chartName,
java.lang.String iconPath)
Builds the selected chart type and displays the new window frame.
|
void |
clearPropsTable()
Clears the properties table.
|
void |
deleteActiveGPXObject()
Removes the active
GPXObject from its parent container. |
void |
deselectAllToggles(javax.swing.JToggleButton exceptThisOne)
Registers a list of
JToggleButton s and deselects them all, optionally leaving one selected. |
void |
editProperties()
Displays the edit properties dialog and saves the user-selected values to the active
GPXObject . |
void |
fileNew()
Creates a new GPX file and loads it into the application.
|
void |
fileOpen()
Loads a GPX file into the application.
|
void |
fileSave()
Saves the active
GPXFile to disk. |
GPXObject |
getActiveGPXObject() |
private void |
initialize()
Initialize the contents of the frame.
|
static void |
main(java.lang.String[] args)
Launch the application.
|
void |
propsDisplayPathDetails(WaypointGroup path)
Displays details common to all path types (
WaypointGroup.WptGrpType.ROUTE and WaypointGroup.WptGrpType.TRACKSEG ). |
void |
propsDisplayRoute(Route rte)
Displays details for a
Route in the properties table. |
void |
propsDisplayTrackseg(Track trk,
WaypointGroup trkpts)
Displays details for a track segment in the properties table.
|
void |
setActiveGPXObject(GPXObject gpxObject) |
void |
setFileIOHappening(boolean happening)
Sets a flag to synchronize I/O operations with
GPXFile s. |
void |
updateActiveWpt(java.awt.event.MouseEvent e)
Common function used by multiple mouse listeners.
|
void |
updateActiveWptGrp()
Determines which
GPXObject s are active and sets the appropriate variables. |
void |
updateButtonVisibility()
Dynamically enables/disables certain toolbar buttons dependent on which type of
GPXObject is active
and what operations are allowed on that type of element. |
void |
updatePropsTable()
Updates the data displayed in the properties table.
|
void |
updatePropTableWidths()
Dynamically adjusts the widths of the columns in the properties table for optimal display.
|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusDownCycle, validate, validateTree
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
private javax.swing.JFrame frame
private javax.swing.JPanel glassPane
private javax.swing.JLabel glassPaneStatus
private static java.lang.String lookAndFeel
private javax.swing.JToolBar toolBarMain
private boolean fileIOHappening
private javax.swing.JButton btnFileNew
private javax.swing.JButton btnFileOpen
private javax.swing.JFileChooser chooserFileOpen
private java.io.File fileOpened
private GPXFile gpxFileOpened
private javax.swing.JButton btnFileSave
private javax.swing.JFileChooser chooserFileSave
private java.io.File fileSave
private javax.swing.JButton btnObjectDelete
private javax.swing.JButton btnEditProperties
private javax.swing.JToggleButton tglPathFinder
private javax.swing.SwingWorker<java.lang.Void,java.lang.Void> pathFindWorker
private javax.swing.JToggleButton tglAddPoints
private javax.swing.JToggleButton tglDelPoints
private javax.swing.JToggleButton tglSplitTrackseg
private javax.swing.JButton btnCorrectEle
private javax.swing.JButton btnEleChart
private javax.swing.JButton btnSpeedChart
private javax.swing.JComboBox<java.lang.String> comboBoxTileSource
private javax.swing.JLabel lblLat
private javax.swing.JTextField textFieldLat
private javax.swing.JLabel lblLon
private javax.swing.JTextField textFieldLon
private javax.swing.JToggleButton tglLatLonFocus
private javax.swing.JSplitPane splitPaneMain
private javax.swing.JSplitPane splitPaneSidebar
private javax.swing.JPanel containerLeftSidebarTop
private javax.swing.JPanel containerExplorerHeading
private javax.swing.JLabel labelExplorerHeading
private javax.swing.JScrollPane scrollPaneExplorer
private javax.swing.tree.DefaultMutableTreeNode root
private javax.swing.tree.DefaultTreeModel treeModel
private javax.swing.JTree tree
private javax.swing.tree.DefaultMutableTreeNode currSelection
private javax.swing.JPanel containerLeftSidebarBottom
private javax.swing.JPanel containerPropertiesHeading
private javax.swing.JLabel labelPropertiesHeading
private javax.swing.JScrollPane scrollPaneProperties
private javax.swing.table.DefaultTableModel tableModelProperties
private javax.swing.JTable tableProperties
private java.text.SimpleDateFormat sdf
private GPXPanel mapPanel
private javax.swing.JPanel panelRoutingOptions
private javax.swing.JLabel lblMapQuestFoot
private javax.swing.JLabel lblMapQuestBike
private javax.swing.JLabel lblYOURSFoot
private javax.swing.JLabel lblYOURSBike
private java.util.List<javax.swing.JLabel> lblsRoutingOptions
private PathFinder pathFinder
private PathFinder pathFinderMapquest
private PathFinder pathFinderYOURS
private PathFinder.PathFindType pathFindType
private javax.swing.JPanel panelRoutingCancel
private javax.swing.JLabel lblRoutingCancel
private GPXObject activeGPXObject
private java.awt.Cursor mapCursor
private boolean mouseOverLink
private WaypointGroup activeWptGrp
private javax.swing.tree.DefaultMutableTreeNode activeTracksegNode
private Waypoint activeWpt
private java.awt.Color transparentYellow
private java.awt.Color transparentGrey
private java.awt.Color transparentRed
public static void main(java.lang.String[] args)
private void initialize()
public void fileNew()
public void fileOpen()
public void fileSave()
GPXFile
to disk.public void deleteActiveGPXObject()
GPXObject
from its parent container.public GPXObject getActiveGPXObject()
public void setActiveGPXObject(GPXObject gpxObject)
public void updatePropsTable()
public void propsDisplayRoute(Route rte)
Route
in the properties table.public void propsDisplayTrackseg(Track trk, WaypointGroup trkpts)
public void propsDisplayPathDetails(WaypointGroup path)
WaypointGroup.WptGrpType.ROUTE
and WaypointGroup.WptGrpType.TRACKSEG
).public void updatePropTableWidths()
public void clearPropsTable()
public void updateActiveWpt(java.awt.event.MouseEvent e)
public void updateActiveWptGrp()
GPXObject
s are active and sets the appropriate variables.public void deselectAllToggles(javax.swing.JToggleButton exceptThisOne)
JToggleButton
s and deselects them all, optionally leaving one selected.
Used to prevent multiple toggles from being selected simultaneously.public void updateButtonVisibility()
GPXObject
is active
and what operations are allowed on that type of element.public void buildChart(java.lang.String chartName, java.lang.String iconPath)
public void editProperties()
GPXObject
.public void setFileIOHappening(boolean happening)
GPXFile
s. Must be called before and after each I/O.