|
ProgramixGenericLib v5.0.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.programix.gui.layout.AbstractTableLayout
com.programix.gui.layout.AnchorTableLayout
public class AnchorTableLayout
A table layout that allows an
AnchorPoint to be specified
for some (or all) of child components added,
for some (or all) of the columns, and
for some (or all) of the column headers.
Specifically, an AnchorPoint is optionally specified for each
of the columns.
Additionally, a different AnchorPoint is optionally specified
for each of the columns in the table's first row (table header).
Furthermore, a different AnchorPoint is optionally specified for
each of the Component's added to the table by specifying
an AnchorPoint as a constraint at the time that the
Component is added to its Container
(using the add(Component comp, Object constraint) method from Container).
Some subclasses of this layout manager will have defaults for columns.
Those defaults should be used unless a specific anchor has been specified
for the column.
If getColumnAnchorPoint(int colIdx)
returns null, this indicates that there has not been a request to
override the default anchor point for all rows in the column.
If getColumnHeaderAnchorPoint(int colIdx)
returns null, this indicates that there has not been a request to
override the default anchor point for the first row in the column.
The anchor used is the first one found from the following (precedence):
AnchorPoint.CENTER
is used.There's nothing in this class that prevents a single instance from being used simultaneously by multiple containers. If this class is a subclass, be sure that this is also true for the particular subclass that is being used.
FormLayout,
ColumnButtonLayout,
RowButtonLayout,
StackLayout,
ShelfLayout,
Serialized Form| Nested Class Summary | |
|---|---|
protected class |
AnchorTableLayout.AnchorTableCellData
|
| Nested classes/interfaces inherited from class com.programix.gui.layout.AbstractTableLayout |
|---|
AbstractTableLayout.CellData |
| Field Summary |
|---|
| Fields inherited from class com.programix.gui.layout.AbstractTableLayout |
|---|
anchorPoint, borderGap, colGap, columnCoordinator, DEFAULT_ANCHOR_POINT, DEFAULT_BORDER_GAP, DEFAULT_COL_GAP, DEFAULT_ROW_GAP, ignoreInvisibleComponents, rowGap |
| Constructor Summary | |
|---|---|
AnchorTableLayout(int columnCount)
Creates a table layout with the specified number of columns. |
|
AnchorTableLayout(int columnCount,
AnchorPoint anchorPoint)
Creates a table layout with the specified number of columns. |
|
AnchorTableLayout(int columnCount,
int borderGap)
Creates a table layout with the specified number of columns. |
|
AnchorTableLayout(int columnCount,
int borderGap,
AnchorPoint anchorPoint)
Creates a table layout with the specified number of columns. |
|
AnchorTableLayout(int columnCount,
int rowGap,
int colGap,
AnchorPoint anchorPoint)
Creates a table layout with the specified number of columns. |
|
AnchorTableLayout(int columnCount,
int rowGap,
int colGap,
int borderGap)
Creates a table layout with the specified number of columns. |
|
AnchorTableLayout(int columnCount,
int rowGap,
int colGap,
int borderGap,
AnchorPoint anchorPoint)
Creates a table layout with the specified number of columns. |
|
| Method Summary | |
|---|---|
void |
addLayoutComponent(Component comp,
Object constraints)
Called by the graphical subsystem when a component is being added to the container with constraints. |
protected AbstractTableLayout.CellData |
createCellData(Container pane)
This implementation returns a an instance of AnchorTableLayout.AnchorTableCellData
with a default anchor for all columns of AnchorPoint.CENTER. |
AnchorPoint |
getColumnAnchorPoint(int columnIndex)
Returns the AnchorPoint (if defined)
for the specified column. |
int |
getColumnCount()
Returns the number of columns currently defined for this table. |
AnchorPoint |
getColumnHeaderAnchorPoint(int columnIndex)
Returns the AnchorPoint (if defined)
for the specified column's first row (header). |
float |
getLayoutAlignmentX(Container target)
|
float |
getLayoutAlignmentY(Container target)
|
void |
invalidateLayout(Container target)
|
Dimension |
maximumLayoutSize(Container target)
|
void |
removeLayoutComponent(Component comp)
Called by the graphical subsystem when a component is being removed from the container. |
void |
setColumnAnchorPoint(int columnIndex,
AnchorPoint anchor)
Set a specific AnchorPoint for a column. |
void |
setColumnCount(int columnCount)
Changes the number of columns in this table. |
void |
setColumnHeaderAnchorPoint(int columnIndex,
AnchorPoint anchor)
Set a specific AnchorPoint for the specified column's
first row (header). |
| Methods inherited from class com.programix.gui.layout.AbstractTableLayout |
|---|
addLayoutComponent, getAnchorPoint, getBorderGap, getColumnCoordinator, getColumnGap, getRowGap, isIgnoreInvisibleComponents, layoutContainer, minimumLayoutSize, preferredLayoutSize, setAnchorPoint, setBorderGap, setColumnCoordinator, setColumnGap, setIgnoreInvisibleComponents, setRowGap |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface java.awt.LayoutManager |
|---|
addLayoutComponent, layoutContainer, minimumLayoutSize, preferredLayoutSize |
| Constructor Detail |
|---|
public AnchorTableLayout(int columnCount,
int rowGap,
int colGap,
int borderGap,
AnchorPoint anchorPoint)
columnCount - number of columns in this table.
See setColumnCount().rowGap - space between rows.
See setRowGap().colGap - space between columns.
See setColumnGap.borderGap - space around the outside of the form.
See setBorderGap().anchorPoint - region to anchor to when there is extra space
See setAnchorPoint().
public AnchorTableLayout(int columnCount,
int rowGap,
int colGap,
int borderGap)
DEFAULT_ANCHOR_POINT.
columnCount - number of columns in this table.
See setColumnCount().rowGap - space between rows.
See setRowGap().colGap - space between columns.
See setColumnGap.borderGap - space around the outside of the form.
See setBorderGap().
public AnchorTableLayout(int columnCount,
int rowGap,
int colGap,
AnchorPoint anchorPoint)
DEFAULT_BORDER_GAP.
columnCount - number of columns in this table.
See setColumnCount().rowGap - space between rows.
See setRowGap().colGap - space between columns.
See setColumnGap.anchorPoint - region to anchor to when there is extra space
See setAnchorPoint().
public AnchorTableLayout(int columnCount,
int borderGap)
DEFAULT_ROW_GAP.
Uses DEFAULT_COL_GAP.
Uses DEFAULT_ANCHOR_POINT.
columnCount - number of columns in this table.
See setColumnCount().borderGap - space around the outside of the form.
See setBorderGap().
public AnchorTableLayout(int columnCount,
int borderGap,
AnchorPoint anchorPoint)
DEFAULT_ROW_GAP.
Uses DEFAULT_COL_GAP.
columnCount - number of columns in this table.
See setColumnCount().borderGap - space around the outside of the form.
See setBorderGap().anchorPoint - region to anchor to when there is extra space
See setAnchorPoint().
public AnchorTableLayout(int columnCount,
AnchorPoint anchorPoint)
DEFAULT_ROW_GAP.
Uses DEFAULT_COL_GAP.
Uses DEFAULT_BORDER_GAP.
columnCount - number of columns in this table.
See setColumnCount().anchorPoint - region to anchor to when there is extra space
See setAnchorPoint().public AnchorTableLayout(int columnCount)
DEFAULT_ROW_GAP.
Uses DEFAULT_COL_GAP.
Uses DEFAULT_BORDER_GAP.
Uses DEFAULT_ANCHOR_POINT.
columnCount - number of columns in this table.
See setColumnCount().| Method Detail |
|---|
public void removeLayoutComponent(Component comp)
removeLayoutComponent in interface LayoutManagerremoveLayoutComponent in class AbstractTableLayout
public void addLayoutComponent(Component comp,
Object constraints)
addLayoutComponent in interface LayoutManager2public Dimension maximumLayoutSize(Container target)
maximumLayoutSize in interface LayoutManager2public float getLayoutAlignmentX(Container target)
getLayoutAlignmentX in interface LayoutManager2public float getLayoutAlignmentY(Container target)
getLayoutAlignmentY in interface LayoutManager2public void invalidateLayout(Container target)
invalidateLayout in interface LayoutManager2public int getColumnCount()
setColumnCount(int)public void setColumnCount(int columnCount)
columnCount - new number of columns; must be at least one.
If this is the same as the current number of columns, this method
call does nothing.
public AnchorPoint getColumnAnchorPoint(int columnIndex)
throws IllegalArgumentException
AnchorPoint (if defined)
for the specified column. If no specific anchor has been defined
for the specified column, then null is returned.
The anchors for each column may be specified by using
setColumnAnchorPoint(int, AnchorPoint).
columnIndex - the desired column. Columns are numbered starting
from zero {0, 1, 2, ... (NumOfColumns - 1)}.
AnchorPoint if there has previously been a
specific anchor defined. Or null if nothing has been
specified to override the default for the particular layout manager.
IllegalArgumentException - if columnIndex is
less than zero or greater than or equal to the number of columns.setColumnAnchorPoint(int, AnchorPoint),
getColumnHeaderAnchorPoint(int),
setColumnHeaderAnchorPoint(int, AnchorPoint)
public void setColumnAnchorPoint(int columnIndex,
AnchorPoint anchor)
throws IllegalArgumentException
AnchorPoint for a column. Passing in
null for the AnchorPoint will cause the column
to revert to the default anchor point for a column. Otherwise,
the AnchorPoint specified overrides any default (or calculated)
AnchorPoint that would have been used for the specified column.
columnIndex - the desired column. Columns are numbered starting
from zero {0, 1, 2, ... (NumOfColumns - 1)}.anchor - the AnchorPoint to use for this column.
If non-null, the specified anchor will override any
default for the column. If null, the column will revert
to using the default anchor for the column as defined by a
specific layout manager (subclass).
IllegalArgumentException - if columnIndex is
less than zero or greater than or equal to the number of columns.getColumnAnchorPoint(int),
getColumnHeaderAnchorPoint(int),
setColumnHeaderAnchorPoint(int, AnchorPoint)
public AnchorPoint getColumnHeaderAnchorPoint(int columnIndex)
throws IllegalArgumentException
AnchorPoint (if defined)
for the specified column's first row (header).
If no specific anchor has been defined
for the specified column's header, then null is returned.
The anchors for each column's first row may be specified by using
setColumnHeaderAnchorPoint(int, AnchorPoint).
If this method returns null, then the anchor might be
specified by getColumnAnchorPoint(int). If that also
returns null, then the default anchor the specific
layout manager should be used.
columnIndex - the desired column. Columns are numbered starting
from zero {0, 1, 2, ... (NumOfColumns - 1)}.
AnchorPoint if there has previously been a
specific anchor defined. Or null if nothing has been
specified to override the default for the particular layout manager.
IllegalArgumentException - if columnIndex is
less than zero or greater than or equal to the number of columns.setColumnHeaderAnchorPoint(int, AnchorPoint),
getColumnAnchorPoint(int),
setColumnAnchorPoint(int, AnchorPoint)
public void setColumnHeaderAnchorPoint(int columnIndex,
AnchorPoint anchor)
throws IllegalArgumentException
AnchorPoint for the specified column's
first row (header). Passing in
null for the AnchorPoint will cause the column
to revert to the default anchor point for a column (which may come
from getColumnAnchorPoint(int) or the default for the
particular layout manager).
Otherwise, the AnchorPoint specified overrides any default
(or calculated) AnchorPoint that would have been used for
the specified column's first row.
columnIndex - the desired column. Columns are numbered starting
from zero {0, 1, 2, ... (NumOfColumns - 1)}.anchor - the AnchorPoint to use for the first row
of the specified column.
If non-null, the specified anchor will override any
default for the column's first row.
If null, the column will revert
to using the anchor for the column as defined by
getColumnAnchorPoint(int).
IllegalArgumentException - if columnIndex is
less than zero or greater than or equal to the number of columns.getColumnHeaderAnchorPoint(int),
getColumnAnchorPoint(int),
setColumnAnchorPoint(int, AnchorPoint)protected AbstractTableLayout.CellData createCellData(Container pane)
AnchorTableLayout.AnchorTableCellData
with a default anchor for all columns of AnchorPoint.CENTER.
If this is appropriate for a subclass, then the subclass does not
need to override this method.
createCellData in class AbstractTableLayout
|
ProgramixGenericLib v5.0.1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||