org.zaval.lw
Class LwCompRender
java.lang.Object
|
+--org.zaval.lw.LwView
|
+--org.zaval.lw.LwRender
|
+--org.zaval.lw.LwCompRender
- All Implemented Interfaces:
- Validationable
- public class LwCompRender
- extends LwRender
The class implements lightweight component render interface that provides ability to render
a lightweight component (the 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,
Layoutable d)
Paints the view using the given width and height. |
protected void |
recalc()
Invoked by the validate method if the view is invalid. |
| Methods inherited from class org.zaval.lw.LwView |
getBottom, getLeft, getPreferredSize, getRight, getTop, getType, invalidate, isValid, ownerChanged, paint, setType, validate |
| 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 preferred size if it is defined.
- Overrides:
calcPreferredSize in class LwView
- Returns:
- a "pure" preferred size of the view.
recalc
protected void recalc()
- Invoked by the
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 necessary, so there you don't need 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,
Layoutable 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.
|