superwaba.ext.xplat.ui
Class BigNumber
java.lang.Object
|
+--waba.ui.Control
|
+--superwaba.ext.xplat.ui.BigNumber
- public class BigNumber
- extends Control
This is a basic eight segment number display control which can be scaled to any size.
Fields inherited from class waba.ui.Control |
AFTER,
appId,
asContainer,
asWindow,
backColor,
backDis,
BEFORE,
BOTTOM,
CENTER,
enabled,
FILL,
FIT,
fm,
fmH,
focusLess,
font,
foreColor,
foreDis,
height,
LEFT,
parent,
PREFERRED,
RANGE,
RIGHT,
SAME,
TOP,
visible,
width,
x,
x2,
y,
y2 |
Constructor Summary |
BigNumber()
Construct a new number initialised to 0 with DIRECT changing |
BigNumber(int num)
Construct a new number with DIRECT changing |
BigNumber(int num,
int mode)
Construct a new number with the given options |
Method Summary |
int |
getNumber()
Gets the value of the number |
int |
getPreferredHeight()
Returns the preffered height of this control. |
int |
getPreferredWidth()
Returns the preffered width of this control. |
void |
onEvent(Event event)
Process pen and key events to this component |
void |
onPaint(Graphics g)
Called to draw the control. |
void |
setMode(int mode)
Sets the mode of changing this number.
|
void |
setNumber(int num)
Sets the value of this number |
Methods inherited from class waba.ui.Control |
addTimer,
contains,
createGraphics,
getAbsoluteRect,
getBackColor,
getFont,
getFontMetrics,
getForeColor,
getNext,
getParent,
getParentWindow,
getPos,
getRect,
getSize,
isDisplayed,
isEnabled,
isVisible,
onBoundsChanged,
onColorsChanged,
onFontChanged,
onWindowPaintFinished,
postEvent,
removeTimer,
repaint,
repaintNow,
requestFocus,
setBackColor,
setBackForeColors,
setEnabled,
setFocusLess,
setFont,
setForeColor,
setRect,
setRect,
setRect,
setVisible |
DOLLAR
public static final int DOLLAR
POINT
public static final int POINT
DIRECT
public static final int DIRECT
UP_DOWN
public static final int UP_DOWN
NONE
public static final int NONE
BigNumber
public BigNumber()
- Construct a new number initialised to 0 with DIRECT changing
BigNumber
public BigNumber(int num)
- Construct a new number with DIRECT changing
BigNumber
public BigNumber(int num,
int mode)
- Construct a new number with the given options
- Parameters:
num
- the value to start withmode
- the mode to use
setNumber
public void setNumber(int num)
- Sets the value of this number
- Parameters:
num
- 0-9, DOLLAR (for $) or POINT (for .)
setMode
public void setMode(int mode)
- Sets the mode of changing this number.
Possible values are:
- DIRECT - value is determined by the y position clicked - top is 0, bottom is 9, the rest evently divided between
- UP_DOWN - value is increased by one if clicked in the top half, decreased by one in the bottom half
- NONE - this number cannot change
- Parameters:
mode
- the mode
getNumber
public int getNumber()
- Gets the value of the number
- Returns:
- the value from 0-9 (or DOLLAR or POINT)
getPreferredWidth
public int getPreferredWidth()
- Description copied from class: Control
- Returns the preffered width of this control.
- Overrides:
- getPreferredWidth in class Control
getPreferredHeight
public int getPreferredHeight()
- Description copied from class: Control
- Returns the preffered height of this control.
- Overrides:
- getPreferredHeight in class Control
onPaint
public void onPaint(Graphics g)
- Description copied from class: Control
- Called to draw the control. When this method is called, the graphics
object passed has been translated into the coordinate system of the
control and the area behind the control has
already been painted. The background is painted by the top-level
window control.
- Overrides:
- onPaint in class Control
- Tags copied from class: Control
- Parameters:
g
- the graphics object for drawing- See Also:
Graphics
onEvent
public void onEvent(Event event)
- Process pen and key events to this component
- Overrides:
- onEvent in class Control
- Parameters:
event
- the event to process