Package ucar.nc2.ui.gis
Class MapBean
- java.lang.Object
-
- ucar.nc2.ui.gis.MapBean
-
- Direct Known Subclasses:
ShapeFileBean
,WorldMapBean
public abstract class MapBean extends Object
Wrap map Renderers as beans.
-
-
Constructor Summary
Constructors Constructor Description MapBean()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description void
addPropertyChangeListener(PropertyChangeListener l)
Add a PropertyChangeEvent Listener.protected void
firePropertyChangeEvent(PropertyChangeEvent event)
protected void
firePropertyChangeEvent(Object source, String propertyName, Object oldValue, Object newValue)
Action
getAction()
Construct the Action that is called when this bean's menu item/buttcon is selected.abstract String
getActionDesc()
abstract String
getActionName()
abstract ImageIcon
getIcon()
abstract Renderer
getRenderer()
Each bean has one Renderer, made current when Action is calledstatic PopupMenu
getStandardMapSelectButton(PropertyChangeListener pcl)
static PopupMenu
makeMapSelectButton()
Convenience routine to make a button with a popup menu attached.void
removePropertyChangeListener(PropertyChangeListener l)
Remove a PropertyChangeEvent Listener.
-
-
-
Method Detail
-
getIcon
public abstract ImageIcon getIcon()
-
getActionName
public abstract String getActionName()
-
getActionDesc
public abstract String getActionDesc()
-
getRenderer
public abstract Renderer getRenderer()
Each bean has one Renderer, made current when Action is called
-
getAction
public Action getAction()
Construct the Action that is called when this bean's menu item/buttcon is selected. Typically this routine is only called once when the bean is added. The Action itself is called whenever the menu/buttcon is selected. The action should have NAME, SMALL_ICON and SHORT_DESC properties set. The applications uses these to put up a buttcon and menu item. The actionPerformed() method may do various things, but it must send a PropertyChangeEvent with newValue = Renderer.- Returns:
- the Action to be called.
-
addPropertyChangeListener
public void addPropertyChangeListener(PropertyChangeListener l)
Add a PropertyChangeEvent Listener.
-
removePropertyChangeListener
public void removePropertyChangeListener(PropertyChangeListener l)
Remove a PropertyChangeEvent Listener.
-
firePropertyChangeEvent
protected void firePropertyChangeEvent(Object source, String propertyName, Object oldValue, Object newValue)
-
firePropertyChangeEvent
protected void firePropertyChangeEvent(PropertyChangeEvent event)
-
makeMapSelectButton
public static PopupMenu makeMapSelectButton()
Convenience routine to make a button with a popup menu attached. to use:thredds.ui.PopupMenu mapBeanMenu = MapBean.makeMapSelectButton(); AbstractButton butt = (AbstractButton) mapBeanMenu.getParentComponent(); addToMenu (butt); // add map beans here mapBeanMenu.addAction( mb.getActionDesc(), mb.getIcon(), mb.getAction()); mb.addPropertyChangeListener( new PropertyChangeListener() { public void propertyChange( java.beans.PropertyChangeEvent e) { if (e.getPropertyName().equals("Renderer")) { mapRender = (thredds.viewer.ui.Renderer) e.getNewValue(); mapRender.setProjection( np.getProjectionImpl()); redraw(); } } });
-
getStandardMapSelectButton
public static PopupMenu getStandardMapSelectButton(PropertyChangeListener pcl)
-
-