|
||||||||||
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
public abstract class AbstractNumericDisplayerPanel
An extension of AbstractDisplayerPanel used for numerical displayers.
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 | |
---|---|
AbstractNumericDisplayerPanel()
Default constructor. |
|
AbstractNumericDisplayerPanel(java.lang.String title,
boolean titleVisible,
int layoutOrientation,
boolean resizable,
boolean enabled,
boolean enchanced,
int minTitleFontSize,
int maxTitleFontSize,
java.lang.String units,
boolean unitsVisible,
boolean unitsShownWithTitle)
Creates a new AbstractNumericDisplayerPanel object with initial parameters. |
Method Summary | |
---|---|
java.lang.String |
getFormat()
Gets the C-style format string used for formatting numerical display |
int |
getLayoutOrientation()
Returns the current layout orientation setting. |
protected javax.swing.JComponent |
getMaxComponent()
Gets the component displaying the maximum numerical value. |
protected java.lang.Number |
getMaximumValue()
|
protected javax.swing.JComponent |
getMinComponent()
Returns the component displaying the minimum numerical value. |
protected java.lang.Number |
getMinimumValue()
|
protected java.lang.Class<? extends java.lang.Number> |
getNumberType()
Determines the number type currently set to this NumericDispalyerPanel. |
State |
getState()
Returns the current state of the component. |
java.lang.String |
getUnits()
Gets the physical units of the value displayed by the numeric component |
protected javax.swing.JComponent |
getUnitsComponent()
Returns the GUI component diplaying units. |
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 |
internalSetMaximum()
|
protected void |
internalSetMinimum()
|
protected void |
internalSetResizable()
Overriden to implement additional functionality. |
protected void |
internalSetTitle()
|
protected void |
internalSetUnits()
|
boolean |
isBoundsVisible()
Determines wether the component should display the numerical bounds of the value component |
boolean |
isUnitsShownWithTitle()
If true units will be shown in title label. |
boolean |
isUnitsVisible()
Returns true if units are displayed. |
protected void |
layoutDisplayer()
Lays out the displayer according to the set layout orientation. |
protected void |
layoutValueAndBounds()
|
protected void |
layoutValueAndTitleAndBounds()
|
protected void |
layoutValueAndTitleAndUnits()
|
protected void |
layoutValueAndTitleAndUnitsAndBounds()
|
protected void |
layoutValueAndUnits()
|
protected void |
layoutValueAndUnitsAndBounds()
|
void |
setBackground(java.awt.Color bg)
|
void |
setBoundsVisible(boolean b)
Sets the visibility of the numerical bounds. |
void |
setForeground(java.awt.Color fg)
|
void |
setFormat(java.lang.String value)
Sets the C-style format String used for formatting numerical values |
void |
setLayoutOrientation(int i)
Sets the orientation tag determining how the title and value components should be layed out inside the panel. |
protected void |
setMaximumValue(java.lang.Number value)
|
protected void |
setMinimumValue(java.lang.Number value)
|
protected void |
setNumberType(java.lang.Class<? extends java.lang.Number> class1)
|
void |
setState(State state)
Sets the state to the component. |
void |
setTitleMaximumFontSize(int max)
Sets the maximum title font size allowed. |
void |
setTitleMinimumFontSize(int min)
Sets the minimum title font size allowed. |
void |
setTransferHandler(javax.swing.TransferHandler newHandler)
|
void |
setUnits(java.lang.String value)
Sets the units String to denote the physical units of numerical values displayed |
void |
setUnitsShownWithTitle(boolean unitsShownWithTitle)
If set to true units will be shown in title label |
void |
setUnitsVisible(boolean b)
Set to true to display units. |
Methods inherited from class com.cosylab.gui.components.AbstractDisplayerPanel |
---|
getCustomizer, getPopupManager, getTitle, getTitleComponent, getTitleMaximumFontSize, getTitleMinimumFontSize, getValueComponent, 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 |
Constructor Detail |
---|
public AbstractNumericDisplayerPanel()
public AbstractNumericDisplayerPanel(java.lang.String title, boolean titleVisible, int layoutOrientation, boolean resizable, boolean enabled, boolean enchanced, int minTitleFontSize, int maxTitleFontSize, java.lang.String units, boolean unitsVisible, boolean unitsShownWithTitle)
title
- initial valuetitleVisible
- initial valuelayoutOrientation
- initial valueresizable
- initial valueenabled
- initial valueenchanced
- initial valueminTitleFontSize
- initial valuemaxTitleFontSize
- initial valueunits
- initial valueunitsVisible
- initial valueunitsShownWithTitle
- initial valueMethod Detail |
---|
public void setBoundsVisible(boolean b)
b
- wether the bounds should be displayed in the panel.public boolean isBoundsVisible()
true
if the bounds are displayed,
false
otherwise.public void setFormat(java.lang.String value)
value
- format Stringpublic java.lang.String getFormat()
public void setLayoutOrientation(int i)
AbstractDisplayerPanel
setLayoutOrientation
in class AbstractDisplayerPanel
i
- layout tag, valid values are HORIZONTAL_LAYOUT
,
VERTICAL_LAYOUT
, DYNAMIC_LAYOUT
AbstractDisplayerPanel.getLayoutOrientation()
public int getLayoutOrientation()
AbstractDisplayerPanel
Returns the current layout orientation setting.
Possible values are:
#HORIZONTAL_LAYOUT
- the title and value components are
displayed side by side horizontally
#VERTICAL_LAYOUT
- the title and value components are
displayed vertically, title above the value
#DYNAMIC_LAYOUT
- the orientation of the components inside
the panel is determined dynamically on the basisi of the components
preferred sizes so as to most affectivelly fill up the space available.
getLayoutOrientation
in class AbstractDisplayerPanel
public void setState(State state)
AbstractDisplayerPanel
setState
in interface StateOriginator
setState
in class AbstractDisplayerPanel
state
- to set.StateOriginator.setState(com.cosylab.application.state.State)
public State getState()
AbstractDisplayerPanel
getState
in interface StateOriginator
getState
in class AbstractDisplayerPanel
StateOriginator.getState()
public void setUnits(java.lang.String value)
value
- units Stringpublic java.lang.String getUnits()
public void setUnitsVisible(boolean b)
true
to display units.
b
- true
if units are to be displayed.public boolean isUnitsVisible()
true
if units are displayed.
true
if units are displayed.protected javax.swing.JComponent getMaxComponent()
protected void setMaximumValue(java.lang.Number value)
protected java.lang.Number getMaximumValue()
protected javax.swing.JComponent getMinComponent()
protected void setMinimumValue(java.lang.Number value)
protected java.lang.Number getMinimumValue()
protected void setNumberType(java.lang.Class<? extends java.lang.Number> class1)
protected java.lang.Class<? extends java.lang.Number> getNumberType()
Double.class
or Long.class
protected javax.swing.JComponent getUnitsComponent()
protected void internalSetEnabled()
internalSetEnabled
in class AbstractDisplayerPanel
protected void internalSetEnhanced()
internalSetEnhanced
in class AbstractDisplayerPanel
protected void internalSetFormat()
protected void internalSetMaximum()
protected void internalSetMinimum()
protected void internalSetResizable()
internalSetResizable
in class AbstractDisplayerPanel
AbstractDisplayerPanel.setResizable(boolean)
protected void internalSetUnits()
protected void internalSetTitle()
internalSetTitle
in class AbstractDisplayerPanel
protected void layoutDisplayer()
AbstractDisplayerPanel
layoutDisplayer
in class AbstractDisplayerPanel
protected void layoutValueAndBounds()
protected void layoutValueAndTitleAndBounds()
protected void layoutValueAndTitleAndUnits()
protected void layoutValueAndTitleAndUnitsAndBounds()
protected void layoutValueAndUnits()
protected void layoutValueAndUnitsAndBounds()
public boolean isUnitsShownWithTitle()
true
units will be shown in title label.
true
units will be shown in title labelpublic void setUnitsShownWithTitle(boolean unitsShownWithTitle)
true
units will be shown in title label
unitsShownWithTitle
- if true
units will be shown in
title labelpublic void setTitleMaximumFontSize(int max)
AbstractDisplayerPanel
setTitleMaximumFontSize
in class AbstractDisplayerPanel
public void setTitleMinimumFontSize(int min)
AbstractDisplayerPanel
setTitleMinimumFontSize
in class AbstractDisplayerPanel
public void setTransferHandler(javax.swing.TransferHandler newHandler)
setTransferHandler
in class AbstractDisplayerPanel
public void setBackground(java.awt.Color bg)
setBackground
in class AbstractDisplayerPanel
public void setForeground(java.awt.Color fg)
setForeground
in class AbstractDisplayerPanel
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |