public class Control extends ControlBase implements UIConstants, EventListener, ImageRefresher, Drawable, DataInterface, TimerProc, HasAncestor
Modifier and Type | Field and Description |
---|---|
Color |
backGround |
protected static Object |
beforeRemoved
A temporary holding spot for data in the process of being moved.
|
Color |
borderColor
The Color of the border of the Control (if a single line, non-3D border is used).
|
int |
borderStyle
The border style of the Control.
|
int |
borderWidth |
protected Control |
children
The children of the container.
|
int |
columns |
int |
constraints |
Font |
curFont |
protected static boolean |
debugModify |
static boolean |
debugRepaintNow |
Color |
disabledBackground |
DragContext |
dragging |
int |
dragResolution
The minimum number of pixels that the Pen/Mouse has to move during a drag operation to
be considered a drag to a new location.
|
int |
dragTime
Use this to control the resolution of the pen drags - it is the minimum delay in milliseconds
between processing pen drags.
|
int[] |
exitKeys |
FieldTransfer |
fieldTransfer
The fieldTransfer used by the fromField() and toField() methods
that take no parameters.
|
Font |
font |
FontChange |
fontChange |
Control |
fontFrom |
Color |
foreGround |
protected int |
height
The control's height
|
int |
holdDownPause |
int |
holdTick |
int |
hotKey
This is the "HotKey" for the control - use setHotKey() to set it.
|
IImage |
image |
protected MenuItem |
lastSelected |
protected Vector |
listeners |
boolean |
lockPaint
If this is true, then the repaintNow()/paintDataNow() methods will invoke
a readLock() on the Control before calling doPaint() or doPaintData().
|
protected int |
maxHeight
Do not set this directly - use setMaximumSize() instead.
|
protected int |
maxWidth
Do not set this directly - use setMaximumSize() instead.
|
MenuState |
menuState
This holds a MenuState Object used for controlling the Menu associated with
the Control.
|
protected int |
minHeight
Do not set this directly - use setMinimumSize() instead.
|
protected int |
minWidth
Do not set this directly - use setMinimumSize() instead.
|
protected int |
modifiers
Modifiers of the control.
|
String |
name |
protected Control |
next
The control's next sibling.
|
protected Container |
parent
The parent of the control.
|
int |
penStatus |
protected int |
preferredHeight
Do not set this directly - use setPrefferedSize() instead.
|
protected int |
preferredWidth
Do not set this directly - use setPrefferedSize() instead.
|
protected Control |
prev
The control's previous sibling.
|
String |
prompt
This is an optional string that is used as a user informative prompt for the control.
|
Control |
promptControl
This is optional - if a Label is used as the on-screen prompt for this control, then set this value
to be that control.
|
int |
rows |
protected ScrollServer |
ss |
int |
startDragResolution
The number of pixels that the Pen/Mouse has to move before it is considered the start
of a drag operation.
|
TagList |
tags |
protected Control |
tail
The tail of the children list.
|
String |
text |
Object |
toolTip
The object's tool tip which should be a String, IImage, Control or ToolTip
|
protected int |
width
The control's width
|
protected int |
x
The control's x location
|
protected int |
y
The control's y location
|
clipItems, clipObject, clipOwner, debugControl, debugFlag, doubleBuffer, doubleClickTime, doubleSizedFontHeight, firstPress, globalEditable, globalEnabled, PEN_STATUS_DID_HOLD_DOWN, PEN_STATUS_GOT_PEN_DOWN, PEN_STATUS_PEN_IS_ON, pressPoint, TAG_BOOLEAN_KEEP_BELOW_SIP, TAG_HOVER_TIME_INT, TAG_LAST_USER_DATA, TAG_USER_DATA, TAKE_FIRST_PRESS, unnamed
BDR_DOTTED, BDR_INNER, BDR_NOBORDER, BDR_OUTER, BDR_OUTLINE, BDR_RAISEDINNER, BDR_RAISEDOUTER, BDR_SUNKENINNER, BDR_SUNKENOUTER, BF_ABUT_ANY, BF_ABUT_BOTTOM, BF_ABUT_LEFT, BF_ABUT_RIGHT, BF_ABUT_TOP, 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
ALWAYS_STRETCHABLE, BOTTOM, CELLFLAG, CELLMASK, CENTER, CONTROLMASK, DONTCHANGE, DONTFILL, DONTSTRETCH, EAST, FILL, GROW, HCENTER, HCONTRACT, HEXPAND, HFILL, HGROW, HSHRINK, HSTRETCH, INITIALLY_CLOSED, INITIALLY_HIDDEN, INITIALLY_MINIMIZED, INITIALLY_PREFERRED_SIZE, INSETS, LEFT, MAXIMUMSIZE, MINIMUMSIZE, NORTH, NORTHEAST, NORTHWEST, PREFERREDSIZE, RECT, RIGHT, SHRINK, SOUTH, SOUTHEAST, SOUTHWEST, SPAN, STRETCH, TAG_BACKGROUND_IMAGE, TAG_BUSY_DISPLAY, TAG_COLORS, TAG_CONTROL_PAINTER, TAG_EXPOSE_GROUP, TAG_FIXEDSIZE, TAG_GRAY_BACKGROUND, TAG_HIDE_CONTROL_OBJECT, TAG_HIDE_PARENT, TAG_INNER_TEXT_INSETS, TAG_INPUT_STACK_PARENT, TAG_INSETS, TAG_MAKE_VISIBLE, TAG_MAXIMUMSIZE, TAG_MINIMUMSIZE, TAG_PAINT_CONTROL_LIST, TAG_PREFERRED_TEXT_SIZE, TAG_PREFERRED_TEXT_SIZE_HEIGHT, TAG_PREFERRED_TEXT_SIZE_WIDTH, TAG_PREFERREDSIZE, TAG_RECT, TAG_SHADOW_INSETS, TAG_SPAN, TAG_SWIPER, TAG_TEMPORARY_ERROR, TAG_TEXT_INSETS, TAG_TEXTSIZE, TEXTSIZE, TOP, VCENTER, VCONTRACT, VEXPAND, VFILL, VGROW, VSHRINK, VSTRETCH, WEST
All, AlwaysEnabled, AlwaysRecalculateSizes, ByDeferredMouse, ByDeferredPen, ByFrameChange, ByKeyboard, ByMouse, ByPen, ByRequest, CalculatedSizes, ContainerDontPaintChildren, Disabled, DisablePopupMenu, DisplayOnly, DontBuffer, Down, DrawFlat, Flag, ForceResize, HasData, Invisible, KeepImage, KeepSIP, Left, MakeMenuAtLeastAsWide, Maximize, Minimize, ModifiersInheritedFromWindow, MouseSensitive, NoFocus, NotAnEditor, NotEditable, PaintDataOnly, PaintOutsideOnly, PenTransparent, PreferredSizeOnly, Right, SendUpUIEvents, ShowSIP, ShrinkToNothing, SmallControl, TakeChildUIEvents, TakeControlEvents, TakesKeyFocus, Transparent, Up, WantDrag, WantHoldDown
KEEP_VISIBLE
Constructor and Description |
---|
Control() |
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsData(Object data,
DragContext how)
This should indicate whether this control will accept the data either via
a drag and drop or via a paste operation.
|
void |
activate()
This does NOT enable a disabled control - but tells it to put itself in an "active"
state.
|
void |
addListener(EventListener list)
This adds an EventListener that can listen for Events that are generated
by this Control - not Events that are received by this control.
|
boolean |
amOnTopFrame()
Returns true if this Control is in the topmost Frame.
|
Control |
applyFontChange(FontChange fc)
Apply a FontChange to a possibly already existing font change.
|
void |
baseOnPenEvent(PenEvent ev)
Called to handle an incoming PenEvent.
|
BufferedGraphics |
bufferGraphics(Graphics gr) |
BufferedGraphics |
bufferGraphics(Graphics original,
int x,
int y,
int width,
int height,
int options)
Get a BufferedGraphics for drawing to this Control given an original Graphics that
may be unbuffered (ie drawing directly to a Window).
|
BufferedGraphics |
bufferGraphics(Graphics original,
int x,
int y,
int width,
int height,
int options,
BufferedGraphics reUse) |
BufferedGraphics |
bufferGraphics(Graphics original,
Rect area,
int options)
Get a BufferedGraphics for drawing to this Control given an original Graphics that
may be unbuffered (ie drawing directly to a Window).
|
BufferedGraphics |
bufferGraphics(Graphics original,
Rect area,
int options,
BufferedGraphics reUse) |
static void |
cache(Object obj) |
protected void |
calculatedSizes()
This is called after calculateSizes() has been called.
|
protected void |
calculateSizes()
Override this to calculate the preferred, minimum and maximum size of your control.
|
protected Dimension |
calculateTextSize(FontMetrics fm,
int width,
int height,
Dimension dest) |
Dimension |
calculateTextSize(FontMetrics fm,
int width,
int height,
double hgap,
double vgap,
Dimension dest) |
protected Dimension |
calculateTextSize(int width,
int height,
Dimension dest) |
static void |
cancelHoldDown() |
void |
cancelPenPress() |
boolean |
canEdit()
Returns if the Control can edit its contents.
|
boolean |
change(int flagsToSet,
int flagsToClear)
This ensures that the specified flags are set or clear.
|
protected void |
changeDimension(int newWidth,
int newHeight) |
boolean |
changeTag(int tag,
Object oldValue,
Object newValue)
Change the tag for a Control only if it is set to the specified oldValue.
|
boolean |
checkClipboardOperations(Menu m)
This is called to enable/disable the clipboard options depending on the state of the Control.
|
protected boolean |
checkExitKey(KeyEvent ev) |
boolean |
checkMenu(Menu m)
This is called before a menu is displayed.
|
boolean |
checkMenuKey(KeyEvent ev,
Point where)
This checks the incoming KeyEvent to see if it should cause this Control to show a
menu.
|
boolean |
checkModifiers(int flagsSet,
int flagsClear)
This checks if the specified flags are set or clear.
|
boolean |
checkParentInterceptsUIEvent(Event ev,
Control destination)
This method is called by a Window before a UI event is sent to the destination
control.
|
protected boolean |
checkPenTransparent(PenEvent ev)
This will give a PenEvent to the parent Control IF
this Control is marked as PenTransparent.
|
protected void |
childrenPainted(Graphics g,
Rect area) |
Control |
clearTag(int tag) |
String |
clipboardToString(Object what) |
Object |
clipboardTransfer(Object clip,
boolean toClipboard,
boolean cut) |
void |
closeMenu()
If a menu for the control is being displayed, this will close it.
|
boolean |
contains(Control who)
See if this Control contains the specified Control.
|
boolean |
contains(int x,
int y)
Returns true if the given x and y coordinate in the parent's
coordinate system is contained within this control.
|
protected Menu |
createNewMenu(Point pen)
If this does not return null, then the new menu is set to menuState and that menu is used.
|
protected void |
dataAccepted(Control byWho,
Object data,
String action)
This is called either when data that was cut from this control was
pasted into another control, OR when data that was dragged from this
control is dropped into another control.
|
protected void |
dataBeingRemoved(Object data,
DragContext dc)
This tells the control that data is being removed from it either via
a cut operation or by a drag operation that is not explicitly a copy operation.
|
void |
dataDraggedOff(Object data)
This is called when data that was previously dragged into the control
has now been dragged off.
|
void |
dataDraggedOver(Object data)
This is called when data is being dragged into the control.
|
void |
dataDraggedOver(Object data,
Point p,
PenEvent ev)
This is called when data is being dragged into the control.
|
boolean |
dataDroppedOn(Object data,
Point p,
DragContext dc)
This is called by a drop from a drag and drop operation.
|
protected void |
dataTransferCancelled(Object data)
This gets called either when that was cut from this control was not
placed into another control (either it was rejected by a paste or a
subsequent copy/cut into the clipboard occured before the data was pasted)
or a drag and drop was initiated but not completed.
|
void |
deactivate()
This does NOT disable a control - but tells it to put itself in a "non-active" state.
|
Control |
defaultTo(int tag,
Object value) |
boolean |
deferInWindowThread(Event ev,
EventListener listener)
Post an Event to an EventListener via the Event Thread of the Window
containing this Control and via the cause field of a newly created DeferredEvent.
|
void |
doAction(int how)
Do the action as appropriate for this Control - but do not send an Action event.
|
void |
doActionKey(int key)
This will call doAction(ByKeyboard) and then call notifyAction()
|
void |
doBackground(Graphics g)
By default this calls paintBackground().
|
void |
doBorder(Graphics g) |
protected boolean |
doHotKey(Control from,
KeyEvent ev)
This method checks to see if a KeyEvent should be considered the Control's hot-key.
|
boolean |
doMenu(Point p)
This is a request to display a menu based on the pen being held or the mouse being right clicked on
the Control.
|
protected void |
dontAcceptDrop()
Should be called from the dataDraggedOver() method to indicate that the Control is willing
to accept the data.
|
void |
doPaint(Graphics g,
Rect r)
This is the main method to override when doing custom Control painting.
|
void |
doPaintChildren(Graphics g,
int x,
int y,
int w,
int h) |
protected void |
doPaintData()
Repaint the "data" part of the Control.
|
protected void |
doPaintData(Graphics g)
Repaint the "data" part of the Control.
|
protected boolean |
doShowMenu(Point pen)
Used to show the menu associated with the Control.
|
void |
dragged(DragContext dc)
This is called during the drag operation.
|
void |
draw(Graphics g,
int x,
int y,
int options) |
void |
draw(Graphics g,
int x,
int y,
int width,
int height,
int options) |
void |
draw(Graphics g,
int x,
int y,
Rect visibleDestinationArea,
int options)
Draw the Drawable to the Graphics and specify the area on the graphics that is visible.
|
boolean |
exitEntry(int exitKey,
int modifiers)
If this returns false it means it is already in exitEntry.
|
void |
fillBackground(Graphics g) |
void |
fillBackgroundNotInFrame(Graphics g,
Frame f) |
Object |
findTagInParents(int tag)
Find a Tag in this control or in its ancestors.
|
protected void |
fontChanged()
This is called when setFont() or applyFont() or setFontChanged() is called.
|
protected void |
formClosing()
This is called to indicate that the Form is about to close and it causes a FormClosed event to be posted.
|
void |
free() |
void |
fromClipboard()
Paste the contents of the clipboard into the control, overwriting any
exisiting selected area.
|
void |
fromField()
Transfer data from a Field (possibly in an Object) to
be displayed on this Control
using the FieldTransfer saved in the member field "fieldTransfer".
|
void |
fromField(FieldTransfer ft)
Transfer data from a Field (possibly in an Object) to
be displayed on this Control.
|
Iterator |
getAllDescendants(boolean backwards)
Get all the children for this Control and their children.
|
Iterator |
getAllSubControls()
Get all the sub-controls for this Control and their sub-controls.
|
HasAncestor |
getAncestor() |
HasAncestor |
getAncestor(Class ofType,
boolean includeThis) |
Object |
getAncestorProperty(String propertyName) |
Color |
getBackground() |
static Object |
getCached(Class type) |
ControlIterator |
getCachedChildren(boolean backwards) |
static Dimension |
getCachedDim() |
static Dimension |
getCachedDim(int width,
int height) |
static Rect |
getCachedRect() |
static Rect |
getCachedRect(int x,
int y,
int width,
int height) |
ControlIterator |
getCachedSubControls() |
ControlAnchor |
getChildAnchor() |
ControlIterator |
getChildren()
Deprecated.
- use getChildren(ControlIterator,boolean) instead.
|
ControlIterator |
getChildren(ControlIterator dest,
boolean backwards)
Get an Iterator to go through the list of all the direct children of this
Control re-using a ControlIterator if provided.
|
ControlIterator |
getChildrenBackwards()
This returns an Iterator that goes backwards through the components which are physically
added to this Control - i.e. may be displayed within the Control.
|
Menu |
getClipboardMenu(Menu addTo)
This adds the standard clipboard menu to a menu to be used by this control.
|
static Object |
getClipObject() |
protected Insets |
getContentsInsets()
This returns content insets, separate from borderWidth.
|
Insets |
getContentsInsets(Insets dest) |
Rect |
getContentsRect(Rect destination) |
protected Object |
getDataToCopy()
This is called to get data from the control to put into the clipboard.
|
protected boolean |
getDataToDragAndDrop(DragContext dc)
A quick way to provide DragAndDrop data.
|
Rect |
getDim(Rect dest)
Return the size of the Control in a Rect rather than a Dimension.
|
String |
getDisplayText()
Get the text to display for the Control (which may be different
to what is considered the text of the control).
|
static DragContext |
getDragAndDropContext() |
FieldTransfer |
getFieldTransfer() |
Font |
getFont() |
FontMetrics |
getFontMetrics()
Returns the font metrics for the Font for this Control.
|
FontMetrics |
getFontMetrics(Font font)
Returns the font metrics for a given font.
|
protected FontMetrics |
getFontMetricsForSizeCalculations() |
Color |
getForeground() |
Frame |
getFrame() |
Container |
getFrameOrContainer() |
BufferedGraphics |
getGraphics() |
BufferedGraphics |
getGraphics(int x,
int y,
int width,
int height) |
int |
getHeight() |
Container |
getHideParent()
Get the parent Container used to hide()/unhide() the Control.
|
IImage |
getImage() |
MenuItem |
getLastSelected()
Find the menu item which was last selected.
|
Point |
getLocation(Point dest)
Return the location of the Control (x and y coordinates) within
its parent in a Point.
|
ReadWriteLock |
getLock() |
Dimension |
getMaximumSize(Dimension dest) |
Menu |
getMenu()
Return the Menu associated with the Control if any.
|
Dimension |
getMinimumSize(Dimension dest) |
int |
getModifiedBorderFlags(int borderFlags) |
int |
getModifiers(boolean shouldInherit)
This will get the modifiers for this control.
|
Control |
getNext()
Returns the next child in the parent's list of controls.
|
Control |
getNextKeyFocus(Control sourceChild,
boolean forwards)
Determine which sub-control should receive the keyboard focus.
|
PaintParameters |
getPaintParameters(int customFlags) |
Container |
getParent()
Returns the control's parent container.
|
Control |
getParent(Class ofType)
Return this Control or the parent of this Control that is of a particular type.
|
Control |
getParent(Class ofType,
boolean includeThis) |
Object |
getParentOrListener(Class ofType) |
char |
getPasswordCharacter()
If this Control represents the input of a password that must be kept
hidden, then this method should return a password character (usually a '*').
|
Point |
getPosInFrame() |
Point |
getPosInFrame(Point dest) |
Point |
getPosInParent(Container parent)
Deprecated.
- use getPosInParent(Container,Point) instead.
|
Point |
getPosInParent(Container parent,
Point dest) |
Dimension |
getPreferredSize(Dimension dest) |
Dimension |
getPreferredSizeByParent(int widht,
int height) |
PointRect |
getPreferredTextSize(PointRect dest)
Get the preferred text size as a PointRect.
|
String |
getPrompt()
Get the prompt for the Control if any is set.
|
String |
getPromptText()
This returns either the value of prompt, if it is not null and not an empty string, or
the text value of promptControl, if that is not null and not an empty string.
|
Rect |
getRect() |
Rect |
getRect(Rect dest)
Return the on-screen coordinates of this Control in a Rect.
|
ScrollServer |
getServer() |
Dimension |
getSize(Dimension dest)
Return the size of the Control in a Dimension object.
|
int[] |
getSizes(int[] values)
This gets all of the control sizes.
|
ControlIterator |
getSubControls()
Deprecated.
- use getSubControls(ControlIterator,boolean) instead.
|
ControlIterator |
getSubControls(ControlIterator dest)
This returns an Iterator that goes forwards through the components
which are considered a sub-control of this Control, even though they
may not be a "child" of the control -
i.e. it may not have been added into the Control heirarchy.
|
Object |
getTag(int tag,
Object defaultValue) |
String |
getText()
Get the text of the Control.
|
Object |
getToolTip(int x,
int y)
This should return an acceptable ToolTip object.
|
int |
getWidth() |
Window |
getWindow() |
Graphics |
getWindowGraphics()
Return a Graphics context for this control for drawing directly onto the
window surface IF supported by the Window.
|
void |
gotFocus(int how)
This is called when the Control gets the focus.
|
boolean |
hasModifier(int what,
boolean shouldInherit)
Check if the control has the specified modifier flags set.
|
boolean |
hasPopupFormAttached()
Returns true if a ControlPopupForm is attached to this Control.
|
boolean |
hasTag(int tag) |
void |
hide(boolean updateParent)
Temporarily hide the Control.
|
void |
inheritModifiers(Control fromWho,
boolean inheritFromAll,
int what,
boolean setChildren)
Get particular modifiers flags from another control and optionally set children flags.
|
protected Rect |
insetToContents(Rect r,
boolean newRect) |
boolean |
interceptChildUIEvent(Event event,
Control destination)
This method is called if this Control has the TakeChildUIEvents modifier set
and one of its children is the destination for a UI event.
|
boolean |
isChildOf(Container who) |
Window |
isDirectChildOfWindow() |
boolean |
isHidden() |
boolean |
isModal()
This determines if the Control is being displayed in a modal frame.
|
protected boolean |
isOnMe(int x,
int y) |
protected boolean |
isOnMe(Point p)
Checks if the Point p - which is relative to the top-left of this Control, is within the bounds
of the Control.
|
protected boolean |
isOnMe(Point p,
boolean orOnMyPrompt) |
protected boolean |
isSomeonesHotKey(KeyEvent ev) |
void |
lostFocus(int how)
This is called when the Control loses the focus.
|
void |
make(boolean reMake)
This is used to "make" the control before being displayed.
|
void |
makeFrameTopMost() |
String |
makeHot(String label)
Deprecated.
use makeHot(String,CharArray) instead.
|
CharArray |
makeHot(String label,
CharArray dest)
Format the String as a true Hotkey encoded string using the hotkey associated with this control (if any).
|
Closes |
makeInvisible(boolean repaintOnVisible) |
void |
makeVisible()
This will attempt to make the control visible by finding the MakeVisible tag in this control or the first of its ancestors that
have a makeVisible tag.
|
void |
markAsTemporaryError() |
boolean |
menuIsActive()
Return whether the Control currently has an active popup menu.
|
protected void |
menuStateChanged(boolean menuOpened) |
int |
modify(int flagsToSet,
int flagsToClear)
Set/Clear modifier flags for the Control.
|
void |
modifyAll(int set,
int clear)
Modify this control and all child controls (and their children).
|
void |
modifyAll(int set,
int clear,
boolean doThisOne)
Modify all child controls (and their children).
|
long |
modifyFlags(int flagsToSet,
int flagsToClear)
Set/Clear modifier flags for the Control.
|
void |
mouseHover(Point p,
int modifiers,
boolean isHover) |
Object |
newEventThread(Control toDisable)
Call this within a Thread handling an Event for the Control if
the Event handling may block.
|
void |
notifyAction()
Generate and send a standard "action" event for this Control.
|
void |
notifyDataChange()
Generate and dispatch a new DataChangeEvent.
|
void |
notifyDataChange(DataChangeEvent dce) |
void |
notifyMenuItemSelected(MenuItem mi)
This sets the lastSelected MenuItem to the specified menu item and then fires a MenuEvent.SELECTED event if
the provided MenuItem is not null.
|
void |
notifyStructureChanged()
Generate and dispatch a new ControlEvent with type ControlEvent.STRUCTURE_CHANGED.
|
void |
onControlEvent(ControlEvent ev) |
void |
onEvent(Event ev) |
void |
onKeyEvent(KeyEvent ev) |
void |
onLabelPenEvent(PenEvent ev)
This is called if the Pen/Mouse is pressed on the Label associated with this Control.
|
void |
onPenEvent(PenEvent ev) |
void |
paintBackground(Graphics g)
Do a standard painting of the Background.
|
protected boolean |
paintWithControlPainter(Graphics g,
Rect area,
int customFlags) |
Object |
pauseEventThread()
Call this within a Thread handling an Event for the Control if
the Event handling may block.
|
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 |
penRightReleased(Point p)
Called when the right Mouse button is released on the control.
|
static void |
popupBeep()
This is called when a popup-menu or pull-down menu is first shown.
|
protected void |
popupMenuClosed(Menu m)
This gets closed after the popup menu for the Control has closed.
|
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 |
postEvent(Event ev)
Send a newly generated Event up the chain of Controls, starting from this one.
|
boolean |
postInWindowThread(Event ev)
Post an Event using the Event Thread of the Window containing this Control.
|
void |
postUIEvent(Event ev)
This method is called by the Window to send UI events to this Control.
|
ControlAnchor |
putInside(int toPutAnchor,
Container parent,
int parentAnchor,
double xOffset,
double yOffset) |
void |
queueKeyEvent(int type,
int key,
int modifiers) |
void |
queuePenEvent(int type,
int modifiers) |
void |
readLock() |
Dimension |
recalculatePreferredSize(Dimension dest) |
void |
redisplay()
Do not use this to repaint a control - use repaintNow() instead.
|
void |
refresh(IImage image,
int options)
The default version of this method simpy repaints the control - however for controls
which may display multiple images a better refresh scheme would be needed.
|
void |
releaseBufferedGraphics(BufferedGraphics g)
This is only used in special circumstances such as repaintNow()
when you are or may be buffering directly to the Window surface.
|
protected void |
removed() |
void |
removeListener(EventListener list)
This removes an EventListener added by addListener().
|
void |
repaint()
This is the same as repaintInWindowThread() and requests a
paint of the Control synchronized to the Window Event Thread.
|
void |
repaint(int x,
int y,
int width,
int height) |
void |
repaintDataNow()
Repaint the "data" part of the Control now.
|
void |
repaintInWindowThread()
Request a repaint of the entire control in the Window thread.
|
void |
repaintInWindowThread(boolean alwaysInSeparateCall,
Rect area)
Request a repaint of the control in the Window thread.
|
void |
repaintNow()
Repaint the Control now.
|
void |
repaintNow(boolean yes)
Repaint the Control now if the "yes" parameter is true.
|
void |
repaintNow(Graphics gr,
Rect where) |
void |
repaintNow(Graphics gr,
Rect where,
boolean ignoreParents)
Repaint a section of the Control now.
|
boolean |
requestPaint()
See if a paint is allowed on the Control at this time.
|
void |
requestResizeTo(int width,
int height)
This requests that the size be changed to the following dimensions
but the control is free to ignore it or to change to a different value.
|
void |
resetAllCachedProperties(boolean doThisOne) |
void |
resetCachedProperties() |
void |
resetRect()
This calls setRect() with the current rect parameters.
|
void |
resizeTo(int width,
int height)
This is called to change the width and height values.
|
void |
restore(int oldValue,
int mask)
Restore the modifier flags to their previous value.
|
void |
restoreBorderModifiers(long fromSetBorderModifiers) |
void |
restoreFlags(long oldValue)
Restore the modifier flags to their previous value.
|
void |
resumeEventThread(Object fromPause)
Call this within a Thread handling an Event after a call to
pauseEventThread().
|
void |
scrollAndRepaint(int sx,
int sy,
int sw,
int sh,
int destX,
int destY)
This is called to update a Control on-screen after it has been scrolled.
|
void |
sendToListeners(Event ev)
Send an Event to the the Listeners but note that PenEvents are not
sent to Listeners.
|
int |
set(int flag,
boolean status)
Switch on or off a modifier depending on the status parameter.
|
void |
setAllFonts(Font parentFont,
boolean setAsFixedFont) |
Control |
setBackgroundImage(ImageData image,
int backgroundImageType,
double scaleAlphaBy)
Set the background image for the Control.
|
Control |
setBorder(int style,
int width)
This sets both the border style and width of the Control
|
long |
setBorderModifiers(int toSet,
int toClear,
int toRemove) |
Control |
setCell(int val) |
ControlAnchor |
setChildAnchor(Control parent) |
static void |
setClipObject(Object obj) |
Control |
setControl(int val) |
void |
setCursor(int cursor) |
void |
setFieldTransfer(FieldTransfer ft) |
Control |
setFixedSize(int width,
int height) |
Control |
setFont(Font f)
Set the Font for the control.
|
Control |
setFontChange(FontChange fc)
Set the FontChange for the control.
|
static void |
setFreeDragging()
Call this in response to a Pen Down event to convert Drag
events to simple Move events, and to let the release event
get sent to whichever control it is released on, instead
of the initially pressed control.
|
void |
setHidden(boolean isHidden,
boolean updateParent) |
void |
setHiddenParent(boolean hiddenAtFirst,
Container parentForHiding)
A convenience method for setting up a Control for later hide() and unhide()
calls.
|
Control |
setHotKey(int modifiers,
char key)
Set the hot-key for this Control.
|
Control |
setHotKey(int modifiers,
int key)
Set the hot-key for this Control.
|
void |
setLocation(int x,
int y)
Set the location (x and y coordinates) of this Control within its
parent.
|
Control |
setMaximumSize(int width,
int height) |
void |
setMenu(Menu menu)
Associate a context sensitive menu with the Control.
|
Control |
setMinimumSize(int width,
int height) |
Control |
setPreferredSize(int width,
int height) |
Control |
setPreferredTextSize(double width,
double height) |
Control |
setPreferredTextSize(int width,
int height) |
void |
setPromptControl(Control prompt)
On a normal Control this will set the promptControl variable to "prompt", but
on a Container, the first child non-container will have "prompt" assigned to it.
|
void |
setRect(int x,
int y,
int width,
int height)
Set the on-screen coordinates of this Control.
|
void |
setRect(Rect r)
Set the on-screen coordinates of this Control.
|
Control |
setScaledBackgroundImage(ImageData image,
double scaleAlphaBy)
Set the background image for the Control scaled to fit the Control.
|
void |
setServer(ScrollServer server) |
Control |
setShadow(int top,
int left,
int bottom,
int right,
int options) |
void |
setSwiping(boolean horizontal,
boolean vertical,
boolean allowSimultaneous)
Call this to request Swipe handling for this Control.
|
Control |
setTag(int tag,
Object value) |
Control |
setTags(TagList tl) |
void |
setText(String what)
Set the text of the Control, automatically repainting it.
|
Control |
setTextSize(int width,
int height) |
Control |
setTiledBackgroundImage(ImageData image,
double scaleAlphaBy)
Set the background image for the Control in a tiled pattern.
|
Control |
setToolTip(Object tip)
Set the tooltip of the object.
|
protected boolean |
showHoldDownIndicator(int x,
int y)
If this returns true then the Pen Hold Down indicator will be
displayed before a Popup menu is shown.
|
void |
shown()
This is called when a Control is shown in a Window.
|
void |
simulateClickOn(int modifiers)
Call this in a non-event thread.
|
void |
simulateKeyPresses(String text) |
void |
simulateKeyType(int key,
int modifiers) |
void |
standardOnKeyEvent(KeyEvent ev)
This is the standard Control onKeyEvent() - call this only after you have checked for
other keys that your control definitely wants to trap.
|
protected boolean |
startDragAndDrop(Object data,
boolean isMultiple,
boolean isCopy)
Called by a Control from within the startDragging() method to indicate that
a DragAndDrop operation should begin.
|
protected boolean |
startDragAndDrop(Object data,
int dragCursor,
boolean isCopy)
Called by a Control from within the startDragging() method to indicate that
a DragAndDrop operation should begin.
|
void |
startDragging(DragContext dc)
This is called to indicate the start of a pen/mouse drag operation.
|
void |
stopDragging(DragContext dc)
Called when the pen was released during a drag operation.
|
boolean |
takeData(Object data,
DragContext how)
This tells the Control to take the data which has either come from a clipboard operation
or from a DragAndDrop.
|
void |
takeFocus(int how)
Set the focus on this Control.
|
protected void |
takeFromClipboard(Object clip,
String action)
This calls takeData(data,null) and then calls dataAccepted(this,data,action)
on the clipOwner.
|
protected boolean |
takePromptControl(Control prompt) |
void |
testInWindowThread() |
void |
ticked(Object id,
long elapsed) |
boolean |
tipIsDisplayed()
Returns true if a tooltip is displayed in the current window.
|
void |
toClipboard(boolean cut)
Copy the selected contents of the control to clipboard.
|
void |
toField()
Transfer data from this Control to a Field (possibly in an Object)
using the FieldTransfer saved in the member field "fieldTransfer".
|
void |
toField(FieldTransfer ft)
Transfer data from this Control to a Field (possibly in an Object).
|
String |
toIDString() |
String |
toString()
Return a String representation of this object.
|
static Object |
toTextData(Object data)
This converts an object into either a String or an array of Strings.
|
void |
transferPenPress(Control toChild)
This is used to transfer a pen press to a Control that is contained
within this child control tree of this Control.
|
void |
transferPenPress(Control toWho,
int dx,
int dy)
This is used to transfer a pen press to another Control.
|
protected boolean |
tryDragAndDrop(DragContext dc)
Call this from startDragging() if you want to try to do a drag and drop.
|
Graphics |
tryGetGraphics()
Avoid using this method - use getGraphics() instead to get a BufferedGraphics
for painting to the Control.
|
boolean |
tryNext(boolean forwards) |
boolean |
tryStartMenu(Point pen)
This attempts to display a Menu for the Control if one exists AND is not already displayed.
|
void |
unhide(boolean updateParent)
Reveal the Control after being hidden by hide().
|
void |
unlock() |
void |
updateData()
This tells the control to consider its current data to be unchanged.
|
protected void |
updateDCDuringDD(boolean stopDrag,
PenEvent ev) |
void |
updateFrom(FieldTransfer ft) |
void |
updateTo(FieldTransfer ft) |
boolean |
verifyWantDrag()
This is called only if the WantDrag modifier is set for the Control.
|
boolean |
verifyWantHoldDown()
This is called only if the WantHoldDown modifier is set for the Control.
|
Object |
waitEventThread(Handle h)
This method calls pauseEventThread() on this Control and then
waits until the provided Handle (which must not be null) to
complete (have the Stopped bit set).
|
protected void |
willAcceptDrop()
Should be called from the dataDraggedOver() method to indicate that the Control is not willing
to accept the data.
|
boolean |
willShowFrame(PenEvent ev)
This is used to indicate that the control is going to show a pop-up Frame of some sort (e.g. for a Menu)
in reaction to the specified PenEvent.
|
protected boolean |
windowHasFloatingControls() |
void |
writeLock() |
doubleSizeIt, getGuiTextHeight, isDoubleSized, isDoubleSizedFont, loadImage, tryLoadImage
protected int x
protected int y
protected int width
protected int height
protected Container parent
protected Control next
protected Control prev
protected Control children
protected Control tail
protected int modifiers
public int hotKey
public int borderStyle
public Color borderColor
public int borderWidth
public int penStatus
public boolean lockPaint
public int rows
public int columns
public String name
public String text
public String prompt
public Control promptControl
public int dragResolution
public int startDragResolution
public Object toolTip
public Color backGround
public Color disabledBackground
public Color foreGround
public Font font
public IImage image
public Control fontFrom
public FontChange fontChange
public Font curFont
protected static boolean debugModify
public int constraints
public TagList tags
protected int preferredWidth
protected int preferredHeight
protected int minWidth
protected int minHeight
protected int maxWidth
protected int maxHeight
public static boolean debugRepaintNow
public int dragTime
protected MenuItem lastSelected
public int[] exitKeys
public int holdDownPause
public int holdTick
public DragContext dragging
protected static Object beforeRemoved
public MenuState menuState
protected Vector listeners
public FieldTransfer fieldTransfer
protected ScrollServer ss
public long setBorderModifiers(int toSet, int toClear, int toRemove)
public int getModifiedBorderFlags(int borderFlags)
public void restoreBorderModifiers(long fromSetBorderModifiers)
public ReadWriteLock getLock()
public void readLock()
public void writeLock()
public void unlock()
public String toString()
Object
public void gotFocus(int how)
how
- one of the ByXXX values.public void markAsTemporaryError()
public ControlAnchor setChildAnchor(Control parent)
public ControlAnchor getChildAnchor()
public void lostFocus(int how)
how
- one of the ByXXX values.public void setText(String what)
public String getText()
public char getPasswordCharacter()
public String getDisplayText()
public String getPrompt()
public void updateData()
public String getPromptText()
public void setPromptControl(Control prompt)
prompt
- the Control acting as the prompt (usually an mLabel).protected boolean takePromptControl(Control prompt)
public void takeFocus(int how)
how
- - one of the ControlConstant.ByXXX values.public Control setToolTip(Object tip)
tip
- the tip which should be a String, IImage, Control or ToolTippublic Object getToolTip(int x, int y)
x
- The x location of the mouse in this control.y
- The y location of the mouse in this control.public PointRect getPreferredTextSize(PointRect dest)
dest
- public IImage getImage()
public final String toIDString()
public Font getFont()
protected void fontChanged()
public Control setFont(Font f)
f
- the Font to set.public Control setFontChange(FontChange fc)
fc
- the font change to use for the control - which may be null.public Control applyFontChange(FontChange fc)
fc
- the FontChange to apply. It is not used thereafter.public Color getBackground()
public Color getForeground()
public FontMetrics getFontMetrics(Font font)
public FontMetrics getFontMetrics()
public void activate()
If you want to re-enable a disabled control do modify(0,Control.Disabled)
public void deactivate()
If you want to disable a control do modify(Control.Disabled,0)
public final int set(int flag, boolean status)
flag
- The flags to set on or off.status
- if true the flags will be set on, if false they will be set off.public int modify(int flagsToSet, int flagsToClear)
int old = myControl.modify(flagsSet,flagsClear); //do some processing... myControl.restore(old,flagsSet|flagsClear);
flagsToSet
- The flags to set.flagsToClear
- The flags to clear.public HasAncestor getAncestor()
getAncestor
in interface HasAncestor
public final HasAncestor getAncestor(Class ofType, boolean includeThis)
public Control getParent(Class ofType)
ofType
- public final long modifyFlags(int flagsToSet, int flagsToClear)
long old = myControl.modifyFlags(flagsSet,flagsClear); //do some processing... myControl.restoreFlags(old);
flagsToSet
- The flags to set.flagsToClear
- The flags to clear.public final void restoreFlags(long oldValue)
long old = myControl.modifyFlags(flagsSet,flagsClear); //do some processing... myControl.restoreFlags(old);
oldValue
- the value returned by modifyFlags.public void restore(int oldValue, int mask)
int old = myControl.modify(flagsSet,flagsClear); //do some processing... myControl.restore(old,flagsSet|flagsClear);
oldValue
- the value returned by modify().mask
- the paramters flagsToSet OR'ed with flagsToClear as used in the modify() method.public boolean checkModifiers(int flagsSet, int flagsClear)
flagsSet
- Flags to check for being set.flagsClear
- Flags to check for being clear.public boolean change(int flagsToSet, int flagsToClear)
public boolean hasModifier(int what, boolean shouldInherit)
what
- The modifier flags to check for.shouldInherit
- if this is true then all parents of the control will also be checked.public int getModifiers(boolean shouldInherit)
public final void inheritModifiers(Control fromWho, boolean inheritFromAll, int what, boolean setChildren)
fromWho
- The control to get from.inheritFromAll
- if this is true then also check the ancestors of the control for the flags.what
- the flags to get (or'ed together).setChildren
- if this is true then modify my children.public void modifyAll(int set, int clear)
set
- The flags to set.clear
- The flags to clear.public void modifyAll(int set, int clear, boolean doThisOne)
set
- The flags to set.clear
- The flags to clear.doThisOne
- if this is true then this control will also be modified otherwise
only the children will be.public void setAllFonts(Font parentFont, boolean setAsFixedFont)
public void resetAllCachedProperties(boolean doThisOne)
public void resetCachedProperties()
public boolean canEdit()
public Control setControl(int val)
public Control setCell(int val)
public boolean changeTag(int tag, Object oldValue, Object newValue)
tag
- oldValue
- newValue
- public Control clearTag(int tag)
public boolean hasTag(int tag)
public Control setScaledBackgroundImage(ImageData image, double scaleAlphaBy)
image
- the image.scaleAlphaBy
- a value to scale the transparency of the Image by. A value
of 1.0 indicates no change to the alpha value. Values less than 1 makes the
image more transparent by that value.public Control setTiledBackgroundImage(ImageData image, double scaleAlphaBy)
image
- the image.scaleAlphaBy
- a value to scale the transparency of the Image by. A value
of 1.0 indicates no change to the alpha value. Values less than 1 makes the
image more transparent by that value.public Control setBackgroundImage(ImageData image, int backgroundImageType, double scaleAlphaBy)
image
- the image.backgroundImageType
- one of the BackgroundImage.DISPLAY_TYPE_XXX values.scaleAlphaBy
- a value to scale the transparency of the Image by. A value
of 1.0 indicates no change to the alpha value. Values less than 1 makes the
image more transparent by that value.public Control setFixedSize(int width, int height)
public Control setPreferredSize(int width, int height)
public Control setPreferredTextSize(int width, int height)
public Control setTextSize(int width, int height)
public Control setMinimumSize(int width, int height)
public Control setMaximumSize(int width, int height)
public Control setPreferredTextSize(double width, double height)
protected void calculatedSizes()
public int[] getSizes(int[] values)
protected void calculateSizes()
protected FontMetrics getFontMetricsForSizeCalculations()
public Dimension calculateTextSize(FontMetrics fm, int width, int height, double hgap, double vgap, Dimension dest)
protected Dimension calculateTextSize(FontMetrics fm, int width, int height, Dimension dest)
public Dimension getPreferredSizeByParent(int widht, int height)
public ControlAnchor putInside(int toPutAnchor, Container parent, int parentAnchor, double xOffset, double yOffset)
protected final void changeDimension(int newWidth, int newHeight)
public Window isDirectChildOfWindow()
public void resizeTo(int width, int height)
public void redisplay()
public void requestResizeTo(int width, int height) throws RelayoutException
RelayoutException
public Rect getRect(Rect dest)
dest
- an optional destination Rect. If it is null a new one
will be created and returned.public Rect getRect()
public void resetRect() throws RelayoutException
RelayoutException
public void setRect(Rect r) throws RelayoutException
r
- the Rect representing the x, y, width and height of the
Control.RelayoutException
public void setRect(int x, int y, int width, int height) throws RelayoutException
x
- the x-coordinate.y
- the y-coordinate.width
- the new width of the Control.height
- the new height of the Control.RelayoutException
public Rect getDim(Rect dest)
dest
- an optional destination Rect. If it is null a new one
will be created and returned.public Dimension getSize(Dimension dest)
dest
- an optional destination Dimension. If it is null a new one
will be created and returned.public Point getLocation(Point dest)
dest
- an optional destination Point. If it is null a new one
will be created and returned.public void setLocation(int x, int y)
x
- the new x-coordinate.y
- the new y-coordinate.public final ControlIterator getChildren()
Note that a sub-control may not be a "child" of the control - i.e. it may not have been added into the Control heirarchy.
public final ControlIterator getChildrenBackwards()
Note that a sub-control may not be a "child" of the control - i.e. it may not have been added into the Control heirarchy.
public ControlIterator getChildren(ControlIterator dest, boolean backwards)
dest
- an optional destination ControlIterator.backwards
- true to iterate through the children in the reverse order
in which they were added.public final ControlIterator getCachedChildren(boolean backwards)
public final ControlIterator getCachedSubControls()
public Iterator getAllDescendants(boolean backwards)
public Iterator getAllSubControls()
public final ControlIterator getSubControls()
public ControlIterator getSubControls(ControlIterator dest)
public void make(boolean reMake)
reMake
- if this is true then you should do a full re-make.public Container getParent()
public Control getNext()
public boolean contains(int x, int y)
public boolean contains(Control who)
who
- the possible child or anscestor control.public final boolean isChildOf(Container who)
public final boolean isModal()
public void setHiddenParent(boolean hiddenAtFirst, Container parentForHiding)
hiddenAtFirst
- true to have the Control added to its parent in an
initially hidden state, false for it to be added normally.parentForHiding
- the parent Container that will be used for hide()/unhide()
calls. If this is null it will default to the Frame of the Control when
hide()/unhide() is called.public Container getHideParent()
public boolean isHidden()
public void hide(boolean updateParent)
updateParent
- if this is true then the hide parent will have
relayout() called on it and will update itself onscreen.public void unhide(boolean updateParent)
updateParent
- if this is true then the hide parent will have
relayout() called on it and will update itself onscreen.public void setHidden(boolean isHidden, boolean updateParent)
public Frame getFrame()
public Window getWindow()
public Container getFrameOrContainer()
public boolean amOnTopFrame()
public Point getPosInFrame()
public final Graphics tryGetGraphics()
public BufferedGraphics bufferGraphics(Graphics original, int x, int y, int width, int height, int options)
original
- the original Graphics that may be unbuffered or may be null.x
- the x location within the Graphics to draw to.
This is usually the x location
within the control you wish to draw to as the original Graphics will usually be
translated so that (0,0) in the Graphics is set to the top-lef corner of the Control.y
- the y location within the Graphics to draw to.
This is usually the y location
within the control you wish to draw to as the original Graphics will usually be
translated so that (0,0) in the Graphics is set to the top-lef corner of the Control.width
- the width within the Control you wish to draw to.height
- the height within the Control you wish to draw to.options
- one of the BufferedGraphics OPTION_XXX values.public BufferedGraphics getGraphics(int x, int y, int width, int height)
public BufferedGraphics getGraphics()
public BufferedGraphics bufferGraphics(Graphics gr)
public BufferedGraphics bufferGraphics(Graphics original, int x, int y, int width, int height, int options, BufferedGraphics reUse)
public void releaseBufferedGraphics(BufferedGraphics g)
g
- the BufferedGraphics.public BufferedGraphics bufferGraphics(Graphics original, Rect area, int options)
original
- the original Graphics that may be unbuffered or may be null.area
- the area within the Graphics to draw to.
This is usually the area
within the control you wish to draw to as the original Graphics will usually be
translated so that (0,0) in the Graphics is set to the top-lef corner of the Control.options
- one of the BufferedGraphics OPTION_XXX values.public BufferedGraphics bufferGraphics(Graphics original, Rect area, int options, BufferedGraphics reUse)
public void repaintNow()
public void repaintNow(boolean yes)
public Object waitEventThread(Handle h)
h
- the Handle to wait for.public Object pauseEventThread()
Use resumeEventThread() when the operation is complete to resume this thread.
public void resumeEventThread(Object fromPause)
public Object newEventThread(Control toDisable)
Use resumeEventThread() when the operation is complete to resume this thread.
toDisable
- an optional Control to disable while the new
Event thread is running.public boolean requestPaint()
public void repaintInWindowThread(boolean alwaysInSeparateCall, Rect area)
alwaysInSeparateCall
- if this is true the repaint is always done in
a separate call of the Window Event Thread even if the current thread is
the active Window Event Thread.area
- the area to repaint, or null to repaint the entire area.public void testInWindowThread()
public void repaintInWindowThread()
public void repaint()
public void repaint(int x, int y, int width, int height)
public void repaintNow(Graphics gr, Rect where, boolean ignoreParents)
gr
- The Graphics to paint to. If this is null a new Graphics will be created.where
- The rectangle within the Control to paint. If this is null the entire Control will be painted.public void doBackground(Graphics g)
g
- the non-null Graphics to paint to.public void fillBackground(Graphics g)
public void doPaint(Graphics g, Rect r)
g
- the graphics to paint to.r
- the area within the Control to paint. This can be ignored and the entire
area can be painted if so desired.public Graphics getWindowGraphics()
public void paintBackground(Graphics g)
g
- the non-null Graphics to paint to.public void doBorder(Graphics g)
public void doPaintChildren(Graphics g, int x, int y, int w, int h)
public static Rect getCachedRect(int x, int y, int width, int height)
public static Rect getCachedRect()
public static Dimension getCachedDim(int width, int height)
public static Dimension getCachedDim()
public static void cache(Object obj)
protected boolean windowHasFloatingControls()
protected final void doPaintData()
protected void doPaintData(Graphics g)
g
- The Graphics object to paint to.public void repaintDataNow()
public void refresh(IImage image, int options)
refresh
in interface ImageRefresher
image
- the image to refresh.options
- refresh options.public boolean hasPopupFormAttached()
public boolean willShowFrame(PenEvent ev)
protected boolean showHoldDownIndicator(int x, int y)
x
- the x position on the Control.y
- the y position on the Control.public Point getPosInParent(Container parent)
parent
- public void makeFrameTopMost()
public final void transferPenPress(Control toChild)
toChild
- The child control to pass the pen press to.public final void transferPenPress(Control toWho, int dx, int dy)
toWho
- The Control to send it to.dx
- The change in the x co-ordinate for the event.dy
- The change in the y co-ordinate for the event.public void cancelPenPress()
public void onLabelPenEvent(PenEvent ev)
ev
- public static void setFreeDragging()
This is used for things like menu/menu bars.
protected void updateDCDuringDD(boolean stopDrag, PenEvent ev)
public void onPenEvent(PenEvent ev)
public void baseOnPenEvent(PenEvent ev)
ev
- The incoming PenEvent.protected void menuStateChanged(boolean menuOpened)
public void onControlEvent(ControlEvent ev)
public MenuItem getLastSelected()
public void notifyMenuItemSelected(MenuItem mi)
mi
- the MenuItem to set as the last selected.protected boolean isOnMe(int x, int y)
protected boolean isOnMe(Point p)
p
- The point to check.protected boolean isOnMe(Point p, boolean orOnMyPrompt)
public void penPressed(Point p)
Within this method you can use the Control.Gui.currentPenPress() 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.
p
- The point on the Control where the pen was pressed.public void penHeld(Point p)
Within this method you can use the Control.Gui.currentPenPress() 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);
p
- The point on the Control where the pen was held.public void penRightReleased(Point p)
Within this method you can use the Control.Gui.currentPenPress() 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()) if (doMenu(p)) return; penReleased(p);
p
- The point on the Control where the pen was released.public void mouseHover(Point p, int modifiers, boolean isHover)
public void penReleased(Point p)
Within this method you can use the Control.Gui.currentPenPress() 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.
p
- The point on the Control where the pen was released.public void penClicked(Point p)
Within this method you can use the Control.Gui.currentPenPress() 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.
p
- The point on the Control where the pen was clicked.public void penDoubleClicked(Point p)
Within this method you can use the Control.Gui.currentPenPress() 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.
p
- The point on the Control where the pen was double-clicked.public final Control setBorder(int style, int width)
style
- The border style. One or more of the BDR_XXX or EDGE_XXX constants ORed together.width
- The distance between the edge of the Control and the data within it.public final Control setShadow(int top, int left, int bottom, int right, int options)
protected Insets getContentsInsets()
public final Control setHotKey(int modifiers, char key)
modifiers
- One or more of the IKeys.SHIFT, IKeys.CONTROL and IKeys.ONLY ORed together.key
- The character for the hot-key.public final Control setHotKey(int modifiers, int key)
modifiers
- One or more of the IKeys.SHIFT, IKeys.CONTROL and IKeys.ONLY ORed together.key
- The KeyEvent key code for the hot-key.protected boolean doHotKey(Control from, KeyEvent ev)
from
- The Control (parent or sibling) that is passing the event to this Control.ev
- The KeyEvent representing the key press.public boolean tryNext(boolean forwards)
public final String makeHot(String label)
label
- The label to be displayed.public final CharArray makeHot(String label, CharArray dest)
label
- The label to be displayed.dest
- an optional destination CharArray.public void doActionKey(int key)
key
- public Control getNextKeyFocus(Control sourceChild, boolean forwards)
sourceChild
- the child control from which the call came from, or null if the call
came from the parent of this control, or this control itself.forwards
- true if the user wants to go to the next control, false if the user wants
to go to the previous one.public final boolean exitEntry(int exitKey, int modifiers)
protected final boolean checkExitKey(KeyEvent ev)
protected boolean isSomeonesHotKey(KeyEvent ev)
public boolean checkMenuKey(KeyEvent ev, Point where)
public void standardOnKeyEvent(KeyEvent ev)
public void onKeyEvent(KeyEvent ev)
public static void cancelHoldDown()
public boolean dataDroppedOn(Object data, Point p, DragContext dc)
public void dataDraggedOff(Object data)
data
- the data being dragged.public static DragContext getDragAndDropContext()
public void dataDraggedOver(Object data, Point p, PenEvent ev)
By default this method calls dataDraggedOver(Object data) - which itself by default calls acceptsData() to determine whether to call willAcceptDrop() or dontAcceptDrop().
data
- The data being dragged.p
- The current location of the pen/mouse.ev
- The PenEvent that prompted this call.public void dataDraggedOver(Object data)
By default this method calls acceptsData() to determine whether to call willAcceptDrop() or dontAcceptDrop().
data
- The data being dragged.public boolean acceptsData(Object data, DragContext how)
data
- The data to be transferred.how
- if the transfer is via DragAndDrop this will be a DragContext object,
otherwise it will be null to indicate a clipboard operation.public boolean takeData(Object data, DragContext how)
data
- The data to accept.how
- if the transfer is via DragAndDrop this will be a DragContext object,
otherwise it will be null to indicate a clipboard operation.protected void dontAcceptDrop()
protected void willAcceptDrop()
protected boolean getDataToDragAndDrop(DragContext dc)
To setup the DragContext you should set the dataToDrag, isMultiple and isCopy and (optionally) the dragCursor value.
dc
- the DragContext to setup for the drag and drop operation.protected boolean tryDragAndDrop(DragContext dc)
dc
- the DragContext to setup for the drag and drop operation.public void startDragging(DragContext dc)
dc
- A DragContext indicating information about the dragging.public void stopDragging(DragContext dc)
dc
- The DragContext for the dragging operation.public void dragged(DragContext dc)
dc
- The DragContext for the dragging operation.protected void dataAccepted(Control byWho, Object data, String action)
byWho
- The Control that accepted the data.data
- The data being transferred.action
- This is either "copy" or "move" indicating if the data
is meant to be copied to the other control or moved to the other Control.protected void dataTransferCancelled(Object data)
data
- The data that was being transferred. If it is null it indicates
that this Control was a destination for a Drag and Drop operation, but the
operation was cancelled by the user.protected void dataBeingRemoved(Object data, DragContext dc)
protected boolean startDragAndDrop(Object data, int dragCursor, boolean isCopy)
data
- The data to drag.dragCursor
- The cursor code for the special cursor to use. This should
be one of the ewe.sys.Vm.XXX_CURSOR constants OR a value returned by ewe.sys.Vm.createCursor().isCopy
- true if the operation is to be considered a copy operation. false if it is to be
considered a move operation.protected boolean startDragAndDrop(Object data, boolean isMultiple, boolean isCopy)
data
- The data to drag.isMultiple
- should be true if the data should be considered as multiple data. This
will affect the cursor that is used.isCopy
- true if the operation is to be considered a copy operation. false if it is to be
considered a move operation. This will affect the cursor that is used.public boolean checkMenu(Menu m)
public boolean checkClipboardOperations(Menu m)
m
- The Menu which contains the clipboard operations.public Menu getClipboardMenu(Menu addTo)
addTo
- The menu under construction or null for a new menu.public void toClipboard(boolean cut)
public void fromClipboard()
public boolean menuIsActive()
public void closeMenu()
public void setMenu(Menu menu)
You can set a Menu for most Controls including Buttons.
menu
- The Menu to set for the Control. This can be null.public Menu getMenu()
public boolean tryStartMenu(Point pen)
By default it will call doShowMenu(pen) if the menu is not already active.
pen
- The point where the pen/mouse was pressed - or null if you are requesting the control to show
its menu at no particular point.public boolean doMenu(Point p)
p
- The point where the pen was pressed or held.protected boolean doShowMenu(Point pen)
pen
- The point where the pen was pressed.protected Menu createNewMenu(Point pen)
pen
- the point where the pen was pressed, or null if no pen press is associated with the menu being displayed.public void addListener(EventListener list)
list
- the EventListener to add.public void removeListener(EventListener list)
list
- the EventListener to add.public void sendToListeners(Event ev)
ev
- the Event to send.public void notifyAction()
public void fromField(FieldTransfer ft)
ft
- the FieldTransfer Object to use.public void toField(FieldTransfer ft)
ft
- the FieldTransfer Object to use.public final void fromField()
public final void toField()
public final void notifyDataChange()
public final void notifyStructureChanged()
public void notifyDataChange(DataChangeEvent dce)
public void doAction(int how)
how
- one of the ByXXX values.public void shown()
protected void formClosing()
protected boolean checkPenTransparent(PenEvent ev)
public void popupMenuEvent(MenuEvent ev)
ev
- The event.protected void popupMenuClosed(Menu m)
public static void setClipObject(Object obj)
public static Object getClipObject()
protected Object getDataToCopy()
protected void takeFromClipboard(Object clip, String action)
public static final Object toTextData(Object data)
public void popupMenuEvent(Object selectedItem)
selectedItem
- The item selected.public boolean postInWindowThread(Event ev)
ev
- the Event to post.public boolean deferInWindowThread(Event ev, EventListener listener)
A new Event is created, the target is set to The method returns immediately even if the current Thread is the Window Event Thread.
ev
- the Event to re-post.listener
- the EventListener to receive the Event.public void onEvent(Event ev)
public boolean tipIsDisplayed()
public void postUIEvent(Event ev)
ev
- the event to be sent to this Control.public void postEvent(Event ev)
ev
- the Event to post.public void setServer(ScrollServer server)
public ScrollServer getServer()
public void scrollAndRepaint(int sx, int sy, int sw, int sh, int destX, int destY)
If data can be moved directly on screen, then this will be done and only the newly exposed portion will be updated via a repaintNow() operation. If no moving is possible at all - or if the SIP may be covering the control then no scrolling will be done.
sx
- The source x co-ordinate.sy
- The source y co-ordinate.sw
- The source width.sh
- The source height.destX
- The destination x co-ordinate.destY
- The destination y co-ordinate.public static void popupBeep()
public void setCursor(int cursor)
public void draw(Graphics g, int x, int y, int options)
public void setFieldTransfer(FieldTransfer ft)
setFieldTransfer
in interface DataInterface
public FieldTransfer getFieldTransfer()
getFieldTransfer
in interface DataInterface
public void updateFrom(FieldTransfer ft)
updateFrom
in interface DataInterface
public void updateTo(FieldTransfer ft)
updateTo
in interface DataInterface
public void queuePenEvent(int type, int modifiers)
public void simulateClickOn(int modifiers)
public void queueKeyEvent(int type, int key, int modifiers)
public void simulateKeyType(int key, int modifiers)
public void simulateKeyPresses(String text)
public void draw(Graphics g, int x, int y, int width, int height, int options)
public final boolean checkParentInterceptsUIEvent(Event ev, Control destination)
ev
- the event to be sent to the child control.destination
- the child control.public boolean interceptChildUIEvent(Event event, Control destination)
If you override this method you may wish to call checkParentInterceptsUIEvent() first or second. That method will check if any parents also wish to intercept the event and calls the intereceptChildUIEvent() method if it does. If that method returns true then this method should return immediately true.
event
- the event that will be sent to the destination.destination
- the destination Control.public void draw(Graphics g, int x, int y, Rect visibleDestinationArea, int options)
Drawable
draw
in interface Drawable
g
- the Graphics to draw to.x
- the x-location on the graphics to draw to.y
- the y-location on the graphics to draw to.visibleDestinationArea
- the area that will be updated on the Graphics. If this is null
then assume that all of the Drawable must be drawn.options
- any of the Drawable options OR'ed together.public void setSwiping(boolean horizontal, boolean vertical, boolean allowSimultaneous)
horizontal
- true to allow horizontal swiping.vertical
- true to allow vertical swiping.allowSimultaneous
- true to allow swiping in both directions simultaneously.IllegalStateException
- if this Control does not implement eve.ui.Swiper.SwipableSwipable
public boolean verifyWantDrag()
public boolean verifyWantHoldDown()
public PaintParameters getPaintParameters(int customFlags)
protected boolean paintWithControlPainter(Graphics g, Rect area, int customFlags)
protected void removed()
public Object findTagInParents(int tag)
tag
- the tag to find.public void makeVisible()
public Closes makeInvisible(boolean repaintOnVisible)