|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.gui.layer.Layer
org.openstreetmap.josm.gui.layer.GpxLayer
public class GpxLayer
Nested Class Summary | |
---|---|
class |
GpxLayer.ChooseTrackVisibilityAction
allows the user to choose which of the downloaded tracks should be displayed. |
(package private) static class |
GpxLayer.colorModes
|
class |
GpxLayer.ConvertToDataLayerAction
|
private class |
GpxLayer.CustomizeDrawing
|
class |
GpxLayer.DownloadAlongTrackAction
Action that issues a series of download requests to the API, following the GPX track. |
class |
GpxLayer.DownloadWmsAlongTrackAction
|
private class |
GpxLayer.ImportAudio
|
private class |
GpxLayer.ImportImages
|
private static class |
GpxLayer.Markers
|
private class |
GpxLayer.MarkersFromNamedPoins
|
Nested classes/interfaces inherited from class org.openstreetmap.josm.gui.layer.Layer |
---|
Layer.LayerAction, Layer.LayerGpxExportAction, Layer.LayerSaveAction, Layer.LayerSaveAsAction, Layer.MultiLayerAction, Layer.SeparatorLayerAction |
Field Summary | |
---|---|
private static java.awt.Color[] |
colors
|
private static java.awt.Color[] |
colors_cyclic
|
private boolean |
computeCacheColorDynamic
|
private GpxLayer.colorModes |
computeCacheColored
|
private int |
computeCacheColorTracksTune
|
private java.awt.Color |
computeCacheColorUsed
|
private boolean |
computeCacheInSync
|
private int |
computeCacheMaxLineLengthUsed
|
GpxData |
data
|
private static int[][] |
dir
|
private boolean |
isLocalFile
|
private java.util.List<GpxTrack> |
lastTracks
|
private int |
lastUpdateCount
|
private static int |
ll0
|
protected static double |
PHI
|
private static java.lang.String |
PREF_DOWNLOAD_ALONG_TRACK_AREA
|
private static java.lang.String |
PREF_DOWNLOAD_ALONG_TRACK_DISTANCE
|
private static java.lang.String |
PREF_DOWNLOAD_ALONG_TRACK_NEAR
|
private static int |
sl4
|
private static int |
sl9
|
private boolean[] |
trackVisibility
|
Fields inherited from class org.openstreetmap.josm.gui.layer.Layer |
---|
ICON_SIZE, NAME_PROP, OPACITY_PROP, propertyChangeSupport, VISIBLE_PROP |
Constructor Summary | |
---|---|
GpxLayer(GpxData d)
|
|
GpxLayer(GpxData d,
java.lang.String name)
|
|
GpxLayer(GpxData d,
java.lang.String name,
boolean isLocal)
|
Method Summary | |
---|---|
private static void |
addToDownload(java.awt.geom.Area a,
java.awt.geom.Rectangle2D r,
java.util.Collection<java.awt.geom.Rectangle2D> results,
double max_area)
|
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. |
java.io.File |
getAssociatedFile()
|
java.awt.Color |
getColor(boolean ignoreCustom)
Return a Color for this layer. |
GpxLayer.colorModes |
getColorMode()
|
static java.awt.Color |
getGenericColor()
|
javax.swing.Icon |
getIcon()
Return a representative small image for this layer. |
java.lang.Object |
getInfoComponent()
|
javax.swing.Action[] |
getMenuEntries()
Returns list of actions. |
private static java.lang.String |
getTimespanForTrack(GpxTrack trk)
returns a human readable string that shows the timespan of the given track |
java.lang.String |
getToolTipText()
|
private void |
importAudio(java.io.File wavFile,
MarkerLayer ml,
double firstStartTime,
GpxLayer.Markers markers)
Makes a new marker layer derived from this GpxLayer containing at least one audio marker which the given audio file is associated with. |
boolean |
isChanged()
Check changed status of layer |
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). |
void |
mergeFrom(Layer from)
Merges the given layer into this layer. |
WayPoint |
nearestPointOnTrack(EastNorth P,
double tolerance)
Makes a WayPoint at the projection of point P onto the track providing P is less than tolerance away from the track |
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)
|
private static float |
w(float x)
transition function: w(0)=1, w(1)=0, 0<=w(x)<=1 |
Methods inherited from class org.openstreetmap.josm.gui.layer.Layer |
---|
addPropertyChangeListener, destroy, fireOpacityChanged, fireVisibleChanged, getName, getOpacity, hookUpMapView, isBackgroundLayer, isProjectionSupported, isVisible, nameSupportedProjections, onPostLoadFromFile, removePropertyChangeListener, setBackgroundLayer, setName, setOpacity, setVisible, toggleVisible |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.lang.String PREF_DOWNLOAD_ALONG_TRACK_DISTANCE
private static final java.lang.String PREF_DOWNLOAD_ALONG_TRACK_AREA
private static final java.lang.String PREF_DOWNLOAD_ALONG_TRACK_NEAR
public GpxData data
protected static final double PHI
private boolean computeCacheInSync
private int computeCacheMaxLineLengthUsed
private java.awt.Color computeCacheColorUsed
private boolean computeCacheColorDynamic
private GpxLayer.colorModes computeCacheColored
private int computeCacheColorTracksTune
private boolean isLocalFile
private boolean[] trackVisibility
private final java.util.List<GpxTrack> lastTracks
private int lastUpdateCount
private static final java.awt.Color[] colors
private static final java.awt.Color[] colors_cyclic
private static final int ll0
private static final int sl4
private static final int sl9
private static final int[][] dir
Constructor Detail |
---|
public GpxLayer(GpxData d)
public GpxLayer(GpxData d, java.lang.String name)
public GpxLayer(GpxData d, java.lang.String name, boolean isLocal)
Method Detail |
---|
private static java.lang.String getTimespanForTrack(GpxTrack trk)
public javax.swing.Icon getIcon()
Layer
getIcon
in class Layer
public java.lang.Object getInfoComponent()
getInfoComponent
in class Layer
public java.awt.Color getColor(boolean ignoreCustom)
Layer
getColor
in class Layer
ignoreCustom
- Custom color should return null, as no default color
is used. When this is true, then even for custom coloring the base
color is returned - mainly for layer internal use.public GpxLayer.colorModes getColorMode()
public static java.awt.Color getGenericColor()
public javax.swing.Action[] getMenuEntries()
Layer
getMenuEntries
in class Layer
public java.lang.String getToolTipText()
getToolTipText
in class Layer
public boolean isMergable(Layer other)
isMergable
in class Layer
other
- The other layer that is tested to be mergable with this.
private int sumUpdateCount()
public boolean isChanged()
Layer
isChanged
in class Layer
public void mergeFrom(Layer from)
Layer
mergeFrom
in class Layer
from
- The layer that get merged into this one. After the merge,
the other layer is not usable anymore and passing to one others
mergeFrom should be one of the last things to do with a layer.private static float w(float x)
x
- number: 0<=x<=1
public void paint(java.awt.Graphics2D g, MapView mv, Bounds box)
Layer
paint
in interface MapViewPaintable
paint
in class Layer
mv
- The object that can translate GeoPoints to screen coordinates.public void visitBoundingBox(BoundingXYVisitor v)
visitBoundingBox
in class Layer
public java.io.File getAssociatedFile()
getAssociatedFile
in class Layer
public void setAssociatedFile(java.io.File file)
setAssociatedFile
in class Layer
private final void ensureTrackVisibilityLength()
private static void addToDownload(java.awt.geom.Area a, java.awt.geom.Rectangle2D r, java.util.Collection<java.awt.geom.Rectangle2D> results, double max_area)
private void importAudio(java.io.File wavFile, MarkerLayer ml, double firstStartTime, GpxLayer.Markers markers)
wavFile
- : the file to be associated with the markers in the new marker layermarkers
- : keeps track of warning messages to avoid repeated warningspublic WayPoint nearestPointOnTrack(EastNorth P, double tolerance)
P
- : the point to determine the projection fortolerance
- : must be no further than this from the track
public void projectionChanged(Projection oldValue, Projection newValue)
projectionChanged
in interface ProjectionChangeListener
projectionChanged
in class Layer
public boolean isSavable()
Layer
isSavable
in class Layer
public boolean checkSaveConditions()
Layer
checkSaveConditions
in class Layer
true
, if it is safe to save.public java.io.File createAndOpenSaveFileChooser()
Layer
createAndOpenSaveFileChooser
in class Layer
File
SaveActionBase.createAndOpenSaveFileChooser(java.lang.String, org.openstreetmap.josm.actions.ExtensionFileFilter)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |