|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ewe.ui.ControlBase ewe.ui.Control courselog.AbstractImageDisplay courselog.maputils.TiledMapBrowser
public class TiledMapBrowser
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 |
---|
public static final int OPT_WPUNCHANGED
public static final int OPT_TRUNCHANGED
public static final ewe.fx.Pen PENVISITEDWP
public static final ewe.fx.Pen PENNONVISITEDWP
public static final ewe.fx.Pen PENTRACK
public static final int VISITDISTANCESQUARE
public final int MEMORYTHRESHOLD
public static final int[] tXPt
public static final int[] tYPt
protected int[] tXDir
protected int[] tYDir
public int[] tX
public int[] tY
public static final int STATE_FOLLOW
public static final int STATE_DISPLAYTR
public static final int STATE_DISPLAYWP
public static final int STATE_ACTIVE
public static final int STATE_INFO
public static final int STATE_LOCKWP
public static final int MAXDIST
public TiledMap myMap
public ewe.fx.Image[] myDispImages
public ewe.fx.Graphics[] myDispGraphics
protected ewe.sys.Handle myUpdateHandle
public int myIdxDisp
protected ewe.ui.Menu myMenPenHeldWP
protected ewe.ui.Menu myMenPenHeldNoWP
protected int myIdxLastPenHeld
protected ewe.fx.Point myLastPenHeldPoint
public int myState
public ewe.ui.EventListener mySwapHandler
public ewe.ui.Event mySwapEvent
public static final ewe.fx.Pen PENPOSITION
public static final ewe.fx.Pen NORMALPEN
public static final ewe.fx.Pen LOSTPEN
public static final ewe.fx.Pen DISCONNECTPEN
public ewe.fx.Pen currentPen
public TrackPoint myCurrentPosition
public int myGPSStatus
public ewe.fx.Point tmpPt
public ewe.fx.Rect tmpRe
public ewe.fx.Dimension tmpDim
public ewe.fx.Point ptDrag
public GeoDirection tmpGD
protected double myLastSc
protected double myLastSelected
protected int myCenterRadius
protected MapTrack myTrCurrent
public boolean myIsWaypointsChanged
public MapTrack myTrWaypoints
public ewe.ui.mLabel myLPoint
public ewe.ui.mLabel myLTrack
Constructor Detail |
---|
public TiledMapBrowser(java.lang.String mapDir)
Method Detail |
---|
public boolean isActive()
XPositionDisplayer
isActive
in interface XPositionDisplayer
public void setActive(boolean active)
public MapTrack getMyTrCurrent()
public void setDisplays(ewe.ui.mLabel lDispPoint, ewe.ui.mLabel lDispTrack)
public int getNextWaypoint()
public void setNextWaypoint(int next)
public int getSelectedWaypoint()
public void setSelectedWaypoint(int next)
public void setPenHeldMenus(ewe.ui.Menu onWaypoint, ewe.ui.Menu onNoWaypoint)
public void setSwapStateHandler(ewe.ui.EventListener handler, ewe.ui.Event ev)
public void setWPLocked(boolean st)
st
- true if yes, false otherwise.public void setTiledMapFrom(java.lang.String imageDirName)
public void reAllocateImages(int width, int height)
width
- width of the images to create.heigth
- height of the images to create.public void resetWaypoints()
public void reScaleOne()
public void reScaleMin()
public void reScaleMax()
public void visitPenHeldWaypoint()
public void reCenterOnPenHeldPoint()
public void reCenter(GeoPoint newCenter)
public void invertWaypoints()
public void removePenHeldWaypoint()
public void removeWaypointAt(int idxR)
public void drawRefPointSymbolAt(ewe.fx.Graphics g, int x, int y)
public void drawDirectionSymbolFor(ewe.fx.Graphics gD, double dir_deg)
public void drawPositionSymbolAt(ewe.fx.Graphics gD, int x, int y, double dir_deg)
public void drawOnScreenInformation(ewe.fx.Graphics g)
public void drawMyPosition(ewe.fx.Graphics gD)
public void saveWaypoints(ewe.io.File fWp)
public void saveTrack(ewe.io.File fWp)
public void loadWaypoints(ewe.io.File fWp)
public boolean updateTracerStatus(PositionTracer pTr)
public void updateTrackData(PositionTracer pTr)
public void listenerUpdated(int opt, PositionTracer pTr)
listenerUpdated
in interface XPositionDisplayer
opt
- option indicating if status and/or trakc changedpTr
- Tracer which has been updated.XPositionDisplayer
public void setCurrentTrack(TrackRecord tr)
setCurrentTrack
in interface XPositionDisplayer
public void onKeyEvent(ewe.ui.KeyEvent ev)
onKeyEvent
in class ewe.ui.Control
public void penDrag(ewe.ui.PenEvent pEv)
penDrag
in class AbstractImageDisplay
pEv
- Gives the pen position.public void penReleased(ewe.fx.Point p)
penReleased
in class AbstractImageDisplay
public void actionOnPenClick(ewe.fx.Point p)
actionOnPenClick
in class AbstractImageDisplay
public void actionOnPenHeld(ewe.fx.Point p)
actionOnPenHeld
in class AbstractImageDisplay
public void doublePressEnter(ewe.ui.KeyEvent kEv)
doublePressEnter
in class AbstractImageDisplay
kEv
- Key generating the move.public void updateDisplayedImage(ewe.fx.Rect r, int opt)
updateDisplayedImage
in class AbstractImageDisplay
public void rescaleImage(double byFactor)
AbstractImageDisplay
rescaleImage
in class AbstractImageDisplay
public void resizeTo(int width, int height)
resizeTo
in class ewe.ui.Control
public void doPaint(ewe.fx.Graphics g, ewe.fx.Rect r)
AbstractImageDisplay
doPaint
in class AbstractImageDisplay
g
- Graphic context.r
- rectangle to repaint.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |