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
BeanBoxHandler
interface.Modifier and Type | Field and Description |
---|---|
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
|
beanContextChildSupport, layers, md, pcSupport, proj
default_action, startDrag
Constructor and Description |
---|
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.
|
Modifier and Type | Method and Description |
---|---|
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.
|
addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, childrenAdded, childrenRemoved, consume, findAndInit, findAndUndo, firePropertyChange, fireVetoableChange, getBeanContext, getProjection, mouseDragged, mouseReleased, projectionChanged, propertyChange, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext, setLayers, setProjection, setProjection
dragDropEnd, dragEnter, dragEnter, dragExit, dragExit, dragOver, dragOver, dropActionChanged, dropActionChanged, getCursor, getDefaultAction, setCursor, setDefaultAction
mouseEntered, mouseExited, mouseMoved, mousePressed, registerListeners, unregisterListeners
addDragGestureListener, appendEvent, fireDragGestureRecognized, getComponent, getDragSource, getSourceActions, getTriggerEvent, removeDragGestureListener, resetRecognizer, setComponent, setSourceActions
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addPropertyChangeListener, addVetoableChangeListener, getBeanContext, removePropertyChangeListener, removeVetoableChangeListener, setBeanContext
childrenAdded, childrenRemoved
projectionChanged
setLayers
protected java.lang.Object selectedBean
protected java.io.ByteArrayOutputStream serBean
protected java.awt.Point selectedBeanLocation
protected BeanBox selectedBeanBox
BeanBox
that manages the
currently selected beanprotected Layer selectedBeanLayer
protected java.util.HashMap beanInfoMap
public BeanBoxDnDCatcher()
DnDListener
object.public BeanBoxDnDCatcher(java.awt.dnd.DragSource ds)
ds
- the DragSource for the Componentpublic BeanBoxDnDCatcher(java.awt.dnd.DragSource ds, java.awt.Component c)
ds
- the DragSource for the Component cc
- the Component to observepublic BeanBoxDnDCatcher(java.awt.dnd.DragSource ds, java.awt.Component c, int act)
ds
- the DragSource for the Component cc
- the Component to observeact
- the drag-and-drop actionpublic BeanBoxDnDCatcher(java.awt.dnd.DragSource ds, java.awt.Component c, int act, java.awt.dnd.DragGestureListener dgl)
ds
- the DragSource for the Component cc
- the Component to observeact
- the drag-and-drop actiondgl
- the DragGestureListenerpublic void findAndInit(java.lang.Object someObj)
findAndInit
in class DefaultDnDCatcher
protected void copySelectedBean()
protected void pasteSelectedBean()
protected void cutSelectedBean()
protected void unCutSelectedBean()
protected void deleteSelectedBean()
public void drop(java.awt.dnd.DropTargetDropEvent dtde)
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.
drop
in interface java.awt.dnd.DropTargetListener
drop
in class DefaultDnDCatcher
dtde
- the DropTargetDropEvent
public void mouseClicked(java.awt.event.MouseEvent evt)
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.mouseClicked
in interface java.awt.event.MouseListener
mouseClicked
in class java.awt.dnd.MouseDragGestureRecognizer
public void actionPerformed(java.awt.event.ActionEvent evt)
actionPerformed
in interface java.awt.event.ActionListener
actionPerformed
in class DefaultDnDCatcher
public void setLayers(Layer[] allLayers)
setLayers
in class DefaultDnDCatcher
public void startDragAction(java.awt.dnd.DragGestureEvent dge, java.awt.dnd.DragSourceListener dsl)
startDragAction
in class DefaultDnDCatcher
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details