All Packages Class Hierarchy This Package Previous Next Index
Class htmllayout.HtmlLayout
java.lang.Object
|
+----htmllayout.HtmlLayout
- public class HtmlLayout
- extends Object
- implements LayoutManager
HtmlLayout uses a string containing HTML like table tags to
layout components.
Ex:
<table rows=2 cols=2>
<tr>
<td> A label
<td component=someName>
<tr>
<td component=anotherName vert=max>
<td component="some other name" horz=max>
Tags and their options
Table
- Contains TR
- horz= LEFT | RIGHT | CENTER | FIT | (MAX)
Specifies how the table fills the available width
- vert= TOP | BOTTOM | CENTER | FIT | (MAX)
Specifies how the table fills the available height
- rows=y ; y = rowCount (req)
- cols=y ; y = colCount (req)
- hgap=y ; y = horizontal gap between components
- vgap=y ; y = vertical gap between components
- hpad=y ; y = horizontal padding (components made wider)
- vpad=y ; y = vertical padding (components made taller)
TR
- Contains TD
- vgap=y ; y = gap between this row and the row above
TD
- Contains text (creates a label) or TABLE but only if no component
is specified. Nested tables inherit the gaps and pads of their
enclosing table.
- colspan=y
- rowspan=y
- horz= (LEFT) | RIGHT | CENTER | FIT | MAX
Specifies how the component fills the available cell width
- vert= TOP | BOTTOM | (CENTER) | FIT | MAX
Specifies how the component fills the available cell height
- hgap=y ; y = horizontal gap between components
- vgap=y ; y = vertical gap between components
- hpad=y ; y = horizontal padding
- vpad=y ; y = vertical padding (components made larger)
- component="componentName" ; this is the name that must be used
when add is called, as in add(comp, "componentName")
- Author:
- Paul Buchheit
-
HtmlLayout(String)
- Creates an HtmlLayout with the specified "HTML" string.
-
addLabels(Container)
- If this layout includes any automatic lables (text within a TD)
this will add them to container parent.
-
addLayoutComponent(String, Component)
-
-
layoutContainer(Container)
-
-
minimumLayoutSize(Container)
-
-
preferredLayoutSize(Container)
-
-
removeLayoutComponent(Component)
-
-
toString()
- Returns a string representation of the object.
HtmlLayout
public HtmlLayout(String html)
- Creates an HtmlLayout with the specified "HTML" string.
- Parameters:
- html
The - "HTML" which specifies the layout, if this is not valid
table-html a BadTableHtmlException will be thrown. Html can
be tested ahead of time using HtmlLayoutTest.
- See Also:
- BadTableHtmlException, HtmlLayoutTest
addLabels
public void addLabels(Container parent)
- If this layout includes any automatic lables (text within a TD)
this will add them to container parent.
It is not always necessary to call this, if you don't it will
automatically be called when the container is first sized or
layed out. Ordinarily this is ok but not always, such as when
using CardLayout. Calling addLabels manually at the same time
as the other components are added will never be a problem.
addLayoutComponent
public void addLayoutComponent(String name,
Component comp)
- See Also:
- addLayoutComponent
removeLayoutComponent
public void removeLayoutComponent(Component comp)
- See Also:
- removeLayoutComponent
preferredLayoutSize
public Dimension preferredLayoutSize(Container parent)
- See Also:
- preferredLayoutSize
minimumLayoutSize
public Dimension minimumLayoutSize(Container parent)
- See Also:
- minimumLayoutSize
layoutContainer
public void layoutContainer(Container parent)
- See Also:
- layoutContainer
toString
public String toString()
- Returns a string representation of the object.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index