courselog
Class DistanceForm

java.lang.Object
  extended by ewe.ui.ControlBase
      extended by ewe.ui.Control
          extended by ewe.ui.Container
              extended by ewe.ui.Canvas
                  extended by ewe.ui.Panel
                      extended by ewe.ui.CellPanel
                          extended by ewe.ui.FormBase
                              extended by ewe.ui.Form
                                  extended by courselog.CourseLogAppForm
                                      extended by courselog.DistanceForm
All Implemented Interfaces:
XPositionDisplayer, ewe.data.HasProperties, ewe.fx.ImageRefresher, ewe.sys.TimerProc, ewe.ui.CellConstants, ewe.ui.ControlConstants, ewe.ui.EventListener, ewe.ui.IScroll, ewe.ui.LayoutManager, ewe.ui.ScrollClient, ewe.ui.UIConstants

public class DistanceForm
extends CourseLogAppForm
implements XPositionDisplayer

Panel for displaying the current trace status.


Field Summary
protected  PullDownForKey bGoto
          Button for application navigation
protected  ActionKeySensitiveButton bGps
          GPS button.
protected  ActionKeySensitiveButton bStatusc
          Label that displays the status
protected  ewe.fx.IconAndText iconHold
          Hold Item
protected  ewe.fx.IconAndText iconPause
          Pause Item
protected  ewe.fx.IconAndText iconRec
          Record Item.
protected  ewe.fx.IconAndText iconStop
          Stop Item.
protected  ewe.ui.mLabel lAltc
          Label that displays the content of the current point altitude value.
protected  ewe.ui.mLabel lAvHeadingc
          Label that displays the content of the current point average heading value.
protected  ewe.ui.mLabel lAvSpeedc
          Label that displays the content of the current point average speed value.
protected  ewe.ui.mLabel lDwc
          Label that displays the content of the total downward displacement value since the start of the trace.
protected  ewe.ui.mLabel lHeadingc
          Label that displays the content of the current point instantaneous heading value.
protected  ewe.ui.mLabel lLatc
          Label that displays the content of the GPS latitude value.
protected  ewe.ui.mLabel lLenc
          Label that displays the content of the total integrated distance value since the start of the trace.
protected  ewe.ui.mLabel lLonc
          Label that displays the content of the GPS longitude value.
protected  ewe.ui.mLabel lSpeedc
          Label that displays the content of the current point instantaneous speed value.
protected  ewe.ui.mLabel lTimec
          Label that displays the content of the current point elapsed time value since the start of the trace.
protected  ewe.ui.mLabel lUpc
          Label that displays the content of the total upward displacement value since the start of the trace.
protected  ewe.ui.mLabel lUTCc
          Label that displays the content of the UTC value.
protected  boolean myIsActive
          Is this panel active or not.
protected  int myLastGPSStatus
          Last displayed GPS status
protected  PositionTracer myLastTracer
          Last tracer identified
protected  int myLastTracerState
          Last tracer state
protected  PullDownForKey pdRecord
           
 
Fields inherited from class courselog.CourseLogAppForm
bLeft, bRight, dbgL, defC
 
Fields inherited from class ewe.ui.Form
acceptsDroppedFiles, apply, back, buttons, BUTTONS_TO_SOFT_KEY_FIRST_BUTTON_SEPARATE, BUTTONS_TO_SOFT_KEY_MENU_ALWAYS, BUTTONS_TO_SOFT_KEY_USE_FIRST_SOFT_KEY, buttonsPanel, buttonsPerRow, cancel, deflt, dismantleOnClose, exitButtonDefined, exitSystemOnClose, exitValue, firstFocus, formFrame, globalIcon, handle, hasTopBar, keepFrame, moveable, no, noBorder, ok, pl, reset, resizable, resizeOnSIP, taskbarIcon, title, titleCancel, titleControls, titleOK, topControls, untitledTitle, windowFlagsToClear, windowFlagsToSet, windowIcon, windowTitle, yes
 
Fields inherited from class ewe.ui.FormBase
BACKB, CANCELB, close, cross, defaultShowOptions, DEFCANCELB, DEFOKB, EXIT_IDBACK, EXIT_IDCANCEL, EXIT_IDNO, EXIT_IDOK, EXIT_IDYES, IDBACK, IDCANCEL, IDNO, IDOK, IDYES, MBB, MBNONE, MBOK, MBOKCANCEL, MBYESNO, MBYESNOCANCEL, NOB, OKB, stop, tick, tools, YESB
 
Fields inherited from class ewe.ui.CellPanel
autoSpan, equalHeights, equalWidths, layout, mySplitter, nextSplitter, quickRecalculate
 
Fields inherited from class ewe.ui.Panel
all, backgroundImage, calculated, childListeners, defaultAddToMeCellConstraints, defaultTags, grid, lastAdded, layoutManager, made, noInsets, stretchFirstColumn, stretchFirstRow, stretchLastColumn, stretchLastRow, titleGap
 
