|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.gui.beans.BeanInstance
public class BeanInstance
Class that manages a set of beans.
| Field Summary | |
|---|---|
static int |
BEAN_EXECUTING
|
static int |
IDLE
class variable holding all the beans |
| Constructor Summary | |
|---|---|
BeanInstance(JComponent container,
Object bean,
int x,
int y,
Integer... tab)
Creates a new BeanInstance instance. |
|
BeanInstance(JComponent container,
String beanName,
int x,
int y,
Integer... tab)
Creates a new BeanInstance instance given the fully
qualified name of the bean |
|
| Method Summary | |
|---|---|
static void |
addAllBeansToContainer(JComponent container,
Integer... tab)
Adds all beans to the supplied component |
void |
addBean(JComponent container,
Integer... tab)
Adds this bean to the global list of beans and to the supplied container. |
static void |
addBeanInstances(Vector beanInstances,
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(JComponent container,
Vector beans,
int tab)
|
static BeanInstance |
findInstance(Point p,
Integer... tab)
Looks for a bean (if any) whose bounds contain the supplied point |
static Vector |
findInstances(Rectangle boundingBox,
Integer... tab)
Looks for all beans (if any) located within the supplied bounding box. |
Object |
getBean()
Gets the bean encapsulated in this instance |
static Vector |
getBeanInstances(Integer... tab)
Return the list of displayed beans |
int |
getHeight()
Gets the height of this bean |
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(Graphics gx,
Integer... tab)
Renders the textual labels for the beans. |
static void |
removeAllBeansFromContainer(JComponent container,
Integer... tab)
Removes all beans from containing component |
void |
removeBean(JComponent container,
Integer... tab)
Remove this bean from the list of beans and from the containing component |
static void |
removeBeanInstances(JComponent container,
Integer tab)
Remove the vector of bean instances from the supplied index in the list of collections. |
static void |
setBeanInstances(Vector beanInstances,
JComponent container,
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 |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int IDLE
public static final int BEAN_EXECUTING
| Constructor Detail |
|---|
public BeanInstance(JComponent container,
Object bean,
int x,
int y,
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 bean
public BeanInstance(JComponent container,
String beanName,
int x,
int y,
Integer... tab)
BeanInstance instance given the fully
qualified name of the bean
container - 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 bean| Method Detail |
|---|
public static void init()
public static void removeAllBeansFromContainer(JComponent container,
Integer... tab)
container - a JComponent value
public static void addAllBeansToContainer(JComponent container,
Integer... tab)
container - a JComponent valuepublic static Vector getBeanInstances(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 returned
public static void setBeanInstances(Vector beanInstances,
JComponent container,
Integer... tab)
beanInstances - a Vector valuecontainer - a JComponent value
public static void addBeanInstances(Vector beanInstances,
JComponent container)
beanInstances - the vector of bean instances to addcontainer -
public static void removeBeanInstances(JComponent container,
Integer tab)
tab - the index of the vector of beans to remove.
public static void paintLabels(Graphics gx,
Integer... tab)
gx - a Graphics object on which to render
the labels
public static BeanInstance findInstance(Point p,
Integer... tab)
p - a point
public static Vector findInstances(Rectangle boundingBox,
Integer... tab)
boundingBox - the bounding rectangle
public void removeBean(JComponent container,
Integer... tab)
container - the JComponent that holds the bean
public static void appendBeans(JComponent container,
Vector beans,
int tab)
public void addBean(JComponent container,
Integer... tab)
container - the Component on which this
BeanInstance will be displayedpublic Object getBean()
Object valuepublic int getX()
int valuepublic int getY()
int valuepublic int getWidth()
int valuepublic int getHeight()
int value
public 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
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||