Class MapBean

    • Constructor Detail

      • MapBean

        public MapBean()
    • 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();
         }
         }
         });