courselog.maputils
Class TiledMapBrowser

java.lang.Object
  extended by ewe.ui.ControlBase
      extended by ewe.ui.Control
          extended by courselog.AbstractImageDisplay
              extended by courselog.maputils.TiledMapBrowser
All Implemented Interfaces:
XPositionDisplayer, ewe.fx.ImageRefresher, ewe.sys.TimerProc, ewe.ui.CellConstants, ewe.ui.ControlConstants, ewe.ui.EventListener, ewe.ui.UIConstants

public class TiledMapBrowser
extends AbstractImageDisplay
implements XPositionDisplayer


Field Summary
 ewe.fx.Pen currentPen
          Current drawing pen.
static ewe.fx.Pen DISCONNECTPEN
          Pen for drawing position when disconnected from GPS.
static ewe.fx.Pen LOSTPEN
          Pen for drawing Position when lost.
static int MAXDIST
          Distance to select a point ==4
 int MEMORYTHRESHOLD
          Memory threshold to start freeing maps which are unused == 80 (%)
protected  int myCenterRadius
          Last Center circle radius
 TrackPoint myCurrentPosition
          Mobile position geo point object.
 ewe.fx.Graphics[] myDispGraphics
          Pool of graphics associated to the images
 ewe.fx.Image[] myDispImages
          Pool of images to swap for display
 int myGPSStatus
          The GPS current status.
 int myIdxDisp
          Index of the active image [0,1].
protected  int myIdxLastPenHeld
          Memory of last waypoint which had a pen held on it.
 boolean myIsWaypointsChanged
          Flag indicated if waypoints need to be saved.
protected  ewe.fx.Point myLastPenHeldPoint
          Memory of last point which had a pen held on it.
protected  double myLastSc
          Last Scaling factor
protected  double myLastSelected
          Last selected point
 ewe.ui.mLabel myLPoint
          Label displaying the point status.
 ewe.ui.mLabel myLTrack
          Label displaying the track status.
 TiledMap myMap
          My CalibratedMap
protected  ewe.ui.Menu myMenPenHeldNoWP
          Menu to display for pen held not on a waypoint.
protected  ewe.ui.Menu myMenPenHeldWP
          Menu to display for pen held on a waypoint.
 int myState
          Status of the browser.
 ewe.ui.Event mySwapEvent
          Event to send to the listener.
 ewe.ui.EventListener mySwapHandler
          Event listener handling swap state action.
protected  MapTrack myTrCurrent
          Current track of the receiver
 MapTrack myTrWaypoints
          Waypoints track
protected  ewe.sys.Handle myUpdateHandle
          Handle to allow displayed image update.
static ewe.fx.Pen NORMALPEN
          Pen for normal drawing of points.
static int OPT_TRUNCHANGED
          Update option indicating that Track are unchanged
static int OPT_WPUNCHANGED
          Update option indicating that Waypoints are unchanged
static ewe.fx.Pen PENNONVISITEDWP
          Pen for non visited waypoints
static ewe.fx.Pen PENPOSITION
          Pen for normal drawing central area circle.
static ewe.fx.Pen PENTRACK
          Pen for Track
static ewe.fx.Pen PENVISITEDWP
          Pen for visited waypoints
 ewe.fx.Point ptDrag
          Symbol point to display when point is dragged.
static int STATE_ACTIVE
          myState bit if active.
static int STATE_DISPLAYTR
          myState bit if track is displayed.
static int STATE_DISPLAYWP
          myState bit if waypoints are displayed.
static int STATE_FOLLOW
          myState bit if the browser follows the current position.
static int STATE_INFO
          myState bit if information is displayed.
static int STATE_LOCKWP
          myState bit if waypoints are locked.
 ewe.fx.Dimension tmpDim
          temporary Dimension object.
 GeoDirection tmpGD
          temporary Direction object.
 ewe.fx.Point tmpPt
          temporary point object.
 ewe.fx.Rect tmpRe
          temporary Rect object.
 int[] tX
          Temp X values of polygon drawing a position symbol.
protected  int[] tXDir
          X values of polygon drawing the direction symbol
static int[] tXPt
          X values of polygon drawing a position symbol.
 int[] tY
          Temp Y values of polygon drawing a position symbol.
protected  int[] tYDir
          Y values of polygon drawing the direction symbol
static int[] tYPt
          Y values of polygon drawing a position symbol.
static int VISITDISTANCESQUARE
          Square of distance under which a waypoint is considered visited.
 
Fields inherited from class courselog.AbstractImageDisplay
akdC, deltaScaleDisplay, dispImage, iEnterPressed, imageDelta, INTDBLPRESSMS, INTLGPRESSMS, iNumberEnterPressed, iOX, iOY, iStampWhenPressed, keEnter, notPenDragged, notPenHeld, poBase, poPress, tickerForEnter
 
Fields inherited from class ewe.ui.Control
_debug, backGround, beforeRemoved, borderColor, borderStyle, borderWidth, children, columns, constraints, DoPaintMethod, dragging, dragResolution, dragTime, exitKeys, fieldTransfer, font, foreGround, haveNativePaint, height, holdDownPause, holdTick, hotKey, image, lastSelected, listeners, maxHeight, maxWidth, menuState, minHeight, minWidth, modifiers, MyClass, name, next, np, parent, penStatus, popupSound, popupSoundClip, preferredHeight, preferredWidth, prev, prompt, promptControl, rows, ss, standardBorder, standardEdge, startDragResolution, tags, tail, text, toolTip, width, x, y
 
Fields inherited from class ewe.ui.ControlBase
clipItems, clipObject, clipOwner, curPoint, currentPenEvent, debugControl, debugFlag, DidHoldDown, doubleBuffer, doubleClickTime, firstPress, globalDrawFlat, globalEditable, globalEnabled, globalPalmStyle, globalSmallControls, GotPenDown, PenIsOn, pressPoint, TAG_LAST_USER_DATA, TAG_USER_DATA, TAKE_FIRST_PRESS, unnamed, useNativeTextInput
 
Fields inherited from interface courselog.gpsutils.XPositionDisplayer
OPT_POSUPDATED, OPT_TRACKUPDATED
 
Fields inherited from interface ewe.ui.UIConstants
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, BF_BOTTOM, BF_BOTTOMLEFT, BF_BOTTOMRIGHT, BF_BUTTON, BF_DIAGONAL, BF_DIAGONAL_ENDBOTTOMLEFT, BF_DIAGONAL_ENDBOTTOMRIGHT, BF_DIAGONAL_ENDTOPLEFT, BF_DIAGONAL_ENDTOPRIGHT, BF_EXACT, BF_FLAT, BF_LEFT, BF_MIDDLE, BF_MONO, BF_PALM, BF_RECT, BF_RIGHT, BF_SOFT, BF_SQUARE, BF_TOP, BF_TOPLEFT, BF_TOPRIGHT, EDGE_BUMP, EDGE_ETCHED, EDGE_RAISED, EDGE_SUNKEN
 
Fields inherited from interface ewe.ui.CellConstants
BORDER, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, FIXEDSIZE, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST
 
Fields inherited from interface ewe.ui.ControlConstants
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, Disabled, DisablePopupMenu, DisplayOnly, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpKeyEvents, SendUpPenEvents, ShowSIP, ShrinkToNothing, SmallControl, SpecialBackground, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown
 
Fields inherited from interface ewe.fx.ImageRefresher
KEEP_VISIBLE
 
Constructor Summary
TiledMapBrowser(java.lang.String mapDir)
          Creates a new instance of CalibratedMapBrowser from an image file name.
 
Method Summary
 void actionOnPenClick(ewe.fx.Point p)
          On pen click, if mode is waypoint, place a new point at the end of the track.
 void actionOnPenHeld(ewe.fx.Point p)
          Pen held on the displayed image, display a menu depending this is on a waypoint or this is elsewere.
 void doPaint(ewe.fx.Graphics g, ewe.fx.Rect r)
          Paint this control.
 void doublePressEnter(ewe.ui.KeyEvent kEv)
          Double press on enter, consider it as a long click on the center of the control.
 void drawDirectionSymbolFor(ewe.fx.Graphics gD, double dir_deg)
          Draw a direction symbol on the central circle.
 void drawMyPosition(ewe.fx.Graphics gD)
          Draw the followed position of the navigating mobile.
 void drawOnScreenInformation(ewe.fx.Graphics g)
          Draw the on-screen message selected by the user.
 void drawPositionSymbolAt(ewe.fx.Graphics gD, int x, int y, double dir_deg)
          Draw a point position.
 void drawRefPointSymbolAt(ewe.fx.Graphics g, int x, int y)
          Draw a point position.
 MapTrack getMyTrCurrent()
          Getter for myTrCurrent.
 int getNextWaypoint()
          Getter for next waypoint.
 int getSelectedWaypoint()
          Getter for selected waypoint.
 void invertWaypoints()
           
 boolean isActive()
          Indicator meaning that the displayer should be updated.
 void listenerUpdated(int opt, PositionTracer pTr)
          Called when the PositionTracer changes.
 void loadWaypoints(ewe.io.File fWp)
          Load waypoints from a log file.
 void onKeyEvent(ewe.ui.KeyEvent ev)
          Trap key events to allow keyboard shortcuts.
 void penDrag(ewe.ui.PenEvent pEv)
          On pen drag, if the user tries to drag a waypoint, select it, move it.
 void penReleased(ewe.fx.Point p)
          On pen release, if a waypoint was dragged, commit the move and update the image.
 void reAllocateImages(int width, int height)
          Clears the pool of images used by the browser, re-initialises with new sizes, initialises the image index, the graphics objects.
 void reCenter(GeoPoint newCenter)
          Re-center Tiled map.
 void reCenterOnPenHeldPoint()
          Re-center on last selected point.
 void removePenHeldWaypoint()
           
 void removeWaypointAt(int idxR)
           
 void rescaleImage(double byFactor)
          Rescale the displayed image by a given factor.
 void reScaleMax()
          Rescale Tiled map to the larger scale at the current center.
 void reScaleMin()
          Rescale Tiled map to the smaller scale at the current center.
 void reScaleOne()
          Rescale Tiled map to one at the current center.
 void resetWaypoints()
          Reset the track.
 void resizeTo(int width, int height)
           
 void saveTrack(ewe.io.File fWp)
          Save the track.
 void saveWaypoints(ewe.io.File fWp)
          save the waypoints.
 void setActive(boolean active)
           
 void setCurrentTrack(TrackRecord tr)
          Setter for current track.
 void setDisplays(ewe.ui.mLabel lDispPoint, ewe.ui.mLabel lDispTrack)
          Setter for display labels.
 void setNextWaypoint(int next)
          Setter for next waypoint.
 void setPenHeldMenus(ewe.ui.Menu onWaypoint, ewe.ui.Menu onNoWaypoint)
          Setter for pen held menus.
 void setSelectedWaypoint(int next)
          Setter for selected waypoint.
 void setSwapStateHandler(ewe.ui.EventListener handler, ewe.ui.Event ev)
          Setter for swap action shortcut control.
 void setTiledMapFrom(java.lang.String imageDirName)
          Set tiled map from a directory name where the calibrated maps are.
 void setWPLocked(boolean st)
          Set the waypoints locked bit.
 void updateDisplayedImage(ewe.fx.Rect r, int opt)
          Modify the displayed image to draw reference points.
 boolean updateTracerStatus(PositionTracer pTr)
          Update the current position and drawing mode according to tracer status.
 void updateTrackData(PositionTracer pTr)
          Update the trace on the map according to the new track.
 void visitPenHeldWaypoint()
          Set last selected waypoint to be the next to visit.
 
