public class BeanInstance
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static int |
BEAN_EXECUTING |
static int |
IDLE
class variable holding all the beans
|
Constructor and Description |
---|
BeanInstance(javax.swing.JComponent container,
java.lang.Object bean,
int x,
int y,
java.lang.Integer... tab)
Creates a new
BeanInstance instance. |
BeanInstance(javax.swing.JComponent container,
java.lang.String beanName,
int x,
int y,
java.lang.Integer... tab)
Creates a new
BeanInstance instance given the fully qualified
name of the bean |
Modifier and Type | Method and Description |
---|---|
static void |
addAllBeansToContainer(javax.swing.JComponent container,
java.lang.Integer... tab)
Adds all beans to the supplied component
|
void |
addBean(javax.swing.JComponent container,
java.lang.Integer... tab)
Adds this bean to the global list of beans and to the supplied container.
|
static void |
addBeanInstances(java.util.Vector<java.lang.Object> beanInstances,
javax.swing.JComponent container)
Adds the supplied collection of beans to the end of the list of collections
and to the JComponent container (if not null)
|
static void |
appendBeans(javax.swing.JComponent container,
java.util.Vector<java.lang.Object> beans,
int tab) |
static BeanInstance |
findInstance(java.awt.Point p,
java.lang.Integer... tab)
Looks for a bean (if any) whose bounds contain the supplied point
|
static BeanInstance |
findInstance(java.lang.String beanName,
java.lang.Integer... tab)
Search for a named bean in the indexed flow
|
static java.util.Vector<java.lang.Object> |
findInstances(java.awt.Rectangle boundingBox,
java.lang.Integer... tab)
Looks for all beans (if any) located within the supplied bounding box.
|
java.lang.Object |
getBean()
Gets the bean encapsulated in this instance
|
static java.util.Vector<java.lang.Object> |
getBeanInstances(java.lang.Integer... tab)
Return the list of displayed beans
|
int |
getHeight()
Gets the height of this bean
|
static java.util.List<BeanInstance> |
getStartPoints(java.lang.Integer... tab)
Returns a list of start points (if any) in the indexed flow
|
int |
getWidth()
Gets the width of this bean
|
int |
getX()
Gets the x coordinate of this bean
|
int |
getY()
Gets the y coordinate of this bean
|
static void |
init()
Sets up just a single collection of bean instances in the first element of
the list.
|
static void |
paintLabels(java.awt.Graphics gx,
java.lang.Integer... tab)
Renders the textual labels for the beans.
|
static void |
removeAllBeansFromContainer(javax.swing.JComponent container,
java.lang.Integer... tab)
Removes all beans from containing component
|
void |
removeBean(javax.swing.JComponent container,
java.lang.Integer... tab)
Remove this bean from the list of beans and from the containing component
|
static void |
removeBeanInstances(javax.swing.JComponent container,
java.lang.Integer tab)
Remove the vector of bean instances from the supplied index in the list of
collections.
|
static void |
setBeanInstances(java.util.Vector<java.lang.Object> beanInstances,
javax.swing.JComponent container,
java.lang.Integer... tab)
Adds the supplied collection of beans at the supplied index in the list of
collections.
|
void |
setX(int newX)
Sets the x coordinate of this bean
|
void |
setXY(int newX,
int newY)
Set the x and y coordinates of this bean
|
void |
setY(int newY)
Sets the y coordinate of this bean
|
public static final int IDLE
public static final int BEAN_EXECUTING
public BeanInstance(javax.swing.JComponent container, java.lang.Object bean, int x, int y, java.lang.Integer... tab)
BeanInstance
instance.container
- a JComponent
to add the bean tobean
- the bean to addx
- the x coordinate of the beany
- the y coordinate of the beanpublic BeanInstance(javax.swing.JComponent container, java.lang.String beanName, int x, int y, java.lang.Integer... tab)
BeanInstance
instance given the fully qualified
name of the beancontainer
- a JComponent
to add the bean tobeanName
- the fully qualified name of the beanx
- the x coordinate of the beany
- th y coordinate of the beanpublic static void init()
public static void removeAllBeansFromContainer(javax.swing.JComponent container, java.lang.Integer... tab)
container
- a JComponent
valuepublic static void addAllBeansToContainer(javax.swing.JComponent container, java.lang.Integer... tab)
container
- a JComponent
valuepublic static java.util.Vector<java.lang.Object> getBeanInstances(java.lang.Integer... tab)
tab
- varargs parameter specifying the index of the collection of
beans to return - if omitted then the first (i.e. primary)
collection of beans is returnedpublic static void setBeanInstances(java.util.Vector<java.lang.Object> beanInstances, javax.swing.JComponent container, java.lang.Integer... tab)
beanInstances
- a Vector
valuecontainer
- a JComponent
valuepublic static void addBeanInstances(java.util.Vector<java.lang.Object> beanInstances, javax.swing.JComponent container)
beanInstances
- the vector of bean instances to addcontainer
- public static void removeBeanInstances(javax.swing.JComponent container, java.lang.Integer tab)
tab
- the index of the vector of beans to remove.public static void paintLabels(java.awt.Graphics gx, java.lang.Integer... tab)
gx
- a Graphics
object on which to render the labelspublic static java.util.List<BeanInstance> getStartPoints(java.lang.Integer... tab)
tab
- varargs integer index of the flow to search for start points.
Defaults to 0 if not supplied.public static BeanInstance findInstance(java.lang.String beanName, java.lang.Integer... tab)
beanName
- the name of the bean to look fortab
- varargs integer index of the flow to search inpublic static BeanInstance findInstance(java.awt.Point p, java.lang.Integer... tab)
p
- a pointpublic static java.util.Vector<java.lang.Object> findInstances(java.awt.Rectangle boundingBox, java.lang.Integer... tab)
boundingBox
- the bounding rectanglepublic void removeBean(javax.swing.JComponent container, java.lang.Integer... tab)
container
- the JComponent
that holds the beanpublic static void appendBeans(javax.swing.JComponent container, java.util.Vector<java.lang.Object> beans, int tab)
public void addBean(javax.swing.JComponent container, java.lang.Integer... tab)
container
- the Component on which this BeanInstance will be displayedpublic java.lang.Object getBean()
Object
valuepublic int getX()
int
valuepublic int getY()
int
valuepublic int getWidth()
int
valuepublic int getHeight()
int
valuepublic void setXY(int newX, int newY)
newX
- the x coordinatenewY
- the y coordinatepublic void setX(int newX)
newX
- an int
valuepublic void setY(int newY)
newY
- an int
value