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.SeparatorLayerActionAbstractMapViewPaintable.CompatibilityModeLayerPainterMapViewPaintable.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, getColorProperty, getDefaultLayerPosition, getName, getOpacity, getViewProjectionBounds, hookUpMapView, isBackgroundLayer, isInfoResizable, isProjectionSupported, isRenamed, isSavable, isVisible, nameSupportedProjections, onPostLoadFromFile, projectionChanged, removePropertyChangeListener, rename, setAssociatedFile, setBackgroundLayer, setFilterStateChanged, setName, setOpacity, setVisible, toggleVisible, toStringaddInvalidationListener, createMapViewPainter, invalidate, removeInvalidationListenerprivate 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()
Layerdestroy in interface Destroyabledestroy in class Layerpublic 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 AbstractMapViewPaintableevent - the event.public javax.swing.Icon getIcon()
protected NamedColorProperty getBaseColorProperty()
LayergetBaseColorProperty in class Layernull if this layer is not colored.public static java.awt.Color getGenericColor()
public void paint(java.awt.Graphics2D g, MapView mv, Bounds box)
MapViewPaintablepaint in interface MapViewPaintableg - Graphicsmv - The object that can translate GeoPoints to screen coordinates.box - Bounding boxpublic java.lang.String getToolTipText()
getToolTipText in class Layerpublic void mergeFrom(Layer from)
Layerpublic boolean isMergable(Layer other)
isMergable in class Layerother - The other layer that is tested to be mergable with this.public void visitBoundingBox(BoundingXYVisitor v)
LayervisitBoundingBox in class Layerv - The visitor that gets notified about the contents of this layer.public java.lang.Object getInfoComponent()
LayergetInfoComponent in class LayerComponent describing the layer.public javax.swing.Action[] getMenuEntries()
LayerLayer.SeparatorLayerAction.INSTANCE instead of new JSeparatorgetMenuEntries in class Layerpublic boolean synchronizeAudioMarkers(AudioMarker startMarker)
public AudioMarker addAudioMarker(double time, LatLon coor)
public void jumpToNextMarker()
JumpToMarkerActions.JumpToMarkerLayerjumpToNextMarker in interface JumpToMarkerActions.JumpToMarkerLayerpublic void jumpToPreviousMarker()
JumpToMarkerActions.JumpToMarkerLayerjumpToPreviousMarker in interface JumpToMarkerActions.JumpToMarkerLayerpublic 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.