Package org.openstreetmap.josm.gui.layer
Class GpxRouteLayer
- java.lang.Object
-
- org.openstreetmap.josm.gui.layer.AbstractMapViewPaintable
-
- org.openstreetmap.josm.gui.layer.Layer
-
- org.openstreetmap.josm.gui.layer.AbstractModifiableLayer
-
- org.openstreetmap.josm.gui.layer.GpxRouteLayer
-
- All Implemented Interfaces:
Lockable
,ProjectionChangeListener
,DownloadFromServer
,MapViewPaintable
,SaveToFile
,UploadToServer
,Destroyable
public class GpxRouteLayer extends AbstractModifiableLayer
A layer that displays GpxData.routes from a GPX file.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.layer.Layer
Layer.LayerAction, Layer.LayerGpxExportAction, Layer.LayerSaveAction, Layer.LayerSaveAsAction, Layer.MultiLayerAction, Layer.SeparatorLayerAction
-
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.layer.AbstractMapViewPaintable
AbstractMapViewPaintable.CompatibilityModeLayerPainter
-
Nested classes/interfaces inherited from interface org.openstreetmap.josm.gui.layer.MapViewPaintable
MapViewPaintable.LayerPainter, MapViewPaintable.MapViewEvent, MapViewPaintable.PaintableInvalidationEvent, MapViewPaintable.PaintableInvalidationListener
-
-
Field Summary
Fields Modifier and Type Field Description GpxLayer
fromLayer
private java.util.Collection<GpxRoute>
routes
-
Fields inherited from class org.openstreetmap.josm.gui.layer.AbstractModifiableLayer
IS_DIRTY_SYMBOL, REQUIRES_SAVE_TO_DISK_PROP
-
Fields inherited from class org.openstreetmap.josm.gui.layer.Layer
FILTER_STATE_PROP, NAME_PROP, OPACITY_PROP, propertyChangeSupport, VISIBLE_PROP
-
-
Constructor Summary
Constructors Constructor Description GpxRouteLayer()
GpxRouteLayer(java.lang.String name, GpxLayer fromLayer)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected MapViewPaintable.LayerPainter
createMapViewPainter(MapViewPaintable.MapViewEvent event)
Creates a new LayerPainter.javax.swing.Icon
getIcon()
Return a representative small image for this layer.java.lang.Object
getInfoComponent()
Gets the layer information to display to the user.javax.swing.Action[]
getMenuEntries()
Returns list of actions.java.lang.String
getToolTipText()
Returns a small tooltip hint about some statistics for this layer.boolean
isMergable(Layer other)
Determines if the other layer can be merged into this layer.boolean
isModified()
Determines if data managed by this layer has been modified.void
mergeFrom(Layer from)
Merges the given layer into this layer.void
paint(java.awt.Graphics2D g, MapView mv, Bounds bbox)
Paint the dataset using the engine set.void
visitBoundingBox(BoundingXYVisitor v)
Visits the content bounds of this layer.-
Methods inherited from class org.openstreetmap.josm.gui.layer.AbstractModifiableLayer
autosave, createUploadTask, getData, getUploadDialog, isDirty, isDownloadable, isLocked, isUploadable, isUploadDiscouraged, isUploadInProgress, lock, onPostSaveToFile, onPostUploadToServer, requiresSaveToFile, requiresUploadToServer, unlock
-
Methods inherited from class org.openstreetmap.josm.gui.layer.Layer
addPropertyChangeListener, checkSaveConditions, createAndOpenSaveFileChooser, destroy, fireFilterStateChanged, fireOpacityChanged, fireVisibleChanged, getAssociatedFile, getChangesetSourceTag, getColor, getDefaultLayerPosition, getLabel, getName, getOpacity, getViewProjectionBounds, hasColor, hookUpMapView, isBackgroundLayer, isInfoResizable, isProjectionSupported, isRenamed, isSavable, isVisible, nameSupportedProjections, onPostLoadFromFile, projectionChanged, removePropertyChangeListener, rename, setAssociatedFile, setBackgroundLayer, setColor, setFilterStateChanged, setName, setOpacity, setVisible, toggleVisible, toString
-
Methods inherited from class org.openstreetmap.josm.gui.layer.AbstractMapViewPaintable
addInvalidationListener, attachToMapView, invalidate, removeInvalidationListener
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.openstreetmap.josm.gui.layer.SaveToFile
isSavable
-
-
-
-
Constructor Detail
-
GpxRouteLayer
public GpxRouteLayer()
-
GpxRouteLayer
public GpxRouteLayer(java.lang.String name, GpxLayer fromLayer)
-
-
Method Detail
-
isModified
public boolean isModified()
Description copied from class:AbstractModifiableLayer
Determines if data managed by this layer has been modified.- Specified by:
isModified
in classAbstractModifiableLayer
- Returns:
- true if data has been modified; false, otherwise
-
getIcon
public javax.swing.Icon getIcon()
Description copied from class:Layer
Return a representative small image for this layer. The image must not be larger than 64 pixel in any dimension.
-
getToolTipText
public java.lang.String getToolTipText()
Description copied from class:Layer
Returns a small tooltip hint about some statistics for this layer.- Specified by:
getToolTipText
in classLayer
- Returns:
- A small tooltip hint about some statistics for this layer.
-
mergeFrom
public void mergeFrom(Layer from)
Description copied from class:Layer
Merges the given layer into this layer. Throws if the layer types are incompatible.
-
isMergable
public boolean isMergable(Layer other)
Description copied from class:Layer
Determines if the other layer can be merged into this layer.- Specified by:
isMergable
in classLayer
- Parameters:
other
- The other layer that is tested to be mergable with this.- Returns:
- Whether the other layer can be merged into this layer.
-
visitBoundingBox
public void visitBoundingBox(BoundingXYVisitor v)
Description copied from class:Layer
Visits the content bounds of this layer. The behavior of this method depends on the layer, but each implementation should attempt to cover the relevant content of the layer in this method.- Specified by:
visitBoundingBox
in classLayer
- Parameters:
v
- The visitor that gets notified about the contents of this layer.
-
getInfoComponent
public java.lang.Object getInfoComponent()
Description copied from class:Layer
Gets the layer information to display to the user. This is used if the user requests information about this layer. It should display a description of the layer content.- Specified by:
getInfoComponent
in classLayer
- Returns:
- Either a String or a
Component
describing the layer.
-
getMenuEntries
public javax.swing.Action[] getMenuEntries()
Description copied from class:Layer
Returns list of actions. Action can implement LayerAction interface when it needs to be represented by other menu component than JMenuItem or when it supports multiple layers. Actions that support multiple layers should also have correct equals implementation.Use
Layer.SeparatorLayerAction.INSTANCE
instead of new JSeparator- Specified by:
getMenuEntries
in classLayer
- Returns:
- menu actions for this layer
-
paint
public void paint(java.awt.Graphics2D g, MapView mv, Bounds bbox)
Description copied from interface:MapViewPaintable
Paint the dataset using the engine set.- Parameters:
g
- Graphicsmv
- The object that can translate GeoPoints to screen coordinates.bbox
- Bounding box
-
createMapViewPainter
protected MapViewPaintable.LayerPainter createMapViewPainter(MapViewPaintable.MapViewEvent event)
Description copied from class:AbstractMapViewPaintable
Creates a new LayerPainter.- Overrides:
createMapViewPainter
in classAbstractMapViewPaintable
- Parameters:
event
- The event that triggered the creation.- Returns:
- The painter.
-
-