Package ucar.unidata.ui.colortable
Class ColorTableEditor
java.lang.Object
ucar.unidata.ui.WindowHolder
ucar.unidata.ui.colortable.ColorTableEditor
- All Implemented Interfaces:
ActionListener,EventListener
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
FieldsFields inherited from class ucar.unidata.ui.WindowHolder
contents, dialog, frame, window -
Constructor Summary
ConstructorsConstructorDescriptionColorTableEditor(ColorTableManager colorTableManager) Create a stand alone color table editorColorTableEditor(ColorTableManager colorTableManager, ColorTable table) Create an editor for the given color tableColorTableEditor(ColorTableManager colorTableManager, ColorTable table, PropertyChangeListener listener) Create an editor for the given color table -
Method Summary
Modifier and TypeMethodDescriptionvoidHandle the action (eg: CLOSE, APPLY, CANCEL, etc).voidAdd the given property change listenervoiddoClose()Close the windowprotected voiddoMakeFileMenu(JMenu fileMenu) Add the file menu itemsprotected JMenuBarMake the menu barvoidMake the View menu.Get the canvasGet the managerGet the name of the currently edited color tablebooleangetOk()Was OK pressed_more_static voidTest mainvoidsetColorTable(String ctName) Find the color table with the given name and use itvoidSet the current color tableprotected voidSet the title of the window to the defaultstatic voidsetHelpTopDir(String topDir) voidSet the range used by the color table canvasvoidsetVisible(boolean v) Set the visiblity of the windowvoidshow()Show the windowvoidMethods inherited from class ucar.unidata.ui.WindowHolder
close, doMakeContents, getContents, getDialog, getFrame, getWindow, isShowing, removeAll, setMenuBar, setWindowTitle, shouldMakeDialog, show, showModal, toFront, windowIsClosing
-
Field Details
-
log_
For logging errors
-
-
Constructor Details
-
ColorTableEditor
Create a stand alone color table editor- Parameters:
colorTableManager- The manager
-
ColorTableEditor
Create an editor for the given color table- Parameters:
colorTableManager- The managertable- 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 managertable- 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:
showin classWindowHolder
-
getColorTableManager
Get the manager- Returns:
- The manager
-
getColorTableName
Get the name of the currently edited color table- Returns:
- The color table name
-
getWindowTitle
_more_- Overrides:
getWindowTitlein classWindowHolder- Returns:
- _more_
-
updateViewMenu
-
doMakeMenuBar
Make the menu bar- Returns:
- The menu bar
-
getCanvas
Get the canvas- Returns:
- The canvas
-
doMakeFileMenu
Add the file menu items- Parameters:
fileMenu- The file menu
-
doMakeViewMenu
public void doMakeViewMenu()Make the View menu. -
setColorTable
Find the color table with the given name and use it- Parameters:
ctName- The color table name to lookup
-
setColorTable
Set the current color table- Parameters:
ct- The new color table to use
-
setRange
Set the range used by the color table canvas- Parameters:
range- The new range
-
addPropertyChangeListener
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
Handle the action (eg: CLOSE, APPLY, CANCEL, etc).- Specified by:
actionPerformedin interfaceActionListener- Overrides:
actionPerformedin classWindowHolder- Parameters:
e- The action
-
setHelpTopDir
-
getOk
public boolean getOk()Was OK pressed- Returns:
- Are the changes ok
-
main
Test main- Parameters:
args- cmd line args
-