ucar.unidata.ui.colortable
Class ColorTableEditor

java.lang.Object
  extended by ucar.unidata.ui.WindowHolder
      extended by ucar.unidata.ui.colortable.ColorTableEditor
All Implemented Interfaces:
ActionListener, EventListener

public class ColorTableEditor
extends WindowHolder

Class ColorTableEditor handles some of the editing of colortables. It wraps a ColorTableCanvas that does most of the actual work but this class serves as the intermediary between the canvas and calling code

Author:
IDV development team

Field Summary
static LogUtil.LogCategory log_
          For logging errors
 
Fields inherited from class ucar.unidata.ui.WindowHolder
contents, dialog, frame, window
 
Constructor Summary
ColorTableEditor(ColorTableManager colorTableManager)
          Create a stand alone color table editor
ColorTableEditor(ColorTableManager colorTableManager, ColorTable table)
          Create an editor for the given color table
ColorTableEditor(ColorTableManager colorTableManager, ColorTable table, PropertyChangeListener listener)
          Create an editor for the given color table
 
Method Summary
 void actionPerformed(ActionEvent e)
          Handle the action (eg: CLOSE, APPLY, CANCEL, etc).
 void addPropertyChangeListener(PropertyChangeListener listener)
          Add the given property change listener
 void doClose()
          Close the window
protected  void doMakeFileMenu(JMenu fileMenu)
          Add the file menu items
protected  JMenuBar doMakeMenuBar()
          Make the menu bar
 void doMakeViewMenu()
          Make the View menu.
 ColorTableCanvas getCanvas()
          Get the canvas
 ColorTableManager getColorTableManager()
          Get the manager
 String getColorTableName()
          Get the name of the currently edited color table
 boolean getOk()
          Was OK pressed
 String getWindowTitle()
          _more_
static void main(String[] args)
          Test main
 void setColorTable(ColorTable ct)
          Set the current color table
 void setColorTable(String ctName)
          Find the color table with the given name and use it
protected  void setDialogTitle()
          Set the title of the window to the default
static void setHelpTopDir(String topDir)
           
 void setRange(Range range)
          Set the range used by the color table canvas
 void setVisible(boolean v)
          Set the visiblity of the window
 void show()
          Show the window
 void updateViewMenu(JMenu m)
           
 
Methods inherited from class ucar.unidata.ui.WindowHolder
close, doMakeContents, getContents, getDialog, getFrame, getWindow, isShowing, removeAll, setWindowTitle, shouldMakeDialog, show, showModal, toFront, windowIsClosing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log_

public static LogUtil.LogCategory log_
For logging errors

Constructor Detail

ColorTableEditor

public ColorTableEditor(ColorTableManager colorTableManager)
Create a stand alone color table editor

Parameters:
colorTableManager - The manager

ColorTableEditor

public ColorTableEditor(ColorTableManager colorTableManager,
                        ColorTable table)
Create an editor for the given color table

Parameters:
colorTableManager - The manager
table - The color table (may be null)

ColorTableEditor

public ColorTableEditor(ColorTableManager colorTableManager,
                        ColorTable table,
                        PropertyChangeListener listener)
Create an editor for the given color table

Parameters:
colorTableManager - The manager
table - The color table (may be null)
listener - The property change listener to route events to. May be null
Method Detail

show

public void show()
Show the window

Overrides:
show in class WindowHolder

getColorTableManager

public ColorTableManager getColorTableManager()
Get the manager

Returns:
The manager

getColorTableName

public String getColorTableName()
Get the name of the currently edited color table

Returns:
The color table name

getWindowTitle

public String getWindowTitle()
_more_

Overrides:
getWindowTitle in class WindowHolder
Returns:
_more_

updateViewMenu

public void updateViewMenu(JMenu m)

doMakeMenuBar

protected JMenuBar doMakeMenuBar()
Make the menu bar

Returns:
The menu bar

getCanvas

public ColorTableCanvas getCanvas()
Get the canvas

Returns:
The canvas

doMakeFileMenu

protected void doMakeFileMenu(JMenu fileMenu)
Add the file menu items

Parameters:
fileMenu - The file menu

doMakeViewMenu

public void doMakeViewMenu()
Make the View menu.


setColorTable

public void setColorTable(String ctName)
Find the color table with the given name and use it

Parameters:
ctName - The color table name to lookup

setColorTable

public void setColorTable(ColorTable ct)
Set the current color table

Parameters:
ct - The new color table to use

setRange

public void setRange(Range range)
Set the range used by the color table canvas

Parameters:
range - The new range

addPropertyChangeListener

public void addPropertyChangeListener(PropertyChangeListener listener)
Add the given property change listener

Parameters:
listener - The listener to route events to.

setVisible

public void setVisible(boolean v)
Set the visiblity of the window

Parameters:
v - On or off.

setDialogTitle

protected void setDialogTitle()
Set the title of the window to the default


doClose

public void doClose()
Close the window


actionPerformed

public void actionPerformed(ActionEvent e)
Handle the action (eg: CLOSE, APPLY, CANCEL, etc).

Specified by:
actionPerformed in interface ActionListener
Overrides:
actionPerformed in class WindowHolder
Parameters:
e - The action

setHelpTopDir

public static void setHelpTopDir(String topDir)

getOk

public boolean getOk()
Was OK pressed

Returns:
Are the changes ok

main

public static void main(String[] args)
Test main

Parameters:
args - cmd line args