XFA4J

com.adobe.xfa.layout
Class BoxModelLayout

java.lang.Object
  extended by com.adobe.xfa.layout.BoxModelLayout

public class BoxModelLayout
extends java.lang.Object

A class to access and manipulate the axis-aligned rectangular layout of form objects. Form objects that subscribe to this box model paradigm are <draw>, <field>, <subform>, <contentArea>, <area> and <pageArea>.

A box model defines a number of rectangular regions. All regions are relative to an offset from the local coordinate space, which has its origin at the top left corner of the nominal extent; this is the local box model origin.

All regions have a set of margins. A region may also have an optional border that may be inset from its extents.

A box model is characterized by the following:

The nominal extent is used for graphical placement. However, the actual rendering of the form object may include graphic elements that draw outside of the nominal extent; this is the visual extent.

Box model instances should be created using the static BoxModelLayout.newBoxModel(...) function.


Method Summary
 Angle getAngle()
          Gets the rotation angle.
 Rect getBorderExtent()
          Gets the nominal extent border rectangle relative to the local box model origin.
 Rect getCaptionExtent()
          Gets the caption bounding rectangle relative to the local box model origin.
 Margins getCaptionExtentMargins()
          Gets the margins (top/left/bottom/right insets) of the caption extent.
 Rect getContentBorderExtent()
          Gets the content border rectangle relative to the local box model origin.
 Rect getContentExtent()
          Gets the content rectangle.
 Margins getContentExtentMargins()
          Gets the margins (top/left/bottom/right insets) of the content extent.
 UnitSpan getHeight()
          Gets the height of the box model.
 Rect getNominalExtent()
          Gets the nominal bounding rectangle relative to the local box model origin.
 Margins getNominalExtentMargins()
          Gets the margins (top/left/bottom/right insets) of the nominal extent.
 Rect getVisualExtent()
          Gets the visual bounding rectangle relative to the local box model origin.
 UnitSpan getWidth()
          Gets the width of the box model.
 boolean hasCaption()
          Determines if this box model has any formattable content within it's caption region.
 boolean hasRotation()
          Determines if this box model has had a rotation applied.
static BoxModelLayout newBoxModel(Element node, LayoutEnv env, boolean bAllowProxy)
          Creates a new, fully initialized instance of a box model.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newBoxModel

public static BoxModelLayout newBoxModel(Element node,
                                         LayoutEnv env,
                                         boolean bAllowProxy)
Creates a new, fully initialized instance of a box model.

Parameters:
node - the form node that the box model applies to.
env - the layout environment.
bAllowProxy - allow proxy -- ie. drawn from stored text run definitions. ????.
Returns:
a new box model layout.

getNominalExtent

public Rect getNominalExtent()
Gets the nominal bounding rectangle relative to the local box model origin.

Returns:
The nominal extent rectangle.

getWidth

public UnitSpan getWidth()
Gets the width of the box model.

Returns:
The width of the box model.

getHeight

public UnitSpan getHeight()
Gets the height of the box model.

Returns:
The height of the box model.

getVisualExtent

public Rect getVisualExtent()
Gets the visual bounding rectangle relative to the local box model origin. The visual extent is the nominal extent plus any border thickness that extends outside.

Returns:
The visual extent rectangle.

getBorderExtent

public Rect getBorderExtent()
Gets the nominal extent border rectangle relative to the local box model origin.

Returns:
The border extent rectangle.

getContentBorderExtent

public Rect getContentBorderExtent()
Gets the content border rectangle relative to the local box model origin.

Returns:
The content border extent rectangle.

getCaptionExtent

public Rect getCaptionExtent()
Gets the caption bounding rectangle relative to the local box model origin.

Returns:
The caption extent rectangle, which may be empty.

getContentExtent

public Rect getContentExtent()
Gets the content rectangle.

Returns:
The content extent rectangle.

getCaptionExtentMargins

public Margins getCaptionExtentMargins()
Gets the margins (top/left/bottom/right insets) of the caption extent.

Returns:
The caption extent margins.

getContentExtentMargins

public Margins getContentExtentMargins()
Gets the margins (top/left/bottom/right insets) of the content extent.

Returns:
The content extent margins.

getAngle

public Angle getAngle()
Gets the rotation angle.

Returns:
The rotation angle.

getNominalExtentMargins

public Margins getNominalExtentMargins()
Gets the margins (top/left/bottom/right insets) of the nominal extent.

Returns:
The nominal extent margins.

hasCaption

public boolean hasCaption()
Determines if this box model has any formattable content within it's caption region.

Returns:
true if it has.

hasRotation

public boolean hasRotation()
Determines if this box model has had a rotation applied.

Returns:
true if it has.

XFA4J

© 2005 Adobe Systems Incorporated. All Rights Reserved.