|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectuk.ac.starlink.ttools.plot2.config.SpecifierPanel<Double>
uk.ac.starlink.ttools.plot2.config.SliderSpecifier
public class SliderSpecifier
Double value specifier that uses a slider to choose a value in the range betwen two given values. Linear and logarithmic scaling are available. The slider can optionally be accompanied by a text entry field.
Nested Class Summary | |
---|---|
static class |
SliderSpecifier.TextOption
Specifies whether and how a text display field should appear alongside the slider for user entry. |
Constructor Summary | |
---|---|
SliderSpecifier(double lo,
double hi,
boolean log,
double reset)
Constructs a specifier with minimal options. |
|
SliderSpecifier(double lo,
double hi,
boolean log,
double reset,
boolean flip,
SliderSpecifier.TextOption txtOpt)
Constructs a specifier with all options. |
Method Summary | |
---|---|
protected JComponent |
createComponent()
Abstract method called lazily during getComponent
to obtain the graphical component used by this specifier. |
JSlider |
getSlider()
Returns the slider component used by this specifier. |
double |
getSliderValue()
Returns the value currently represented by the slider, regardless of whether the slider or text field is currently active. |
Double |
getSpecifiedValue()
Returns the typed value currently specified by the graphical component. |
JTextField |
getTextField()
Returns the text entry component used by this specifier. |
double |
getTextValue()
Returns the value currently entered in the text field, regardless of whether the text field or slider is currently active. |
boolean |
isSliderActive()
Indicates whether the slider or the text field is the currently selected input component. |
void |
setSliderActive(boolean isActive)
Configures programmatically whether the slider or the text field is the currently selected input component. |
void |
setSpecifiedValue(Double dValue)
Sets the typed value represented by the graphical component. |
void |
submitReport(ReportMap report)
Accepts information about a completed plot that was drawn with input from this specifier. |
String |
valueToString(double value)
Formats a value provided by this specifier for display. |
Methods inherited from class uk.ac.starlink.ttools.plot2.config.SpecifierPanel |
---|
addActionListener, fireAction, getActionForwarder, getChangeForwarder, getComponent, isXFill, removeActionListener |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SliderSpecifier(double lo, double hi, boolean log, double reset)
lo
- slider lower boundhi
- slider upper boundlog
- true for logarithmic slider scale, false for linearreset
- value reset button resets to, or NaN for no resetpublic SliderSpecifier(double lo, double hi, boolean log, double reset, boolean flip, SliderSpecifier.TextOption txtOpt)
lo
- slider lower boundhi
- slider upper boundlog
- true for logarithmic slider scale, false for linearreset
- value reset button resets to, or NaN for no resetflip
- true to make slider values increase right to lefttxtOpt
- configures whether a text field should appear;
null means NONEMethod Detail |
---|
protected JComponent createComponent()
SpecifierPanel
getComponent
to obtain the graphical component used by this specifier.
It will be called a maximum of once. It is not necessary that
the component actually be created in this method, for instance
it may be created at construction time if that's more convenient.
createComponent
in class SpecifierPanel<Double>
public Double getSpecifiedValue()
Specifier
public void setSpecifiedValue(Double dValue)
Specifier
getSpecifiedValue
should yield the same result.
However if a value is set which is of the correct type but cannot be represented by this specifier, results are unpredictable.
dValue
- new valuepublic void submitReport(ReportMap report)
Specifier
report
- report of a plot partially specified by this objectpublic boolean isSliderActive()
public void setSliderActive(boolean isActive)
isActive
- true for slider, false for text fieldpublic double getTextValue()
public double getSliderValue()
public JSlider getSlider()
public JTextField getTextField()
public String valueToString(double value)
value
- double value as provided by this specifier
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |