All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.bulletproof.gui.Container

java.lang.Object
   |
   +----com.bulletproof.gui.Component
           |
           +----com.bulletproof.gui.Container

public class Container
extends Component
A generic GUI container object is a component that can contain other GUI components.

Components added to a container are tracked in a list. The order of the list will define the components' front-to-back stacking order within the container. If no index is specified when adding a component to a container, it will be added to the end of the list (and hence to the bottom of the stacking order).


Constructor Index

 o Container()
Constructs a new Container.
 o Container(LayoutManager)
Constructs a new Container with the speicified layout manager.

Method Index

 o add(Component)
Adds the specified component to this container.
 o add(String, Component)
Adds the specified component to this container.
 o doLayout()
Does a layout on this Container.
 o findComponentAt(int, int)
Find the component at the specified x and y position
 o getComponent(int)
Get the specific component
 o getComponentCount()
Get the specific component
 o getLayout()
Gets the layout manager for this container.
 o getMinimumSize()
Returns the minimum size of this container.
 o paint(Graphics)
Paints the container.
 o processMouseEvent(MouseEvent)
This method attempts to distribute a mouse event to a lightweight component.
 o remove(Component)
Removes the component at the specified index from this container.
 o removeAll()
Paints the components in this container.
 o setLayout(LayoutManager)
Sets the layout manager for this container.
 o setMasterDrawRegion(Rectangle)
Set the master drawing region for this container and it's children.
 o validate()
Validates this Container and all of the components contained within it.

Constructors

 o Container
 public Container()
Constructs a new Container. Containers can be extended directly, but are lightweight in this case and must be contained by a parent somewhere higher up in the component tree that is native. (such as Frame for example).

 o Container
 public Container(LayoutManager layoutManager)
Constructs a new Container with the speicified layout manager. Containers can be extended directly, but are lightweight in this case and must be contained by a parent somewhere higher up in the component tree that is native. (such as Frame for example).

Parameters:
layoutManager - the desired layout manager for this container

Methods

 o add
 public Component add(Component component)
Adds the specified component to this container.

Parameters:
comp - the component to be added
 o add
 public Component add(String where,
                      Component c)
Adds the specified component to this container.

Parameters:
where - the position where the component is to be added
comp - the component to be added
 o doLayout
 public void doLayout()
Does a layout on this Container. Most programs should not call this directly, but should invoke validate instead.

Overrides:
doLayout in class Component
See Also:
setLayout, validate
 o getComponentCount
 public int getComponentCount()
Get the specific component

 o getComponent
 public Component getComponent(int comp)
Get the specific component

 o findComponentAt
 public Component findComponentAt(int x,
                                  int y)
Find the component at the specified x and y position

 o getMinimumSize
 public Dimension getMinimumSize()
Returns the minimum size of this container.

Overrides:
getMinimumSize in class Component
 o getLayout
 public LayoutManager getLayout()
Gets the layout manager for this container.

See Also:
doLayout, setLayout
 o paint
 public void paint(Graphics g)
Paints the container. This forwards the paint to any lightweight components that are children of this container.

Parameters:
g - the specified Graphics window
Overrides:
paint in class Component
 o processMouseEvent
 public void processMouseEvent(MouseEvent me)
This method attempts to distribute a mouse event to a lightweight component. It tries to avoid doing any unnecessary probes down into the component tree to minimize the overhead of determining where to route the event, since mouse movement events tend to come in large and frequent amounts.

Overrides:
processMouseEvent in class Component
 o removeAll
 public void removeAll()
Paints the components in this container.

Parameters:
g - the specified Graphics window
 o remove
 public void remove(Component c)
Removes the component at the specified index from this container.

Parameters:
index - the index of the component to be removed
See Also:
add
 o setLayout
 public void setLayout(LayoutManager mgr)
Sets the layout manager for this container.

Parameters:
mgr - the specified layout manager
See Also:
doLayout, getLayout
 o validate
 public void validate()
Validates this Container and all of the components contained within it.

Overrides:
validate in class Component
See Also:
validate, invalidate
 o setMasterDrawRegion
 public void setMasterDrawRegion(Rectangle region)
Set the master drawing region for this container and it's children.

Parameters:
region - the specified master drawing region
Overrides:
setMasterDrawRegion in class Component

All Packages  Class Hierarchy  This Package  Previous  Next  Index