org.zaval.lw
Interface LwContainer

All Superinterfaces:
Drawable, Layoutable, LayoutContainer, LwComponent, Validationable
All Known Subinterfaces:
LwComposite, LwDesktop, LwLayer
All Known Implementing Classes:
LwPanel

public interface LwContainer
extends LwComponent, LayoutContainer

This interface defines light weight container that inherits the LwComponent interface and can contain other light weight components as child components.

The interface inherits LayoutContainer interface so it is possible to use a layout manager to layout its child components.


Method Summary
 void add(LwComponent c)
          Adds the specified lightweight component as a child of this container.
 void add(java.lang.Object s, LwComponent c)
          Adds the specified lightweight component with the specified constraints as a child of this container.
 LwLayout getLwLayout()
          Gets a layout manager for this container.
 int indexOf(LwComponent c)
          Searches the specified component among this container children and returns an index of the component in the child list.
 void insert(int i, java.lang.Object s, LwComponent c)
          Inserts the specified lightweight component with the specified constraints as a child of this container at the specified position in the container list.
 void paintOnTop(java.awt.Graphics g)
          Paints additional elements (for example, marker) after the container and its child components have been rendered.
 void remove(int i)
          Removes the component, specified by the index, from this container.
 void removeAll()
          Removes all child components from this container.
 void setLwLayout(LwLayout m)
          Sets the layout manager for this container.
 
Methods inherited from interface org.zaval.lw.LwComponent
canHaveFocus, getLwComponentAt, getLwParent, getViewMan, getVisiblePart, setBackground, setEnabled, setLwParent, setViewMan, setVisible
 
Methods inherited from interface org.zaval.lw.Drawable
getBackground, getOrigin, isEnabled, isOpaque, paint, repaint, repaint, setOpaque, update
 
Methods inherited from interface org.zaval.util.Validationable
invalidate, isValid, validate
 
Methods inherited from interface org.zaval.lw.Layoutable
getBounds, getHeight, getInsets, getLocation, getPreferredSize, getSize, getWidth, getX, getY, isVisible, setLocation, setSize
 
Methods inherited from interface org.zaval.lw.LayoutContainer
count, get, getLayoutOffset
 

Method Detail

add

public void add(LwComponent c)
Adds the specified lightweight component as a child of this container. The method should call componentAdded method its layout manager to inform the layout manager that the new child has been added.
Parameters:
c - the lightweight component to be added.

add

public void add(java.lang.Object s,
                LwComponent c)
Adds the specified lightweight component with the specified constraints as a child of this container. The method should call componentAdded method its layout manager to inform the layout manager that the new child has been added.
Parameters:
s - the object expressing layout contraints for this.
c - the lightweight component to be added.

insert

public void insert(int i,
                   java.lang.Object s,
                   LwComponent c)
Inserts the specified lightweight component with the specified constraints as a child of this container at the specified position in the container list. The method should call componentAdded method its layout manager to inform the layout manager that the new child has been added with the given constraints.
Parameters:
i - the position in the container list at which to insert the component.
s - the object expressing layout contraints for this.
c - the lightweight component to be added.

remove

public void remove(int i)
Removes the component, specified by the index, from this container. The layout manager of this container should be informed by calling componentRemoved method of the manager.
Parameters:
index - the index of the component to be removed.

removeAll

public void removeAll()
Removes all child components from this container. The layout manager of this container should be informed by calling componentRemoved method of the manager for every child component that has been removed.

indexOf

public int indexOf(LwComponent c)
Searches the specified component among this container children and returns an index of the component in the child list. If the component has not been found than the method returns -1.
Parameters:
c - the component to get index.
Returns:
a child component index inside the container children list.

setLwLayout

public void setLwLayout(LwLayout m)
Sets the layout manager for this container.
Parameters:
m - the specified layout manager.

getLwLayout

public LwLayout getLwLayout()
Gets a layout manager for this container.
Returns:
a layout manager.

paintOnTop

public void paintOnTop(java.awt.Graphics g)
Paints additional elements (for example, marker) after the container and its child components have been rendered.
Parameters:
g - the graphics context.


Copyright © Zaval Creative Engineering Group, 2000-2005.
http://www.zaval.org