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 classes/interfaces inherited from class org.eclipse.draw2d.Figure
org.eclipse.draw2d.Figure.FigureIterator, org.eclipse.draw2d.Figure.IdentitySearch, org.eclipse.draw2d.Figure.ReverseFigureChildrenIterator
Nested 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, toolTip
Fields inherited from interface org.eclipse.draw2d.IFigure
MAX_DIMENSION, MIN_DIMENSION, NO_INSETS
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
int
double
getMax()
double
getMin()
double
int
double
double
getValue()
boolean
boolean
protected void
layout()
boolean
manualSetValue
(double value) Set Value from manual control of the widget.protected void
pageDown()
Cause the spinner to decrease its value by its step increment;protected void
pageUp()
Cause the spinner to increase its value by its step increment;void
void
setArrowButtonsHorizontal
(boolean arrowButtonsHorizontal) Set the layout of the arrow buttonsvoid
setArrowButtonsOnLeft
(boolean arrowButtonsOnLeft) Set the position of arrow buttonsvoid
setButtonWidth
(int buttonWidth) void
setDisplayValue
(double value) Set the displayed value in the spinner.void
setEnabled
(boolean value) void
setFormatType
(SpinnerFigure.NumericFormatType formatType) void
setMax
(double max) void
setMin
(double min) void
setPageIncrement
(double pageIncrement) void
setPrecision
(int precision) void
setStepIncrement
(double stepIncrement) void
setValue
(double value) Set the value of the spinner.void
showText
(boolean isVisible) Show or hide the 'text' of the spinner.protected void
stepDown()
Cause the spinner to decrease its value by its step increment;protected void
stepUp()
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:
layout
in 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:
setEnabled
in interfaceorg.eclipse.draw2d.IFigure
- Overrides:
setEnabled
in 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:
getBeanInfo
in 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
-
-