org.zaval.lw.theme
Class LwBorder
java.lang.Object
|
+--org.zaval.lw.LwView
|
+--org.zaval.lw.theme.LwBorder
- All Implemented Interfaces:
- Validationable
- Direct Known Subclasses:
- LwTitledBorder
- public class LwBorder
- extends LwView
This class implements generic border render. The rendering is customized by
LwLineRender class. The class specifies top, left, bottom and right lines
rendering rules.
|
Constructor Summary |
LwBorder(java.awt.Color c)
Constructs the border render that paints border using the specified color.
|
LwBorder(java.awt.Color c,
int size)
Constructs the border render that paints border using the specified color
with the given thickness. |
LwBorder(java.awt.Color c,
int size,
int bs)
Constructs the border render that paints border using the specified color
with the given thickness and the indent. |
LwBorder(LwLineRender r)
Constructs the border render using the specified line render to paint
the border's lines. |
|
Method Summary |
protected java.awt.Dimension |
calcPreferredSize()
Calculates and returns the view preferred size. |
int |
getBottom()
Gets the bottom indent. |
int |
getLeft()
Gets the left indent. |
int |
getRight()
Gets the right indent. |
int |
getTop()
Gets the top indent. |
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
render
protected LwLineRender render
LwBorder
public LwBorder(java.awt.Color c)
- Constructs the border render that paints border using the specified color.
The border thickness is 1.
- Parameters:
c - the specified border color.
LwBorder
public LwBorder(java.awt.Color c,
int size)
- Constructs the border render that paints border using the specified color
with the given thickness.
- Parameters:
c - the specified border color.size - the specified border thickness.
LwBorder
public LwBorder(java.awt.Color c,
int size,
int bs)
- Constructs the border render that paints border using the specified color
with the given thickness and the indent. The indent specifies minimal
top, left, bottom, right insets.
- Parameters:
c - the specified border color.size - the specified border thickness.bs - the specified indent.
LwBorder
public LwBorder(LwLineRender r)
- Constructs the border render using the specified line render to paint
the border's lines.
- Parameters:
r - the specified line render.
paint
public void paint(java.awt.Graphics g,
int x,
int y,
int w,
int h,
Layoutable d)
- Description copied from class:
LwView
- Paints the view using the given width and height. The location where the
view has to be painted is determined with the
x and y
coordinates. This abstract method has to be implemented to define a "face" for the view.
- Overrides:
paint in class LwView
- Following copied from class:
org.zaval.lw.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.
getTop
public int getTop()
- Description copied from class:
LwView
- Gets the top indent.
- Overrides:
getTop in class LwView
- Following copied from class:
org.zaval.lw.LwView
- Returns:
- a top indent.
getLeft
public int getLeft()
- Description copied from class:
LwView
- Gets the left indent.
- Overrides:
getLeft in class LwView
- Following copied from class:
org.zaval.lw.LwView
- Returns:
- a left indent.
getBottom
public int getBottom()
- Description copied from class:
LwView
- Gets the bottom indent.
- Overrides:
getBottom in class LwView
- Following copied from class:
org.zaval.lw.LwView
- Returns:
- a bottom indent.
getRight
public int getRight()
- Description copied from class:
LwView
- Gets the right indent.
- Overrides:
getRight in class LwView
- Following copied from class:
org.zaval.lw.LwView
- Returns:
- a right indent.
calcPreferredSize
protected java.awt.Dimension calcPreferredSize()
- Description copied from class:
LwView
- Calculates and returns the view preferred size. The method has not to use
the view insets to compute the preferred size.
- Overrides:
calcPreferredSize in class LwView
- Following copied from class:
org.zaval.lw.LwView
- Returns:
- a "pure" preferred size of the view.
|