com.abstractics.xmlpanel.xmllayout
Class XmlLayoutCell
java.lang.Object
com.abstractics.xmlpanel.xmllayout.XmlLayoutSize
com.abstractics.xmlpanel.xmllayout.XmlLayoutCell
- All Implemented Interfaces:
- javax.swing.SwingConstants
- public class XmlLayoutCell
- extends XmlLayoutSize
- implements javax.swing.SwingConstants
- Version:
- $Id: XmlLayoutCell.java,v 1.3 2006/03/15 05:37:44 andyman99 Exp $
- Author:
- Andrew Lawrence, Copyright 2006 Abstractics, L.L.C., Licensed under the Apache
License, Version 2.0
Fields inherited from interface javax.swing.SwingConstants |
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST |
Method Summary |
int |
getAlignment()
|
java.awt.Rectangle |
getBounds()
|
java.awt.Component |
getComponent()
|
java.awt.Dimension |
getMinimumSize()
Minimum size relies on the following scenarios:
If parent row is null (floating cell) then the minimum size is taken
from getBounds()
Use the component's minimum size
If the size is fixed (row or height) then use the max of the fixed
size and the component size
|
int |
getNeededSize()
Should return the size element of the preferred size needed for this type
of component (width for cells, height for rows) |
java.awt.Insets |
getPadding()
|
XmlLayoutRow |
getParentRow()
|
java.awt.Dimension |
getPreferredSize()
Preferred size relies on the following scenarios:
If parent row is null (floating cell) then the preferred size is
taken from getBounds()
If the cell is not included in the layout, then the width is 0
If a cell width is fixed, use that number for width
If a cell height is fixed, use that number for height
Otherwise use the components width/height and add padding
|
int |
getStretch()
|
boolean |
includeInLayout()
For cells, if the component is not visible, and the width is unspecified
then the cell should not be included |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
STRETCH_NONE
public static final int STRETCH_NONE
- See Also:
- Constant Field Values
STRETCH_HORIZONTAL
public static final int STRETCH_HORIZONTAL
- See Also:
- Constant Field Values
STRETCH_VERTICAL
public static final int STRETCH_VERTICAL
- See Also:
- Constant Field Values
STRETCH_BOTH
public static final int STRETCH_BOTH
- See Also:
- Constant Field Values
XmlLayoutCell
XmlLayoutCell(XmlLayoutRow parentRow,
XmlPanel panel,
org.w3c.dom.Element element)
- Only package level constructable. Created from the
XmlLayoutRow
object
- Parameters:
parentRow
- panel
- element
-
getComponent
public java.awt.Component getComponent()
- Returns:
- Returns the component
getParentRow
public XmlLayoutRow getParentRow()
- Returns:
- Returns the parentRow.
getMinimumSize
public java.awt.Dimension getMinimumSize()
- Minimum size relies on the following scenarios:
- If parent row is null (floating cell) then the minimum size is taken
from
getBounds()
- Use the component's minimum size
- If the size is fixed (row or height) then use the max of the fixed
size and the component size
- Returns:
getPreferredSize
public java.awt.Dimension getPreferredSize()
- Preferred size relies on the following scenarios:
- If parent row is null (floating cell) then the preferred size is
taken from
getBounds()
- If the cell is not included in the layout, then the width is 0
- If a cell width is fixed, use that number for width
- If a cell height is fixed, use that number for height
- Otherwise use the components width/height and add padding
- Specified by:
getPreferredSize
in class XmlLayoutSize
- Returns:
getAlignment
public int getAlignment()
- Returns:
- Returns the alignment.
getPadding
public java.awt.Insets getPadding()
- Returns:
- Returns the padding.
getNeededSize
public int getNeededSize()
- Description copied from class:
XmlLayoutSize
- Should return the size element of the preferred size needed for this type
of component (width for cells, height for rows)
- Specified by:
getNeededSize
in class XmlLayoutSize
- Returns:
getStretch
public int getStretch()
- Returns:
- Returns the stretch.
includeInLayout
public boolean includeInLayout()
- For cells, if the component is not visible, and the width is unspecified
then the cell should not be included
- Specified by:
includeInLayout
in class XmlLayoutSize
- Returns:
- See Also:
XmlLayoutSize.includeInLayout()
getBounds
public java.awt.Rectangle getBounds()
- Returns:
- If the cell is "floating" (no parent row) then this will return
the bounds for the component - otherwise null