|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.zaval.util.ValidationObject | +--org.zaval.lw.LwCanvas | +--org.zaval.lw.LwPanel
This is implementation of the light weight container interface that has to be used to develop own light weight containers. The container implementation inherits the light weight component implementation. Draw attention at the following features:
null
.
calcPreferredSize
method as it needs for LwCanvas,
because the container preferred size is determined by a layout manager.
recalc
method as it needs for LwCanvas,
because the container preferred size is determined by a layout manager.
setSize
and setLocation
methods of the components)
to layout child components.
Field Summary | |
protected java.util.Vector |
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 | |
LwPanel()
Constructs the container. |
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. |
protected java.awt.Dimension |
calcPreferredSize()
Gets the "pure" preferred size for this component. |
int |
count()
Returns the number of child components in this container. |
Layoutable |
get(int i)
Gets a child component at the given index. |
protected LwLayout |
getDefaultLayout()
Gets the default layout manager that is set with the container during initialization. |
java.awt.Point |
getLayoutOffset()
Returns the offset. |
LwComponent |
getLwComponentAt(int xx,
int yy)
Determines if the component or an immediate child component contains the (xx, yy) location in its visible part and if so, returns the component. |
LwLayout |
getLwLayout()
Gets the layout manager of 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,
LwComponent d)
Inserts the specified lightweight component as a child of this container at the specified position in the container list. |
void |
insert(int i,
java.lang.Object s,
LwComponent d)
Inserts the specified lightweight component with the specified constraints as a child of this container at the specified position in the container list. |
void |
invalidate()
Invalidates this object. |
void |
paintOnTop(java.awt.Graphics g)
Paints additional elements (for example, marker) after the container and its child components have been rendered. |
protected void |
recalc()
Invoked with validate method only if the component is not valid. |
void |
remove(int i)
Removes the component at the specified index from this container. |
void |
remove(LwComponent c)
Removes the specified component from this container. |
void |
removeAll()
Removes all child components from this container. |
void |
setBackground(java.awt.Color c)
Sets the background color of this container. |
void |
setLwLayout(LwLayout m)
Sets the layout manager for this container. |
void |
setOpaque(boolean b)
Sets the opaque of this component. |
void |
toFront(LwComponent c)
Sets the specified child component to be painted over other child components. |
protected void |
updateCashedPs(int w,
int h)
|
Methods inherited from class org.zaval.lw.LwCanvas |
canHaveFocus, 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.LwComponent |
canHaveFocus, getLwParent, getViewMan, getVisiblePart, setEnabled, setLwParent, setViewMan, setVisible |
Methods inherited from interface org.zaval.lw.Drawable |
getBackground, getOrigin, isEnabled, isOpaque, paint, repaint, repaint, update |
Methods inherited from interface org.zaval.util.Validationable |
isValid, validate |
Methods inherited from interface org.zaval.lw.Layoutable |
getBounds, getHeight, getInsets, getLocation, getPreferredSize, getSize, getWidth, getX, getY, isVisible, setLocation, setSize |
Field Detail |
protected java.util.Vector children
Constructor Detail |
public LwPanel()
Method Detail |
public void paintOnTop(java.awt.Graphics g)
LwContainer
paintOnTop
in interface LwContainer
org.zaval.lw.LwContainer
g
-
the graphics context.public void add(java.lang.Object s, LwComponent c)
componentAdded
method its
layout manager to inform the layout manager that the new child has been added with
the given constraints.add
in interface LwContainer
s
- the object expressing layout constraints for this.c
- the lightweight component to be added.public void add(LwComponent c)
componentAdded
method its layout manager to inform
the layout manager that the new child has been added.add
in interface LwContainer
c
- the lightweight component to be added.public void insert(int i, LwComponent d)
componentAdded
method its layout manager to inform the layout manager
that the new child has been added.i
- the position in the container list at which to insert
the component.d
- the lightweight component to be added.public void insert(int i, java.lang.Object s, LwComponent d)
componentAdded
method its layout manager to inform the layout manager
that the new child has been added with the given constraints.insert
in interface LwContainer
i
- the position in the container list at which to insert
the component.s
- the object expressing layout contraints for this.d
- the lightweight component to be added.public void remove(LwComponent c)
componentRemoved
method of the manager.c
- the specified component to be removed.public void remove(int i)
componentRemoved
method of the manager.remove
in interface LwContainer
i
- the index of the component to be removed.public void removeAll()
componentRemoved
method of the manager for every child that has been
removed.removeAll
in interface LwContainer
public int indexOf(LwComponent c)
indexOf
in interface LwContainer
c
- the component to get index.public Layoutable get(int i)
get
in interface LayoutContainer
i
- the specified index of the child to be returned.public int count()
count
in interface LayoutContainer
public void setLwLayout(LwLayout m)
null
as a layout manager, in this case IllegalArgumentException will be thrown.setLwLayout
in interface LwContainer
m
- the specified layout manager.public LwLayout getLwLayout()
getLwLayout
in interface LwContainer
public void setBackground(java.awt.Color c)
setBackground
in interface LwComponent
setBackground
in class LwCanvas
c
- the color to become this component background color.public void setOpaque(boolean b)
false
argument value to make a transparent component from this component.
Additionally the method sets the specified opaque for every child component.setOpaque
in interface Drawable
setOpaque
in class LwCanvas
b
- the opaque flag.public LwComponent getLwComponentAt(int xx, int yy)
getLwComponentAt
in interface LwComponent
getLwComponentAt
in class LwCanvas
xx
- the x coordinate.yy
- the y coordinate.null
if the location is outside of this component visible part.public void toFront(LwComponent c)
c
- the specified child component.protected void recalc()
validate
method only if the component is not valid.
The method should not be overrided for this container like it can be done for LwCanvas,
because the method starts validating and layouting of the child components.recalc
in class LwCanvas
public java.awt.Point getLayoutOffset()
x
is offset for x-coordinates and y
is offset for y-coordinates. The ability to offset child components with a layout manager
is used with the library to organize scrolling.getLayoutOffset
in interface LayoutContainer
public void invalidate()
Validationable
invalidate
in interface Validationable
invalidate
in class LwCanvas
protected java.awt.Dimension calcPreferredSize()
calcPreferredSize
in class LwCanvas
protected LwLayout getDefaultLayout()
protected void updateCashedPs(int w, int h)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |