public abstract class BeanBox
extends java.lang.Object
BeanPanel
via the
BeanBoxDnDCatcher
. An
implementation of this abstract class is expected to be associated
with an openmap layer. The abstract BeanBox class performs
functions such as adding and removing beans from the associated
openmap layer and provides support for moving beans on the layer
and cut/copy/paste functionality.
Layer developers wishing to make use of the BeanBox's bean management capabilities should:
BeanBoxHandler
interface in
the layer associated with the BeanBox implementation.An implementation of this class should provide layer specific versions of at least the following abstract base class methods:
BeanContainer
s)Additionally, an implementation of this class can optionally provide layer specific versions of the following base class methods:
Constructor and Description |
---|
BeanBox()
Default constructor initializes the BeanBox.
|
Modifier and Type | Method and Description |
---|---|
abstract void |
addBean(java.lang.Object bean)
This method is called when a bean is dropped on the layer
associated with this BeanBox.
|
abstract void |
beanChanged(java.lang.Object bean,
java.lang.String changedPropertyName)
This method is called by a propertysheet whenever a bean
property changes.
|
abstract boolean |
containsBean(java.lang.Object bean)
This method is intended to check whether this BeanBox knows
about the specified bean.
|
protected void |
createPropertySheet(java.lang.Object bean)
Utility method to create and display a property sheet to show
the specified bean's properties.
|
protected void |
doSpecialHandling(java.lang.Object bean)
Checks if the specified bean should be added to a
BeanContainer . |
abstract BeanContainer |
findEnclosingContainer(java.lang.Object bean)
Returns a bean contained in the layer that implements the
BeanContainer interface and which contains the specified bean.
|
abstract java.lang.Object |
getBeanAtLocation(java.awt.Point pointOnMap)
Returns a bean contained in the layer at the specified map
location.
|
java.beans.BeanInfo |
getBeanInfoForBean(java.lang.String beanClassName)
Utility method to obtain the BeanInfo object associated with a
bean class that the BeanBox knows about.
|
protected java.awt.Image |
getDragImage(java.lang.Object bean)
Returns the image that the cursor will be set to when the
specified bean is dragged over the map.
|
protected void |
prepareForAddition(java.lang.Object bean,
java.beans.BeanInfo beanInfo,
java.awt.Point location)
This method is called to prepare the bean for addition to the
beanbox.
|
abstract void |
relocateBean(java.lang.Object bean,
java.beans.BeanInfo beanInfo,
java.awt.Point newLocation)
This method is called when a bean is moved from its present
location to the newlocation within the layer associated with
this BeanBox.
|
abstract void |
removeBean(java.lang.Object bean)
This method is called when a bean is moved from the layer
associated with this BeanBox to another layer.
|
abstract void |
setBeanProperties(java.lang.Object bean,
java.beans.BeanInfo beanInfo,
java.awt.Point location)
This method is called when a bean is dropped on the layer
associated with this BeanBox.
|
void |
showCut(java.lang.Object bean)
This method is called when the user 'cuts' a bean, usually as a
a result of the clicking on it in a layer and then pressing
Ctrl-X.
|
void |
showSelected(java.lang.Object bean)
This method is called when the user selects a bean, usually as
a a result of the clicking on it in a layer.
|
void |
showUnCut(java.lang.Object bean)
This method is called when the user cancels a 'cut' operation,
usually as a a result of pressing the ESC key.
|
public java.beans.BeanInfo getBeanInfoForBean(java.lang.String beanClassName)
protected void prepareForAddition(java.lang.Object bean, java.beans.BeanInfo beanInfo, java.awt.Point location)
protected void createPropertySheet(java.lang.Object bean) throws java.lang.Exception
java.lang.Exception
protected void doSpecialHandling(java.lang.Object bean)
BeanContainer
.protected java.awt.Image getDragImage(java.lang.Object bean)
public void showSelected(java.lang.Object bean)
public void showCut(java.lang.Object bean)
public void showUnCut(java.lang.Object bean)
public abstract void addBean(java.lang.Object bean)
public abstract void removeBean(java.lang.Object bean)
public abstract boolean containsBean(java.lang.Object bean)
public abstract void setBeanProperties(java.lang.Object bean, java.beans.BeanInfo beanInfo, java.awt.Point location)
public abstract java.lang.Object getBeanAtLocation(java.awt.Point pointOnMap)
public abstract BeanContainer findEnclosingContainer(java.lang.Object bean)
public abstract void relocateBean(java.lang.Object bean, java.beans.BeanInfo beanInfo, java.awt.Point newLocation)
public abstract void beanChanged(java.lang.Object bean, java.lang.String changedPropertyName)
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details