BeanBoxDnDCatcher (OpenMap API)
Date: 2016-12-09

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bbn.openmap.tools.beanbox
Class BeanBoxDnDCatcher

    java.lang.Object
      java.awt.dnd.DragGestureRecognizer
          java.awt.dnd.MouseDragGestureRecognizer
              com.bbn.openmap.tools.dnd.DnDListener
                  com.bbn.openmap.tools.dnd.DefaultDnDCatcher
                      com.bbn.openmap.tools.beanbox.BeanBoxDnDCatcher

All Implemented Interfaces:
  LayerListener, ProjectionListener, SoloMapComponent, java.awt.dnd.DragSourceListener, java.awt.dnd.DropTargetListener, java.awt.event.ActionListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, java.beans.PropertyChangeListener, java.io.Serializable, java.util.EventListener

    public class BeanBoxDnDCatcher

extends DefaultDnDCatcher
implements SoloMapComponent, java.beans.beancontext.BeanContextChild, java.beans.beancontext.BeanContextMembershipListener, java.beans.PropertyChangeListener, java.io.Serializable, ProjectionListener, LayerListener, java.awt.event.ActionListener

The BeanBoxDnDCatcher class manages all Java Drag-and-Drop events associated with openmap layers that implement the `BeanBoxHandler`interface.

See Also:
  Serialized Form

Field Summary
`protected java.util.HashMap` | `beanInfoMap` contains BeanInfo objects hashed by the class names of the associated bean classes
`protected java.lang.Object` | `selectedBean` holds the currently selected bean
`protected BeanBox` | `selectedBeanBox` holds the `BeanBox`that manages the currently selected bean
`protected Layer` | `selectedBeanLayer` holds the openmap layer that contains the currently selected bean
`protected java.awt.Point` | `selectedBeanLocation` holds the map location of the currently selected bean
`protected java.io.ByteArrayOutputStream` | `serBean` holds the serialized version of currently selected bean

Fields inherited from class com.bbn.openmap.tools.dnd.DefaultDnDCatcher
`beanContextChildSupport, layers, md, pcSupport, proj`

Fields inherited from class com.bbn.openmap.tools.dnd.DnDListener
`default_action, startDrag`

Fields inherited from class java.awt.dnd.DragGestureRecognizer
`component, dragGestureListener, dragSource, events, sourceActions`

Constructor Summary
`BeanBoxDnDCatcher()` Constructs a new `DnDListener` object.
`BeanBoxDnDCatcher(java.awt.dnd.DragSource ds)` Constructs a new MouseDragGestureRecognizer given the DragSource for the Component.
`BeanBoxDnDCatcher(java.awt.dnd.DragSource ds, java.awt.Component c)` Construct a new MouseDragGestureRecognizer given the DragSource for the Component c, and the Component to observe.
`BeanBoxDnDCatcher(java.awt.dnd.DragSource ds, java.awt.Component c, int act)` Construct a new MouseDragGestureRecognizer given the DragSource for the Component c, and the Component to observe and the drag-and-drop action.
`BeanBoxDnDCatcher(java.awt.dnd.DragSource ds, java.awt.Component c, int act, java.awt.dnd.DragGestureListener dgl)` Construct a new MouseDragGestureRecognizer given the DragSource for the Component c, and the Component to observe.

Method Summary
`void` | `actionPerformed(java.awt.event.ActionEvent evt)` This method is called whenever the user choose a layer to drop or move a bean to.
`protected void` | `copySelectedBean()` This method is called when the user chooses to copy a bean by some means such by by pressing Ctrl-C.
`protected void` | `cutSelectedBean()` This method is called when the user chooses to cut a bean by some means such by by pressing Ctrl-X.
`protected void` | `deleteSelectedBean()` This method is called when the user chooses to delete a bean by some means such by by pressing DEL.
`void` | `drop(java.awt.dnd.DropTargetDropEvent dtde)` The drag operation has terminated with a drop on this `DropTarget`.
`void` | `findAndInit(java.lang.Object someObj)` Calls superclass method and then adds the KeyListener to someObj if someObj is of type OpenMapFrame.
`void` | `mouseClicked(java.awt.event.MouseEvent evt)` Displays a `GenericPropertySheet`if mouse click is on a bean in some layer.
`protected void` | `pasteSelectedBean()` This method is called when the user chooses to paste by some means (such by pressing Ctrl-V) a previously copied or cut bean.
`void` | `setLayers(Layer[] allLayers)` Asscoiates a DropTarget with each layer.
`void` | `startDragAction(java.awt.dnd.DragGestureEvent dge, java.awt.dnd.DragSourceListener dsl)` Invoked on dragGestureRecognized
`protected void` | `unCutSelectedBean()` This method is called when the user chooses to cancel a cut operation on a bean by some means such by by pressing ESC.

Methods inherited from class com.bbn.openmap.tools.dnd.DefaultDnDCatcher
`addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, childrenAdded, childrenRemoved, consume, findAndInit, findAndUndo, firePropertyChange, fireVetoableChange, getBeanContext, getProjection, mouseDragged, mouseReleased, projectionChanged, propertyChange, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext, setLayers, setProjection, setProjection`

Methods inherited from class com.bbn.openmap.tools.dnd.DnDListener
`dragDropEnd, dragEnter, dragEnter, dragExit, dragExit, dragOver, dragOver, dropActionChanged, dropActionChanged, getCursor, getDefaultAction, setCursor, setDefaultAction`

Methods inherited from class java.awt.dnd.MouseDragGestureRecognizer
`mouseEntered, mouseExited, mouseMoved, mousePressed, registerListeners, unregisterListeners`

Methods inherited from class java.awt.dnd.DragGestureRecognizer
`addDragGestureListener, appendEvent, fireDragGestureRecognized, getComponent, getDragSource, getSourceActions, getTriggerEvent, removeDragGestureListener, resetRecognizer, setComponent, setSourceActions`

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

Methods inherited from interface java.beans.beancontext.BeanContextChild
`addPropertyChangeListener, addVetoableChangeListener, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext`

Methods inherited from interface java.beans.beancontext.BeanContextMembershipListener
`childrenAdded, childrenRemoved`

Methods inherited from interface java.beans.PropertyChangeListener
`propertyChange`

Methods inherited from interface com.bbn.openmap.event.ProjectionListener
`projectionChanged`

Methods inherited from interface com.bbn.openmap.event.LayerListener
`setLayers`

Field Detail

### selectedBean

    protected java.lang.Object selectedBean

  holds the currently selected bean

### serBean

    protected java.io.ByteArrayOutputStream serBean

  holds the serialized version of currently selected bean

### selectedBeanLocation

    protected java.awt.Point selectedBeanLocation

  holds the map location of the currently selected bean

### selectedBeanBox

    protected BeanBox selectedBeanBox

  holds the `BeanBox`that manages the currently selected bean

### selectedBeanLayer

    protected Layer selectedBeanLayer

  holds the openmap layer that contains the currently selected bean

### beanInfoMap

    protected java.util.HashMap beanInfoMap

  contains BeanInfo objects hashed by the class names of the associated bean classes

Constructor Detail

### BeanBoxDnDCatcher

    public BeanBoxDnDCatcher()

  Constructs a new `DnDListener` object.

### BeanBoxDnDCatcher

    public BeanBoxDnDCatcher(java.awt.dnd.DragSource ds)

  Constructs a new MouseDragGestureRecognizer given the DragSource for the Component.

  Parameters:
    `ds` - the DragSource for the Component

### BeanBoxDnDCatcher

    public BeanBoxDnDCatcher(java.awt.dnd.DragSource ds,
                             java.awt.Component c)

  Construct a new MouseDragGestureRecognizer given the DragSource for the Component c, and the Component to observe.

  Parameters:
    `ds` - the DragSource for the Component c
    `c` - the Component to observe

### BeanBoxDnDCatcher

    public BeanBoxDnDCatcher(java.awt.dnd.DragSource ds,
                             java.awt.Component c,
                             int act)

  Construct a new MouseDragGestureRecognizer given the DragSource for the Component c, and the Component to observe and the drag-and-drop action.

  Parameters:
    `ds` - the DragSource for the Component c
    `c` - the Component to observe
    `act` - the drag-and-drop action

### BeanBoxDnDCatcher

    public BeanBoxDnDCatcher(java.awt.dnd.DragSource ds,
                             java.awt.Component c,
                             int act,
                             java.awt.dnd.DragGestureListener dgl)

  Construct a new MouseDragGestureRecognizer given the DragSource for the Component c, and the Component to observe. the drag-and-drop action and a DragGestureListener

  Parameters:
    `ds` - the DragSource for the Component c
    `c` - the Component to observe
    `act` - the drag-and-drop action
    `dgl` - the DragGestureListener

Method Detail

### findAndInit

    public void findAndInit(java.lang.Object someObj)

  Calls superclass method and then adds the KeyListener to someObj if someObj is of type OpenMapFrame.

  Overrides:
    `findAndInit` in class `DefaultDnDCatcher`

### copySelectedBean

    protected void copySelectedBean()

  This method is called when the user chooses to copy a bean by some means such by by pressing Ctrl-C. This method tries to serialize the selected bean. If no bean is selected or the bean is not serializable, this method is a no-op.

### pasteSelectedBean

    protected void pasteSelectedBean()

  This method is called when the user chooses to paste by some means (such by pressing Ctrl-V) a previously copied or cut bean. This method tries to deserialize the previously serialized bean. If the bean in question was cut, this method also removes it from from the source beanbox. The paste operation is treated the same as a drop operation. If no bean was previously copied or cut or if an error occurs during deserialization, this method is a no-op.

### cutSelectedBean

    protected void cutSelectedBean()

  This method is called when the user chooses to cut a bean by some means such by by pressing Ctrl-X. This method tries to serialize the selected bean. If no bean is selected or the bean is not serializable, this method is a no-op.

### unCutSelectedBean

    protected void unCutSelectedBean()

  This method is called when the user chooses to cancel a cut operation on a bean by some means such by by pressing ESC. If no bean was marked for cutting this method is a no-op.

### deleteSelectedBean

    protected void deleteSelectedBean()

  This method is called when the user chooses to delete a bean by some means such by by pressing DEL. This method removes the selected bean from its beanbox. If no bean is selected this method is a no-op.

### drop

    public void drop(java.awt.dnd.DropTargetDropEvent dtde)

  The drag operation has terminated with a drop on this `DropTarget`. This method is responsible for undertaking the transfer of the data associated with the gesture. The `DropTargetDropEvent` provides a means to obtain a `Transferable` object that represents the data object(s) to be transfered.

  Specified by:
    `drop` in interface `java.awt.dnd.DropTargetListener`
  Overrides:
    `drop` in class `DefaultDnDCatcher`
  Parameters:
    `dtde` - the `DropTargetDropEvent`

### mouseClicked

    public void mouseClicked(java.awt.event.MouseEvent evt)

  Displays a `GenericPropertySheet`if mouse click is on a bean in some layer. In case of overlapping beans, chooses the first bean found to be under the mouse, which is usually a bean in the top most visible layer.

  Specified by:
    `mouseClicked` in interface `java.awt.event.MouseListener`
  Overrides:
    `mouseClicked` in class `java.awt.dnd.MouseDragGestureRecognizer`

### actionPerformed

    public void actionPerformed(java.awt.event.ActionEvent evt)

  This method is called whenever the user choose a layer to drop or move a bean to. This method adds the bean to the layer or moves the beans to or within the selected layer.

  Specified by:
    `actionPerformed` in interface `java.awt.event.ActionListener`
  Overrides:
    `actionPerformed` in class `DefaultDnDCatcher`

### setLayers

    public void setLayers(Layer[] allLayers)

  Asscoiates a DropTarget with each layer. Also caches all layers that implement the BeanBoxHandler interface.

  Overrides:
    `setLayers` in class `DefaultDnDCatcher`

### startDragAction

    public void startDragAction(java.awt.dnd.DragGestureEvent dge,
                                java.awt.dnd.DragSourceListener dsl)

  Invoked on dragGestureRecognized

  Overrides:
    `startDragAction` in class `DefaultDnDCatcher`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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