Class marimba.gui.SpinBoxTextWidget
All Packages Class Hierarchy This Package Previous Next Index
Class marimba.gui.SpinBoxTextWidget
java.lang.Object
|
+----marimba.gui.Widget
|
+----marimba.gui.TextWidget
|
+----marimba.gui.TextBoxWidget
|
+----marimba.gui.SpinBoxTextWidget
- public class SpinBoxTextWidget
- extends TextBoxWidget
A text widget with an up and down arrow for switching values.
- Version:
- 1.14, 01/13/97
- Author:
- Klaas Waslander
-
down
- Indicates whether one of the buttons is lowered.
-
fillButtons
- A SpinBoxTextWidget can hide the background from the buttons
by filling the buttons with the background color.
-
target
- The button that is being pressed.
-
SpinBoxTextWidget()
- Constructor.
-
action()
- The user tried to change the value.
-
eventInText(Event)
- Event is not in text area when it is on button.
-
findButton(int, int)
- Which button is located under a given (x,y) coordinate.
-
getButtonHeight()
- Get the height of the buttons.
-
getButtonWidth()
- Get the width of the buttons.
-
getFillButtons()
- Check if the buttons of the spinboxtextwidget are filled.
-
getOwner()
- Get the owner; the SpinTextBoxWidget gives events to the owners handleEvent.
-
getProperties(PropertyList)
- Get the properties of the dropdown textbox.
-
handleEvent(Event)
- Handle user events.
-
insert(char)
- Insert a character; only integers are allowed!
It will do nothing if the new character will result in
an invalid number, the new character will overwrite the
old character at that position or it will be appended
at the end if appropriate of course.
-
paintBackground(Graphics)
- Paint the background and the two buttons.
-
paintButton(Graphics, int, int, int, int, int, int)
- Paint a button raised or lowered and with an up or down arrow.
-
rightMargin()
- Right margin.
-
setFillButtons(boolean)
- Let the buttons of the spinboxtextwidget fill itself or not.
-
setProperties(PropertyList)
- Set the properties of the dropdown textbox.
-
setStyle(int)
- Set the style of this widget the same as in the
super class, but adjust the transparent boolean.
target
public int target
- The button that is being pressed. Target can be none, up or down.
down
public boolean down
- Indicates whether one of the buttons is lowered.
fillButtons
public boolean fillButtons
- A SpinBoxTextWidget can hide the background from the buttons
by filling the buttons with the background color.
- See Also:
- getFillButtons, setFillButtons
SpinBoxTextWidget
public SpinBoxTextWidget()
- Constructor.
getProperties
public void getProperties(PropertyList list)
- Get the properties of the dropdown textbox.
- Overrides:
- getProperties in class TextBoxWidget
setProperties
public void setProperties(PropertyList list)
- Set the properties of the dropdown textbox.
- Overrides:
- setProperties in class TextBoxWidget
getFillButtons
public boolean getFillButtons()
- Check if the buttons of the spinboxtextwidget are filled.
- See Also:
- fillButtons
setFillButtons
public void setFillButtons(boolean fillButtons)
- Let the buttons of the spinboxtextwidget fill itself or not.
- See Also:
- fillButtons
setStyle
public void setStyle(int style)
- Set the style of this widget the same as in the
super class, but adjust the transparent boolean.
- Overrides:
- setStyle in class TextBoxWidget
- See Also:
- style
insert
public void insert(char ch)
- Insert a character; only integers are allowed!
It will do nothing if the new character will result in
an invalid number, the new character will overwrite the
old character at that position or it will be appended
at the end if appropriate of course.
- Overrides:
- insert in class TextBoxWidget
rightMargin
public int rightMargin()
- Right margin.
- Overrides:
- rightMargin in class TextBoxWidget
getButtonWidth
public int getButtonWidth()
- Get the width of the buttons.
getButtonHeight
public int getButtonHeight()
- Get the height of the buttons.
getOwner
public SpinBoxWidget getOwner()
- Get the owner; the SpinTextBoxWidget gives events to the owners handleEvent.
The owner is always a SpinBoxWidget.
findButton
public int findButton(int x,
int y)
- Which button is located under a given (x,y) coordinate.
- Returns:
- UP, DOWN or NONE
paintBackground
public void paintBackground(Graphics g)
- Paint the background and the two buttons.
- Overrides:
- paintBackground in class TextBoxWidget
paintButton
public void paintButton(Graphics g,
int x,
int y,
int width,
int height,
int dir,
int mode)
- Paint a button raised or lowered and with an up or down arrow.
Constants defined in WidgetConstants are used for that.
eventInText
protected boolean eventInText(Event evt)
- Event is not in text area when it is on button.
- Overrides:
- eventInText in class TextWidget
handleEvent
public boolean handleEvent(Event evt)
- Handle user events.
- Overrides:
- handleEvent in class TextBoxWidget
action
public void action()
- The user tried to change the value.
- Overrides:
- action in class TextBoxWidget
All Packages Class Hierarchy This Package Previous Next Index