public class GroupPaneLayout extends AbstractGroupingLayout implements javax.swing.SwingConstants
GroupPane container.
It constructs a grid of components to be visually grouped and knows how to retrieve components at specific cells.| Modifier and Type | Field and Description |
|---|---|
protected int |
columns
Amount of columns used to place components.
|
protected java.util.Map<java.awt.Component,GroupPaneConstraints> |
constraints
Component constraints.
|
protected int |
orientation
Components placement order orientation.
|
protected int |
rows
Amount of rows used to place components.
|
buttonGroup, children, group, groupButtons, sides| Constructor and Description |
|---|
GroupPaneLayout()
Constructs default layout.
|
GroupPaneLayout(int orientation)
Constructs layout with the specified amount of rows and columns.
|
GroupPaneLayout(int columns,
int rows)
Constructs layout with the specified amount of rows and columns.
|
GroupPaneLayout(int orientation,
int columns,
int rows)
Constructs layout with the specified amount of rows and columns.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addComponent(java.awt.Component component,
java.lang.Object c)
Called when component added into container with this layout.
|
protected void |
appendDelta(int count,
int[] sizes,
int size)
Appends delta space equally to last elements to properly fill in all available space.
|
protected com.alee.utils.general.Pair<int[],int[]> |
calculateSizes(java.awt.Container parent,
GridSize gridSize,
com.alee.utils.swing.SizeType type)
Returns column and row sizes.
|
protected com.alee.utils.general.Pair<java.lang.Double,java.lang.Integer> |
calculateSizes(int count,
int size,
int[] sizes,
double[] percents)
Calculates proper component sizes along with percents summ and free size.
|
GridSize |
getActualGridSize(java.awt.Container parent)
Returns actual grid size according to container components amount.
|
int |
getColumns()
Returns amount of columns used to place components.
|
java.awt.Component |
getComponentAt(java.awt.Container parent,
int column,
int row)
Returns component at the specified cell.
|
protected com.alee.utils.general.Pair<java.lang.String,java.lang.String> |
getDescriptors(java.awt.Container parent,
java.awt.Component component,
int index)
Returns descriptors for painted component sides and lines.
|
java.awt.Component |
getNeighbour(java.awt.Container parent,
GridSize gridSize,
int col,
int row,
int direction)
Returns neighbour component.
|
int |
getOrientation()
Returns components placement order orientation.
|
int |
getRows()
Returns amount of rows used to place components.
|
int |
indexToColumn(java.awt.Container parent,
int index,
GridSize gridSize)
Returns grid column in which component under the specified index is placed.
|
int |
indexToRow(int index)
Returns grid row in which component under the specified index is placed.
|
boolean |
isNeighbourDecoratable(java.awt.Container parent,
GridSize gridSize,
int col,
int row,
int direction)
Returns whether or not neighbour component painter is decoratable.
|
void |
layoutContainer(java.awt.Container parent) |
int |
pointToIndex(java.awt.Container parent,
int column,
int row,
GridSize gridSize)
Returns index of the component placed in the specified grid cell or
null if cell is empty. |
java.awt.Dimension |
preferredLayoutSize(java.awt.Container parent) |
void |
removeComponent(java.awt.Component component)
Called when component removed from container with this layout.
|
void |
setColumns(int columns)
Sets amount of columns used to place components.
|
void |
setOrientation(int orientation)
Sets components placement order orientation.
|
void |
setRows(int rows)
Sets amount of rows used to place components.
|
clearGrouping, createButtonGroup, getButtonGroup, getLines, getSides, isGroupable, isGroupButtons, isGrouping, isPaintBottom, isPaintLeft, isPaintRight, isPaintTop, resetDescriptors, setGroup, setGroupButtons, setPaintBottom, setPaintLeft, setPaintRight, setPaintSides, setPaintTop, sides, updateButtonGroupingaddLayoutComponent, addLayoutComponent, getLayoutAlignmentX, getLayoutAlignmentY, invalidateLayout, maximumLayoutSize, minimumLayoutSize, removeLayoutComponentclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait@XStreamAsAttribute protected int orientation
@XStreamAsAttribute protected int columns
@XStreamAsAttribute protected int rows
protected final transient java.util.Map<java.awt.Component,GroupPaneConstraints> constraints
public GroupPaneLayout()
public GroupPaneLayout(int orientation)
orientation - components placement order orientationpublic GroupPaneLayout(int columns,
int rows)
columns - amount of columns used to place componentsrows - amount of rows used to place componentspublic GroupPaneLayout(int orientation,
int columns,
int rows)
orientation - components placement order orientationcolumns - amount of columns used to place componentsrows - amount of rows used to place componentspublic int getOrientation()
public void setOrientation(int orientation)
orientation - components placement order orientationpublic int getColumns()
public void setColumns(int columns)
columns - amount of columns to place componentspublic int getRows()
public void setRows(int rows)
rows - amount of rows to place componentspublic void addComponent(java.awt.Component component,
java.lang.Object c)
AbstractLayoutManageraddComponent in class AbstractGroupingLayoutcomponent - added componentc - component constraintspublic void removeComponent(java.awt.Component component)
AbstractLayoutManagerremoveComponent in class AbstractGroupingLayoutcomponent - removed componentpublic void layoutContainer(java.awt.Container parent)
layoutContainer in interface java.awt.LayoutManagerpublic java.awt.Dimension preferredLayoutSize(java.awt.Container parent)
preferredLayoutSize in interface java.awt.LayoutManagerpublic GridSize getActualGridSize(java.awt.Container parent)
parent - group panepublic java.awt.Component getComponentAt(java.awt.Container parent,
int column,
int row)
parent - group panecolumn - component columnrow - component rowpublic int indexToColumn(java.awt.Container parent,
int index,
GridSize gridSize)
parent - group paneindex - component indexgridSize - actual grid sizepublic int indexToRow(int index)
index - component indexpublic int pointToIndex(java.awt.Container parent,
int column,
int row,
GridSize gridSize)
null if cell is empty.parent - group panecolumn - grid column indexrow - grid row indexgridSize - actual grid sizenull if cell is emptyprotected com.alee.utils.general.Pair<int[],int[]> calculateSizes(java.awt.Container parent,
GridSize gridSize,
com.alee.utils.swing.SizeType type)
parent - group panegridSize - actual grid sizetype - requested sizes typeprotected com.alee.utils.general.Pair<java.lang.Double,java.lang.Integer> calculateSizes(int count,
int size,
int[] sizes,
double[] percents)
count - parts countsize - total available sizesizes - part sizespercents - part percentagesprotected void appendDelta(int count,
int[] sizes,
int size)
count - parts countsizes - part sizessize - total available sizeprotected com.alee.utils.general.Pair<java.lang.String,java.lang.String> getDescriptors(java.awt.Container parent,
java.awt.Component component,
int index)
AbstractGroupingLayoutgetDescriptors in class AbstractGroupingLayoutparent - component containercomponent - painted componentindex - component z-index in containerpublic boolean isNeighbourDecoratable(java.awt.Container parent,
GridSize gridSize,
int col,
int row,
int direction)
parent - containergridSize - actual grid sizecol - current component columnrow - current component rowdirection - neighbour directionpublic java.awt.Component getNeighbour(java.awt.Container parent,
GridSize gridSize,
int col,
int row,
int direction)
parent - containergridSize - actual grid sizecol - current component columnrow - current component rowdirection - neighbour direction