ui::Container Class Reference

Inheritance diagram for ui::Container:

Inheritance graph
[legend]
Collaboration diagram for ui::Container:

Collaboration graph
[legend]
List of all members.

Detailed Description

A Component that can hold other components. A container can contain other Components, and has public methods for manipulating them.


Public Member Functions

 Container ()
 Container (const Container &rhs)
Containeroperator= (const Container &rhs)
void swap (Container &rhs) throw ()
virtual ~Container ()
bool isContainer () const
virtual bool isRootContainer () const
bool hasChildren () const
void setEnabled (bool enable)
virtual const util::DimensiongetPreferredSize () const
virtual void remove (Component *component)
void removeAll ()
ComponentgetChild (int n) const
int getNumberOfChildren () const
virtual void add (Component *comp, int constraints=-1)
void setLayout (layout::LayoutManager *newLayout)
void validate ()
virtual void updateComponent (float deltaTime)

Protected Member Functions

void addImpl (Component *component, int constraints)
void removeImpl (Component *component)
virtual void paintComponent (Graphics &g)
void paintChildren (Container *parent, Graphics &g)
virtual void paintChildren (Graphics &g)


Constructor & Destructor Documentation

ui::Container::Container  ) 
 

Constructor.

ui::Container::Container const Container rhs  ) 
 

Copy constructor.

ui::Container::~Container  )  [virtual]
 

Destructor.


Member Function Documentation

Container & ui::Container::operator= const Container rhs  ) 
 

Assignment operator.

bool ui::Container::isContainer  )  const [virtual]
 

Returns true if this Component is a Container or not.

Note:
Returned true doesnt mean the Container has children, it might as well be an empty Container.
Returns:
true if this Component is a Container, false otherwise.

Reimplemented from ui::Component.

bool ui::Container::isRootContainer  )  const [virtual]
 

Returns wether this Container is a top level Container.

Reimplemented from ui::Component.

Reimplemented in ui::Window.

bool ui::Container::hasChildren  )  const
 

Returns true if this container has children.

void ui::Container::setEnabled bool  enable  )  [virtual]
 

Enables or disables this Component. Disabling the Component makes this Component ignore any user input (that is, mouse and key events generated by a user).

Reimplemented from ui::Component.

const util::Dimension & ui::Container::getPreferredSize  )  const [virtual]
 

Returns the preferred size for this Container.

Reimplemented from ui::Component.

void ui::Container::remove Component component  )  [virtual]
 

Remove the specified Component.

Reimplemented in ui::Window.

void ui::Container::removeAll  ) 
 

Remove all containers children.

Component * ui::Container::getChild int  n  )  const
 

Returns the Component at n. N means the depth level of the Container.

Parameters:
n depth/index level
Returns:
the Component at n, or NULL if none is found.

int ui::Container::getNumberOfChildren  )  const
 

Returns the number of components in the container.

Returns:
number of components in the container.

void ui::Container::add Component comp,
int  constraints = -1
[virtual]
 

Add a Component to this Container with given constraint. Can be overridden to create custom containers.

Parameters:
comp Component to add to this Container.
constraints Constraints used for laying out this Container. These are hints for the LayoutManager.

Reimplemented in ui::Window.

void ui::Container::setLayout layout::LayoutManager newLayout  ) 
 

Sets the LayoutManager for this Container.

Parameters:
newLayout the new LayoutManager.
Note:
Note that the previous LayoutManager is freed from memory.

void ui::Container::validate  )  [virtual]
 

Validates this Component.

Reimplemented from ui::Component.

void ui::Container::updateComponent float  deltaTime  )  [virtual]
 

Update, for time based motion. After updating, it calls all the update methods on it's children.

Parameters:
deltaTime time between two sequential frames. This can be used for calculating frame rate independant motion.

Reimplemented from ui::Component.

Reimplemented in ui::Window.

void ui::Container::addImpl Component component,
int  constraints
[protected]
 

Add a Component to this Container. This method should not be overridden, as it is used by add(Component *comp).

Parameters:
component Component to add to this Container.
constraints Constraints used for laying out this Container. These are hints for the LayoutManager.

void ui::Container::removeImpl Component component  )  [protected]
 

Removes a Component from this Container. This is the implementation of the normal remove function (which can be overridden).

void ui::Container::paintComponent Graphics g  )  [protected, virtual]
 

Paint this Component and it's children.

Parameters:
g A Graphics reference.

Reimplemented from ui::Component.

void ui::Container::paintChildren Container parent,
Graphics g
[protected]
 

Paints the Children of this Container.

void ui::Container::paintChildren Graphics g  )  [protected, virtual]
 

Draws all the child components of this element. Method can be overridden to enhance or modify the drawing routine.

Reimplemented from ui::Component.

Reimplemented in ui::Window.


Generated on Mon Jun 20 19:41:43 2005 for UI by doxygen 1.3.1 using KingsTools