|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.zaval.util.ValidationObject | +--org.zaval.lw.LwCanvas | +--org.zaval.lw.LwPanel | +--org.zaval.lw.LwSpin
This is spin light weight component that can be used to input a bound integer value.
The bound is determined by setBound
method. To control current value
use setValue
and getValue
methods. The component performs
action event whenever the spin value has been changed. Use addActionListener
and removeActionListener
methods to register the listener.
The spin value validation and representation are defined by LwSpinValidator. Use setSpinValidator method to customize it.
Fields inherited from class org.zaval.lw.LwPanel |
children |
Fields inherited from class org.zaval.lw.LwCanvas |
bits, height, insets, parent, psHeight, psWidth, skins, width, x, y |
Fields inherited from class org.zaval.util.ValidationObject |
isValidFlag |
Constructor Summary | |
LwSpin()
Constructs the componen. |
Method Summary | |
void |
actionPerformed(LwActionEvent e)
Invoked when an action event occured. |
void |
addActionListener(LwActionListener l)
Adds the action events listener. |
java.awt.Dimension |
calcPreferredSize(LayoutContainer target)
Calculates the preferred size dimension for the layout container. |
void |
componentAdded(java.lang.Object id,
Layoutable lw,
int index)
Invoked when the specified layoutable component is added to the layout container (that uses the layout manager). |
void |
componentRemoved(Layoutable lw,
int index)
Invoked when the specified layoutable component is removed from the layout container, that uses the layout manager. |
void |
enableLoop(boolean b)
Enables or disables the loop mode. |
protected LwLayout |
getDefaultLayout()
Gets the default layout manager that is set with the container during initialization. |
int |
getMaxValue()
Gets the maximum value. |
int |
getMinValue()
Gets the minimum value. |
LwSpinValidator |
getSpinValidator()
Gets the spin validator. |
int |
getStep()
Gets the current step. |
TextModel |
getTextModel()
Gets the text model. |
int |
getValue()
Gets the current value. |
boolean |
isLoopEnabled()
Returns the loop mode. |
void |
layout(LayoutContainer target)
Lays out the child layoutable components inside the layout container. |
void |
removeActionListener(LwActionListener l)
Removes the action events listener so it no longer get action events from the component. |
void |
setBound(int min,
int max)
Sets the specified bound. |
void |
setSpinValidator(LwSpinValidator v)
Sets the specified spin validator. |
void |
setStep(int s)
Sets the specified step. |
void |
setValue(int v)
Sets the specified value. |
void |
textInserted(TextEvent e)
Invoked when a new text has been inserted in the text. |
void |
textRemoved(TextEvent e)
Invoked when a part of the text has been removed. |
void |
textUpdated(TextEvent e)
Invoked when the text has been updated. |
protected void |
valueChanged()
The method is called whenever the spin value has been changed. |
Methods inherited from class org.zaval.lw.LwPanel |
add, add, calcPreferredSize, count, get, getLayoutOffset, getLwComponentAt, getLwLayout, indexOf, insert, insert, invalidate, paintOnTop, recalc, remove, remove, removeAll, setBackground, setLwLayout, setOpaque, toFront, updateCashedPs |
Methods inherited from class org.zaval.lw.LwCanvas |
canHaveFocus, getBackground, getBounds, getHeight, getInsets, getLocation, getLwParent, getOrigin, getPreferredSize, getSize, getViewMan, getVisiblePart, getWidth, getX, getY, hasFocus, isEnabled, isOpaque, isVisible, paint, repaint, repaint, requestFocus, setEnabled, setInsets, setLocation, setLwParent, setPSSize, setSize, setViewMan, setVisible, toString, update, validate, viewManChanged, vrp |
Methods inherited from class org.zaval.util.ValidationObject |
isValid |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.zaval.lw.LwComponent |
canHaveFocus, getLwParent, getViewMan, getVisiblePart, setEnabled, setLwParent, setViewMan, setVisible |
Methods inherited from interface org.zaval.lw.Drawable |
getBackground, getOrigin, isEnabled, isOpaque, paint, repaint, repaint, update |
Methods inherited from interface org.zaval.util.Validationable |
isValid, validate |
Methods inherited from interface org.zaval.lw.Layoutable |
getBounds, getHeight, getInsets, getLocation, getPreferredSize, getSize, getWidth, getX, getY, isVisible, setLocation, setSize |
Constructor Detail |
public LwSpin()
Method Detail |
public TextModel getTextModel()
public void enableLoop(boolean b)
b
- true
to enable the loop mode.public boolean isLoopEnabled()
public void setStep(int s)
s
- the specified step.public int getStep()
public void addActionListener(LwActionListener l)
l
- the action events listener.public void removeActionListener(LwActionListener l)
l
- the action events listener.public void componentAdded(java.lang.Object id, Layoutable lw, int index)
LwLayout
componentAdded
in interface LwLayout
org.zaval.lw.LwLayout
id
- the layoutable component constraints.lw
- the layoutable component that has been added.index
- the child index.public void componentRemoved(Layoutable lw, int index)
LwLayout
componentRemoved
in interface LwLayout
org.zaval.lw.LwLayout
lw
- the layoutable component that has been removed.index
- the child component index.public java.awt.Dimension calcPreferredSize(LayoutContainer target)
LwLayout
calcPreferredSize
in interface LwLayout
org.zaval.lw.LwLayout
target
- the layout container.public void layout(LayoutContainer target)
LwLayout
layout
in interface LwLayout
org.zaval.lw.LwLayout
target
- the layout container that needs to be laid out.public void actionPerformed(LwActionEvent e)
LwActionListener
actionPerformed
in interface LwActionListener
org.zaval.lw.event.LwActionListener
e
- the specified action event.public int getValue()
public void setValue(int v)
v
- the new current value.public int getMinValue()
public int getMaxValue()
public LwSpinValidator getSpinValidator()
public void setSpinValidator(LwSpinValidator v)
v
- the specified spin validator.public void setBound(int min, int max)
min
- the specified minimum value.max
- the specified maximum value.public void textRemoved(TextEvent e)
TextListener
textRemoved
in interface TextListener
org.zaval.data.event.TextListener
e
- the text event.public void textInserted(TextEvent e)
TextListener
textInserted
in interface TextListener
org.zaval.data.event.TextListener
e
- the text event.public void textUpdated(TextEvent e)
TextListener
textUpdated
in interface TextListener
org.zaval.data.event.TextListener
e
- the text event.protected LwLayout getDefaultLayout()
LwPanel
getDefaultLayout
in class LwPanel
org.zaval.lw.LwPanel
protected void valueChanged()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |