courselog
Class ImageBrowser

java.lang.Object
  extended by ewe.ui.ControlBase
      extended by ewe.ui.Control
          extended by courselog.AbstractImageDisplay
              extended by courselog.ImageBrowser
All Implemented Interfaces:
ewe.fx.ImageRefresher, ewe.sys.TimerProc, ewe.ui.CellConstants, ewe.ui.ControlConstants, ewe.ui.EventListener, ewe.ui.UIConstants
Direct Known Subclasses:
CalibratedMapBrowser

public class ImageBrowser
extends AbstractImageDisplay


Field Summary
 ewe.fx.IImage baseIImage
          Base drawable image.
 ewe.fx.ImageData baseImageData
          Base image data for Image operations.
protected  int centerX
          Center X offset in control coordinates.
protected  int centerY
          Center Y offset in control coordinates.
 boolean isReticuleOn
          Indicator to set if a reticule is wanted.
static ewe.fx.Pen pReticule
          Reticule pen.
protected  double scaleDisplay
          Scaling of display image.
static int[] tiReticuleX
          CenterReticule
static int[] tiReticuleY
           
 
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 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
ImageBrowser()
          Creates a new empty instance of ImageBrowser without an image file.
ImageBrowser(java.lang.String imagePath)
          Creates a new instance of ImageBrowser from an image file.
 
Method Summary
 void actionOnLeftAppButton()
           
 void actionOnPenClick(ewe.fx.Point p)
           
 void actionOnPenHeld(ewe.fx.Point p)
           
 void actionOnRightAppButton()
           
 ewe.fx.Point baseToDisplay(int x, int y, ewe.fx.Point dest)
          Transform a set of (x,y) coordinates in base image to a Point with (x,y) coordinates in displayed image.
 ewe.fx.Point displayToBase(int x, int y, ewe.fx.Point dest)
          Transform a set of (x,y) coordinates in displayed image to a Point with (x,y) coordinates in base image.
 void doPaint(ewe.fx.Graphics g, ewe.fx.Rect r)
          Paint this control.
 void rescaleImage(double byFactor)
          Rescale the displayed image by a given factor.
 void resizeTo(int width, int height)
           
 void setBaseImage(ewe.fx.IImage img)
          Set base of this ImageBrowser from an image interface.
 void setBaseImage(ewe.fx.ImageData datImg, ewe.fx.IImage newIImage)
           
 void updateDisplayedImage(ewe.fx.Rect r, int opt)
          Update image.
 
Methods inherited from class courselog.AbstractImageDisplay
directionButtonReleased, doublePressEnter, downButtonPressed, leftButtonPressed, longPressEnter, moveImage, onEvent, penDrag, penHeld, penPressed, penReleased, 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, onKeyEvent, 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

tiReticuleX

public static final int[] tiReticuleX
CenterReticule


tiReticuleY

public static final int[] tiReticuleY

pReticule

public static final ewe.fx.Pen pReticule
Reticule pen.


isReticuleOn

public boolean isReticuleOn
Indicator to set if a reticule is wanted. False at initialisation.


baseImageData

public ewe.fx.ImageData baseImageData
Base image data for Image operations.


baseIImage

public ewe.fx.IImage baseIImage
Base drawable image.


centerX

protected int centerX
Center X offset in control coordinates.


centerY

protected int centerY
Center Y offset in control coordinates.


scaleDisplay

protected double scaleDisplay
Scaling of display image.

Constructor Detail

ImageBrowser

public ImageBrowser()
Creates a new empty instance of ImageBrowser without an image file.


ImageBrowser

public ImageBrowser(java.lang.String imagePath)
Creates a new instance of ImageBrowser from an image file.

Parameters:
imagePath - Path to image file.
Method Detail

setBaseImage

public void setBaseImage(ewe.fx.IImage img)
Set base of this ImageBrowser from an image interface.

Parameters:
img - Drawable image to use as base.

setBaseImage

public void setBaseImage(ewe.fx.ImageData datImg,
                         ewe.fx.IImage newIImage)

baseToDisplay

public ewe.fx.Point baseToDisplay(int x,
                                  int y,
                                  ewe.fx.Point dest)
Transform a set of (x,y) coordinates in base image to a Point with (x,y) coordinates in displayed image.


displayToBase

public ewe.fx.Point displayToBase(int x,
                                  int y,
                                  ewe.fx.Point dest)
Transform a set of (x,y) coordinates in displayed image to a Point with (x,y) coordinates in base image.


updateDisplayedImage

public void updateDisplayedImage(ewe.fx.Rect r,
                                 int opt)
Update image. The option value is not used.

Specified by:
updateDisplayedImage in class AbstractImageDisplay

actionOnLeftAppButton

public void actionOnLeftAppButton()

actionOnRightAppButton

public void actionOnRightAppButton()

actionOnPenHeld

public void actionOnPenHeld(ewe.fx.Point p)
Specified by:
actionOnPenHeld in class AbstractImageDisplay

actionOnPenClick

public void actionOnPenClick(ewe.fx.Point p)
Specified by:
actionOnPenClick 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.