|
||||||||||
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 com.cosylab.gui.components.Piper
public class Piper
A visual component for displaying numerical (double
) values
using a liquid partially filled vertical tube visualisation. A value label
above the pipe displays the textural value together vith possible units.
Nested Class Summary | |
---|---|
static class |
Piper.LayoutOrientation
Defines the orietation of the piper. |
protected class |
Piper.TiltHandler
|
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 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 | |
---|---|
Piper()
Creates a new Piper with zero value. |
|
Piper(double newValue)
Creates a new Piper displaying the specified value. |
Method Summary | |
---|---|
AbstractCustomizerPanel |
getCustomizer()
Returns the Customizer intance for this displayer. |
java.awt.Color |
getDarkWaterColor()
|
java.lang.String |
getFormat()
Returns the format of the value label text. |
Piper.LayoutOrientation |
getLayoutOrientation()
Returns the layout orientation. |
java.awt.Color |
getLightWaterColor()
|
double |
getMaximum()
Returns the maximum value displayed at the top of the scale of the Piper. |
double |
getMinimum()
Gets the minimum value displayed at the bottom of the scale of the Piper. |
java.awt.Color |
getOutOfBoundsDarkWaterColor()
|
java.awt.Color |
getOutOfBoundsLightWaterColor()
|
PopupManager |
getPopupManager()
Returns popup manager for adding popup actions. |
protected RangedValueController |
getRangedValue()
Returns the rangedValue object containing all the value logic. |
State |
getState()
Returns the current state of the component. |
java.lang.String |
getTitle()
Returns the current title of the component or null is none is set. |
int |
getTitleMaximumFontSize()
|
int |
getTitleMinimumFontSize()
|
java.lang.String |
getUnits()
Returns the units to be displayed in the value label or null is none is set. |
double |
getValue()
Returns the value currently displayed. |
RangedValuePolicy |
getValuePolicy()
DOCUMENT ME! |
boolean |
isEnhanced()
Returns wether the component visualisation is enhanced. |
boolean |
isLogarithmic()
Returns true if the display is in logarithmic scale. |
boolean |
isPopupEnabled()
Returns whether the user can trigger the component's popup menu through mouse click. |
boolean |
isResizable()
Returns the resizable property of the component. |
boolean |
isStretch()
Returns wether the pipe should strech all across the width of the component or not. |
boolean |
isTiltingEnabled()
Returns whether the component should indicate value out of bounds condition by visually tilting its border. |
boolean |
isTitleVisible()
|
boolean |
isUnitsVisible()
DOCUMENT ME! |
static void |
main(java.lang.String[] args)
For demonstration purposes. |
protected void |
paintComponent(java.awt.Graphics g)
This method has been overriden to implement custom painting of the Piper. |
void |
setDarkWaterColor(java.awt.Color color)
Sets the dark color of the water in the piper. |
void |
setEnabled(boolean enabled)
Overriden to implement visual notification of enabled state. |
void |
setEnhanced(boolean enhanced)
Triggers on and off the visually enhanced mode of the Piper. |
void |
setFormat(java.lang.String format)
Sets the format of the value label text. |
void |
setLayoutOrientation(Piper.LayoutOrientation orientation)
Sets the orientation of the pipe. |
void |
setLightWaterColor(java.awt.Color color)
Sets the light color of the water in the piper. |
void |
setLogarithmic(boolean logScale)
Switches between linear and logarithmic scales displayed. |
void |
setMaximum(double newMaximum)
Sets the new maximum value displayed at the top of the scale of the Piper. |
void |
setMaxMin(double newMax,
double newMin)
Sets both minimum and maximum displayed values displayed at the bottom and at the top of the Pipers's scale. |
void |
setMinimum(double newMinimum)
Sets the new minimum value displayed at the bottom of the scale of the Piper. |
void |
setOutOfBoundsDarkWaterColor(java.awt.Color color)
Sets the dark color of the water in case value is out of bounds. |
void |
setOutOfBoundsLightWaterColor(java.awt.Color color)
Sets the light color of the water in case value is out of bounds. |
void |
setPopupEnabled(boolean b)
Enables or disables the popup capabilities of the component. |
void |
setResizable(boolean b)
Sets the resizable property of the component. |
void |
setState(State state)
Sets the state to the component. |
void |
setStretch(boolean b)
Sets if the pipe should strech all across the width of the component or not. |
void |
setTiltingEnabled(boolean b)
Sets the tilitng enabled property. |
void |
setTitle(java.lang.String string)
Sets the title to be rendered on top of the component when not stretched. |
void |
setTitleMaximumFontSize(int titleMaximumFontSize)
|
void |
setTitleMinimumFontSize(int titleMinimumFontSize)
|
void |
setTitleVisible(boolean titleVisible)
|
void |
setUnits(java.lang.String units)
Sets the units to be displayed in the value label. |
void |
setUnitsVisible(boolean b)
DOCUMENT ME! |
void |
setValue(double newValue)
Sets the new value to be displayed. |
void |
setValuePolicy(RangedValuePolicy p)
DOCUMENT ME! |
Methods inherited from class javax.swing.JComponent |
---|
addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getAccessibleContext, 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, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, paramString, 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, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI |
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 Piper(double newValue)
newValue
- doublepublic Piper()
Method Detail |
---|
public AbstractCustomizerPanel getCustomizer()
public void setEnhanced(boolean enhanced)
enhanced
- public boolean isEnhanced()
public void setFormat(java.lang.String format)
format
- The format to setpublic java.lang.String getFormat()
public void setMaximum(double newMaximum)
newMaximum
- doublepublic double getMaximum()
public void setMinimum(double newMinimum)
newMinimum
- doublepublic double getMinimum()
public void setLogarithmic(boolean logScale)
logScale
- booleanpublic boolean isLogarithmic()
true
if the display is in logarithmic scale.
public void setMaxMin(double newMax, double newMin)
newMax
- doublenewMin
- doublepublic void setPopupEnabled(boolean b)
b
- the component should bring up popup dialog on mouse click.public boolean isPopupEnabled()
public void setValue(double newValue)
newValue
- doublepublic double getValue()
public static void main(java.lang.String[] args)
args
- String[]public void setEnabled(boolean enabled)
setEnabled
in class javax.swing.JComponent
Component.setEnabled(boolean)
public PopupManager getPopupManager()
getPopupManager
in interface PopupManageable
PopupManageable.getPopupManager()
public void setResizable(boolean b)
b
- public boolean isResizable()
public void setState(State state)
setState
in interface StateOriginator
state
- to set.StateOriginator.setState(com.cosylab.application.state.State)
public State getState()
getState
in interface StateOriginator
StateOriginator.getState()
public void setStretch(boolean b)
b
- public boolean isStretch()
public void setTiltingEnabled(boolean b)
b
- whether the component should tilt when value is out of bounds.public boolean isTiltingEnabled()
public void setTitle(java.lang.String string)
string
- titlepublic java.lang.String getTitle()
public void setUnits(java.lang.String units)
units
- The units to set, can be nullpublic java.lang.String getUnits()
protected RangedValueController getRangedValue()
public void setLayoutOrientation(Piper.LayoutOrientation orientation)
orientation
- public Piper.LayoutOrientation getLayoutOrientation()
protected void paintComponent(java.awt.Graphics g)
paintComponent
in class javax.swing.JComponent
g
- GraphicsJComponent.paintComponent(java.awt.Graphics)
public void setValuePolicy(RangedValuePolicy p)
p
- DOCUMENT ME!public RangedValuePolicy getValuePolicy()
public boolean isUnitsVisible()
public void setUnitsVisible(boolean b)
b
- public boolean isTitleVisible()
public void setTitleVisible(boolean titleVisible)
public int getTitleMaximumFontSize()
public void setTitleMaximumFontSize(int titleMaximumFontSize)
public int getTitleMinimumFontSize()
public void setTitleMinimumFontSize(int titleMinimumFontSize)
public void setLightWaterColor(java.awt.Color color)
color
- public void setDarkWaterColor(java.awt.Color color)
color
- public void setOutOfBoundsLightWaterColor(java.awt.Color color)
color
- public void setOutOfBoundsDarkWaterColor(java.awt.Color color)
color
- public java.awt.Color getLightWaterColor()
public java.awt.Color getDarkWaterColor()
public java.awt.Color getOutOfBoundsLightWaterColor()
public java.awt.Color getOutOfBoundsDarkWaterColor()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |