public final class PlayHeadMarker extends Marker
Modifier and Type | Field and Description |
---|---|
private double |
animationInterval |
private int |
dropTolerance |
private boolean |
enabled |
private boolean |
jumpToMarker |
private LatLon |
oldCoor |
private MapMode |
oldMode |
private static PlayHeadMarker |
playHead |
private javax.swing.Timer |
timer |
private boolean |
wasPlaying |
LABEL_PATTERN_AUTO, LABEL_PATTERN_DESC, LABEL_PATTERN_NAME, MARKER_FORMATTED_OFFSET, MARKER_OFFSET, offset, parentLayer, symbol, time
Modifier | Constructor and Description |
---|---|
private |
PlayHeadMarker() |
Modifier and Type | Method and Description |
---|---|
void |
animate()
Animates the marker along the track.
|
boolean |
containsPoint(java.awt.Point p)
Checks whether the marker display area contains the given point.
|
static PlayHeadMarker |
create()
Returns the unique instance of
PlayHeadMarker . |
void |
drag(EastNorth en)
apply the new position resulting from a drag in progress
|
private void |
endDrag(boolean reset)
reinstate the old map mode after switching temporarily to do a play head drag
|
void |
paint(java.awt.Graphics g,
MapView mv)
Paint the marker icon in the given graphics context.
|
void |
reposition(EastNorth en)
reposition the play head at the point on the track nearest position given,
providing we are within reasonable distance from the track; otherwise reset to the
original position.
|
void |
startDrag()
called back from drag mode to say when we started dragging for real
(at least a short distance)
|
void |
synchronize(EastNorth en)
Synchronize the audio at the position where the play head was paused before
dragging with the position on the track where it was dropped.
|
void |
timerAction()
callback for moving play head marker according to audio player position
|
actionPerformed, appendMarkerProducer, convertToWayPoint, createMarkers, evaluateCondition, getCoor, getTemplateKeys, getTemplateValue, getText, getTextTemplateKey, isErroneous, lat, lon, paint, paintIcon, prependMarkerProducer, setCoor, setEastNorth, setErroneous, updateText
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getEastNorth, isLatLonKnown
private javax.swing.Timer timer
private double animationInterval
private static volatile PlayHeadMarker playHead
private final boolean enabled
private boolean wasPlaying
private int dropTolerance
private boolean jumpToMarker
private PlayHeadMarker()
public static PlayHeadMarker create()
PlayHeadMarker
.PlayHeadMarker
.public boolean containsPoint(java.awt.Point p)
Marker
containsPoint
in class Marker
p
- The point to checktrue
if the marker "hotspot" contains the point.public void startDrag()
private void endDrag(boolean reset)
reset
- whether to reset state (pause audio and restore old coordinates)public void drag(EastNorth en)
en
- the new position in map termspublic void reposition(EastNorth en)
en
- the position to start looking frompublic void synchronize(EastNorth en)
en
- : the EastNorth end point of the dragpublic void paint(java.awt.Graphics g, MapView mv)
g
- The graphics contextmv
- The mappublic void animate()
public void timerAction()