Package org.csstudio.swt.widgets.figures
Class SpinnerFigure
java.lang.Object
org.eclipse.draw2d.Figure
org.csstudio.swt.widgets.figures.SpinnerFigure
- All Implemented Interfaces:
Introspectable,org.eclipse.draw2d.IFigure
The figure for a spinner widget.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.eclipse.draw2d.Figure
org.eclipse.draw2d.Figure.FigureIterator, org.eclipse.draw2d.Figure.IdentitySearch, org.eclipse.draw2d.Figure.ReverseFigureChildrenIteratorNested classes/interfaces inherited from interface org.eclipse.draw2d.IFigure
org.eclipse.draw2d.IFigure.NoInsets -
Field Summary
Fields inherited from class org.eclipse.draw2d.Figure
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTipFields inherited from interface org.eclipse.draw2d.IFigure
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidintdoublegetMax()doublegetMin()doubleintdoubledoublegetValue()booleanbooleanprotected voidlayout()booleanmanualSetValue(double value) Set Value from manual control of the widget.protected voidpageDown()Cause the spinner to decrease its value by its step increment;protected voidpageUp()Cause the spinner to increase its value by its step increment;voidvoidsetArrowButtonsHorizontal(boolean arrowButtonsHorizontal) Set the layout of the arrow buttonsvoidsetArrowButtonsOnLeft(boolean arrowButtonsOnLeft) Set the position of arrow buttonsvoidsetButtonWidth(int buttonWidth) voidsetDisplayValue(double value) Set the displayed value in the spinner.voidsetEnabled(boolean value) voidsetFormatType(SpinnerFigure.NumericFormatType formatType) voidsetMax(double max) voidsetMin(double min) voidsetPageIncrement(double pageIncrement) voidsetPrecision(int precision) voidsetStepIncrement(double stepIncrement) voidsetValue(double value) Set the value of the spinner.voidshowText(boolean isVisible) Show or hide the 'text' of the spinner.protected voidstepDown()Cause the spinner to decrease its value by its step increment;protected voidstepUp()Cause the spinner to increase its value by its step increment;Methods inherited from class org.eclipse.draw2d.Figure
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getChildrenRevIterable, getClientArea, getClientArea, getClippingStrategy, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getListenersIterable, getLocalBackgroundColor, getLocalFont, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, optimizeClip, paint, paintBorder, paintChildren, paintClientArea, paintFigure, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setClippingStrategy, setConstraint, setCursor, setFlag, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates, validate
-
Constructor Details
-
SpinnerFigure
public SpinnerFigure()
-
-
Method Details
-
addManualValueChangeListener
-
getButtonWidth
public int getButtonWidth()- Returns:
- the buttonWidth
-
setButtonWidth
public void setButtonWidth(int buttonWidth) - Parameters:
buttonWidth- the buttonWidth to set
-
getFormatType
- Returns:
- the formatType
-
getLabelFigure
-
getMax
public double getMax()- Returns:
- the max
-
getMin
public double getMin()- Returns:
- the min
-
getPageIncrement
public double getPageIncrement() -
getPrecision
public int getPrecision()- Returns:
- the precision
-
getStepIncrement
public double getStepIncrement()- Returns:
- the stepIncrement
-
getValue
public double getValue()- Returns:
- the value
-
isArrowButtonsOnLeft
public boolean isArrowButtonsOnLeft()- Returns:
- true if arrow buttons on left side of the figure.
-
isArrowButtonsHorizontal
public boolean isArrowButtonsHorizontal()- Returns:
- true if arrow buttons layout is horizontal.
-
layout
protected void layout()- Overrides:
layoutin classorg.eclipse.draw2d.Figure
-
manualSetValue
public boolean manualSetValue(double value) Set Value from manual control of the widget. Value will be coerced in range.- Parameters:
value-
-
pageDown
protected void pageDown()Cause the spinner to decrease its value by its step increment; -
pageUp
protected void pageUp()Cause the spinner to increase its value by its step increment; -
removeManualValueChangeListener
-
setArrowButtonsOnLeft
public void setArrowButtonsOnLeft(boolean arrowButtonsOnLeft) Set the position of arrow buttons- Parameters:
arrowButtonsOnLeft- true if on left.
-
setArrowButtonsHorizontal
public void setArrowButtonsHorizontal(boolean arrowButtonsHorizontal) Set the layout of the arrow buttons- Parameters:
arrowButtonsHorizontal- true if horizontal.
-
setDisplayValue
public void setDisplayValue(double value) Set the displayed value in the spinner. It may out of the range.- Parameters:
value- the value to be displayed
-
setEnabled
public void setEnabled(boolean value) - Specified by:
setEnabledin interfaceorg.eclipse.draw2d.IFigure- Overrides:
setEnabledin classorg.eclipse.draw2d.Figure
-
setFormatType
-
setMax
public void setMax(double max) - Parameters:
max- the max to set
-
setMin
public void setMin(double min) - Parameters:
min- the min to set
-
setPageIncrement
public void setPageIncrement(double pageIncrement) -
setPrecision
public void setPrecision(int precision) - Parameters:
precision- the precision to set
-
setStepIncrement
public void setStepIncrement(double stepIncrement) - Parameters:
stepIncrement- the stepIncrement to set
-
setValue
public void setValue(double value) Set the value of the spinner. It will be coerced in the range. This only update the text. It will not notify listeners about the value change.- Parameters:
value- the value to set
-
stepDown
protected void stepDown()Cause the spinner to decrease its value by its step increment; -
stepUp
protected void stepUp()Cause the spinner to increase its value by its step increment; -
getBeanInfo
- Specified by:
getBeanInfoin interfaceIntrospectable- Throws:
IntrospectionException
-
showText
public void showText(boolean isVisible) Show or hide the 'text' of the spinner. If False the spinner just shows the 'up' and 'down' buttons.- Parameters:
isVisible-
-