Methods inherited from class courselog.AbstractImageDisplay
directionButtonReleased, downButtonPressed, leftButtonPressed, longPressEnter, moveImage, onEvent, penHeld, penPressed, rightButtonPressed, setActionKeyDispatcher, shortPressEnter, ticked, upButtonPressed
 
Methods inherited from class ewe.ui.Control
acceptsData, activate, addListener, addTimer, amOnTopFrame, calculateSizes, calculateTextSize, cancelCut, cancelHoldDown, canEdit, chainDataChange, change, checkClipboardOperations, checkExitKey, checkMenu, checkMenuKey, checkModifiers, checkPenTransparent, clearTag, clipboardToString, clipboardTransfer, closeMenu, contains, contains, createGraphics, dataAccepted, dataBeingRemoved, dataDraggedOff, dataDraggedOver, dataDraggedOver, dataDroppedOn, dataTransferCancelled, deactivate, defaultTo, doAction, doActionKey, doBackground, doBorder, doHotKey, doMenu, dontAcceptDrop, doPaintChildren, doPaintChildren, doPaintChildren, doPaintData, doPaintData, doShowMenu, dragged, exitEntry, fillBackground, formClosing, fromClipboard, fromField, fromField, getAllDescendants, getAllSubControls, getBackground, getChildren, getChildrenBackwards, getClipboardMenu, getClipObject, getControlBuffer, getControlBuffer, getDataRect, getDataToCopy, getDataToDragAndDrop, getDim, getDisplayText, getDragAndDropContext, getFont, getFontMetrics, getFontMetrics, getForeground, getFrame, getFrameOrContainer, getGraphics, getImage, getLastSelected, getLocation, getMaximumSize, getMenu, getMinimumSize, getModifiers, getNext, getNextKeyFocus, getParent, getPasswordCharacter, getPosInFrame, getPosInParent, getPreferredSize, getPrompt, getPromptText, getRect, getRect, getServer, getSize, getSizes, getSubControls, getTag, getText, getToolTip, getWindow, gotFocus, hasModifier, hasPopupFormAttached, hasTag, inheritModifiers, isChildOf, isModal, isOnMe, isSomeonesHotKey, lostFocus, make, makeFrameTopMost, makeHot, menuIsActive, modify, modifyAll, modifyAll, notifyAction, notifyDataChange, notifyDataChange, notNative_doPaintChildren, oldButWorksDoPaintChildren, oldPaintChildren, oldPostEvent, onControlEvent, onLabelPenEvent, onPaint, onPenEvent, paintBackground, paintChildren, penClicked, penDoubleClicked, penRightReleased, popupBeep, popupMenuClosed, popupMenuEvent, popupMenuEvent, postEvent, recalculatePreferredSize, redisplay, refresh, removeListener, removeTimer, repaint, repaintDataNow, repaintNow, repaintNow, repaintNow, requestPaint, requestResizeTo, resetRect, restore, scrollAndRepaint, sendToListeners, set, setBorder, setCell, setClipObject, setControl, setCursor, setFixedSize, setFont, setHotKey, setHotKey, setLocation, setMaximumSize, setMenu, setMinimumSize, setPreferredSize, setPromptControl, setRect, setRect, setServer, setTag, setTags, setText, setTextSize, setToolTip, show, shown, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, startDragging, stopDragging, takeData, takeFocus, takeFromClipboard, takePromptControl, testDim, toClipboard, toField, toField, toString, toTextData, transferPenPress, transferPenPress, tryDragAndDrop, tryNext, tryStartMenu, updateData, willAcceptDrop, willShowFrame
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

OPT_WPUNCHANGED

public static final int OPT_WPUNCHANGED
Update option indicating that Waypoints are unchanged

See Also:
Constant Field Values

OPT_TRUNCHANGED

public static final int OPT_TRUNCHANGED
Update option indicating that Track are unchanged

See Also:
Constant Field Values

PENVISITEDWP

public static final ewe.fx.Pen PENVISITEDWP
Pen for visited waypoints


PENNONVISITEDWP

public static final ewe.fx.Pen PENNONVISITEDWP
Pen for non visited waypoints


PENTRACK

public static final ewe.fx.Pen PENTRACK
Pen for Track


VISITDISTANCESQUARE

public static final int VISITDISTANCESQUARE
Square of distance under which a waypoint is considered visited. Distance is in pixels so it depends on the current zoom setting. Equals 8*8.

See Also:
Constant Field Values

MEMORYTHRESHOLD

public final int MEMORYTHRESHOLD
Memory threshold to start freeing maps which are unused == 80 (%)

See Also:
Constant Field Values

tXPt

public static final int[] tXPt
X values of polygon drawing a position symbol.


tYPt

public static final int[] tYPt
Y values of polygon drawing a position symbol.


tXDir

protected int[] tXDir
X values of polygon drawing the direction symbol


tYDir

protected int[] tYDir
Y values of polygon drawing the direction symbol


tX

public int[] tX
Temp X values of polygon drawing a position symbol.


tY

public int[] tY
Temp Y values of polygon drawing a position symbol.


STATE_FOLLOW

public static final int STATE_FOLLOW
myState bit if the browser follows the current position. If not set, the browser moves are free and waypoints entering are enabled.

See Also:
Constant Field Values

STATE_DISPLAYTR

public static final int STATE_DISPLAYTR
myState bit if track is displayed.

See Also:
Constant Field Values

STATE_DISPLAYWP

public static final int STATE_DISPLAYWP
myState bit if waypoints are displayed.

See Also:
Constant Field Values

STATE_ACTIVE

public static final int STATE_ACTIVE
myState bit if active.

See Also:
Constant Field Values

STATE_INFO

public static final int STATE_INFO
myState bit if information is displayed.

See Also:
Constant Field Values

STATE_LOCKWP

public static final int STATE_LOCKWP
myState bit if waypoints are locked.

See Also:
Constant Field Values

MAXDIST

public static final int MAXDIST
Distance to select a point ==4

See Also:
Constant Field Values

myMap

public TiledMap myMap
My CalibratedMap


myDispImages

public ewe.fx.Image[] myDispImages
Pool of images to swap for display


myDispGraphics

public ewe.fx.Graphics[] myDispGraphics
Pool of graphics associated to the images


myUpdateHandle

protected ewe.sys.Handle myUpdateHandle
Handle to allow displayed image update.


myIdxDisp

public int myIdxDisp
Index of the active image [0,1].


myMenPenHeldWP

protected ewe.ui.Menu myMenPenHeldWP
Menu to display for pen held on a waypoint.


myMenPenHeldNoWP

protected ewe.ui.Menu myMenPenHeldNoWP
Menu to display for pen held not on a waypoint.


myIdxLastPenHeld

protected int myIdxLastPenHeld
Memory of last waypoint which had a pen held on it.


myLastPenHeldPoint

protected ewe.fx.Point myLastPenHeldPoint
Memory of last point which had a pen held on it.


myState

public int myState
Status of the browser. Should be a combination of the STATE_XXX bits.


mySwapHandler

public ewe.ui.EventListener mySwapHandler
Event listener handling swap state action.


mySwapEvent

public ewe.ui.Event mySwapEvent
Event to send to the listener.


PENPOSITION

public static final ewe.fx.Pen PENPOSITION
Pen for normal drawing central area circle.


NORMALPEN

public static final ewe.fx.Pen NORMALPEN
Pen for normal drawing of points.


LOSTPEN

public static final ewe.fx.Pen LOSTPEN
Pen for drawing Position when lost.


DISCONNECTPEN

public static final ewe.fx.Pen DISCONNECTPEN
Pen for drawing position when disconnected from GPS.


currentPen

public ewe.fx.Pen currentPen
Current drawing pen.


myCurrentPosition

public TrackPoint myCurrentPosition
Mobile position geo point object.


myGPSStatus

public int myGPSStatus
The GPS current status.


tmpPt

public ewe.fx.Point tmpPt
temporary point object.


tmpRe

public ewe.fx.Rect tmpRe
temporary Rect object.


tmpDim

public ewe.fx.Dimension tmpDim
temporary Dimension object.


ptDrag

public ewe.fx.Point ptDrag
Symbol point to display when point is dragged. When position is negative, no point displayed.


tmpGD

public GeoDirection tmpGD
temporary Direction object.


myLastSc

protected double myLastSc
Last Scaling factor


myLastSelected

protected double myLastSelected
Last selected point


myCenterRadius

protected int myCenterRadius
Last Center circle radius


myTrCurrent

protected MapTrack myTrCurrent
Current track of the receiver


myIsWaypointsChanged

public boolean myIsWaypointsChanged
Flag indicated if waypoints need to be saved.


myTrWaypoints

public MapTrack myTrWaypoints
Waypoints track


myLPoint

public ewe.ui.mLabel myLPoint
Label displaying the point status.


myLTrack

public ewe.ui.mLabel myLTrack
Label displaying the track status.

Constructor Detail

TiledMapBrowser

public TiledMapBrowser(java.lang.String mapDir)
Creates a new instance of CalibratedMapBrowser from an image file name.

Method Detail

isActive

public boolean isActive()
Description copied from interface: XPositionDisplayer
Indicator meaning that the displayer should be updated.

Specified by:
isActive in interface XPositionDisplayer

setActive

public void setActive(boolean active)

getMyTrCurrent

public MapTrack getMyTrCurrent()
Getter for myTrCurrent.


setDisplays

public void setDisplays(ewe.ui.mLabel lDispPoint,
                        ewe.ui.mLabel lDispTrack)
Setter for display labels. Set the display objects to null if you want to deactivate displays.


getNextWaypoint

public int getNextWaypoint()
Getter for next waypoint.


setNextWaypoint

public void setNextWaypoint(int next)
Setter for next waypoint.


getSelectedWaypoint

public int getSelectedWaypoint()
Getter for selected waypoint.


setSelectedWaypoint

public void setSelectedWaypoint(int next)
Setter for selected waypoint.


setPenHeldMenus

public void setPenHeldMenus(ewe.ui.Menu onWaypoint,
                            ewe.ui.Menu onNoWaypoint)
Setter for pen held menus. Set the menus object to null if you want to deactive menu.


setSwapStateHandler

public void setSwapStateHandler(ewe.ui.EventListener handler,
                                ewe.ui.Event ev)
Setter for swap action shortcut control. Set the control that should be activated when the shortcut for swaping the state is activated.


setWPLocked

public void setWPLocked(boolean st)
Set the waypoints locked bit.

Parameters:
st - true if yes, false otherwise.

setTiledMapFrom

public void setTiledMapFrom(java.lang.String imageDirName)
Set tiled map from a directory name where the calibrated maps are.


reAllocateImages

public void reAllocateImages(int width,
                             int height)
Clears the pool of images used by the browser, re-initialises with new sizes, initialises the image index, the graphics objects. If called with either width or height at 0, the new image objects are not allocated.

Parameters:
width - width of the images to create.
heigth - height of the images to create.

resetWaypoints

public void resetWaypoints()
Reset the track.


reScaleOne

public void reScaleOne()
Rescale Tiled map to one at the current center.


reScaleMin

public void reScaleMin()
Rescale Tiled map to the smaller scale at the current center.


reScaleMax

public void reScaleMax()
Rescale Tiled map to the larger scale at the current center.


visitPenHeldWaypoint

public void visitPenHeldWaypoint()
Set last selected waypoint to be the next to visit.


reCenterOnPenHeldPoint

public void reCenterOnPenHeldPoint()
Re-center on last selected point.


reCenter

public void reCenter(GeoPoint newCenter)
Re-center Tiled map.


invertWaypoints

public void invertWaypoints()

removePenHeldWaypoint

public void removePenHeldWaypoint()

removeWaypointAt

public void removeWaypointAt(int idxR)

drawRefPointSymbolAt

public void drawRefPointSymbolAt(ewe.fx.Graphics g,
                                 int x,
                                 int y)
Draw a point position.


drawDirectionSymbolFor

public void drawDirectionSymbolFor(ewe.fx.Graphics gD,
                                   double dir_deg)
Draw a direction symbol on the central circle.


drawPositionSymbolAt

public void drawPositionSymbolAt(ewe.fx.Graphics gD,
                                 int x,
                                 int y,
                                 double dir_deg)
Draw a point position.


drawOnScreenInformation

public void drawOnScreenInformation(ewe.fx.Graphics g)
Draw the on-screen message selected by the user.


drawMyPosition

public void drawMyPosition(ewe.fx.Graphics gD)
Draw the followed position of the navigating mobile.


saveWaypoints

public void saveWaypoints(ewe.io.File fWp)
save the waypoints.


saveTrack

public void saveTrack(ewe.io.File fWp)
Save the track.


loadWaypoints

public void loadWaypoints(ewe.io.File fWp)
Load waypoints from a log file.


updateTracerStatus

public boolean updateTracerStatus(PositionTracer pTr)
Update the current position and drawing mode according to tracer status.


updateTrackData

public void updateTrackData(PositionTracer pTr)
Update the trace on the map according to the new track.


listenerUpdated

public void listenerUpdated(int opt,
                            PositionTracer pTr)
Called when the PositionTracer changes.

Specified by:
listenerUpdated in interface XPositionDisplayer
Parameters:
opt - option indicating if status and/or trakc changed
pTr - Tracer which has been updated.
See Also:
XPositionDisplayer

setCurrentTrack

public void setCurrentTrack(TrackRecord tr)
Setter for current track.

Specified by:
setCurrentTrack in interface XPositionDisplayer

onKeyEvent

public void onKeyEvent(ewe.ui.KeyEvent ev)
Trap key events to allow keyboard shortcuts.

Overrides:
onKeyEvent in class ewe.ui.Control

penDrag

public void penDrag(ewe.ui.PenEvent pEv)
On pen drag, if the user tries to drag a waypoint, select it, move it. Otherwise, do as normally on an AbstractImageDisplay.

Overrides:
penDrag in class AbstractImageDisplay
Parameters:
pEv - Gives the pen position.

penReleased

public void penReleased(ewe.fx.Point p)
On pen release, if a waypoint was dragged, commit the move and update the image.

Overrides:
penReleased in class AbstractImageDisplay

actionOnPenClick

public void actionOnPenClick(ewe.fx.Point p)
On pen click, if mode is waypoint, place a new point at the end of the track.

Specified by:
actionOnPenClick in class AbstractImageDisplay

actionOnPenHeld

public void actionOnPenHeld(ewe.fx.Point p)
Pen held on the displayed image, display a menu depending this is on a waypoint or this is elsewere.

Specified by:
actionOnPenHeld in class AbstractImageDisplay

doublePressEnter

public void doublePressEnter(ewe.ui.KeyEvent kEv)
Double press on enter, consider it as a long click on the center of the control.

Overrides:
doublePressEnter in class AbstractImageDisplay
Parameters:
kEv - Key generating the move.

updateDisplayedImage

public void updateDisplayedImage(ewe.fx.Rect r,
                                 int opt)
Modify the displayed image to draw reference points.

Specified by:
updateDisplayedImage in class AbstractImageDisplay

rescaleImage

public void rescaleImage(double byFactor)
Description copied from class: AbstractImageDisplay
Rescale the displayed image by a given factor. This is not supposed to update the displayed image, only to apply some factor.

Specified by:
rescaleImage in class AbstractImageDisplay

resizeTo

public void resizeTo(int width,
                     int height)
Overrides:
resizeTo in class ewe.ui.Control

doPaint

public void doPaint(ewe.fx.Graphics g,
                    ewe.fx.Rect r)
Description copied from class: AbstractImageDisplay
Paint this control.

Overrides:
doPaint in class AbstractImageDisplay
Parameters:
g - Graphic context.
r - rectangle to repaint.