public class GPXPanel
extends org.openstreetmap.gui.jmapviewer.JMapViewer
JMapViewer
to include the display of GPX elements and related functionality.org.openstreetmap.gui.jmapviewer.JMapViewer.ZOOM_BUTTON_STYLE
javax.swing.JPanel.AccessibleJPanel
javax.swing.JComponent.AccessibleJComponent
Modifier and Type | Field and Description |
---|---|
private java.awt.Color |
activeColor |
private double |
crosshairLat |
private double |
crosshairLon |
private java.util.List<GPXFile> |
gpxFiles |
private java.awt.Image |
imgCrosshair |
private java.awt.Image |
imgPathEnd |
private java.awt.Image |
imgPathPt |
private java.awt.Image |
imgPathStart |
private boolean |
showCrosshair |
private java.awt.Point |
shownPoint |
attribution, center, listenerList, mapMarkerList, mapMarkersVisible, mapPolygonList, mapPolygonsVisible, mapRectangleList, mapRectanglesVisible, MAX_ZOOM, MIN_ZOOM, move, scrollWrapEnabled, tileController, tileGridVisible, zoom, zoomButtonStyle, zoomInButton, zoomOutButton, zoomSlider
accessibleContext, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
Constructor and Description |
---|
GPXPanel()
Constructs a new
GPXPanel instance. |
Modifier and Type | Method and Description |
---|---|
void |
addGPXFile(GPXFile gpxFile)
Adds the chosen
GPXFile to the panel. |
void |
fitGPXObjectToPanel(GPXObject gpxObject)
Centers the
GPXObject and sets zoom for best fit to panel. |
java.awt.Color |
getActiveColor() |
java.util.List<GPXFile> |
getGPXFiles() |
java.awt.Point |
getShownPoint() |
protected void |
paintComponent(java.awt.Graphics g) |
private void |
paintFiles(java.awt.Graphics2D g2d,
java.util.List<GPXFile> files)
Paints each file.
|
private void |
paintPath(java.awt.Graphics2D g2d,
WaypointGroup waypointPath)
Paints a single path contained in a
WaypointGroup . |
private void |
paintStartAndEnd(java.awt.Graphics2D g2d,
WaypointGroup waypointPath)
|
private void |
paintWaypointGroup(java.awt.Graphics2D g2d,
WaypointGroup wptGrp)
Paints the waypoints in
WaypointGroup . |
void |
removeGPXFile(GPXFile gpxFile)
Removes the chosen
GPXFile to the panel. |
void |
setActiveColor(java.awt.Color activeColor) |
void |
setCrosshairLat(double crosshairLat) |
void |
setCrosshairLon(double crosshairLon) |
void |
setShowCrosshair(boolean showCrosshair) |
void |
setShownPoint(java.awt.Point shownPoint) |
addJMVListener, addMapMarker, addMapPolygon, addMapRectangle, getAttribution, getCenter, getMapMarkerList, getMapMarkersVisible, getMapPolygonList, getMapPosition, getMapPosition, getMapPosition, getMapPosition, getMapRectangleList, getMeterPerPixel, getPosition, getPosition, getPosition, getTileCache, getTileController, getToolTipText, getZoom, getZoomButtonStyle, getZoomContolsVisible, initializeZoomSlider, isMapPolygonsVisible, isMapRectanglesVisible, isScrollWrapEnabled, isTileGridVisible, moveMap, paintMarker, paintPolygon, paintRectangle, removeAllMapMarkers, removeAllMapPolygons, removeAllMapRectangles, removeJMVListener, removeMapMarker, removeMapPolygon, removeMapRectangle, setCenter, setDisplayPosition, setDisplayPosition, setDisplayPositionByLatLon, setDisplayPositionByLatLon, setDisplayToFitMapElements, setDisplayToFitMapMarkers, setDisplayToFitMapPolygons, setDisplayToFitMapRectangles, setMapMarkerList, setMapMarkerVisible, setMapPolygonList, setMapPolygonsVisible, setMapRectangleList, setMapRectanglesVisible, setScrollWrapEnabled, setTileGridVisible, setTileLoader, setTileSource, setZoom, setZoom, setZoomButtonStyle, setZoomContolsVisible, tileLoadingFinished, zoomChanged, zoomIn, zoomIn, zoomOut, zoomOut
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, 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, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, 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
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 java.util.List<GPXFile> gpxFiles
private java.awt.Image imgPathStart
private java.awt.Image imgPathPt
private java.awt.Image imgPathEnd
private java.awt.Image imgCrosshair
private double crosshairLat
private double crosshairLon
private boolean showCrosshair
private java.awt.Point shownPoint
private java.awt.Color activeColor
public GPXPanel()
GPXPanel
instance.protected void paintComponent(java.awt.Graphics g)
paintComponent
in class org.openstreetmap.gui.jmapviewer.JMapViewer
private void paintFiles(java.awt.Graphics2D g2d, java.util.List<GPXFile> files)
private void paintPath(java.awt.Graphics2D g2d, WaypointGroup waypointPath)
WaypointGroup
.private void paintWaypointGroup(java.awt.Graphics2D g2d, WaypointGroup wptGrp)
WaypointGroup
.private void paintStartAndEnd(java.awt.Graphics2D g2d, WaypointGroup waypointPath)
public void fitGPXObjectToPanel(GPXObject gpxObject)
GPXObject
and sets zoom for best fit to panel.public java.util.List<GPXFile> getGPXFiles()
public void setCrosshairLat(double crosshairLat)
public void setCrosshairLon(double crosshairLon)
public void setShowCrosshair(boolean showCrosshair)
public java.awt.Point getShownPoint()
public void setShownPoint(java.awt.Point shownPoint)
public java.awt.Color getActiveColor()
public void setActiveColor(java.awt.Color activeColor)