ucar.unidata.idv.control
Class ColorTableWidget

java.lang.Object
  extended by ucar.unidata.idv.control.ControlWidget
      extended by ucar.unidata.idv.control.ColorTableWidget
All Implemented Interfaces:
ActionListener, PropertyChangeListener, EventListener, RangeWidget

public class ColorTableWidget
extends ControlWidget
implements PropertyChangeListener, RangeWidget

A ControlWidget for the color table information in the control window

Version:
$Revision: 1.105 $
Author:
Jeff McWhirter

Constructor Summary
ColorTableWidget(DisplayControlImpl theDisplayControl, ColorTable ct)
          Construct a ColorTableWidget
ColorTableWidget(DisplayControlImpl theDisplayControl, ColorTableManager colorTableManager, ColorTable ct, Range r)
          Construct a ColorTableWidget
 
Method Summary
 void doEdit()
          Called to edit color table
 void doRemove()
          Called to remove this from the display.
 void doUseDefault()
          use the default colortable
 void fillList(List l, int columns)
          Fill the list of components and set them in a certain number of columns.
 JComponent getLegendPanel(int legendType)
          Get the component for the legend panel.
 Range getRange()
          Get the range for the data
 JMenu makeMenu()
          Make the menu for the color table.
 ArrayList makeMenuItems()
          Make the menu items for the widget.
 void propertyChange(PropertyChangeEvent e)
          Public implemenation for property changes
 void rangePopup()
          Show the change range dialog
protected  void revertToDefaultRange()
          Revert to the default range of the color table (control dependent)
 void setColorPalette(float[][] palette)
          Set the color palette on the previews.
 void setColorTable(ColorTable colorTable)
          Set the color table.
 void setRange(Range r)
          Set the range for the color table.
 void setRangeDialog(Range r)
          Set the value in the min max fields in the range dialog
 void setRangeFromPopup(String cmd)
          Set the range in the dialog
 void setTransparency(Integer v)
          Set the transparency
 void showChangeRangeDialog()
          Change the range
 void showMenu(Component from)
          Show menu anchored at the component location
 
Methods inherited from class ucar.unidata.idv.control.ControlWidget
actionPerformed, fillList, fillList, getDisplayControl, getDisplayConventions, logException, userMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColorTableWidget

public ColorTableWidget(DisplayControlImpl theDisplayControl,
                        ColorTableManager colorTableManager,
                        ColorTable ct,
                        Range r)
                 throws RemoteException,
                        VisADException
Construct a ColorTableWidget

Parameters:
theDisplayControl - the associated DisplayControl
colorTableManager - the color table manager
ct - the color table
r - range for the table
Throws:
RemoteException - Java RMI error
VisADException - VisAD error

ColorTableWidget

public ColorTableWidget(DisplayControlImpl theDisplayControl,
                        ColorTable ct)
                 throws RemoteException,
                        VisADException
Construct a ColorTableWidget

Parameters:
theDisplayControl - the associated DisplayControl
ct - the color table
Throws:
RemoteException - Java RMI error
VisADException - VisAD error
Method Detail

doRemove

public void doRemove()
Called to remove this from the display.

Overrides:
doRemove in class ControlWidget

getLegendPanel

public JComponent getLegendPanel(int legendType)
Get the component for the legend panel.

Parameters:
legendType - type of legend
Returns:
component for legend panel
See Also:
DisplayControl.BOTTOM_LEGEND, DisplayControl.SIDE_LEGEND

setRangeFromPopup

public void setRangeFromPopup(String cmd)
Set the range in the dialog

Parameters:
cmd - Which one

setRangeDialog

public void setRangeDialog(Range r)
Set the value in the min max fields in the range dialog

Specified by:
setRangeDialog in interface RangeWidget
Parameters:
r - The range

rangePopup

public void rangePopup()
Show the change range dialog


showChangeRangeDialog

public void showChangeRangeDialog()
Change the range


doEdit

public void doEdit()
Called to edit color table


propertyChange

public void propertyChange(PropertyChangeEvent e)
Public implemenation for property changes

Specified by:
propertyChange in interface PropertyChangeListener
Parameters:
e - event for property change.

showMenu

public void showMenu(Component from)
Show menu anchored at the component location

Parameters:
from - component for anchoring

makeMenu

public JMenu makeMenu()
Make the menu for the color table.

Returns:
menu of menu items.
See Also:
makeMenuItems()

doUseDefault

public void doUseDefault()
use the default colortable


setTransparency

public void setTransparency(Integer v)
Set the transparency

Parameters:
v - Integer, 0-100, of the inverse transparency

makeMenuItems

public ArrayList makeMenuItems()
Make the menu items for the widget.

Returns:
the list of menus

revertToDefaultRange

protected void revertToDefaultRange()
Revert to the default range of the color table (control dependent)


getRange

public Range getRange()
Get the range for the data

Returns:
the range

setRange

public void setRange(Range r)
Set the range for the color table.

Parameters:
r - range of table

setColorPalette

public void setColorPalette(float[][] palette)
                     throws RemoteException,
                            VisADException
Set the color palette on the previews.

Parameters:
palette - new palette
Throws:
RemoteException - Java RMI error
VisADException - VisAD error

setColorTable

public void setColorTable(ColorTable colorTable)
                   throws RemoteException,
                          VisADException
Set the color table.

Parameters:
colorTable - new color table
Throws:
RemoteException - Java RMI error
VisADException - VisAD error

fillList

public void fillList(List l,
                     int columns)
Fill the list of components and set them in a certain number of columns.

Overrides:
fillList in class ControlWidget
Parameters:
l - List of components
columns - number of columns