|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object
oracle.javatools.columnlayout.LayoutLeaf
public class LayoutLeaf
A LayoutLeaf wraps a single UI component that can span multiple rows and columns and be resizable.
Constructor Summary | |
---|---|
LayoutLeaf(java.awt.Component component, java.awt.Insets insets, int columnSpan, boolean isRowResizable, boolean isColumnResizable, int anchor, int fill) Create a LayoutLeaf for a UI component. |
Method Summary | |
---|---|
void |
addToPanel(java.awt.Container container, int baseRow, int baseColumn, boolean[] rowConstraints, boolean[] columnConstraints, int rowSpan) We add the component to the container with appropriate GridBagConstraints. |
void |
areColumnsResizable(boolean[] columnConstraints, int baseColumn) If the LayoutLeaf is resizable and only spans one column then the column is resizable. |
void |
areRowsResizable(boolean[] rowConstraints, int baseRow, int rowSpan) If the LayoutLeaf is resizable and only spans one row then the row is resizable. |
int |
getColumnCount() The number of columns for a LayoutLeaf is the same as its wrapped object. |
int |
getRowCount() A LayoutLeaf only ever has a single row. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LayoutLeaf(java.awt.Component component, java.awt.Insets insets, int columnSpan, boolean isRowResizable, boolean isColumnResizable, int anchor, int fill)
component
- the component to be wrapped, must not be null.insets
- the insets for the component within its cell, if null is passed then (0, 0, 0, 0) is used.columnSpan
- the number of columns the component occupies, must be >0isRowResizable
- is the component vertically resizableisColumnResizable
- is the component horizontally resizableanchor
- the anchor position for the component, one of the grid bag layout compass points.fill
- whether the component should fill all its given space, one of the grid bag layout horizontal or vertical constraints.Method Detail |
---|
public void areRowsResizable(boolean[] rowConstraints, int baseRow, int rowSpan)
areRowsResizable
in interface LayoutComponent
rowConstraints
- the out parameterbaseRow
- the position to start from in the rowConstraintsrowSpan
- the length of the rowConstraints which can be changedpublic void areColumnsResizable(boolean[] columnConstraints, int baseColumn)
areColumnsResizable
in interface LayoutComponent
public int getColumnCount()
getColumnCount
in interface LayoutComponent
public int getRowCount()
getRowCount
in interface LayoutComponent
public void addToPanel(java.awt.Container container, int baseRow, int baseColumn, boolean[] rowConstraints, boolean[] columnConstraints, int rowSpan)
Unfortunately GridBagLayout uses the preferred size of a component as the initial size for a row or column. For resizable components it then adds extra space to this. We actually want to ignore the preferred size of components in resizable rows or columns, so we need to pretend it is 0 in that dimension. To achieve this the resizable component is wrapped in a JPanel subclass which fakes the preferred size using the components preferred size. This is dynamic: if the components preferred size changes the JPanel's returned size will match in the non-resizable dimensions.
addToPanel
in interface LayoutComponent
container
- the container to add tobaseRow
- components must be added relative to thisbaseColumn
- components must be added relative to thisrowConstraints
- whether each row is resizable or not, these are for the whole containercolumnConstraints
- same as rowConstraints but for columnsrowSpan
- the number of rows which the LayoutComponent occupies this will be at least equal to the LayoutComponent's row count
|
Oracle Fusion Middleware Java API Reference for Oracle Extension SDK Reference 11g Release 1 (11.1.1.7.2) E13403-10 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |