|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||

java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
org.jcurl.demo.tactics.JSpinnerNumberUnit
public class JSpinnerNumberUnit
Combine a numerical JSpinner and a Unit JComboBox.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary |
|---|
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
JSpinnerNumberUnit()
|
|
| Method Summary | |
|---|---|
void |
addChangeListener(ChangeListener l)
Register for getValue() changes. |
void |
focusGained(FocusEvent e)
internal use only! |
void |
focusLost(FocusEvent e)
internal use only! |
ChangeListener[] |
getChangeListeners()
getValue() listeners. |
(package private) JComponent |
getLabel()
Allow custom layouting |
SpinnerNumberModel |
getModel()
The data model according to getUnit(). |
(package private) JComponent |
getSpinner()
Allow custom layouting |
Unit |
getUnit()
Currently active Unit |
(package private) JComponent |
getUnitCombo()
Allow custom layouting |
double |
getValue()
The current value in according to the setBase(Unit) unit. |
boolean |
getValueIsAdjusting()
Is getValue() currently changing? |
void |
itemStateChanged(ItemEvent e)
internal use only. |
void |
removeChangeListener(ChangeListener l)
Deregister for getValue() changes. |
void |
setBase(Unit base)
The unit for getValue(). |
void |
setChoose(Unit... choose)
Alternative units.TODO Check compatibility with base. |
void |
setEnabled(boolean enabled)
|
void |
setLabel(String label)
|
void |
setModel(SpinnerNumberModel model)
Mostly to set minimum and maximum values. |
void |
setUnit(Unit current)
Set the currently active (display) Unit |
void |
setValue(double value)
|
void |
setValueIsAdjusting(boolean valueIsAdjusting)
Internal use only! |
void |
stateChanged(ChangeEvent e)
internal use only! |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public JSpinnerNumberUnit()
| Method Detail |
|---|
public void addChangeListener(ChangeListener l)
getValue() changes.
addChangeListener in interface IChangeSupportpublic void focusGained(FocusEvent e)
focusGained in interface FocusListenerpublic void focusLost(FocusEvent e)
focusLost in interface FocusListenerpublic ChangeListener[] getChangeListeners()
getValue() listeners.
JComponent getLabel()
public SpinnerNumberModel getModel()
getUnit().
JComponent getSpinner()
public Unit getUnit()
Unit
JComponent getUnitCombo()
public double getValue()
setBase(Unit) unit.
public boolean getValueIsAdjusting()
getValue() currently changing? (JSpinner has the
focus)
getValueIsAdjusting in interface IChangeSupportpublic void itemStateChanged(ItemEvent e)
itemStateChanged in interface ItemListenerpublic void removeChangeListener(ChangeListener l)
getValue() changes.
removeChangeListener in interface IChangeSupportpublic void setBase(Unit base)
getValue(). TODO Check compatibility with choose.
public void setChoose(Unit... choose)
choose - An empty list makes the Unit JComboBox
invisible.public void setEnabled(boolean enabled)
setEnabled in class JComponentpublic void setLabel(String label)
label - null makes the text JLabel to
invisible.public void setModel(SpinnerNumberModel model)
setBase(Unit) units and is immediately converted to
getUnit().
model - null makes the JSpinner invisible.rescale(Unit, Unit, SpinnerNumberModel)public void setUnit(Unit current)
Unit
public void setValue(double value)
public void setValueIsAdjusting(boolean valueIsAdjusting)
setValueIsAdjusting in interface IChangeSupportpublic void stateChanged(ChangeEvent e)
stateChanged in interface ChangeListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||