public class ValueScale
extends org.eclipse.swt.widgets.Composite
Spinner
s on every
end and a Canvas
in between, on which the scale is drawn.HORIZONTAL, VERTICALRestriction:
This class is not intended to be subclassed.
Constructor and Description |
---|
ValueScale(org.eclipse.swt.widgets.Composite parent,
int style,
int digits,
double lowerValue,
double upperValue)
Constructs a new instance of this class given its parent and a style
value describing its appearance.
|
Modifier and Type | Method and Description |
---|---|
void |
addValueListener(ValueScaleListener listener)
Registers a
ValueScaleListener to listen to changes made to
selected values. |
void |
displayMarker(boolean displayMarker)
Determines whether the marker is to be displayed or not.
|
int |
getDigits() |
boolean |
getEditable() |
double |
getLowerValue() |
double |
getMaximum() |
double |
getMinimum() |
double |
getUpperValue() |
void |
redraw()
Calculates and draws the right scale between the two border-values.
|
void |
removeValueListener(org.eclipse.swt.events.ModifyListener listener)
Unregisters a
ValueScaleListener . |
void |
setDigits(int digits)
Sets the value-
Spinner s' digits after comma. |
void |
setEditable(boolean editable)
Determines whether the border-values are to be editable by the user or
not.
|
void |
setLowerValue(double lowerValue)
Sets the lower border-value the
ValueScale is to be representing. |
void |
setMarker(int pos)
Sets the position of a marker to the
ValueScale , displayed by a red line. |
void |
setMaxima(double minimum,
double maximum)
Sets the minimal and maximal values the
ValueScale is able to
display. |
void |
setUpperValue(double upperValue)
Sets the upper border-value the
ValueScale is to be representing. |
void |
setValues(double lowerValue,
double upperValue)
Sets both selected values at once.
|
changed, checkSubclass, computeSize, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
computeTrim, getClientArea, getHorizontalBar, getVerticalBar
addControlListener, addDragDetectListener, addFocusListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTraverseListener, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getBounds, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getParent, getRegion, getShell, getSize, getToolTipText, getVisible, internal_dispose_GC, internal_new_GC, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTraverseListener, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setFont, setForeground, setLayoutData, setLocation, setLocation, setMenu, setParent, setRedraw, setRegion, setSize, setSize, setToolTipText, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, update
public ValueScale(org.eclipse.swt.widgets.Composite parent, int style, int digits, double lowerValue, double upperValue)
parent
- Composite
in which the ValueScale is to be shown.style
- SWT
-Constant describing the ValueScale's appearance
[defaults to SWT.VERTICAL].ValueScale}
public void redraw()
redraw
in class org.eclipse.swt.widgets.Control
public void setMarker(int pos)
ValueScale
, displayed by a red line.pos
- Position of the marker to be set.public void displayMarker(boolean displayMarker)
displayMarker
- whether the marker is to be displayed or not.public void setMaxima(double minimum, double maximum)
ValueScale
is able to
display.minimum
- minimal value the ValueScale will represent.maximum
- maximal value the ValueScale will represent.public double getMinimum()
ValueScale
will represent.public double getMaximum()
ValueScale
will represent.public void setValues(double lowerValue, double upperValue)
lowerValue
- the lower border-value the ValueScale
is to be
representing.upperValue
- the upper border-value the ValueScale is to be representing.public void setLowerValue(double lowerValue)
ValueScale
is to be representing.lowerValue
- value to be set.public double getLowerValue()
public void setUpperValue(double upperValue)
ValueScale
is to be representing.upperValue
- value to be set.public double getUpperValue()
public void setEditable(boolean editable)
editable
- whether the GUI is to be editable or not.public boolean getEditable()
public void setDigits(int digits)
Spinner
s' digits after comma.digits
- number of digits to be set.public int getDigits()
Spinner
s' digits after comma.public void addValueListener(ValueScaleListener listener)
ValueScaleListener
to listen to changes made to
selected values.listener
- to be registered.public void removeValueListener(org.eclipse.swt.events.ModifyListener listener)
ValueScaleListener
.listener
- to be unregistered.