public class MarkerLayer extends Layer implements JumpToMarkerActions.JumpToMarkerLayer
Modifier and Type | Class and Description |
---|---|
private class |
MarkerLayer.MarkerMouseAdapter |
private class |
MarkerLayer.MoveAudio |
static class |
MarkerLayer.ShowHideMarkerText |
private class |
MarkerLayer.SynchronizeAudio |
Layer.LayerAction, Layer.LayerGpxExportAction, Layer.LayerSaveAction, Layer.LayerSaveAsAction, Layer.MultiLayerAction, Layer.SeparatorLayerAction
AbstractMapViewPaintable.CompatibilityModeLayerPainter
MapViewPaintable.LayerPainter, MapViewPaintable.MapViewEvent, MapViewPaintable.PaintableInvalidationEvent, MapViewPaintable.PaintableInvalidationListener
Modifier and Type | Field and Description |
---|---|
private static NamedColorProperty |
COLOR_PROPERTY |
private Marker |
currentMarker |
java.util.List<Marker> |
data
A list of markers.
|
private static java.awt.Color |
DEFAULT_COLOR |
GpxLayer |
fromLayer |
private boolean |
mousePressed |
AudioMarker |
syncAudioMarker |
FILTER_STATE_PROP, NAME_PROP, OPACITY_PROP, propertyChangeSupport, VISIBLE_PROP
Constructor and Description |
---|
MarkerLayer(GpxData indata,
java.lang.String name,
java.io.File associatedFile,
GpxLayer fromLayer)
Constructs a new
MarkerLayer . |
Modifier and Type | Method and Description |
---|---|
AudioMarker |
addAudioMarker(double time,
LatLon coor) |
MapViewPaintable.LayerPainter |
attachToMapView(MapViewPaintable.MapViewEvent event)
This method is called whenever this layer is added to a map view.
|
void |
destroy()
Called, when the layer is removed from the mapview and is going to be destroyed.
|
private static Marker |
getAdjacentMarker(Marker startMarker,
boolean next,
Layer layer) |
protected NamedColorProperty |
getBaseColorProperty()
Gets the color property that stores the default color for this layer.
|
static java.awt.Color |
getGenericColor() |
javax.swing.Icon |
getIcon()
Return a static icon.
|
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() |
boolean |
isMergable(Layer other) |
private boolean |
isTextOrIconShown()
Get state of text display.
|
void |
jumpToNextMarker()
Jump (move the viewport) to the next marker.
|
void |
jumpToPreviousMarker()
Jump (move the viewport) to the previous marker.
|
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.
|
private static void |
playAdjacentMarker(Marker startMarker,
boolean next) |
static void |
playAudio() |
static void |
playNextMarker() |
static void |
playPreviousMarker() |
boolean |
synchronizeAudioMarkers(AudioMarker startMarker) |
void |
visitBoundingBox(BoundingXYVisitor v)
Visits the content bounds of this layer.
|
addPropertyChangeListener, checkSaveConditions, createAndOpenSaveFileChooser, fireFilterStateChanged, fireOpacityChanged, fireVisibleChanged, getAssociatedFile, getChangesetSourceTag, getColorProperty, getDefaultLayerPosition, getName, getOpacity, getViewProjectionBounds, hookUpMapView, isBackgroundLayer, isInfoResizable, isProjectionSupported, isRenamed, isSavable, isVisible, nameSupportedProjections, onPostLoadFromFile, projectionChanged, removePropertyChangeListener, rename, setAssociatedFile, setBackgroundLayer, setFilterStateChanged, setName, setOpacity, setVisible, toggleVisible, toString
addInvalidationListener, createMapViewPainter, invalidate, removeInvalidationListener
private boolean mousePressed
private Marker currentMarker
public AudioMarker syncAudioMarker
private static final java.awt.Color DEFAULT_COLOR
private static final NamedColorProperty COLOR_PROPERTY
public MarkerLayer(GpxData indata, java.lang.String name, java.io.File associatedFile, GpxLayer fromLayer)
MarkerLayer
.indata
- The GPX data for this layername
- The marker layer nameassociatedFile
- The associated GPX filefromLayer
- The associated GPX layerpublic void destroy()
Layer
destroy
in interface Destroyable
destroy
in class Layer
public MapViewPaintable.LayerPainter attachToMapView(MapViewPaintable.MapViewEvent event)
AbstractMapViewPaintable
You need to return a painter here.
The MapViewPaintable.LayerPainter.detachFromMapView(org.openstreetmap.josm.gui.layer.MapViewPaintable.MapViewEvent)
method is called when the layer is removed
from that map view. You are free to reuse painters.
You should always call the super method. See AbstractMapViewPaintable.createMapViewPainter(org.openstreetmap.josm.gui.layer.MapViewPaintable.MapViewEvent)
if you want to influence painter creation.
This replaces Layer.hookUpMapView()
in the long run.
attachToMapView
in class AbstractMapViewPaintable
event
- the event.public javax.swing.Icon getIcon()
protected NamedColorProperty getBaseColorProperty()
Layer
getBaseColorProperty
in class Layer
null
if this layer is not colored.public static java.awt.Color getGenericColor()
public void paint(java.awt.Graphics2D g, MapView mv, Bounds box)
MapViewPaintable
paint
in interface MapViewPaintable
g
- Graphicsmv
- The object that can translate GeoPoints to screen coordinates.box
- Bounding boxpublic java.lang.String getToolTipText()
getToolTipText
in class Layer
public void mergeFrom(Layer from)
Layer
public boolean isMergable(Layer other)
isMergable
in class Layer
other
- The other layer that is tested to be mergable with this.public void visitBoundingBox(BoundingXYVisitor v)
Layer
visitBoundingBox
in class Layer
v
- The visitor that gets notified about the contents of this layer.public java.lang.Object getInfoComponent()
Layer
getInfoComponent
in class Layer
Component
describing the layer.public javax.swing.Action[] getMenuEntries()
Layer
Layer.SeparatorLayerAction.INSTANCE
instead of new JSeparatorgetMenuEntries
in class Layer
public boolean synchronizeAudioMarkers(AudioMarker startMarker)
public AudioMarker addAudioMarker(double time, LatLon coor)
public void jumpToNextMarker()
JumpToMarkerActions.JumpToMarkerLayer
jumpToNextMarker
in interface JumpToMarkerActions.JumpToMarkerLayer
public void jumpToPreviousMarker()
JumpToMarkerActions.JumpToMarkerLayer
jumpToPreviousMarker
in interface JumpToMarkerActions.JumpToMarkerLayer
public static void playAudio()
public static void playNextMarker()
public static void playPreviousMarker()
private static Marker getAdjacentMarker(Marker startMarker, boolean next, Layer layer)
private static void playAdjacentMarker(Marker startMarker, boolean next)
private boolean isTextOrIconShown()
true
if text should be shown, false
otherwise.