ewe.graphics
Class PageDisplay

java.lang.Object
  extended byewe.ui.ControlBase
      extended byewe.ui.Control
          extended byewe.ui.Container
              extended byewe.ui.Canvas
                  extended byewe.graphics.PageDisplay
All Implemented Interfaces:
CellConstants, ControlConstants, EventListener, ImageRefresher, IScroll, ScrollClient, TimerProc, UIConstants

public class PageDisplay
extends Canvas

A PageDisplay displays a set of PageDisplayUnit objects. These represent any data that can be displayed within a rectangle, however, unlike Containers, no scroll bars or active controls can be displayed within the page, and no clipping is done to ensure the data stays within its bounds.


Field Summary
 PageDisplayUnit display
           
 
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 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.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
PageDisplay()
           
 
Method Summary
 void displayChanged()
          Call this if the "display" unit has changed somehow and the scroll bars need updating.
 boolean doMenu(Point where)
          This will be called by default on a right-click.
 void doPaint(Graphics g, Rect area)
           
 PageDisplayUnit getHotUnit(int x, int y)
           
 Object getToolTip(int x, int y)
          This queries all the PageDisplayUnits to get any tool-tip for specified point.
 boolean isHot(int x, int y)
           
 void onPenEvent(PenEvent ev)
          Called to handle an incoming PenEvent.
 void penClicked(Point p)
          Called if the Pen or Mouse button is quickly pressed and released.
 void penDoubleClicked(Point p)
          Called if the Pen or Mouse button is double clicked on the Control.
 void penHeld(Point p)
          Called when the Pen or Mouse button is held down on the control.
 void penPressed(Point p)
          Called when the Pen or Mouse button is pressed on the control.
 void penReleased(Point p)
          Called when the Pen or Mouse button is released on the control.
 void popupMenuEvent(MenuEvent ev)
          This is called when the popup menu associated with the control generates an event.
 void popupMenuEvent(Object selectedItem)
          This is called when the user selects an item from the popup menu.
 void refresh(int x, int y, int width, int height)
           
 void setDisplay(PageDisplayUnit unit)
          Set the unit for the display.
 
Methods inherited from class ewe.ui.Canvas
canGo, canScreenScroll, checkScrolls, doBorder, 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, addDirectly, containerHasFocus, dismantle, dismantle, doHotKey, findChild, focusFirst, focusFirst, focusOnContainer, focusOnData, getChildren, getChildrenBackwards, getFirstFocus, getNextKeyFocus, gotFocus, lostFocus, remove, removeAll, repaintDataNow, takeFocus, takePromptControl
 
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, dontAcceptDrop, doPaintChildren, doPaintChildren, doPaintChildren, doPaintData, doPaintData, doShowMenu, dragged, exitEntry, fillBackground, formClosing, 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, getSubControls, getTag, getText, getWindow, hasModifier, hasPopupFormAttached, hasTag, inheritModifiers, isChildOf, isModal, isOnMe, isSomeonesHotKey, make, makeFrameTopMost, makeHot, menuIsActive, modify, modifyAll, modifyAll, notifyAction, notifyDataChange, notifyDataChange, notNative_doPaintChildren, oldButWorksDoPaintChildren, oldPaintChildren, oldPostEvent, onControlEvent, onEvent, onKeyEvent, onLabelPenEvent, onPaint, paintBackground, paintChildren, penRightReleased, popupBeep, popupMenuClosed, postEvent, recalculatePreferredSize, redisplay, refresh, removeListener, removeTimer, repaint, repaintNow, repaintNow, repaintNow, requestPaint, requestResizeTo, resetRect, resizeTo, 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, 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
 
Methods inherited from interface ewe.ui.ScrollClient
getServer, setServer
 

Field Detail

display

public PageDisplayUnit display
Constructor Detail

PageDisplay

public PageDisplay()
Method Detail

doPaint

public void doPaint(Graphics g,
                    Rect area)
Overrides:
doPaint in class Control

setDisplay

public void setDisplay(PageDisplayUnit unit)
Set the unit for the display. It will reset the origin and redisplay the new one.

Parameters:
unit - The new unit.

displayChanged

public void displayChanged()
Call this if the "display" unit has changed somehow and the scroll bars need updating.


doMenu

public boolean doMenu(Point where)
This will be called by default on a right-click. It will call getMenuFor(int x,int y) on the display units.

Overrides:
doMenu in class Control
Parameters:
where - The point where the pen was pressed or held.
Returns:
true if a menu was displayed.

popupMenuEvent

public void popupMenuEvent(Object selectedItem)
This is called when the user selects an item from the popup menu.

Overrides:
popupMenuEvent in class Control
Parameters:
selectedItem - The item selected.

getHotUnit

public PageDisplayUnit getHotUnit(int x,
                                  int y)

isHot

public boolean isHot(int x,
                     int y)

onPenEvent

public void onPenEvent(PenEvent ev)
Description copied from class: Control
Called to handle an incoming PenEvent. By default this dispatches the event to the various pen handling methods like penPressed()

Overrides:
onPenEvent in class Control
Parameters:
ev - The incoming PenEvent.

getToolTip

public Object getToolTip(int x,
                         int y)
This queries all the PageDisplayUnits to get any tool-tip for specified point.

Overrides:
getToolTip in class Control
Parameters:
x - The x location of the mouse in this control.
y - The y location of the mouse in this control.
Returns:
An acceptable tool-tip, or null.

popupMenuEvent

public void popupMenuEvent(MenuEvent ev)
Description copied from class: Control
This is called when the popup menu associated with the control generates an event. By default it calls popupMenuEvent(Object selectedItem) if the selectedItem is not null.

Overrides:
popupMenuEvent in class Control
Parameters:
ev - The event.

refresh

public void refresh(int x,
                    int y,
                    int width,
                    int height)

penHeld

public void penHeld(Point p)
Description copied from class: Control
Called when the Pen or Mouse button is held down on the control. This will only get called if the WantHoldDown modifier has been set for this control. This is called by the onPenEvent(PenEvent ev) method.

Within this method you can use the Control.currentPenEvent value to find out more about the PenEvent that caused this - including any modifiers (e.g. SHIFT keys) or determine if the left or right mouse button was pressed.

This method is usually used to display a context sensitive menu. In fact the default code for it is:

                if (!menuIsActive()) doMenu(p);
        

Overrides:
penHeld in class Control
Parameters:
p - The point on the Control where the pen was held.

penPressed

public void penPressed(Point p)
Description copied from class: Control
Called when the Pen or Mouse button is pressed on the control. This is called by the onPenEvent(PenEvent ev) method.

Within this method you can use the Control.currentPenEvent value to find out more about the PenEvent that caused this - including any modifiers (e.g. SHIFT keys) or determine if the left or right mouse button was pressed.

Overrides:
penPressed in class Control
Parameters:
p - The point on the Control where the pen was pressed.

penReleased

public void penReleased(Point p)
Description copied from class: Control
Called when the Pen or Mouse button is released on the control. This is called by the onPenEvent(PenEvent ev) method.

Within this method you can use the Control.currentPenEvent value to find out more about the PenEvent that caused this - including any modifiers (e.g. SHIFT keys) or determine if the left or right mouse button was pressed.

Overrides:
penReleased in class Control
Parameters:
p - The point on the Control where the pen was released.

penClicked

public void penClicked(Point p)
Description copied from class: Control
Called if the Pen or Mouse button is quickly pressed and released. This is called by the onPenEvent(PenEvent ev) method.

Within this method you can use the Control.currentPenEvent value to find out more about the PenEvent that caused this - including any modifiers (e.g. SHIFT keys) or determine if the left or right mouse button was pressed.

By default this method simply calls the penReleased() method.

Overrides:
penClicked in class Control
Parameters:
p - The point on the Control where the pen was clicked.

penDoubleClicked

public void penDoubleClicked(Point p)
Description copied from class: Control
Called if the Pen or Mouse button is double clicked on the Control. This is called by the onPenEvent(PenEvent ev) method.

Within this method you can use the Control.currentPenEvent value to find out more about the PenEvent that caused this - including any modifiers (e.g. SHIFT keys) or determine if the left or right mouse button was pressed.

By default this method simply calls the penClicked() method.

Overrides:
penDoubleClicked in class Control
Parameters:
p - The point on the Control where the pen was double-clicked.