|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.awt.Component java.awt.Container javax.swing.JComponent javax.swing.JPanel visad.util.VisADSlider
public class VisADSlider
VisADSlider combines a JSlider and a JLabel and links them to either a
Real (via a DataReference) or a ScalarMap that maps to
Display.SelectValue. Changes in the slider will reflect the Real or
ScalarMap linked to it. If no bounds are specified, they will be
detected from the ScalarMap and the slider will auto-scale. Note that
a slider linked to a Real cannot auto-scale, because it has no way to
detect the bounds.
BoxLayout
doesn't handle a mixture
of the standard center-aligned widgets and VisADSliders, which
are left-aligned by default. If you have problems with widgets
being too wide, you may want to change the other widgets in
the JPanel
to align on the left
(e.g. widget.setAlignmentX(BoxLayout.LEFT_ALIGNMENT))
Nested Class Summary |
---|
Nested classes/interfaces inherited from class javax.swing.JPanel |
---|
JPanel.AccessibleJPanel |
Nested classes/interfaces inherited from class javax.swing.JComponent |
---|
JComponent.AccessibleJComponent |
Nested classes/interfaces inherited from class java.awt.Container |
---|
Container.AccessibleAWTContainer |
Nested classes/interfaces inherited from class java.awt.Component |
---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
Field Summary |
---|
Fields inherited from class javax.swing.JComponent |
---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
Fields inherited from class java.awt.Component |
---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
Fields inherited from interface java.awt.image.ImageObserver |
---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
Constructor Summary | |
---|---|
VisADSlider(DataReference ref,
float min,
float max)
construct a VisADSlider from an existing Real pointed to by r, with minimum and maximum bounds min and max |
|
VisADSlider(DataReference ref,
float min,
float max,
float start,
RealType rt,
String n)
construct a VisADSlider by creating a Real and linking it to r, using RealType rt and name n, with minimum and maximum bounds min and max, and starting value start |
|
VisADSlider(ScalarMap smap)
construct a VisADSlider from a ScalarMap that maps to Display.SelectValue, with auto-scaling minimum and maximum bounds, non-integral values, and a statically sized label. |
|
VisADSlider(ScalarMap smap,
boolean integralTicks)
construct a VisADSlider from a ScalarMap that maps to Display.SelectValue, with auto-scaling minimum and maximum bounds, either integer or floating-point values, depending on the setting of integralTicks, and a statically sized label. |
|
VisADSlider(ScalarMap smap,
boolean integralTicks,
boolean dynamicLabelWidth)
construct a VisADSlider from a ScalarMap that maps to Display.SelectValue, with auto-scaling minimum and maximum bounds, either integer or floating-point values (depending on the setting of integralTicks, and either a static or dynamically sized label (depending on the setting of dynamicLabelWidth. |
|
VisADSlider(ScalarMap smap,
float min,
float max)
construct a VisADSlider from a ScalarMap that maps to Display.SelectValue, with minimum and maximum bounds min and max, no auto-scaling, non-integer values, and a static label width. |
|
VisADSlider(String n,
int lo,
int hi,
int st,
double scale,
DataReference ref,
RealType rt)
JSlider values range between low and hi (with initial value st) and are multiplied by scale to create Real values of RealType rt referenced by ref. |
|
VisADSlider(String n,
int lo,
int hi,
int st,
double scale,
DataReference ref,
RealType rt,
boolean dynamicLabelWidth)
JSlider values range between low and hi (with initial value st) and are multiplied by scale to create Real values of RealType rt referenced by ref. |
Method Summary | |
---|---|
void |
controlChanged(ControlEvent e)
Update slider when value of linked ValueControl changes |
void |
controlChanged(ScalarMapControlEvent evt)
ScalarMapListener method used to detect new control. |
void |
hardcodeSizePercent(int percent)
Hardcode the preferred size of the slider after increasing the current width by the specified percentage (or decreasing it if percent is negative.) |
void |
mapChanged(ScalarMapEvent e)
used for auto-scaling the minimum and maximum |
void |
stateChanged(ChangeEvent e)
called when slider is adjusted |
Methods inherited from class javax.swing.JPanel |
---|
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public VisADSlider(String n, int lo, int hi, int st, double scale, DataReference ref, RealType rt) throws VisADException, RemoteException
VisADException
RemoteException
public VisADSlider(String n, int lo, int hi, int st, double scale, DataReference ref, RealType rt, boolean dynamicLabelWidth) throws VisADException, RemoteException
VisADException
RemoteException
public VisADSlider(ScalarMap smap) throws VisADException, RemoteException
VisADException
RemoteException
public VisADSlider(ScalarMap smap, boolean integralTicks) throws VisADException, RemoteException
VisADException
RemoteException
public VisADSlider(ScalarMap smap, boolean integralTicks, boolean dynamicLabelWidth) throws VisADException, RemoteException
VisADException
RemoteException
public VisADSlider(ScalarMap smap, float min, float max) throws VisADException, RemoteException
VisADException
RemoteException
public VisADSlider(DataReference ref, float min, float max, float start, RealType rt, String n) throws VisADException, RemoteException
VisADException
RemoteException
public VisADSlider(DataReference ref, float min, float max) throws VisADException, RemoteException
VisADException
RemoteException
Method Detail |
---|
public void hardcodeSizePercent(int percent)
percent
- percent of current size to use for hardcoded
size. (e.g. to keep the current size, specify
100; to increase the size a bit,
specify 115, to decrease it a bit,
specify 85, etc.)public void stateChanged(ChangeEvent e)
stateChanged
in interface ChangeListener
public void mapChanged(ScalarMapEvent e)
mapChanged
in interface ScalarMapListener
e
- the eventpublic void controlChanged(ScalarMapControlEvent evt)
controlChanged
in interface ScalarMapListener
evt
- the eventpublic void controlChanged(ControlEvent e) throws VisADException, RemoteException
controlChanged
in interface ControlListener
VisADException
RemoteException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |