public abstract class MapBean
extends java.lang.Object
Constructor and Description |
---|
MapBean() |
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener l)
Add a PropertyChangeEvent Listener.
|
protected void |
firePropertyChangeEvent(java.lang.Object source,
java.lang.String propertyName,
java.lang.Object oldValue,
java.lang.Object newValue) |
protected void |
firePropertyChangeEvent(java.beans.PropertyChangeEvent event) |
javax.swing.Action |
getAction()
Construct the Action that is called when this bean's menu item/buttcon is selected.
|
abstract java.lang.String |
getActionDesc() |
abstract java.lang.String |
getActionName() |
abstract javax.swing.ImageIcon |
getIcon() |
abstract Renderer |
getRenderer()
Each bean has one Renderer, made current when Action is called
|
static PopupMenu |
getStandardMapSelectButton(java.beans.PropertyChangeListener pcl) |
static PopupMenu |
makeMapSelectButton()
Convenience routine to make a button with a popup menu attached.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener l)
Remove a PropertyChangeEvent Listener.
|
public abstract javax.swing.ImageIcon getIcon()
public abstract java.lang.String getActionName()
public abstract java.lang.String getActionDesc()
public abstract Renderer getRenderer()
public javax.swing.Action getAction()
public void addPropertyChangeListener(java.beans.PropertyChangeListener l)
public void removePropertyChangeListener(java.beans.PropertyChangeListener l)
protected void firePropertyChangeEvent(java.lang.Object source, java.lang.String propertyName, java.lang.Object oldValue, java.lang.Object newValue)
protected void firePropertyChangeEvent(java.beans.PropertyChangeEvent event)
public static PopupMenu makeMapSelectButton()
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(); } } });
public static PopupMenu getStandardMapSelectButton(java.beans.PropertyChangeListener pcl)