public class ColorTableManager extends ResourceManager
Modifier and Type | Field and Description |
---|---|
static PatternFileFilter |
FILTER_ACT
File filter used for ACT color tables
|
static PatternFileFilter |
FILTER_AWIPS2
File filter used for AWIPS II ".cmap" color tables.
|
static PatternFileFilter |
FILTER_GEM
File filter used for Gempak color tables
|
static PatternFileFilter |
FILTER_IDV
File filter used for IDV color tables
|
static PatternFileFilter |
FILTER_MCI
File filter used for McIdas color tables
|
static PatternFileFilter |
FILTER_PAL
File filter used for PAL color tables
|
static java.lang.String |
NAME_DEFAULT
THe name of the default color table
|
static java.lang.String |
PROP_CANCEL
The cancel property for PropertyChangeListeners
|
static java.lang.String |
PROP_CLOSE
The close property for PropertyChangeListeners
|
static java.lang.String |
PROP_COLORTABLE
The color table property for PropertyChangeListeners
|
static java.lang.String |
PROP_RANGE
The range property for PropertyChangeListeners
|
java.lang.String |
TAG_COLORTABLE
Xml tag name
|
java.lang.String |
TAG_COLORTABLES
Xml tag name
|
java.lang.String |
TAG_NAME
Xml tag name
|
listOfResourceLists, log_, LU, nameToObject, PROP_RESOURCECHANGE, PROP_RESOURCEREMOVE, resources, usersList, writablePath
Constructor and Description |
---|
ColorTableManager()
Create me
|
Modifier and Type | Method and Description |
---|---|
void |
doExport(NamedObject object,
java.lang.String file)
_more_
|
NamedObject |
doImport(boolean makeUnique)
Import a color table
|
ColorTableEditor |
edit(ColorTable colorTable,
java.beans.PropertyChangeListener listener)
Create a ColorTableEditor for editing the given color table
|
java.util.List |
getCategories()
Return a list (String) of the categories defined by the color tables
|
ColorTable |
getColorTable(java.lang.String name)
Lookup and return the color table identified by the given name
|
java.util.List |
getColorTables()
Return a list of all ColorTable objects
|
ColorTable |
getDefaultColorTable()
Find and return the default color table
|
protected java.lang.String |
getExportContents(NamedObject object,
java.lang.String file)
When we do an export this method is called to create the String
contents that is actually written out.
|
javax.swing.JLabel |
getLabel(java.lang.String colorTableName) |
static ColorTableManager |
getManager()
Get the singleton
|
java.util.List |
getReadFileFilters()
Return the file filters used for writing a file on an import
|
java.lang.String |
getTitle()
Overwrite the base class (ResourceManager) method to return the name
of the resource we deal with.
|
java.util.List |
getWriteFileFilters()
Return the file filters used for writing a file on an export
|
protected java.lang.Object |
initResource(ResourceCollection resources,
int index)
Check to see if these are any of the special resources
|
static void |
main(java.lang.String[] args)
Merge the programmaticcally created color tables with the ones given
on the command line.
|
void |
makeColorTableMenu(ObjectListener listener,
java.util.List l)
Make the set of color table menus.
|
void |
makeColorTableMenu(ObjectListener listener,
java.util.List l,
boolean showLocal)
Make the set of color table menus.
|
static void |
setManager(ColorTableManager theManager)
set the singleton manager
|
addPropertyChangeListener, addUsers, doExport, doImport, doImport, doNew, doNew, doNew, doSaveAs, firePropertyChange, firePropertyChange, getDefault, getEncoder, getFileFilters, getFileSuffix, getObject, getResources, getResourceTimestamp, getUsersIndex, getUsersObject, hasUsers, init, initDone, isUsers, processObject, reloadResources, removePropertyChangeListener, removeUsers, resourceExists, shouldWeIgnoreThisXml, toObject, toObject
public static final java.lang.String NAME_DEFAULT
public static final java.lang.String PROP_COLORTABLE
public static final java.lang.String PROP_RANGE
public static final java.lang.String PROP_CANCEL
public static final java.lang.String PROP_CLOSE
public java.lang.String TAG_COLORTABLES
public java.lang.String TAG_COLORTABLE
public java.lang.String TAG_NAME
public static final PatternFileFilter FILTER_IDV
public static final PatternFileFilter FILTER_GEM
public static final PatternFileFilter FILTER_MCI
public static final PatternFileFilter FILTER_PAL
public static final PatternFileFilter FILTER_ACT
public static final PatternFileFilter FILTER_AWIPS2
public void doExport(NamedObject object, java.lang.String file)
ResourceManager
doExport
in class ResourceManager
public static void setManager(ColorTableManager theManager)
theManager
- The singleton managerpublic static ColorTableManager getManager()
public java.util.List getWriteFileFilters()
getWriteFileFilters
in class ResourceManager
public java.util.List getReadFileFilters()
getReadFileFilters
in class ResourceManager
public java.lang.String getTitle()
getTitle
in class ResourceManager
public java.util.List getColorTables()
public java.util.List getCategories()
public ColorTable getDefaultColorTable()
public ColorTable getColorTable(java.lang.String name)
name
- The color table namepublic ColorTableEditor edit(ColorTable colorTable, java.beans.PropertyChangeListener listener)
colorTable
- The color table to editlistener
- Who should get changes sent to (may be null)public void makeColorTableMenu(ObjectListener listener, java.util.List l)
listener
- The listener to pass events to.l
- The list to add the JMenus topublic javax.swing.JLabel getLabel(java.lang.String colorTableName)
public void makeColorTableMenu(ObjectListener listener, java.util.List l, boolean showLocal)
listener
- The listener to pass events to.l
- The list to add the JMenus toshowLocal
- If true then add "public static void main(java.lang.String[] args)
args
- Command line arguments.protected java.lang.String getExportContents(NamedObject object, java.lang.String file)
getExportContents
in class ResourceManager
object
- The color tablefile
- The file nameprotected java.lang.Object initResource(ResourceCollection resources, int index)
initResource
in class ResourceManager
resources
- resourcesindex
- which onepublic NamedObject doImport(boolean makeUnique)
doImport
in class ResourceManager
makeUnique
- If true then we change the name of the color table so it is unique