public class BoxModelLayout extends Object
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.
Modifier and Type | Field and Description |
---|---|
static int |
eBarcodeLayout
For a node that is a barcode; it requires a box model
implementation that formats the barcode data and
any text label.
|
static int |
eBaseLayout
For a node that can use the base box model implementation.
|
static int |
eButtonLayout
For a node that is a button; it requires a
box model implementation that makes the caption
extent cover the entire margined nominal extent.
|
static int |
eCheckButtonLayout
For a node that is a check button; it requires a box model
implementation that makes the caption extent cover the
entire margined nominal extent except what's covered by
the checkbox/radiio button.
|
static int |
eExclGroupLayout
For a node that is a exclusion group group;
it requires a specialized box model implementation.
|
static int |
eImageLayout
For a node that is an image; it requries a box model
implementation that separates the nominal extent
into a content region for the image data and
a caption region for the optional caption text data.
|
static int |
ePageLayout
For a node that is a pageArea; it requires a box model
implementation that resolves the correct pagesizes
|
static int |
ePMDBarcodeLayout
For a node that is a paperMetaData barcode, including
PDF417, DataMatrix, QRCode, etc.
|
static int |
eTextContentLayout
For a node that has flowing textual contents; it requires
a box model implementation that can format them.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the box model layout.
|
void |
disableBottomMargin()
Resets the bottom margin inset to zero.
|
void |
disableCaptionBottomMargin()
Reset the caption bottom margin to zero.
|
void |
disableCaptionTopMargin()
Resets the caption top margin to zero.
|
void |
disableContentBottomMargin()
Resets the content bottom margin to zero.
|
void |
disableContentTopMargin()
Resets the content top margin to zero.
|
void |
disableTopMargin()
Resets the top margin inset to zero.
|
boolean |
enumerateCaption(LayoutHandler pHandler,
CoordPair oOffset,
boolean bTruncate,
Rect oInvalidatedRect)
Enumerates the box model's caption using given layout handler.
|
boolean |
enumerateContent(LayoutHandler pHandler,
CoordPair oOffset,
boolean bWrapText,
boolean bTruncate,
Rect oInvalidatedRect)
Enumerates the box model's contents through the given
layout handler.
|
int |
getAnchor() |
CoordPair |
getAnchorPoint() |
Angle |
getAngle()
Gets the rotation angle.
|
Rect |
getBorderExtent()
Gets the nominal extent border rectangle
relative to the local box model origin.
|
static int |
getBoxModelType(Element oNode,
LayoutEnv oEnv)
Gets the box model type required for the node.
|
String |
getCaptionByType(String sType,
List<TemplateResolver.RGB> colorTable,
List<String> fontTable)
Gets a string containing the box model caption.
|
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.
|
String |
getContentByType(String sType,
List<TemplateResolver.RGB> colorTable,
List<String> fontTable)
Gets a string containing the box model content.
|
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.
|
CoordPair |
getRotatedCaptionTopLeft()
Gets the top left of the caption region adjusted for rotations.
|
CoordPair |
getRotatedContentTopLeft()
Gets the top left of the content region adjusted for rotations.
|
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 |
hasCaptionExtentContained()
Determines if the caption extent has been fully contained
within this box model.
|
boolean |
hasContent()
Determines if this box model has any formattable content
within it's content region.
|
boolean |
hasContentExtentContained()
Determines if the content extent has been fully contained
within this box model.
|
boolean |
hasEmbeddedContent()
Determines if this box model has embedded content.
|
boolean |
hasGrowableH()
Determines if this box model has a growable height.
|
boolean |
hasGrowableW()
Determines if this box model has a growable width.
|
boolean |
hasOverflowingCaptionText()
Return true if this box model contains text that overflows it's allotted space
and false otherwise.
|
boolean |
hasOverflowingContentText()
Return true if this box model contains text that overflows it's allotted space
and false otherwise.
|
boolean |
hasRotation()
Determines if this box model has had a rotation applied.
|
boolean |
hasSplit()
Determines if this box model has been involved in a split.
|
void |
initAnchorPoint(Element oNode) |
void |
initBorder(Element oNode) |
void |
initialize(Element oNode)
Initializes the box model internals.
|
void |
initVisualExtent(Element oNode) |
boolean |
isFontSubstituted()
Determines if this box model has a font that's been
substituted.
|
boolean |
isProxy()
Is this box model is based on a proxy definition -- ie.
|
static BoxModelLayout |
newBoxModel(Element node,
LayoutEnv env,
boolean bAllowProxy)
Creates a new, fully initialized instance of a box model.
|
void |
reinitialize(Element oNode)
Re-initializes the box model.
|
void |
resizeToContent(UnitSpan oContentW,
UnitSpan oContentH,
Element oNode)
Resizes the box model by setting it's new content extent.
|
void |
resizeToNominal(UnitSpan oW,
UnitSpan oH,
Element oNode)
Resizes the box model by setting it's new nominal extent.
|
void |
resizeToNominalWidth(UnitSpan oW,
Element oNode)
Resizes the box model by setting it's new nominal extent width.
|
void |
setAnchor(int eVal) |
void |
setAnchorPoint(CoordPair oPt) |
boolean |
split(UnitSpan oNewHeight,
ObjectHolder<BoxModelLayout> oNewBM,
Element oNode)
Split the contents of this box model by trimming
anything would not fit within new height.
|
public static final int eBaseLayout
public static final int eButtonLayout
public static final int eCheckButtonLayout
public static final int eTextContentLayout
public static final int eBarcodeLayout
public static final int ePMDBarcodeLayout
public static final int eImageLayout
public static final int ePageLayout
public static final int eExclGroupLayout
public static int getBoxModelType(Element oNode, LayoutEnv oEnv)
oNode
- the form node that the box model applies to.oEnv
- the layout environment.public static BoxModelLayout newBoxModel(Element node, LayoutEnv env, boolean bAllowProxy)
node
- the form node that the box model applies to.env
- the layout environment.bAllowProxy
- allow proxy -- ie. drawn from stored text run definitions. ????.public void clear()
public Rect getNominalExtent()
public UnitSpan getWidth()
public UnitSpan getHeight()
public Rect getVisualExtent()
public Rect getBorderExtent()
public Rect getContentBorderExtent()
public Rect getCaptionExtent()
public Rect getContentExtent()
public Margins getCaptionExtentMargins()
public Margins getContentExtentMargins()
public Angle getAngle()
public Margins getNominalExtentMargins()
public void disableTopMargin()
public void disableBottomMargin()
public void disableContentTopMargin()
public void disableContentBottomMargin()
public void disableCaptionTopMargin()
public void disableCaptionBottomMargin()
public boolean enumerateCaption(LayoutHandler pHandler, CoordPair oOffset, boolean bTruncate, Rect oInvalidatedRect)
pHandler
- enumeration handler.oOffset
- offset to apply to all enumerated caption data.public boolean enumerateContent(LayoutHandler pHandler, CoordPair oOffset, boolean bWrapText, boolean bTruncate, Rect oInvalidatedRect)
pHandler
- enumeration handler.oOffset
- offset to apply to all enumerated content data.bWrapText
- indicates whether content data should wrap to.
extentspublic String getCaptionByType(String sType, List<TemplateResolver.RGB> colorTable, List<String> fontTable)
sType
- indicates how to represent the data.
within the returned string (rtf|html|plain)colorTable
- array of color values, can be null.fontTable
- array of fonts used, can be null.public String getContentByType(String sType, List<TemplateResolver.RGB> colorTable, List<String> fontTable)
sType
- indicates how to represent the data.
within the returned string (rtf|html|plain)colorTable
- array of color values, can be null.fontTable
- array of fonts used, can be null.public CoordPair getRotatedContentTopLeft()
public CoordPair getRotatedCaptionTopLeft()
public boolean hasCaption()
public boolean hasContent()
public boolean hasRotation()
public boolean hasCaptionExtentContained()
public boolean hasContentExtentContained()
public boolean hasEmbeddedContent()
public boolean hasSplit()
public void initialize(Element oNode)
oNode
- the form node that the box model applies to.public boolean isFontSubstituted()
public boolean isProxy()
public void reinitialize(Element oNode)
oNode
- the form node that the box model applies to.public void resizeToNominal(UnitSpan oW, UnitSpan oH, Element oNode)
oW
- new nominal extent width.oH
- new nominal extent height.oNode
- the form node that the box model applies to.public void resizeToNominalWidth(UnitSpan oW, Element oNode)
oW
- new nominal extent width.oNode
- the form node that the box model applies to.public void resizeToContent(UnitSpan oContentW, UnitSpan oContentH, Element oNode)
oContentW
- new width of content.oContentH
- new height of content.oNode
- the form node that the box model applies to.public boolean split(UnitSpan oNewHeight, ObjectHolder<BoxModelLayout> oNewBM, Element oNode)
oNewHeight
- the distance from top of nominal extent.
at which to perform split.oNewBM
- upon return this refers to a box model.
is the portion of the original box modle that did
not fit.oNode
- the form node that the box model applies to.public boolean hasGrowableW()
public boolean hasGrowableH()
public int getAnchor()
public CoordPair getAnchorPoint()
public void setAnchor(int eVal)
public void setAnchorPoint(CoordPair oPt)
public void initAnchorPoint(Element oNode)
public void initBorder(Element oNode)
public void initVisualExtent(Element oNode)
public boolean hasOverflowingContentText()
public boolean hasOverflowingCaptionText()
Copyright © 2010 - 2020 Adobe. All Rights Reserved