Package ucar.unidata.view.geoloc
Class ProjectionManager
java.lang.Object
ucar.unidata.view.geoloc.ProjectionManager
- All Implemented Interfaces:
ActionListener
,EventListener
Manages a modal dialogue box that allows the user to define
projections using subclasses of ucar.unidata.gis.ProjectionImpl.
1) It uses bean introspection on ProjectionImpl subclasses to dynamically configure edit fields for the projection's parameters. The subclass should define getXXX() and setXXX() methods for each parameter. 3) when the user selects a projection, a NewProjectionEvent is sent to any listeners 4) currently the list of possible projection classes is maintained as a hard-wired list of class names. This should be rethunk.
- Version:
- $Revision: 1.57 $
- Author:
- John Caron
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructorProjectionManager
(RootPaneContainer parent) Create a new ProjectionManagerProjectionManager
(RootPaneContainer parent, boolean makeDialog) Create a new ProjectionManager.ProjectionManager
(RootPaneContainer parent, Object dummy) Create a new ProjectionManager.ProjectionManager
(RootPaneContainer parent, List projections) Create a new ProjectionManager.ProjectionManager
(RootPaneContainer parent, List projections, boolean makeDialog) Create a new ProjectionManager.ProjectionManager
(RootPaneContainer parent, List projections, boolean makeDialog, String helpId) Create a new ProjectionManager.ProjectionManager
(RootPaneContainer parent, List projections, boolean makeDialog, String helpId, List maps) Create a new ProjectionManager. -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept()
Accept a change.void
actionPerformed
(ActionEvent event) Handle action eventsstatic void
addDefaultProjection
(String projectionClass) Add the given class to the list of default projectionsvoid
Add a property change listener.void
close()
Close this widgetboolean
See if the manager contains the projection by name.void
destroy()
Destroy this objectvoid
doDelete()
Delete the selected projection.void
doEdit()
_more_void
doExport()
Export a list of user selected projectionsvoid
doNew()
_more_void
edit
(boolean isNew) Edit a projection.Get the contents as a component.static List
Create the list of default projection classesGet this as a dialog.Get the name of this manager to put in a menuGet the Class type of the objects managed; must implement Serializable, CloneableGet the list of projections that this manager managesGet the currently selected object, of type getPersistentObjectClass()static void
Test the classstatic List
Make the default projections from the internal list of classes.void
Remove a property change listener.void
saveProjection
(ucar.unidata.geoloc.ProjectionImpl proj) Store this Projection in the data tablevoid
Set the list of maps to use in this ProjectionManagervoid
setProjections
(List list) Set the list of projections for this managervoid
setSelection
(PersistentObject select) Set the currently selected thing: must be of type getPersistentObjectClass().void
show()
Popup the Manager Dialogvoid
Dummy method for stores
-
Field Details
-
PROPERTY_CHANGE
property change identifier- See Also:
-
-
Constructor Details
-
ProjectionManager
public ProjectionManager()Default constructor -
ProjectionManager
Create a new ProjectionManager.- Parameters:
parent
- parent containerdummy
- dummy argument for clients that try to pass in a store
-
ProjectionManager
Create a new ProjectionManager- Parameters:
parent
- parent container
-
ProjectionManager
Create a new ProjectionManager.- Parameters:
parent
- parent containermakeDialog
- true to make this a dialog
-
ProjectionManager
Create a new ProjectionManager.- Parameters:
parent
- JFrame (application) or JApplet (applet)projections
- list of initial projections
-
ProjectionManager
Create a new ProjectionManager.- Parameters:
parent
- JFrame (application) or JApplet (applet)projections
- list of initial projectionsmakeDialog
- true to make this a dialog
-
ProjectionManager
public ProjectionManager(RootPaneContainer parent, List projections, boolean makeDialog, String helpId) Create a new ProjectionManager.- Parameters:
parent
- JFrame (application) or JApplet (applet)projections
- list of initial projectionsmakeDialog
- true to make this a dialoghelpId
- help id if dialog
-
ProjectionManager
public ProjectionManager(RootPaneContainer parent, List projections, boolean makeDialog, String helpId, List maps) Create a new ProjectionManager.- Parameters:
parent
- JFrame (application) or JApplet (applet)projections
- list of initial projectionsmakeDialog
- true to make this a dialoghelpId
- help id if dialogmaps
- List of MapData
-
-
Method Details
-
addDefaultProjection
Add the given class to the list of default projections- Parameters:
projectionClass
- The class
-
getDefaultProjections
Create the list of default projection classes- Returns:
- list of default projection classes
-
storePersistentData
public void storePersistentData()Dummy method for stores -
actionPerformed
Handle action events- Specified by:
actionPerformed
in interfaceActionListener
- Parameters:
event
- event to handle
-
close
public void close()Close this widget -
doExport
public void doExport()Export a list of user selected projections -
makeDefaultProjections
Make the default projections from the internal list of classes.- Returns:
- list of default projections
-
setMaps
Set the list of maps to use in this ProjectionManager- Parameters:
maps
- list of MapData's (may be null)
-
setProjections
Set the list of projections for this manager- Parameters:
list
- list of projections
-
getProjections
Get the list of projections that this manager manages- Returns:
- list of projections
-
getManagerName
Get the name of this manager to put in a menu- Returns:
- manager name
-
getPersistentObjectClass
Get the Class type of the objects managed; must implement Serializable, Cloneable- Returns:
- the type of class that this manager manages
-
getContents
Get the contents as a component.- Returns:
- the contents
-
addPropertyChangeListener
Add a property change listener.- Parameters:
l
- listener to add
-
removePropertyChangeListener
Remove a property change listener.- Parameters:
l
- listener to remove
-
getDialog
Get this as a dialog.- Returns:
- the dialog or null if not made as a dialog
-
show
public void show()Popup the Manager Dialog -
destroy
public void destroy()Destroy this object -
getSelection
Get the currently selected object, of type getPersistentObjectClass()- Returns:
- currently selected object
-
setSelection
Set the currently selected thing: must be of type getPersistentObjectClass(). This does NOT fire a PropertyChangeEvent- Parameters:
select
- the object to select.
-
accept
public void accept()Accept a change. -
contains
See if the manager contains the projection by name.- Parameters:
id
- name of projection- Returns:
- true if the projection is managed by this
-
doDelete
public void doDelete()Delete the selected projection. -
doEdit
public void doEdit()_more_ -
doNew
public void doNew()_more_ -
edit
public void edit(boolean isNew) Edit a projection. Used to change an existing projection or add a new one.- Parameters:
isNew
- true if this is a new projection.
-
saveProjection
public void saveProjection(ucar.unidata.geoloc.ProjectionImpl proj) Store this Projection in the data table- Parameters:
proj
- the Projection to store
-
main
Test the class- Parameters:
args
- not used
-