Package ucar.unidata.idv.ui
Class ValueSliderComponent
java.lang.Object
ucar.unidata.idv.ui.ValueSliderComponent
- All Implemented Interfaces:
Removable
- Direct Known Subclasses:
ValueSliderWidget
A class for holding a text field and a slider for setting the
some integer value
- Version:
- $Revision: 1.8 $
- Author:
- IDV Development Team
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionValueSliderComponent
(Object co, int min, int max, String property, String label) Create a ValueSliderComponentValueSliderComponent
(Object co, int min, int max, String property, String label, float scale, boolean andSet) Create a ValueSliderComponentValueSliderComponent
(Object co, int min, int max, String property, String label, float scale, boolean andSet, String tip) Create a ValueSliderComponent -
Method Summary
Modifier and TypeMethodDescriptionvoid
doRemove()
Remove the reference to the displayControlgetContents
(boolean withLabel) Get the GUI contentsboolean
Has the calling object been initialized? Subclasses should override if necessary.float
getValue()
Get the value of the widgetvoid
logException
(String msg, Exception exc) Shortcut to logging facility for subclasses to usevoid
setEnabled
(boolean enable) Enable or disable the widget.void
setPaintLabels
(boolean value) Set the property on the slidervoid
setPaintTicks
(boolean value) Set the property on the slidervoid
setSnapToTicks
(boolean value) Set the property on the slidervoid
setValue
(float value) Set the value on the widget.void
setValue
(int value) Set the value on the widget.
-
Field Details
-
callingObject
readout for value
-
-
Constructor Details
-
ValueSliderComponent
Create a ValueSliderComponent- Parameters:
co
- calling objectmin
- minimum slider valuemax
- maximum slider valueproperty
- Object's property to setlabel
- label for the widget
-
ValueSliderComponent
public ValueSliderComponent(Object co, int min, int max, String property, String label, float scale, boolean andSet) Create a ValueSliderComponent- Parameters:
co
- calling objectmin
- minimum slider valuemax
- maximum slider valueproperty
- Object's property to setlabel
- label for the widgetscale
- scale factor for the valuesandSet
- set the property on the calling object if true
-
ValueSliderComponent
public ValueSliderComponent(Object co, int min, int max, String property, String label, float scale, boolean andSet, String tip) Create a ValueSliderComponent- Parameters:
co
- calling objectmin
- minimum slider valuemax
- maximum slider valueproperty
- calling object property to setlabel
- label for the widgetscale
- scale factor for the valuesandSet
- set the property on the calling object if truetip
- tool tip text for the widget
-
-
Method Details
-
getContents
Get the GUI contents- Parameters:
withLabel
- true if the component should include the label- Returns:
- the component
-
setValue
public void setValue(int value) Set the value on the widget.- Parameters:
value
- new value
-
setValue
public void setValue(float value) Set the value on the widget.- Parameters:
value
- new value
-
getValue
public float getValue()Get the value of the widget- Returns:
- new value
-
setEnabled
public void setEnabled(boolean enable) Enable or disable the widget.- Parameters:
enable
- true to enable
-
setSnapToTicks
public void setSnapToTicks(boolean value) Set the property on the slider- Parameters:
value
- true to snap slider to ticks
-
setPaintTicks
public void setPaintTicks(boolean value) Set the property on the slider- Parameters:
value
- true to paint slider ticks
-
setPaintLabels
public void setPaintLabels(boolean value) Set the property on the slider- Parameters:
value
- true to paint slider labels
-
getObjectHasInitialized
public boolean getObjectHasInitialized()Has the calling object been initialized? Subclasses should override if necessary.- Returns:
- true
-
logException
Shortcut to logging facility for subclasses to use- Parameters:
msg
- error messageexc
- error Exception
-
doRemove
public void doRemove()Remove the reference to the displayControl
-