public class GpxLayer extends Layer
Layer.LayerAction, Layer.LayerGpxExportAction, Layer.LayerSaveAction, Layer.LayerSaveAsAction, Layer.MultiLayerAction, Layer.SeparatorLayerAction| Modifier and Type | Field and Description |
|---|---|
GpxData |
data |
private GpxDrawHelper |
drawHelper |
private boolean |
isLocalFile |
private java.util.List<GpxTrack> |
lastTracks |
private int |
lastUpdateCount |
boolean[] |
trackVisibility |
ICON_SIZE, NAME_PROP, OPACITY_PROP, propertyChangeSupport, VISIBLE_PROP| Constructor and Description |
|---|
GpxLayer(GpxData d) |
GpxLayer(GpxData d,
java.lang.String name) |
GpxLayer(GpxData d,
java.lang.String name,
boolean isLocal) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkSaveConditions()
Checks whether it is ok to launch a save (whether we have data, there is no conflict etc.)
|
java.io.File |
createAndOpenSaveFileChooser()
Creates a new "Save" dialog for this layer and makes it visible.
When the user has chosen a file, checks the file extension, and confirms overwrite if needed. |
private void |
ensureTrackVisibilityLength()
ensures the trackVisibility array has the correct length without losing data.
|
void |
filterTracksByDate(java.util.Date fromDate,
java.util.Date toDate,
boolean showWithoutDate) |
java.io.File |
getAssociatedFile() |
java.awt.Color |
getColor(boolean ignoreCustom)
Return a Color for this layer.
|
javax.swing.Icon |
getIcon()
Return a representative small image for this layer.
|
java.lang.Object |
getInfoComponent() |
javax.swing.Action[] |
getMenuEntries()
Returns list of actions.
|
static java.lang.String |
getTimespanForTrack(GpxTrack trk)
Returns a human readable string that shows the timespan of the given track
|
java.lang.String |
getToolTipText() |
boolean |
isChanged()
Check changed status of layer
|
boolean |
isInfoResizable()
Determines if info dialog can be resized (false by default).
|
boolean |
isLocalFile() |
boolean |
isMergable(Layer other) |
boolean |
isSavable()
Replies the savable state of this layer (i.e if it can be saved through a "File->Save" dialog).
|
private java.util.List<WayPoint> |
listVisibleSegments(Bounds box) |
void |
mergeFrom(Layer from)
Merges the given layer into this layer.
|
void |
paint(java.awt.Graphics2D g,
MapView mv,
Bounds box)
Paint the dataset using the engine set.
|
void |
projectionChanged(Projection oldValue,
Projection newValue) |
void |
setAssociatedFile(java.io.File file) |
private int |
sumUpdateCount() |
void |
visitBoundingBox(BoundingXYVisitor v) |
addPropertyChangeListener, destroy, fireOpacityChanged, fireVisibleChanged, getName, getOpacity, hookUpMapView, isBackgroundLayer, isProjectionSupported, isVisible, nameSupportedProjections, onPostLoadFromFile, removePropertyChangeListener, setBackgroundLayer, setName, setOpacity, setVisible, toggleVisibleprivate boolean isLocalFile
public boolean[] trackVisibility
private final java.util.List<GpxTrack> lastTracks
private int lastUpdateCount
private final GpxDrawHelper drawHelper
public java.awt.Color getColor(boolean ignoreCustom)
Layerpublic static java.lang.String getTimespanForTrack(GpxTrack trk)
trk - The GPX track for which timespan is displayedpublic javax.swing.Icon getIcon()
Layerpublic java.lang.Object getInfoComponent()
getInfoComponent in class Layerpublic boolean isInfoResizable()
LayerisInfoResizable in class Layertrue if the info dialog can be resized, false otherwisepublic javax.swing.Action[] getMenuEntries()
LayergetMenuEntries in class Layerpublic boolean isLocalFile()
public java.lang.String getToolTipText()
getToolTipText in class Layerpublic boolean isMergable(Layer other)
isMergable in class Layerother - The other layer that is tested to be mergable with this.private int sumUpdateCount()
public boolean isChanged()
Layerpublic void filterTracksByDate(java.util.Date fromDate, java.util.Date toDate, boolean showWithoutDate)
public void mergeFrom(Layer from)
Layerpublic void paint(java.awt.Graphics2D g, MapView mv, Bounds box)
Layerpaint in interface MapViewPaintablepaint in class Layermv - The object that can translate GeoPoints to screen coordinates.private java.util.List<WayPoint> listVisibleSegments(Bounds box)
public void visitBoundingBox(BoundingXYVisitor v)
visitBoundingBox in class Layerpublic java.io.File getAssociatedFile()
getAssociatedFile in class Layerpublic void setAssociatedFile(java.io.File file)
setAssociatedFile in class Layerprivate void ensureTrackVisibilityLength()
public void projectionChanged(Projection oldValue, Projection newValue)
projectionChanged in interface ProjectionChangeListenerprojectionChanged in class Layerpublic boolean isSavable()
Layerpublic boolean checkSaveConditions()
LayercheckSaveConditions in class Layertrue, if it is safe to save.public java.io.File createAndOpenSaveFileChooser()
LayercreateAndOpenSaveFileChooser in class LayerFileSaveActionBase.createAndOpenSaveFileChooser(java.lang.String, org.openstreetmap.josm.actions.ExtensionFileFilter)