## com.bbn.openmap.event
Class ProjMapBeanKeyListener

    java.lang.Object
      com.bbn.openmap.MapHandlerChild
          com.bbn.openmap.OMComponent
              com.bbn.openmap.event.MapBeanKeyListener
                  com.bbn.openmap.event.ProjMapBeanKeyListener

All Implemented Interfaces:
  java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, java.util.EventListener, java.awt.event.KeyListener, LightMapHandlerChild, ProjectionStackTrigger, PropertyConsumer

public class ProjMapBeanKeyListener
extends MapBeanKeyListener
implements ProjectionStackTrigger

The ProjMapBeanKeyListener is a KeyListener that gets events when the MapBean has focus, and responds to certain keys by changing the projection. The arrow keys pan the map, and 'z' zooms in. Shift-z zooms out. The less than/comma key tells a projection stack to go back to the last projection, and the greater than/period tells it to go to the next projection. The MapBean has to have focus for these to work which is usually gained by clicking on the map.

Field Summary
`protected PanSupport` `panners`
`protected ListenerSupport` `projListeners`
`protected ZoomSupport` `zoomers`
`protected float` `zoomFactor` Default Zoom In Factor is 2, meaning that the scale number will be cut in half to zoom in and doubled to zoom out.

Fields inherited from class com.bbn.openmap.event.MapBeanKeyListener
`mapBean`

Fields inherited from class com.bbn.openmap.OMComponent
`i18n, propertyPrefix`

Fields inherited from class com.bbn.openmap.MapHandlerChild
`beanContextChildSupport`

Fields inherited from interface com.bbn.openmap.PropertyConsumer
`EditorProperty, initPropertiesProperty, LabelEditorProperty, ScopedEditorProperty`

Constructor Summary
`ProjMapBeanKeyListener()`

Method Summary
`void` `addActionListener(java.awt.event.ActionListener al)` Add an ActionListener for events that trigger events to shift the Projection stack.
`void` `findAndInit(java.lang.Object someObj)` In addition to the MapBean, find a projection stack so the less than/greater than works on that.
`void` `findAndUndo(java.lang.Object someObj)` The childrenRemoved has been changed to go through its iterator to call this method with every object.
`protected void` `fireProjectionStackEvent(java.lang.String command)` Called by keyReleased when the period/comma keys are pressed.
`void` `keyReleased(java.awt.event.KeyEvent e)`
`void` `removeActionListener(java.awt.event.ActionListener al)` Remove an ActionListener that receives events that trigger events to shift the Projection stack.
`void` `setMapBean(MapBean map)` In addition to the super.setMapBean() method, also sets the MapBean as a zoom and pan listener.
`void` `updateProjectionStackStatus(boolean containsBackProjections, boolean containsForwardProjections)` To receive a status to let the trigger know if any projections in the forward or backward stacks exist, possibly to disable any gui widgets.

Methods inherited from class com.bbn.openmap.event.MapBeanKeyListener
`getMapBean, keyPressed, keyTyped`

Methods inherited from class com.bbn.openmap.OMComponent
`getProperties, getPropertyInfo, getPropertyPrefix, setProperties, setProperties, setPropertyPrefix`

Methods inherited from class com.bbn.openmap.MapHandlerChild
`addPropertyChangeListener, addVetoableChangeListener, childrenAdded, childrenRemoved, findAndInit, firePropertyChange, fireVetoableChange, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### zoomFactor

    protected transient float zoomFactor

  Default Zoom In Factor is 2, meaning that the scale number will be cut in half to zoom in and doubled to zoom out.

### panners

    protected PanSupport panners

### zoomers

    protected ZoomSupport zoomers

### projListeners

    protected ListenerSupport projListeners

Constructor Detail

### ProjMapBeanKeyListener

    public ProjMapBeanKeyListener()

Method Detail

### keyReleased

    public void keyReleased(java.awt.event.KeyEvent e)

  Specified by:
    `keyReleased` in interface `java.awt.event.KeyListener`
  Overrides:
    `keyReleased` in class `MapBeanKeyListener`

### setMapBean

    public void setMapBean(MapBean map)

  In addition to the super.setMapBean() method, also sets the MapBean as a zoom and pan listener.

  Overrides:
    `setMapBean` in class `MapBeanKeyListener`

### fireProjectionStackEvent

    protected void fireProjectionStackEvent(java.lang.String command)

  Called by keyReleased when the period/comma keys are pressed.

### addActionListener

    public void addActionListener(java.awt.event.ActionListener al)

  Add an ActionListener for events that trigger events to shift the Projection stack.

  Specified by:
    `addActionListener` in interface `ProjectionStackTrigger`

### removeActionListener

    public void removeActionListener(java.awt.event.ActionListener al)

  Remove an ActionListener that receives events that trigger events to shift the Projection stack.

  Specified by:
    `removeActionListener` in interface `ProjectionStackTrigger`

### updateProjectionStackStatus

    public void updateProjectionStackStatus(boolean containsBackProjections,
                                            boolean containsForwardProjections)

  To receive a status to let the trigger know if any projections in the forward or backward stacks exist, possibly to disable any gui widgets. Does nothing, we don't care here.

  Specified by:
    `updateProjectionStackStatus` in interface `ProjectionStackTrigger`
  Parameters:
    `containsBackProjections` - there is at least one past projection in the back cache.
    `containsForwardProjections` - there is at least one future projection in the forward cache. Used when a past projection is being used.

### findAndInit

    public void findAndInit(java.lang.Object someObj)

  In addition to the MapBean, find a projection stack so the less than/greater than works on that.

  Specified by:
    `findAndInit` in interface `LightMapHandlerChild`
  Overrides:
    `findAndInit` in class `MapBeanKeyListener`

### findAndUndo

    public void findAndUndo(java.lang.Object someObj)

  Description copied from class: `MapHandlerChild`
  The childrenRemoved has been changed to go through its iterator to call this method with every object. This lets subclasses call this method on their super class, so it can handle what it needs to with objects it may be interested in.

  Specified by:
    `findAndUndo` in interface `LightMapHandlerChild`
  Overrides:
    `findAndUndo` in class `MapBeanKeyListener`

Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details