|
||||||||||
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.SimpleColorMapWidget visad.util.ColorMapWidget
public class ColorMapWidget
A color widget that allows users to interactively map numeric data to
RGB/RGBA tuples in a ScalarMap
.
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 | |
---|---|
ColorMapWidget(ScalarMap smap)
Construct a LabeledColorWidget linked to the
color control in the ScalarMap (which must be to either
Display.RGB or Display.RGBA and already
have been added to a Display ). |
|
ColorMapWidget(ScalarMap smap,
boolean immediate)
Construct a LabeledColorWidget linked to the
color control in the ScalarMap (which must be to either
Display.RGB or Display.RGBA and already
have been added to a Display ). |
|
ColorMapWidget(ScalarMap smap,
float[][] table)
Construct a LabeledColorWidget linked to the
color control in the ScalarMap (which must be to either
Display.RGB or Display.RGBA and already
have been added to a Display ). |
|
ColorMapWidget(ScalarMap smap,
float[][] table,
boolean update)
Construct a LabeledColorWidget linked to the
color control in the ScalarMap (which must be to either
Display.RGB or Display.RGBA and already
have been added to a Display ). |
|
ColorMapWidget(ScalarMap smap,
float[][] table,
boolean update,
boolean immediate)
Construct a LabeledColorWidget linked to the
color control in the ScalarMap (which must be to either
Display.RGB or Display.RGBA and already
have been added to a Display ). |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent evt)
Handle button presses. |
void |
controlChanged(ControlEvent evt)
Forward changes from the Control associated with
this widget's ScalarMap to the internal
shadow Control . |
void |
controlChanged(ScalarMapControlEvent evt)
ScalarMapListener method used to detect new control. |
JPanel |
getButtonPanel()
Return the panel in which the buttons are stored. |
float[][] |
getTableView()
Gets the widget's current table. |
static void |
main(String[] args)
|
void |
mapChanged(ScalarMapEvent evt)
If the ScalarMap changes, update the slider with
the new range. |
void |
setTableView(float[][] table)
Use a new table of color values. |
Methods inherited from class visad.util.SimpleColorMapWidget |
---|
getBaseMap, getPreview, getSlider, setTable |
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 ColorMapWidget(ScalarMap smap) throws VisADException, RemoteException
LabeledColorWidget
linked to the
color control in the ScalarMap
(which must be to either
Display.RGB
or Display.RGBA and already
have been added to a Display
).
It will be labeled with the name of the ScalarMap
's
RealType and linked to the ScalarMap
's color control.
The range of RealType
values mapped to color is taken
from the ScalarMap's
range - this allows a color widget
to be used with a range of values defined by auto-scaling from
displayed data.
smap
- ScalarMap
to which this widget is bound.
RemoteException
- If there is an RMI-related problem.
VisADException
- If there is a problem initializing the
widget.public ColorMapWidget(ScalarMap smap, boolean immediate) throws VisADException, RemoteException
LabeledColorWidget
linked to the
color control in the ScalarMap
(which must be to either
Display.RGB
or Display.RGBA and already
have been added to a Display
).
It will be labeled with the name of the ScalarMap
's
RealType and linked to the ScalarMap
's color control.
The range of RealType
values mapped to color is taken
from the ScalarMap's
range - this allows a color widget
to be used with a range of values defined by auto-scaling from
displayed data.
smap
- ScalarMap
to which this widget is bound.immediate
- true
if changes are immediately
propagated to the associated Control
.
RemoteException
- If there is an RMI-related problem.
VisADException
- If there is a problem initializing the
widget.public ColorMapWidget(ScalarMap smap, float[][] table) throws VisADException, RemoteException
LabeledColorWidget
linked to the
color control in the ScalarMap
(which must be to either
Display.RGB
or Display.RGBA and already
have been added to a Display
).
It will be labeled with the name of the ScalarMap
's
RealType and linked to the ScalarMap
's color control.
The range of RealType
values mapped to color is taken
from the ScalarMap's
range - this allows a color widget
to be used with a range of values defined by auto-scaling from
displayed data.
The initial color table (if non-null)
should be a float[resolution][dimension]
, where
dimension
is either
3
for Display.RGB
or
4
for Display.RGB
) with values
between 0.0f
and 1.0f
.
smap
- ScalarMap
to which this widget is bound.table
- Initial color lookup table.
RemoteException
- If there is an RMI-related problem.
VisADException
- If there is a problem initializing the
widget.public ColorMapWidget(ScalarMap smap, float[][] table, boolean update) throws VisADException, RemoteException
LabeledColorWidget
linked to the
color control in the ScalarMap
(which must be to either
Display.RGB
or Display.RGBA and already
have been added to a Display
).
It will be labeled with the name of the ScalarMap
's
RealType and linked to the ScalarMap
's color control.
The range of RealType
values mapped to color is taken
from the ScalarMap's
range - this allows a color widget
to be used with a range of values defined by auto-scaling from
displayed data.
The initial color table (if non-null)
should be a float[resolution][dimension]
, where
dimension
is either
3
for Display.RGB
or
4
for Display.RGB
) with values
between 0.0f
and 1.0f
.
smap
- ScalarMap
to which this widget is bound.table
- Initial color lookup table.update
- true
if the slider should follow the
ScalarMap
's range.
RemoteException
- If there is an RMI-related problem.
VisADException
- If there is a problem initializing the
widget.public ColorMapWidget(ScalarMap smap, float[][] table, boolean update, boolean immediate) throws VisADException, RemoteException
LabeledColorWidget
linked to the
color control in the ScalarMap
(which must be to either
Display.RGB
or Display.RGBA and already
have been added to a Display
).
It will be labeled with the name of the ScalarMap
's
RealType and linked to the ScalarMap
's color control.
The range of RealType
values mapped to color is taken
from the ScalarMap's
range - this allows a color widget
to be used with a range of values defined by auto-scaling from
displayed data.
The initial color table (if non-null)
should be a float[resolution][dimension]
, where
dimension
is either
3
for Display.RGB
or
4
for Display.RGB
) with values
between 0.0f
and 1.0f
.
smap
- ScalarMap
to which this widget is bound.table
- Initial color lookup table.update
- true
if the slider should follow the
ScalarMap
's range.immediate
- true
if changes are immediately
propagated to the associated Control
.
RemoteException
- If there is an RMI-related problem.
VisADException
- If there is a problem initializing the
widget.Method Detail |
---|
public void setTableView(float[][] table)
table
- New color values.public float[][] getTableView()
public JPanel getButtonPanel()
public void actionPerformed(ActionEvent evt)
actionPerformed
in interface ActionListener
evt
- Data from the changed JButton
.public void controlChanged(ControlEvent evt) throws RemoteException, VisADException
Control
associated with
this widget's ScalarMap
to the internal
shadow Control
.
controlChanged
in interface ControlListener
evt
- Data from the changed Control
.
RemoteException
VisADException
public void mapChanged(ScalarMapEvent evt)
ScalarMap
changes, update the slider with
the new range.
mapChanged
in interface ScalarMapListener
evt
- Data from the changed ScalarMap
.public void controlChanged(ScalarMapControlEvent evt) throws RemoteException, VisADException
controlChanged
in interface ScalarMapListener
evt
- the event
RemoteException
- If there was an RMI-related problem.
VisADException
- If there is a problem notifying this listener.public static void main(String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |