|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel com.cosylab.gui.components.AbstractDisplayerPanel com.cosylab.gui.components.AbstractNumericDisplayerPanel com.cosylab.gui.components.LabelledNumberField
public class LabelledNumberField
LabelledNumberField
is extended NumberField
with
title label and units label.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
javax.swing.JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
javax.swing.JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
java.awt.Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class com.cosylab.gui.components.AbstractDisplayerPanel |
---|
DYNAMIC_LAYOUT, HORIZONTAL_LAYOUT, VERTICAL_LAYOUT |
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 | |
---|---|
LabelledNumberField()
Creates a new LabelledNumberField object. |
|
LabelledNumberField(java.lang.Number value)
Creates a new LabelledNumberField object. |
|
LabelledNumberField(java.lang.Number value,
java.lang.String format)
Creates a new LabelledNumberField object. |
|
LabelledNumberField(java.lang.Number value,
java.lang.String format,
java.lang.String title,
java.lang.String units)
Creates a new LabelledNumberField object. |
|
LabelledNumberField(java.lang.Number value,
java.lang.String format,
java.lang.String title,
java.lang.String units,
boolean unitsWithTitle)
Creates a new LabelledNumberField object. |
|
LabelledNumberField(java.lang.Number value,
java.lang.String format,
java.lang.String title,
java.lang.String units,
boolean resizable,
boolean enchanced,
boolean editable,
boolean unitsWithTitle)
Creates a new LabelledNumberField object. |
|
LabelledNumberField(java.lang.String format)
Creates a new LabelledNumberField object. |
Method Summary | |
---|---|
void |
addActionListener(java.awt.event.ActionListener l)
Adds action listener on NumberField . |
void |
addSetListener(SetListener l)
Adds set listener to the NumberField . |
int |
getColumns()
Returns number of columns on the NumberField . |
AbstractCustomizerPanel |
getCustomizer()
Loads the default com.cosylab.gui.components.customizer.Customizer for this
displayer and returns it. |
double |
getDoubleValue()
Returns the value of type double |
long |
getLongValue()
Returns the value of type long |
java.lang.Number |
getMaximumValue()
Returns the maximum value allowed by this NumberField. |
java.lang.Number |
getMinimumValue()
Returns the minimum value allowed by this NumberField. |
protected NumberField |
getNumber()
The NumberField component, that does number editing and
rendering. |
NumberDescriptor |
getNumberDescriptor()
Returns descriptor object, to which visualization of number as strring is dlegated. |
java.lang.Class<? extends java.lang.Number> |
getNumberType()
Returns the type of displayed number. |
java.lang.Number |
getNumberValue()
Returns generic representation of the value using the Number class. |
java.awt.Color |
getOutOfBoundsColor()
Returns th color which indicates the out of bounds state. |
int |
getSettingPolicy()
Returns the currently used seting policy by this Numberfield |
State |
getState()
Returns the current state of the component. |
protected javax.swing.JComponent |
getValueComponent()
Should return the component to display the value of this displayer. |
protected void |
internalSetEnabled()
Overriden to enable/disable min/max labels. |
protected void |
internalSetEnhanced()
Overriden to set enahnced mode to min/max labels. |
protected void |
internalSetFormat()
|
protected void |
internalSetResizable()
Overriden to implement additional functionality. |
boolean |
isEditable()
Returns true if user is allowed to set value. |
boolean |
isTiltingEnabled()
Returns true if tilting is enabled. |
boolean |
isWarnOutOfBounds()
Returns true if the displayer shows a warning when out of bounds. |
static void |
main(java.lang.String[] args)
Run test applet. |
void |
removeActionListener(java.awt.event.ActionListener l)
Removes action listener from NumberField . |
void |
removeSetListener(SetListener l)
Removes set listener from the NumberField . |
void |
setBackground(java.awt.Color bg)
|
void |
setColumns(int columns)
Sets number of columns on the NumberField . |
void |
setDoubleValue(double newValue)
Sets the value of type double to be displayed. |
void |
setEditable(boolean editable)
Enables/disables user editing of number. |
void |
setLongValue(long newValue)
Sets the value of type long to be displayed. |
void |
setMaximumValue(java.lang.Number newMaximum)
Sets the maximum allowed value that can be entered in this NumberField. |
void |
setMinimumValue(java.lang.Number newMinimum)
Sets the minimum allowed value that can be entered in this NumberField. |
void |
setNumberDescriptor(NumberDescriptor numberDescriptor)
When this is set with non-null value, this NumberField uses this descriptor to convert Number to string and back. |
void |
setNumberType(java.lang.Class<? extends java.lang.Number> newNumberFormat)
Sets the number format. |
void |
setNumberValue(java.lang.Number newValue)
Sets the numeric value for this component. |
void |
setOutOfBoundsColor(java.awt.Color c)
Sets the color which indicates the out of bounds state. |
void |
setSettingPolicy(int newPolicy)
Sets the setting policy of thi Numberdisplayer. |
void |
setState(State state)
Sets the state to the component. |
void |
setTiltingEnabled(boolean b)
Enables/disables tilting when value is out of bounds. |
void |
setWarnOutOfBounds(java.lang.Boolean b)
If warnOutOfBounds is set to true, user will be notified when a value is set ot of the preset bounds. |
Methods inherited from class com.cosylab.gui.components.AbstractDisplayerPanel |
---|
getPopupManager, getTitle, getTitleComponent, getTitleMaximumFontSize, getTitleMinimumFontSize, isDragEnabled, isDropEnabled, isEnhanced, isPopupEnabled, isResizable, isTitleVisible, layoutValue, layoutValueAndTitle, setDragEnabled, setDropEnabled, setEnabled, setEnhanced, setPopupEnabled, setResizable, setTitle, setTitleVisible |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
Methods inherited from class java.awt.Container |
---|
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
Methods inherited from class java.awt.Component |
---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.cosylab.gui.components.util.PopupManageable |
---|
getPopupManager |
Constructor Detail |
---|
public LabelledNumberField()
public LabelledNumberField(java.lang.String format)
format
- initial formatpublic LabelledNumberField(java.lang.Number value)
value
- initial valuepublic LabelledNumberField(java.lang.Number value, java.lang.String format)
value
- initial valueformat
- initial formatpublic LabelledNumberField(java.lang.Number value, java.lang.String format, java.lang.String title, java.lang.String units)
value
- initial valueformat
- initial formattitle
- initial titleunits
- initial unitspublic LabelledNumberField(java.lang.Number value, java.lang.String format, java.lang.String title, java.lang.String units, boolean unitsWithTitle)
value
- initial valueformat
- initial formattitle
- initial titleunits
- initial unitsunitsWithTitle
- if true
units shown in title label
and not in separate labelpublic LabelledNumberField(java.lang.Number value, java.lang.String format, java.lang.String title, java.lang.String units, boolean resizable, boolean enchanced, boolean editable, boolean unitsWithTitle)
value
- initial valueformat
- initial formattitle
- initial titleunits
- initial unitsresizable
- inital resizableenchanced
- inital enchancededitable
- initial editableunitsWithTitle
- if true
units shown in title label
and not in separate labelMethod Detail |
---|
public AbstractCustomizerPanel getCustomizer()
AbstractDisplayerPanel
com.cosylab.gui.components.customizer.Customizer
for this
displayer and returns it.
getCustomizer
in class AbstractDisplayerPanel
public void setColumns(int columns)
NumberField
.
JTextField.setColumns(int)
public int getColumns()
NumberField
.
JTextField.getColumns()
public void setDoubleValue(double newValue)
double
to be displayed.
newValue
- public double getDoubleValue()
double
public void setEditable(boolean editable)
editable
- if true
user is allowed to set value.public boolean isEditable()
true
if user is allowed to set value.
true
if user is allowed to input numberpublic void setLongValue(long newValue)
long
to be displayed.
newValue
- public long getLongValue()
long
public void setMaximumValue(java.lang.Number newMaximum)
setMaximumValue
in class AbstractNumericDisplayerPanel
newMaximum
- Numberpublic java.lang.Number getMaximumValue()
getMaximumValue
in class AbstractNumericDisplayerPanel
public void setMinimumValue(java.lang.Number newMinimum)
setMinimumValue
in class AbstractNumericDisplayerPanel
newMinimum
- Numberpublic java.lang.Number getMinimumValue()
getMinimumValue
in class AbstractNumericDisplayerPanel
public void setNumberType(java.lang.Class<? extends java.lang.Number> newNumberFormat)
setNumberType
in class AbstractNumericDisplayerPanel
newNumberFormat
- public java.lang.Class<? extends java.lang.Number> getNumberType()
getNumberType
in class AbstractNumericDisplayerPanel
public void setNumberValue(java.lang.Number newValue)
newValue
- Numberpublic java.lang.Number getNumberValue()
Number
class.
public void setState(State state)
AbstractDisplayerPanel
setState
in interface StateOriginator
setState
in class AbstractNumericDisplayerPanel
state
- to set.StateOriginator.setState(com.cosylab.application.state.State)
public void setTiltingEnabled(boolean b)
b
- true if tilting should be enabledNumberField.setTiltingEnabled(boolean)
public State getState()
AbstractDisplayerPanel
getState
in interface StateOriginator
getState
in class AbstractNumericDisplayerPanel
StateOriginator.getState()
public boolean isTiltingEnabled()
setTiltingEnabled(boolean)
,
NumberField.isTiltingEnabled()
public void addActionListener(java.awt.event.ActionListener l)
NumberField
.
l
- public void addSetListener(SetListener l)
NumberField
.
NumberField.addSetListener(SetListener)
public void removeActionListener(java.awt.event.ActionListener l)
NumberField
.
l
- public void removeSetListener(SetListener l)
NumberField
.
NumberField.removeSetListener(SetListener)
protected NumberField getNumber()
NumberField
component, that does number editing and
rendering.
NumberField
componentprotected javax.swing.JComponent getValueComponent()
AbstractDisplayerPanel
valueComponent
to the AbstractDisplayerPanel. Subclasses
should thus use lazy initialization inside this method.
getValueComponent
in class AbstractDisplayerPanel
protected void internalSetEnabled()
AbstractNumericDisplayerPanel
internalSetEnabled
in class AbstractNumericDisplayerPanel
protected void internalSetEnhanced()
AbstractNumericDisplayerPanel
internalSetEnhanced
in class AbstractNumericDisplayerPanel
protected void internalSetFormat()
internalSetFormat
in class AbstractNumericDisplayerPanel
protected void internalSetResizable()
AbstractNumericDisplayerPanel
internalSetResizable
in class AbstractNumericDisplayerPanel
AbstractDisplayerPanel.setResizable(boolean)
public NumberDescriptor getNumberDescriptor()
public void setNumberDescriptor(NumberDescriptor numberDescriptor)
numberDescriptor
- new Number visualization, can be
null
public void setSettingPolicy(int newPolicy)
newPolicy
- new policy
java.lang.IllegalArgumentException
NumberField.setSettingPolicy(int)
public int getSettingPolicy()
NumberField.getSettingPolicy()
public void setWarnOutOfBounds(java.lang.Boolean b)
b
- true if warnings are turned onpublic boolean isWarnOutOfBounds()
public void setOutOfBoundsColor(java.awt.Color c)
c
- new out of bounds state colorpublic java.awt.Color getOutOfBoundsColor()
public void setBackground(java.awt.Color bg)
setBackground
in class AbstractNumericDisplayerPanel
public static void main(java.lang.String[] args)
args
- command line parameters
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |