public class Control extends GfxSurface
Modifier and Type | Class and Description |
---|---|
static class |
Control.TranslucentShape
Used when this Control is translucent
|
Modifier and Type | Field and Description |
---|---|
static int |
AFTER
Constant used in param x/y in setRect.
|
int |
alphaValue
Alpha to be used in some controls, ranging from 0 to 255.
|
int |
appId
Application defined constant.
|
java.lang.Object |
appObj
Application defined object.
|
protected Container |
asContainer
READ-ONLY property which is not null if this control is a container
|
protected Window |
asWindow
READ-ONLY property which is not null if this control is a window
|
protected int |
backColor
Background color of this control.
|
static int |
BEFORE
Constant used in param x/y in setRect.
|
static int |
BOTTOM
Constant used in param y in setRect.
|
static int |
BOTTOM_OF
Constant used in param x/y in setRect.
|
static int |
BRIGHTER_BACKGROUND
To be used in the setTextShadowColor method.
|
boolean |
callListenersOnAllTargets
True means that EventListeners for PenEvent and KeyEvent will be called without verifying that the event target is this.
|
static int |
CENTER
Constant used in params x and y in setRect.
|
static int |
CENTER_OF
Constant used in param x/y in setRect.
|
int |
clearValueInt
Default value when calling clear.
|
java.lang.String |
clearValueStr
Default value when calling clear.
|
static int |
DARKER_BACKGROUND
To be used in the setTextShadowColor method.
|
static int |
DP |
UIEffects |
effect
The current effect used in this control
|
static boolean |
enableUpdateScreen
Set to false to disallow the screen update.
|
protected EnabledStateChangeEvent |
esce |
boolean |
eventsEnabled |
static int |
FILL
Constant used in params width and height in setRect.
|
int |
fillColor
Color to fill the background in Material UI when its enabled.
|
static int |
FIT
Constant used in params width and height in setRect.
|
protected boolean |
floating
Sets to true to make it control float on a ScrollContainer.
|
FontMetrics |
fm
The fontMetrics corresponding to the controls font.
|
protected int |
fmH
Stores the height of the current font.
|
protected boolean |
focusHandler
Stores the control that should handle the focus change key for this control
|
protected boolean |
focusLess
If true, this control will receive pen and key events but will never gain focus.
|
boolean |
focusOnPenDown
True means this control expects to get focus on a PEN_DOWN event.
|
boolean |
focusTraversable
Defines if this control can receive focus by using the arrow keys.
|
protected Font |
font
The font used by the control.
|
static int |
FONTSIZE
Constant used in param width (will use parent's width) and height (will use the current font size/height) in setRect.
|
protected int |
foreColor
Foreground color of this control.
|
protected int |
height
The control's height
|
boolean |
ignoreInsets
Set to true to ignore parent's insets when placing this control on screen.
|
protected static boolean |
isHighlighting
If true, the keyboard arrows will be used to highlight the controls until one is selected.
|
static boolean |
isTablet
Specifies if this device is a tablet, computing the number of text lines.
|
static int |
KEEP
Constant used in params x/y/width/height in setRect.
|
boolean |
keepDisabled
Keep the control disabled even if enabled is true.
|
boolean |
keepEnabled
Keep the control enabled even if enabled is false.
|
static int |
LEFT
Constant used in param x in setRect.
|
protected Control |
next
The control's next sibling.
|
Control |
nextTabControl
The next control that will receive focus when tab is hit.
|
protected NinePatch.Parts |
npParts
The NinePatch parts used to paint the background image
|
Image |
offscreen
The offscreen image taken with takeScreenShot.
|
Image |
offscreen0
The offscreen image taken with takeScreenShot.
|
boolean |
onEventFirst
Set to true to call onEvent before calling the event listeners.
|
protected Container |
parent
The parent of the control.
|
static int |
PARENTSIZE
Constant used in param width (will use parent's width) and height (will use parent's height) in setRect.
|
static int |
PARENTSIZEMAX
Constant used in param width or height (will use parent's maximum size between width and height) in setRect.
|
static int |
PARENTSIZEMIN
Constant used in param width or height (will use parent's minimum size between width and height) in setRect.
|
static int |
PREFERRED
Constant used in params width and height in setRect.
|
protected Control |
prev
The control's previous sibling.
|
static int |
RANGE |
protected boolean |
repositionAllowed |
static int |
RIGHT
Constant used in param x in setRect.
|
static int |
RIGHT_OF
Constant used in param x/y in setRect.
|
static int |
SAME
Constant used in params x/y/width/height in setRect.
|
static int |
SCREENSIZE
Constant used in param width (will use screen's width) and height (will use screen's height) in setRect.
|
static int |
SCREENSIZEMAX
Constant used in param width or height (will use screen's maximum size between width and height) in setRect.
|
static int |
SCREENSIZEMIN
Constant used in param width or height (will use screen's minimum size between width and height) in setRect.
|
protected Font |
setFont |
protected int |
setH |
protected Control |
setRel |
protected int |
setW |
protected int |
setX |
protected static int |
SETX_NOT_SET |
protected int |
setY |
protected int |
tempW |
int |
textShadowColor
The shadow color to be applied to this control.
|
static int |
TOP
Constant used in param y in setRect.
|
protected Control.TranslucentShape |
translucentShape |
boolean |
transparentBackground
Set the background to be transparent, by not filling the control's area with the background color.
|
boolean |
uiAdjustmentsBasedOnFontHeightIsSupported
Allows to disable the ui adjustments based on font height for a single control.
|
protected static boolean |
uiAndroid
Shortcuts to test the UI style.
|
static int |
UICONST |
protected static boolean |
uiFlat
Shortcuts to test the UI style.
|
protected static boolean |
uiHolo
Shortcuts to test the UI style.
|
protected static boolean |
uiMaterial
Shortcuts to test the UI style.
|
protected static boolean |
uiVista
Shortcuts to test the UI style.
|
protected boolean |
visible
True if the control is visible, false otherwise
|
protected int |
width
The control's width
|
static int |
WILL_RESIZE
Constant used in params width/height in setRect.
|
protected int |
x
The control's x location
|
protected int |
y
The control's y location
|
Modifier | Constructor and Description |
---|---|
protected |
Control()
creates the font for this control as the same font of the MainWindow.
|
Modifier and Type | Method and Description |
---|---|
<H extends EventHandler> |
_onEvent(Event<H> e)
Calls the event listeners and the onEvent method for this control.
|
void |
addEnabledStateListener(EnabledStateChangeListener listener)
Adds a listener for enabled state changes.
|
void |
addFocusListener(FocusListener listener)
Adds a listener for Focus events.
|
void |
addFontChangeHandler(FontChangeHandler listener) |
void |
addGridListener(GridListener listener)
Adds a listener for Grid events.
|
protected <H extends EventHandler> |
addHandler(int type,
H handler) |
void |
addHighlightListener(HighlightListener listener)
Adds a listener for Highlight events.
|
void |
addKeyListener(KeyListener listener)
Adds a listener for Key events.
|
void |
addListContainerListener(ListContainerListener listener)
Adds a listener for ListContainer events.
|
void |
addMouseListener(MouseListener listener)
Adds a listener for mouse events.
|
void |
addMultiTouchListener(MultiTouchListener listener)
Adds a listener for MultiTouch events.
|
void |
addPenListener(PenListener listener)
Adds a listener for Pen events.
|
void |
addPressListener(PressListener listener)
Adds a listener for Press events.
|
void |
addPushNotificationListener(PushNotificationListener listener)
Adds a listener for PushNotification events.
|
void |
addSizeChangeHandler(SizeChangeHandler listener) |
TimerEvent |
addTimer(int millis)
Adds a timer to a control.
|
void |
addTimer(TimerEvent t,
int millis)
Add a timer to a control.
|
void |
addTimerListener(TimerListener listener)
Adds a listener for Timer events.
|
<T> void |
addValueChangeHandler(ValueChangeHandler<T> listener) |
void |
addWindowListener(WindowListener listener)
Adds a listener for Window events.
|
void |
bringToFront()
Send this control to the top of the parent's.
|
void |
changeHighlighted(Container p,
boolean forward)
Transfers the focus to the next or previous control.
|
void |
clear()
Placeholder for the clear method.
|
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.
|
boolean |
drawTranslucentBackground(Graphics g,
int alphaValue) |
Rect |
getAbsoluteRect()
Returns the absolute coordinates of this control relative to the MainWindow.
|
int |
getBackColor()
Get the desired background color of this control.
|
boolean |
getDoEffect()
Returns true if this Cotrol should do it's effect.
|
int |
getEffectH() |
int |
getEffectW() |
int |
getEffectX() |
int |
getEffectY() |
java.util.List<Listener> |
getEventListeners()
Returns the event listeners array.
|
Font |
getFont()
Gets the font of this control.
|
int |
getForeColor()
Get the desired foreground color of this control.
|
int |
getGap(int gap) |
Graphics |
getGraphics()
Returns a Graphics object which can be used to draw in the control.
|
int |
getHeight()
Returns the control's height.
|
Control |
getNext()
Returns the next child in the parent's list of controls.
|
Container |
getParent()
Returns the control's parent container.
|
Window |
getParentWindow()
Returns the control's parent Window or null if there's no parent
(eg: the control still not added to any container).
|
Coord |
getPos()
Returns the current position (x,y) of this control
|
int |
getPreferredHeight()
Returns the preferred height of this control.
|
int |
getPreferredWidth()
Returns the preferred width of this control.
|
protected ControlEvent |
getPressedEvent(Control target)
Creates a ControlEvent.PRESSED if not yet created and returns it.
|
Control |
getPrev()
Returns the previous child in the parent's list of controls.
|
Rect |
getRect()
Returns a copy of the control's rectangle, relative to its parent.
|
Coord |
getSize()
Returns the current size (width,height) of this control
|
int |
getTextShadowColor()
Returns the textShadowColor of this control.
|
int |
getWidth()
Returns the control's width.
|
int |
getX()
Returns the control's x position.
|
int |
getX2()
Returns x+width-1
|
int |
getY()
Returns the control's y position.
|
int |
getY2()
Returns y+height-1
|
boolean |
hadParentScrolled()
Returns true if the parent of this control is a Scrollable and had scrolled since the last
pen down.
|
Control |
handleGeographicalFocusChangeKeys(KeyEvent ke)
Used by the main event loop to give the currently focused control an opportunity to act directly on
the KeyEvent.
|
boolean |
hasFocus()
Returns true if this control has focus
|
boolean |
internalSetEnabled(boolean enabled,
boolean post)
For internal use only.
|
void |
intXYWH(int x,
int y,
int w,
int h) |
protected <H extends EventHandler> |
isActionEvent(Event<H> event)
Returns if this event should be handled as an action.
|
boolean |
isChildOf(Container p)
Returns true if this control is added to the given container at some higher level.
|
boolean |
isDisplayed()
Return true if the parent of this Control is added to somewhere.
|
boolean |
isEnabled()
Returns if this control can or not accept events
|
boolean |
isFloating()
Sets to true to make it control float on a ScrollContainer.
|
boolean |
isInsideOrNear(int x,
int y)
Returns true if the point lies inside this control.
|
boolean |
isObscured(Window parentWindow)
Returns true if this control is obscured by the topmost window.
|
boolean |
isTopMost()
Returns true of the parent window is the top most one.
|
boolean |
isVisible()
Returns true if this control is visible, false otherwise
|
boolean |
isVisibleAndInside(int x0,
int y0,
int xf,
int yf)
Returns true of this control is visible and inside these bounds
|
protected void |
onBoundsChanged(boolean screenChanged)
Called after a setRect.
|
protected void |
onColorsChanged(boolean colorsChanged)
Called after a setEnabled, setForeColor and setBackColor and when a control has
been added to a Container.
|
<H extends EventHandler> |
onEvent(Event<H> event)
Called to process key, pen, control and other posted events.
|
protected void |
onFontChanged()
Called after a setFont
|
void |
onPaint(Graphics g)
Called to draw the control.
|
protected void |
onWindowPaintFinished()
Called after the window has finished a paint.
|
void |
post()
Posts the enable state change event.
|
<H extends EventHandler> |
postEvent(Event<H> event)
Posts an event.
|
void |
postPressedEvent()
Posts a ControlEvent.PRESSED event with this control as target.
|
void |
releaseScreenShot()
Releases the screen shot.
|
void |
removeEnabledStateListener(EnabledStateChangeListener listener)
Removes a listener for enabled state changes.
|
void |
removeFocusListener(FocusListener listener)
Removes a listener for Focus events.
|
void |
removeGridListener(GridListener listener)
Removes a listener for Grid events.
|
protected <H extends EventHandler> |
removeHandler(int type,
H handler)
Removes the given listener from the list of listeners of this control.
|
void |
removeHighlightListener(HighlightListener listener)
Removes a listener for Highlight events.
|
void |
removeKeyListener(KeyListener listener)
Removes a listener for Key events.
|
void |
removeListContainerListener(ListContainerListener listener)
Removes a listener for ListContainer events.
|
void |
removeMouseListener(MouseListener listener)
Removes a listener for mouse events.
|
void |
removeMultiTouchListener(MultiTouchListener listener)
Removes a listener for MultiTouch events.
|
void |
removePenListener(PenListener listener)
Removes a listener for Pen events.
|
void |
removePressListener(PressListener listener)
Removes a listener for Press events.
|
void |
removePushNotificationListener(PushNotificationListener listener)
Removes a listener for PushNotification events.
|
boolean |
removeTimer(TimerEvent timer)
Removes a timer from a control.
|
void |
removeTimerListener(TimerListener listener)
Removes a listener for Timer events.
|
void |
removeWindowListener(WindowListener listener)
Removes a listener for Window events.
|
static void |
repaint()
Marks all controls in the screen for repaint.
|
void |
repaintNow()
Redraws the control immediately.
|
void |
reposition()
Reposition this control, calling again setRect with the original parameters.
|
protected void |
reposition(boolean recursive)
Repositions this control, and dives into other controls if this is a container and recursive is true.
|
protected void |
repositionChildren()
Repositions the children controls.
|
void |
requestFocus()
Sets the focus to this control.
|
void |
resetSetPositions()
Resets the original points that are set by the first setRect, so if you call setRect again, the
old positions are replaced by the new ones.
|
static void |
resetStyle()
Internal use Only.
|
protected void |
safeRepaintNow()
Called by code that runs on threads to safely repaint now.
|
static void |
safeUpdateScreen()
This method causes the screen's update.
|
void |
sendToBack()
Send this control to the last place of the parent's.
|
void |
setBackColor(int c)
Set the background color of this control.
|
void |
setBackForeColors(int back,
int fore)
Set the background and foreground colors at once.
|
void |
setDoEffect(boolean doEffect)
Set to false to make this control not to do it's effect.
|
void |
setEnabled(boolean enabled)
Sets if this control can or not accept events.
|
void |
setFloating(boolean floating)
Sets to true to make it control float on a ScrollContainer.
|
void |
setFocusLess(boolean on)
Sets this control to be focusless.
|
void |
setFont(Font font)
Sets the font of this control.
|
void |
setForeColor(int c)
Set the foreground color of this control.
|
void |
setNinePatch(Image img)
Set the NinePatch of the control.
|
void |
setNinePatch(Image img,
int corner,
int side)
Set the NinePatch of the control.
|
void |
setRect(int x,
int y,
int width,
int height)
Sets or changes a control's position and size.
|
void |
setRect(int x,
int y,
int width,
int height,
Control relative)
Sets or changes a control's position and size.
|
void |
setRect(int x,
int y,
int width,
int height,
Control relative,
boolean screenChanged)
The relative positioning will be made with the given control (relative).
|
void |
setRect(Rect r)
Sets or changes a control's position and size.
|
void |
setSet(int x,
int y)
Used internally.
|
void |
setTextShadowColor(int color)
Call to set the color value to place a shadow around the control's text.
|
void |
setTranslucent(Control.TranslucentShape shape)
Make this control a translucent one by setting the desired shape instead of NONE.
|
void |
setVisible(boolean visible)
Shows or "hides" this control.
|
void |
showTip(java.lang.String s,
int duration,
int y)
Shows a message using a global tip shared by all controls.
|
void |
takeInitialScreenShot()
Take a screen shot of this container and stores it in
offscreen0 . |
void |
takeScreenShot()
Take a screen shot of this container and stores it in
offscreen . |
void |
translateFromOrigin(Coord z)
Sets the given Point to the absolute coordinate relative to the origin Window.
|
static void |
uiStyleChanged()
Internal use only
|
static void |
updateScreen()
This method causes the immediate screen update.
|
protected void |
updateTemporary() |
protected boolean |
willOpenKeyboard()
Returns true if this is a MultiEdit or an Edit that has a standard keyboard.
|
protected int x
protected int y
protected int width
protected int height
protected Container parent
protected Control next
protected Control prev
protected Font font
public FontMetrics fm
protected boolean visible
protected int foreColor
protected int backColor
public int appId
public java.lang.Object appObj
public java.lang.String clearValueStr
public int clearValueInt
public Control nextTabControl
public static final int RANGE
public static final int UICONST
public static final int PREFERRED
public static final int LEFT
public static final int CENTER
public static final int RIGHT
public static final int TOP
public static final int BOTTOM
public static final int FILL
public static final int BEFORE
public static final int SAME
public static final int AFTER
public static final int FIT
public static final int CENTER_OF
public static final int RIGHT_OF
public static final int BOTTOM_OF
public static final int SCREENSIZE
public static final int KEEP
public static final int PARENTSIZE
public static final int SCREENSIZEMIN
public static final int SCREENSIZEMAX
public static final int PARENTSIZEMIN
public static final int PARENTSIZEMAX
public static final int FONTSIZE
public static final int DP
public static final int WILL_RESIZE
Container c; add(c = new Container(), LEFT+5, AFTER+5, FILL-5, WILL_RESIZE); // add controls to c c.resizeHeight();
public boolean ignoreInsets
public boolean uiAdjustmentsBasedOnFontHeightIsSupported
public static boolean enableUpdateScreen
protected int fmH
fm.height
.protected boolean focusHandler
protected static boolean isHighlighting
public boolean focusTraversable
protected static boolean uiFlat
protected static boolean uiVista
protected static boolean uiAndroid
protected static boolean uiHolo
protected static boolean uiMaterial
protected boolean focusLess
protected EnabledStateChangeEvent esce
public boolean eventsEnabled
public int fillColor
public static boolean isTablet
protected static final int SETX_NOT_SET
protected int setX
protected int setY
protected int setW
protected int setH
protected Font setFont
protected Control setRel
protected boolean repositionAllowed
protected int tempW
protected Control.TranslucentShape translucentShape
public int textShadowColor
public boolean onEventFirst
protected Container asContainer
protected Window asWindow
public static final int BRIGHTER_BACKGROUND
public static final int DARKER_BACKGROUND
public int alphaValue
public boolean transparentBackground
public boolean focusOnPenDown
public boolean callListenersOnAllTargets
public Image offscreen
public Image offscreen0
public boolean keepDisabled
public boolean keepEnabled
protected boolean floating
public UIEffects effect
protected NinePatch.Parts npParts
protected Control()
public void setNinePatch(Image img, int corner, int side)
img
- The image to make the NinePatch.
The image must be on a NinePatch format.side
- The size, in pixels, of the NinePatch's side.corner
- The size, in pixels, of the NinePatch's cornerpublic void setNinePatch(Image img)
img
- The image with guides to make the NinePatch.
The image must be on a NinePatch format.public void takeInitialScreenShot()
offscreen0
.public void takeScreenShot()
offscreen
.public void releaseScreenShot()
public void setTextShadowColor(int color)
c = new Label(....); c.setBackColor(Color.BLUE); c.setTextShadowColor(DARKER_BACKGROUND); // you may also set it directly to a color: c.setTextShadowColor(Color.BLACK);
BRIGHTER_BACKGROUND
,
DARKER_BACKGROUND
,
UIColors.textShadowColor
public int getTextShadowColor()
public boolean isInsideOrNear(int x, int y)
Settings.touchTolerance
,
Settings.fingerTouch
public void showTip(java.lang.String s, int duration, int y)
public void postPressedEvent()
protected ControlEvent getPressedEvent(Control target)
public TimerEvent addTimer(int millis)
If the control that holds the timer is removed from screen, the timer is also disabled. Consider using the dispatch-listener event model (addTimerListener) instead of creating a control just to catch the event (if this is the case).
millis
- the timer tick interval in millisecondsTimerEvent
public void addTimer(TimerEvent t, int millis)
t
- the TimerEvent instancemillis
- the timer tick interval in millisecondsTimerEvent
public boolean removeTimer(TimerEvent timer)
public final void setFont(Font font)
public Font getFont()
public int getPreferredWidth()
public int getPreferredHeight()
public void setRect(Rect r)
setRect(r.x,r.y,r.width,r.height,null,false)
public void setRect(int x, int y, int width, int height)
setRect(x,y,width,height,null,false)
public void setRect(int x, int y, int width, int height, Control relative)
setRect(x,y,width,height,relative,false)
public void setRect(int x, int y, int width, int height, Control relative, boolean screenChanged)
Important note: you can't use FILL/FIT with BEFORE/RIGHT/BOTTOM (for x,y).
add(new Label("1"),CENTER,CENTER); add(new Label("2"),AFTER,SAME); add(new Label("3"),SAME,AFTER); add(new Label("4"),BEFORE,SAME); add(new Label("5"),BEFORE,BEFORE);You will see this on screen:
512 43Note: add(control, x,y) does:
add(control); control.setRect(x,y,PREFERRED,PREFERRED);
Important! Always add the control to the container before doing a setRect.
The relative positioning does not work well if the control is placed outside screen bounds.
x
- One of the relative positioning constants: LEFT, RIGHT, SAME, BEFORE, AFTER, CENTER, with a small adjustment. You can also use an absolute value, but this is strongly discouraged.y
- One of the relative positioning constants: TOP, BOTTOM, SAME, BEFORE, AFTER, CENTER, with a small adjustment. You can also use an absolute value, but this is strongly discouraged.width
- One of the relative positioning constants: PREFERRED, FILL, FIT, SAME. You can also use an absolute value, but this is strongly discouraged.height
- One of the relative positioning constants: PREFERRED, FILL, FIT, SAME. You can also use an absolute value, but this is strongly discouraged.relative
- To whom the position should be relative to; or null to be relative to the last control.screenChanged
- Indicates that a screen change (resize, collapse) occured and the reposition
method is calling this method. Set by the system. If you call this method directly, always pass false to it.LEFT
,
TOP
,
RIGHT
,
BOTTOM
,
BEFORE
,
AFTER
,
CENTER
,
SAME
,
FILL
,
PREFERRED
,
FIT
,
CENTER_OF
,
RIGHT_OF
,
BOTTOM_OF
,
SCREENSIZE
,
SCREENSIZEMIN
,
SCREENSIZEMAX
,
PARENTSIZE
,
PARENTSIZEMIN
,
PARENTSIZEMAX
,
FONTSIZE
,
Container.add(Control, int, int)
,
Container.add(Control, int, int, Control)
public void resetSetPositions()
public void setSet(int x, int y)
protected void updateTemporary()
public Coord getSize()
public Coord getPos()
public void setVisible(boolean visible)
public boolean isVisible()
public Rect getRect()
public Rect getAbsoluteRect()
public Window getParentWindow()
public Container getParent()
public Control getNext()
public Control getPrev()
public boolean contains(int x, int y)
public static void repaint()
Window.needsPaint = true;
repaintNow()
public void repaintNow()
repaint()
public void translateFromOrigin(Coord z)
public Graphics getGraphics()
public <H extends EventHandler> void postEvent(Event<H> event)
Event
public void setEnabled(boolean enabled)
public boolean internalSetEnabled(boolean enabled, boolean post)
public void post()
public boolean isEnabled()
public <H extends EventHandler> void onEvent(Event<H> event)
public void onPaint(Graphics g)
g
- the graphics object for drawingGraphics
protected void onBoundsChanged(boolean screenChanged)
screenChanged
- If the bounds were changed due to a screen change (rotation, collapse)protected void onColorsChanged(boolean colorsChanged)
protected void onWindowPaintFinished()
protected void onFontChanged()
public void setBackForeColors(int back, int fore)
public void setForeColor(int c)
public void setBackColor(int c)
public int getForeColor()
public int getBackColor()
public boolean isDisplayed()
public void requestFocus()
isHighlighting = false
.public void setFocusLess(boolean on)
// class fields private PushButtonGroup numericPad; private KeyEvent ke = new KeyEvent(); // in the initUI method: String []numerics = {"1","2","3","4","5","6","7","8","9","0",".","-"}; add(numericPad=new PushButtonGroup(numerics, false, -1, -1, 6, 4, true, PushButtonGroup.BUTTON), RIGHT-2, TOP+2); numericPad.setFocusLess(true); // in the onEvent method Control focus; if (e.target == numericPad && (focus=getParentWindow().getFocus()) instanceof Edit) { String s = numericPad.getSelectedCaption(); if (s != null) { ke.key = s.charAt(0); ke.target = focus; focus.onEvent(ke); } }
public static void resetStyle()
public static void uiStyleChanged()
public void changeHighlighted(Container p, boolean forward)
public void clear()
public static void updateScreen()
safeUpdateScreen()
,
Container#nextTransitionEffect
public static void safeUpdateScreen()
updateScreen()
public int getWidth()
getWidth
in class GfxSurface
public int getHeight()
getHeight
in class GfxSurface
public int getX()
getX
in class GfxSurface
public int getY()
getY
in class GfxSurface
public int getX2()
public int getY2()
protected void reposition(boolean recursive)
protected void repositionChildren()
public void reposition()
public <H extends EventHandler> void _onEvent(Event<H> e)
protected <H extends EventHandler> void addHandler(int type, H handler)
protected <H extends EventHandler> boolean removeHandler(int type, H handler)
public void addPenListener(PenListener listener)
PenListener
public void addMultiTouchListener(MultiTouchListener listener)
MultiTouchListener
public void addMouseListener(MouseListener listener)
MouseListener
public void addWindowListener(WindowListener listener)
WindowListener
public void addGridListener(GridListener listener)
GridListener
public void addListContainerListener(ListContainerListener listener)
ListContainerListener
public void addFocusListener(FocusListener listener)
FocusListener
public void addFontChangeHandler(FontChangeHandler listener)
public void addSizeChangeHandler(SizeChangeHandler listener)
public void addPressListener(PressListener listener)
PressListener
public void addPushNotificationListener(PushNotificationListener listener)
PushNotificationEvent
public void addTimerListener(TimerListener listener)
TimerListener
public void addKeyListener(KeyListener listener)
KeyListener
public void addHighlightListener(HighlightListener listener)
HighlightListener
public void addEnabledStateListener(EnabledStateChangeListener listener)
public <T> void addValueChangeHandler(ValueChangeHandler<T> listener)
public void removeEnabledStateListener(EnabledStateChangeListener listener)
public void removeMultiTouchListener(MultiTouchListener listener)
MultiTouchListener
public void removePenListener(PenListener listener)
PenListener
public void removePushNotificationListener(PushNotificationListener listener)
PushNotificationEvent
public void removeMouseListener(MouseListener listener)
MouseListener
public void removeWindowListener(WindowListener listener)
WindowListener
public void removeGridListener(GridListener listener)
GridListener
public void removeListContainerListener(ListContainerListener listener)
ListContainerListener
public void removeFocusListener(FocusListener listener)
FocusListener
public void removePressListener(PressListener listener)
PressListener
public void removeTimerListener(TimerListener listener)
TimerListener
public void removeKeyListener(KeyListener listener)
KeyListener
public void removeHighlightListener(HighlightListener listener)
HighlightListener
public Control handleGeographicalFocusChangeKeys(KeyEvent ke)
ke
- The KeyEvent to be processedSettings.geographicalFocus
public java.util.List<Listener> getEventListeners()
Listener
public boolean isVisibleAndInside(int x0, int y0, int xf, int yf)
public int getGap(int gap)
public void bringToFront()
public void sendToBack()
public boolean hadParentScrolled()
protected boolean willOpenKeyboard()
protected <H extends EventHandler> boolean isActionEvent(Event<H> event)
public boolean isChildOf(Container p)
public boolean isTopMost()
public boolean isObscured(Window parentWindow)
protected void safeRepaintNow()
public void intXYWH(int x, int y, int w, int h)
public void setTranslucent(Control.TranslucentShape shape)
public boolean drawTranslucentBackground(Graphics g, int alphaValue)
public int getEffectW()
public int getEffectH()
public int getEffectX()
public int getEffectY()
public boolean hasFocus()
public void setFloating(boolean floating)
public boolean isFloating()
public boolean getDoEffect()
public void setDoEffect(boolean doEffect)