Fields inherited from class ewe.ui.Canvas
isFullScrollClient, origin, scrollPercent, virtualSize
 
Fields inherited from class ewe.ui.Container
closedFocus, cycleFocus, dontAutoScroll, dontFocusOnChildren
 
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.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.IScroll
Higher, Horizontal, Lower, OPTION_INDICATOR_ONLY, PageHigher, PageLower, ScrollHigher, ScrollLower, TrackTo, Vertical
 
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.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
DistanceForm(MainApplication mainApp)
          Creates a new instance of DistanceForm.
 
Method Summary
 void executeAction(java.lang.String actString)
           
 boolean isActive()
          Specify that this displayer is active.
 void listenerUpdated(int opt, PositionTracer pTr)
          Called when the PositionTracer changes.
 void onEvent(ewe.ui.Event ev)
           
 void setCurrentTrack(TrackRecord tr)
          Provide the current track log to the displayer.
 void tryExitForm(int nextState)
          Triggers an exit from the application
 void tryHold()
          Hold recording the track.
 void tryPause()
          Pause recording the track.
 void tryRecordOrStop()
          Start recording the track.
 void updateButtons()
          Update buttons according to tracer status.
 void updateTracerStatus(PositionTracer p)
          Update the display according to the position tracer status
 void updateTrackData(PositionTracer p)
          Update tracer display labels.
 
Methods inherited from class courselog.CourseLogAppForm
courseLogAppFormSetup
 
Methods inherited from class ewe.ui.Form
_getSetField, addButton, addTabbedPanel, addToolbar, buttonsToMenu, buttonsToSoftKeyBar, buttonsToSoftKeyBar, cancelWait, canExit, checkButtons, close, closeAll, closeForTransfer, closeForTransfer, continueWait, createMenuItem, createMenuItem, createMenuItem, createWindow, defaultTitleTo, dismantle, doButtons, doShowExec, exec, exec, exec, exec, exec, exec, exec, exec, exec, execute, execute, execute, exit, filesDropped, formClosing, formShown, gatherButtons, getButton, getFirstFocus, getFormFrame, getProperties, getSoftKeyBarFor, getTopmostForm, handleAction, handleAction, hasExitButton, make, makeButtonForForm, makeButtonForForm, makeDefaultButton, makeDefaultButton, makeFrame, makeMenuItemForForm, makeMenuItemForForm, makeSoftKeys, makeSoftKeys, mb, menuItemSelected, modifyForSmartPhone, onControlEvent, onDataChangeEvent, onSoftKey, onSoftKey, placeCancelOnLeft, removeSoftKeyBarFor, setOKCancel, setSoftKeyBarFor, setSoftKeyBarForAll, setTitle, setTopLevelTitle, setupFrame, show, show, show, show, show, show, shown, showWait, stopFormHandle, toolsOnBottom, waitUntilClosed, waitUntilClosed, waitUntilClosed, waitUntilClosed, waitUntilPainted
 
Methods inherited from class ewe.ui.CellPanel
calculateSizes, makeLayoutGrid, relayout, relayoutMe, removeAll, reShow, resize, resizeTo
 
Methods inherited from class ewe.ui.Panel
add, addChildListener, addDirectly, addLast, addLast, addNext, addNext, addNext, doBackground, doBorder, endRow, getControlTag, getPreferredSize, getSubControls, isEmpty, layout, remove, removeChildListener, sendToChildListeners, setText
 
Methods inherited from class ewe.ui.Canvas
canGo, canScreenScroll, checkScrolls, doScroll, fixOrigin, getActual, getBuffer, getCurrent, getDisplayedSize, getMySize, getPercent, getScrollablePanel, getScrollClient, getVisible, getVisibleArea, needScrollBar, onScroll, onSetOrigin, reduceClip, scroll, scroll, scrollToVisible, setOrigin, updateScrollServer
 
Methods inherited from class ewe.ui.Container
_paintChildren, add, containerHasFocus, dismantle, doHotKey, findChild, focusFirst, focusFirst, focusOnContainer, focusOnData, getChildren, getChildrenBackwards, getNextKeyFocus, gotFocus, lostFocus, repaintDataNow, takeFocus, takePromptControl
 
