Class ColorTableEditor

java.lang.Object
ucar.unidata.ui.WindowHolder
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 Details

  • Constructor Details

    • 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 Details

    • 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