org.zaval.lw
Class LwCompRender
java.lang.Object
|
+--org.zaval.util.ValidationObject
|
+--org.zaval.lw.LwView
|
+--org.zaval.lw.LwRender
|
+--org.zaval.lw.LwCompRender
- All Implemented Interfaces:
- Validationable
- public class LwCompRender
- extends LwRender
The class implements lightweigt component render interface that provides ability to render
a light weight component (the light weight component should be used as a target for the render).
Constructor Summary |
LwCompRender(LwComponent c)
Constructs the render with the specified target light weight component. |
Method Summary |
protected java.awt.Dimension |
calcPreferredSize()
Calculates and returns the view preferred size. |
void |
paint(java.awt.Graphics g,
int x,
int y,
int w,
int h,
Drawable d)
Paints the view using the given width and height. |
protected void |
recalc()
Invoked with validate method if the view is invalid. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LwCompRender
public LwCompRender(LwComponent c)
- Constructs the render with the specified target light weight component.
- Parameters:
c
- the target light weight component to be rendered.
calcPreferredSize
protected java.awt.Dimension calcPreferredSize()
- Calculates and returns the view preferred size. The method has not to use
the view insets to compute the preferred size (this is named "pure" preferred size).
The method returns the target light weight component prefered size if it is defined.
- Overrides:
calcPreferredSize
in class LwView
- Returns:
- a "pure" preferred size of the view.
recalc
protected void recalc()
- Invoked with
validate
method if the view is invalid. The method
is used to calculate metrical characteristics of the view and the method
is called only if it is realy necessary, so there is not necessaty to care about
superfluous calling and computing.
- Overrides:
recalc
in class LwView
paint
public void paint(java.awt.Graphics g,
int x,
int y,
int w,
int h,
Drawable d)
- Paints the view using the given width and height. The location where the
view has to be painted is determined with
x
and y
coordinates.
- Overrides:
paint
in class LwView
- Parameters:
g
- the specified context to be used for painting.x
- the x coordinate.y
- the y coordinate.w
- the width of the view.h
- the height of the view.d
- the owner component.
Copyright © Zaval Creative Engineering Group, 2000-2005.
http://www.zaval.org