org.zaval.lw
Class LwActContainer

java.lang.Object
  |
  +--org.zaval.util.ValidationObject
        |
        +--org.zaval.lw.LwCanvas
              |
              +--org.zaval.lw.LwPanel
                    |
                    +--org.zaval.lw.LwActContainer
All Implemented Interfaces:
Drawable, Layoutable, LayoutContainer, LwComponent, LwComposite, LwContainer, Validationable
Direct Known Subclasses:
LwButton, LwCheckbox

public class LwActContainer
extends LwPanel
implements LwComposite

This class can be used for creating light weight containers that:

This class is a composite component and the child components input events are caught by this class.


Fields inherited from class org.zaval.lw.LwPanel
children
 
Fields inherited from class org.zaval.lw.LwCanvas
bits, height, insets, parent, psHeight, psWidth, skins, width, x, y
 
Fields inherited from class org.zaval.util.ValidationObject
isValidFlag
 
Constructor Summary
LwActContainer(LwComponent t)
          Constructs the container with the specified child component.
 
Method Summary
 boolean canHaveFocus()
          Specifies if the component can have focus.
 boolean catchInput(LwComponent child)
          Checks if input events for the specified child component should be caught.
protected  LwLayout getDefaultLayout()
          Gets the default layout manager that is set with the container during initialization.
 LwComponent getFocusComponent()
          Gets the child component that is used to indicate whenever the component has focus.
 java.awt.Color getRectColor()
          Gets the border color that is used to paint rectangle frame around the focus idicator component.
 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 setAsFocusComponent(int index)
          Sets a child focus indicator component by the specified child index.
 void setRectColor(java.awt.Color c)
          Sets the specified color to paint rectangle frame around the focus indicator component in case if the container has set focus indicator component.
 
Methods inherited from class org.zaval.lw.LwPanel
add, add, calcPreferredSize, count, get, getLayoutOffset, getLwComponentAt, getLwLayout, indexOf, insert, insert, invalidate, recalc, remove, setBackground, setLwLayout, setOpaque, toFront, updateCashedPs
 
Methods inherited from class org.zaval.lw.LwCanvas
getBackground, getBounds, getHeight, getInsets, getLocation, getLwParent, getOrigin, getPreferredSize, getSize, getViewMan, getVisiblePart, getWidth, getX, getY, hasFocus, isEnabled, isOpaque, isVisible, paint, repaint, repaint, requestFocus, setEnabled, setInsets, setLocation, setLwParent, setPSSize, setSize, setViewMan, setVisible, toString, update, validate, viewManChanged, vrp
 
Methods inherited from class org.zaval.util.ValidationObject
isValid
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.zaval.lw.LwContainer
add, add, getLwLayout, indexOf, insert, setLwLayout
 
Methods inherited from interface org.zaval.lw.LwComponent
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
 

Constructor Detail

LwActContainer

public LwActContainer(LwComponent t)
Constructs the container with the specified child component. The child is used to indicate whenever the component has focus.
Parameters:
t - the specified child component.
Method Detail

canHaveFocus

public boolean canHaveFocus()
Description copied from interface: LwComponent
Specifies if the component can have focus.
Specified by:
canHaveFocus in interface LwComponent
Overrides:
canHaveFocus in class LwCanvas
Following copied from interface: org.zaval.lw.LwComponent
Returns:
true if the component can have the focus.

getFocusComponent

public LwComponent getFocusComponent()
Gets the child component that is used to indicate whenever the component has focus.
Returns:
a child focus indicator component.

setAsFocusComponent

public void setAsFocusComponent(int index)
Sets a child focus indicator component by the specified child index. Use -1 value to assign null value to the focus indicator component.
Parameters:
index - the specified child index to be set as the focus indicator.

setRectColor

public void setRectColor(java.awt.Color c)
Sets the specified color to paint rectangle frame around the focus indicator component in case if the container has set focus indicator component.
Parameters:
c - the specified color.

getRectColor

public java.awt.Color getRectColor()
Gets the border color that is used to paint rectangle frame around the focus idicator component.
Returns:
a border color.

catchInput

public boolean catchInput(LwComponent child)
Description copied from interface: LwComposite
Checks if input events for the specified child component should be caught.
Specified by:
catchInput in interface LwComposite
Following copied from interface: org.zaval.lw.LwComposite
Parameters:
child - the specified child component.
Returns:
true if input events for the child component should be caught by this component; false otherwise.

paintOnTop

public void paintOnTop(java.awt.Graphics g)
Description copied from interface: LwContainer
Paints additional elements (for example, marker) after the container and its child components have been rendered.
Specified by:
paintOnTop in interface LwContainer
Overrides:
paintOnTop in class LwPanel
Following copied from interface: org.zaval.lw.LwContainer
Parameters:
g - the graphics context.

remove

public void remove(int i)
Description copied from interface: LwContainer
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.
Specified by:
remove in interface LwContainer
Overrides:
remove in class LwPanel
Following copied from interface: org.zaval.lw.LwContainer
Parameters:
index - the index of the component to be removed.

removeAll

public void removeAll()
Description copied from interface: LwContainer
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.
Specified by:
removeAll in interface LwContainer
Overrides:
removeAll in class LwPanel

getDefaultLayout

protected LwLayout getDefaultLayout()
Description copied from class: LwPanel
Gets the default layout manager that is set with the container during initialization. This implementation of the method returns LwRastLayout as the default layout manager, the layout manager is got as a static object by "layout.raster" key.
Overrides:
getDefaultLayout in class LwPanel
Following copied from class: org.zaval.lw.LwPanel
Returns:
a layout manager.


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