com.abstractics.xmlpanel.xmllayout
Class XmlLayoutCell

java.lang.Object
  extended bycom.abstractics.xmlpanel.xmllayout.XmlLayoutSize
      extended bycom.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

Field Summary
static int STRETCH_BOTH
           
static int STRETCH_HORIZONTAL
           
static int STRETCH_NONE
           
static int STRETCH_VERTICAL
           
 
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
 
Constructor Summary
(package private) XmlLayoutCell(XmlLayoutRow parentRow, XmlPanel panel, org.w3c.dom.Element element)
          Only package level constructable.
 
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 com.abstractics.xmlpanel.xmllayout.XmlLayoutSize
determineSizes, getFixed, getPercent, isFixed, isPercent, isRemainder, isUnspecified
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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
Constructor Detail

XmlLayoutCell

XmlLayoutCell(XmlLayoutRow parentRow,
              XmlPanel panel,
              org.w3c.dom.Element element)
Only package level constructable. Created from the XmlLayoutRow object

Parameters:
parentRow -
panel -
element -
Method Detail

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:

Returns:

getPreferredSize

public java.awt.Dimension getPreferredSize()
Preferred size relies on the following scenarios:

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