Methods inherited from class ewe.ui.Control
acceptsData, activate, addListener, addTimer, amOnTopFrame, 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, doMenu, dontAcceptDrop, doPaint, doPaintChildren, doPaintChildren, doPaintChildren, doPaintData, doPaintData, doShowMenu, dragged, exitEntry, fillBackground, fromClipboard, fromField, fromField, getAllDescendants, getAllSubControls, getBackground, 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, getParent, getPasswordCharacter, getPosInFrame, getPosInParent, getPreferredSize, getPrompt, getPromptText, getRect, getRect, getServer, getSize, getSizes, getTag, getText, getToolTip, getWindow, hasModifier, hasPopupFormAttached, hasTag, inheritModifiers, isChildOf, isModal, isOnMe, isSomeonesHotKey, makeFrameTopMost, makeHot, menuIsActive, modify, modifyAll, modifyAll, notifyAction, notifyDataChange, notifyDataChange, notNative_doPaintChildren, oldButWorksDoPaintChildren, oldPaintChildren, oldPostEvent, onKeyEvent, onLabelPenEvent, onPaint, onPenEvent, paintBackground, paintChildren, penClicked, penDoubleClicked, penHeld, penPressed, penReleased, penRightReleased, popupBeep, popupMenuClosed, popupMenuEvent, popupMenuEvent, postEvent, recalculatePreferredSize, redisplay, refresh, removeListener, removeTimer, repaint, 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, setTextSize, setToolTip, show, standardOnKeyEvent, startDragAndDrop, startDragAndDrop, startDragging, stopDragging, takeData, takeFromClipboard, testDim, ticked, 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
 
Methods inherited from interface ewe.ui.ScrollClient
getServer, setServer
 

Field Detail

iconRec

protected ewe.fx.IconAndText iconRec
Record Item.


iconStop

protected ewe.fx.IconAndText iconStop
Stop Item.


iconHold

protected ewe.fx.IconAndText iconHold
Hold Item


iconPause

protected ewe.fx.IconAndText iconPause
Pause Item


bGps

protected ActionKeySensitiveButton bGps
GPS button.


bGoto

protected PullDownForKey bGoto
Button for application navigation


pdRecord

protected PullDownForKey pdRecord

lUTCc

protected ewe.ui.mLabel lUTCc
Label that displays the content of the UTC value.


lLatc

protected ewe.ui.mLabel lLatc
Label that displays the content of the GPS latitude value.


lLonc

protected ewe.ui.mLabel lLonc
Label that displays the content of the GPS longitude value.


lAltc

protected ewe.ui.mLabel lAltc
Label that displays the content of the current point altitude value.


lSpeedc

protected ewe.ui.mLabel lSpeedc
Label that displays the content of the current point instantaneous speed value.


lHeadingc

protected ewe.ui.mLabel lHeadingc
Label that displays the content of the current point instantaneous heading value.


lTimec

protected ewe.ui.mLabel lTimec
Label that displays the content of the current point elapsed time value since the start of the trace.


bStatusc

protected ActionKeySensitiveButton bStatusc
Label that displays the status


lLenc

protected ewe.ui.mLabel lLenc
Label that displays the content of the total integrated distance value since the start of the trace.


lUpc

protected ewe.ui.mLabel lUpc
Label that displays the content of the total upward displacement value since the start of the trace.


lDwc

protected ewe.ui.mLabel lDwc
Label that displays the content of the total downward displacement value since the start of the trace.


lAvSpeedc

protected ewe.ui.mLabel lAvSpeedc
Label that displays the content of the current point average speed value.


lAvHeadingc

protected ewe.ui.mLabel lAvHeadingc
Label that displays the content of the current point average heading value.


myIsActive

protected boolean myIsActive
Is this panel active or not.


myLastGPSStatus

protected int myLastGPSStatus
Last displayed GPS status


myLastTracer

protected PositionTracer myLastTracer
Last tracer identified


myLastTracerState

protected int myLastTracerState
Last tracer state

Constructor Detail

DistanceForm

public DistanceForm(MainApplication mainApp)
Creates a new instance of DistanceForm. Called by ewe at runtime. This initialises all application's GUI with fonts and sizes of each panel. Also defines the options and starts looking for the GPS receiver.

Parameters:
mainApp - Main application using this object.
Method Detail

updateTracerStatus

public void updateTracerStatus(PositionTracer p)
Update the display according to the position tracer status

Parameters:
p - The monitored PositionTracer.

updateTrackData

public void updateTrackData(PositionTracer p)
Update tracer display labels.


updateButtons

public void updateButtons()
Update buttons according to tracer status.


tryExitForm

public void tryExitForm(int nextState)
Triggers an exit from the application


tryRecordOrStop

public void tryRecordOrStop()
Start recording the track.


tryHold

public void tryHold()
Hold recording the track.


tryPause

public void tryPause()
Pause recording the track.


onEvent

public void onEvent(ewe.ui.Event ev)
Specified by:
onEvent in interface ewe.ui.EventListener
Overrides:
onEvent in class ewe.ui.Form

executeAction

public void executeAction(java.lang.String actString)

isActive

public boolean isActive()
Specify that this displayer is active.

Specified by:
isActive in interface XPositionDisplayer
Returns:
true if the display is on, false otherwise.

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)
Description copied from interface: XPositionDisplayer
Provide the current track log to the displayer.

Specified by:
setCurrentTrack in interface XPositionDisplayer