public class GSliderReal extends GSliderAbstract implements GDisplay, ChangeListener
GComponent.CopyPasteOperation, GComponent.DisplayIndicatorStatus, GComponent.ItemType, GComponent.Operation
NAME_ATTRIBUTE
Constructor and Description |
---|
GSliderReal(String orientation,
double minVal,
double maxVal,
double initVal,
double spacing,
int fracDigits)
Creates a GSlider widget based on a JSlider.
|
GSliderReal(String widgetId,
String orientation,
double minVal,
double maxVal,
double initVal,
double spacing,
int fracDigits)
Creates a GSlider widget based on a JSlider.
|
Modifier and Type | Method and Description |
---|---|
void |
display()
Called when the element is to be displayed, so it can perform the actions required for its display, and
the display of its inmmediate descendants.
|
Component |
getComponent()
Returns the low level Swing Component encapsulated by the class if any, otherwise returns
null.
|
String |
getFormattedValue(Number value)
Return the value of the slider in the SCIENTIFIC format that shall be used to read/write from/to file.
|
int |
getFracDigits()
Get the number of fractional digits.
|
JSlider |
getJSlider()
Get the Swing JSlider object.
|
Number |
getMajorTickSpacing()
This method gets the major tick spacing.
|
Number |
getMaxVal()
Get the maximum value of the slider.
|
Number |
getMinVal()
Get the minimum value of the slider.
|
boolean |
getPaintLabels()
Tells if labels are to be painted.
|
boolean |
getPaintTicks()
Tells if the track (area the slider slides in) is to be painted.
|
Number |
getValue()
Get the current value of the widget.
|
void |
setFracDigits(int fracDigits)
Set the number of fractional digits.
|
void |
setMajorTickSpacing(Number spacing)
This method sets the major tick spacing.
|
void |
setMaxVal(double value)
Set the value of the slider.
|
void |
setMinVal(double value)
Set the value of the slider.
|
void |
setPaintLabels(boolean flag)
Determines whether labels are painted on the slider.
|
void |
setPaintTicks(boolean flag)
Determines whether the track is painted on the slider.
|
void |
setValue(Number value)
Set the value of the widget.
|
void |
stateChanged(ChangeEvent e) |
activateConstraintsByType, attachCopyPasteMenu, attachCopyPasteMenu, beginOfElement, beginOfElement, beginOfElement, beginOfElement, clearAllInnerDescendantConstraint, clearConstraint, clearInnerDescendantContraint, composeWidgetId, doDisplay, endOfElement, getCommentInConfigFile, getConstraint, getCurrentOperation, getDisplayIndicatorStatus, getDisplayIsModifiedIndicator, getElement, getGClassName, getGPanel, getGParent, getGUnitInConfigFile, getInnerDescendantConstraint, getName, getNameInConfigFile, getOperationSaveValue, getPathInConfigFile, getSimpleWidgetId, getStatus, getStringConstraint, getSubComponent, getWidgetId, handleCopyPasteEvent, handleCopyPasteEvent, handleProcessEventException, isCopyPasteEvent, isEnabled, isForcedStatus, isModified, launchInvalidPositionException, mouseWheelMoved, parseSimpleConstraint, processGEvent, processMouseWheelEvent, setBusyCursor, setCommentInConfigFile, setConstraint, setCopyPasteMenuEnabled, setCurrentOperation, setDataForConstraintsByType, setDefaultConstraints, setDisplayIsModifiedIndicator, setElement, setEnabled, setForcedStatus, setGPanel, setGParent, setGUnitInConfigFile, setInnerDescendantConstraint, setName, setNameAndCommentInConfigFile, setNameInConfigFile, setPathInConfigFile, setStatus, setStringConstraint, setToolTipText, setWidgetId, setWidth, setWindowBusyCursor, updateIsModifiedIndicator, writeCollection, writeCollection, writeCollection, writeCollection, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem, writeConfigItem
public GSliderReal(String orientation, double minVal, double maxVal, double initVal, double spacing, int fracDigits)
orientation
- of the slider, can have the values "VERTICAL" or "HORIZONTAL", defaults to "HORIZONTAL".minVal
- minimum value.maxVal
- maximum value.initVal
- initial value.spacing
- spacing between the ticks.fracDigits
- number of significant digits after the decimal point in the labels.public GSliderReal(String widgetId, String orientation, double minVal, double maxVal, double initVal, double spacing, int fracDigits)
widgetId
- widget identifierorientation
- of the slider, can have the value "VERTICAL" or "HORIZONTAL", default is "HORIZONTAL".minVal
- minimum value.maxVal
- maximum value.initVal
- initial value.spacing
- spacing between the ticks.fracDigits
- number of significant digits after the decimal point in the labels.public void display()
public void stateChanged(ChangeEvent e)
stateChanged
in interface ChangeListener
public Component getComponent()
getComponent
in class GComponent
public JSlider getJSlider()
getJSlider
in class GSliderAbstract
public boolean getPaintTicks()
getPaintTicks
in class GSliderAbstract
public final void setPaintTicks(boolean flag)
setPaintTicks
in class GSliderAbstract
flag
- whether or not to paint the slider track.public boolean getPaintLabels()
getPaintLabels
in class GSliderAbstract
public final void setPaintLabels(boolean flag)
setPaintLabels
in class GSliderAbstract
flag
- whether or not to paint labelspublic final void setMajorTickSpacing(Number spacing)
setMajorTickSpacing
in class GSliderAbstract
spacing
- new value for the majorTickSpacing property.public Number getMajorTickSpacing()
getMajorTickSpacing
in class GSliderAbstract
public void setFracDigits(int fracDigits)
fracDigits
- number of fractional digits.public int getFracDigits()
public Number getValue()
getValue
in class GSliderAbstract
public void setValue(Number value) throws GArithmeticException
setValue
in class GSliderAbstract
value
- new value of the widget.GArithmeticException
- if value is NaNpublic Number getMinVal()
getMinVal
in class GSliderAbstract
public void setMinVal(double value)
value
- new value of the slider.public Number getMaxVal()
getMaxVal
in class GSliderAbstract
public void setMaxVal(double value)
value
- new value of the slider.Copyright © 2024. All rights reserved.