java.lang.Object
com.voytechs.html.component.Component
com.voytechs.html.component.SimpleComponent
com.voytechs.html.component.Container
- Direct Known Subclasses:
- Form, Frame, Panel, Table
- public class Container
- extends SimpleComponent
A generic container object is a component that can
contain other 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).
| Methods inherited from class com.voytechs.html.component.Component |
areFlagsSet, clearFlags, getParent, getRootFrame, getUriPath, setFlags, setParent, show, show, toStringPrefix, toStringPrefixCap, toStringPrefixTee |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
children
private ComponentVector children
Container
public Container()
init
protected void init(Frame root,
com.voytechs.html.event.HtmlDispatcher dispatcher)
throws com.voytechs.html.event.EventException
- Function that initializes the object relationships. Late bindings,
adding delayed listeners, etc. Called after the full component tree
is built.
- Overrides:
init in class Component
addChild
protected void addChild(Component child)
throws com.voytechs.html.event.EventException
- Add a child component to the list of children to manage.
Components are displayed in the order they were added.
removeElement
public void removeElement(Component child)
throws com.voytechs.html.event.EventException
- Removes a previously added Component from the tree.
paint
protected void paint(com.voytechs.html.io.HtmlWriter htmlOut)
throws java.io.IOException
- Calls the paint method for all is children components.
- Specified by:
paint in class Component
process
protected void process()
- A method that allows a subclass to override and do special processing.
Does nothing by default;
paintChildren
protected void paintChildren(com.voytechs.html.io.HtmlWriter htmlOut)
throws java.io.IOException
- Calls the paint method for all its children conponents.
toStringTree
public java.lang.String toStringTree(java.lang.String prefix)
- A debuging function to print out the component tree.
- Overrides:
toStringTree in class Component
main
public static void main(java.lang.String[] args)
- Test function for Container