public abstract class TextFrame extends Object implements GFXModelContext
The client creates all frame instances, either to pass to the sparse stream API or as a result of its implementation of the sparse stream event handling methods. The client must populate its created frames with geometry information. A future implementation may allow the client to set text attributes for a frame as well.
Once the client passes a frame instance to the sparse stream, AXTE takes over and populates its layout. The layout may come from a client-supplied layout object, or it may be generated by AXTE as the result of a reflow operation.
Frames are reference counted objects, allowing the client to retain handles to objects that are managed by AXTE.
While frames have width and height geometry, it is up to the client to decide how to map frames into its rendering space. AXTE treats the top-left corner of each frame as its origin.
| Constructor and Description |
|---|
TextFrame()
Default constructor.
|
TextFrame(TextFrame oSource)
Copy constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
alignHPoint()
Query whether horizontal alignment occurs at a point.
|
boolean |
alignVPoint()
Query whether vertical alignment occurs at a point.
|
abstract TextFrame |
cloneFrame()
Create a copy (deep clone) of this frame object.
|
int |
combCells() |
void |
copyFrom(TextFrame oSource)
Assignment operator.
|
TextLayout |
format(boolean bAllowCharGlyphs)
Generate a text layout object from this frame's layout.
|
int |
getLayoutOrientation()
Return the frame's layout orientation.
|
int |
getLineCount() |
void |
gfxDraw(GFXEnv poGfxEnv) |
void |
gfxDraw(GFXEnv poGfxEnv,
Rect poInvalid) |
void |
gfxDraw(GFXEnv poGfxEnv,
Rect poInvalid,
TextSelection poSelection) |
void |
gfxDraw(GFXEnv poGfxEnv,
Rect poInvalid,
TextSelection poSelection,
int eOpt)
Render the frame's content.
|
void |
gfxDraw(TextDrawInfo oDrawInfo)
Render the frame contents, using the properties provided.
|
boolean |
isDirty()
Query whether this frame is "dirty".
|
abstract UnitSpan |
maxHeight()
Return the frame's maximum height.
|
abstract UnitSpan |
maxWidth()
Return the frame's maximum width.
|
abstract UnitSpan |
minHeight()
Return the frame's minimum height.
|
abstract UnitSpan |
minWidth()
Return the frame's minimum width.
|
void |
releaseDisposableMaps(com.adobe.xfa.text.DispMapSet poMaps) |
void |
setDirty(boolean bDirty)
Set the frame's dirty flag.
|
boolean |
unlimitedHeight()
Query whether the stream has an unlimited height.
|
boolean |
unlimitedWidth()
Query whether the stream has an unlimited width.
|
public TextFrame()
public TextFrame(TextFrame oSource)
oSource - - Source frame to copy.public boolean alignVPoint()
The text label class performs vertical alignment at a point. The text block and region have a nominal height. Vertical alignment occurs within this height. This method asks the stream what sort of vertical alignment it supports.
public boolean alignHPoint()
The text label class performs horizontal alignment at a point. The text block and region have a nominal width. Horizontal alignment occurs within this width. This method asks the stream what sort of horizontal alignment it supports.
public boolean unlimitedWidth()
The text label can grow arbitrarily in X. A text region may have a maximum width, or it may allow unlimited horizontal growth. This method asks the object whether it has an unlimited width.
public boolean unlimitedHeight()
The text label can grow arbitrarily in Y. A text region may have a maximum height, or it may allow unlimited vertical growth. This method asks the object whether it has an unlimited height.
public boolean isDirty()
A frame is considered dirty if a layout operation changes any of its lines. Any frame that contains a content change or any frame thereafter whose lines change due to reflow will be considered dirty. When a frame is initially loaded with layout through any of the TextSparse stream call-backs, it starts out not being dirty. The application can use this method to determine whether to write the frame's content on save.
public void setDirty(boolean bDirty)
bDirty - - New value for the frame's dirty flag.public void gfxDraw(TextDrawInfo oDrawInfo)
Given a set of rendering properties in an instance of class TextDrawInfo, this method performs the appropriate rendering.
oDrawInfo - - Rendering properties. For more information,
please see the description of TextDrawInfo.public void gfxDraw(GFXEnv poGfxEnv, Rect poInvalid, TextSelection poSelection, int eOpt)
This method is provided so that the application can render a single frame's content in an application-controlled environment. The top left corner of the frame is mapped to (0,0) in relative coordinates, so the application may need to push an offset before calling this method.
poGfxEnv - - Graphic environment in which to do the rendering.poInvalid - - Pointer to invalidation rectangle (in frame
coordinates). If NULL, the frame uses its maximum width and height.poSelection - - Optional text selection. If non-null, this
represents a range and alternate colours for drawing of selected
text. Note that a single selection instance can be used across all
frames in the sparse stream.eOpt - - Run optimization flag. Enumeration values are in class
TextPrefOpt. OPT_UNKNOWN or OPT_CHAR produces the most accurate
behaviour, where each character is individually positioned. OPT_WORD
will result in the first character of each word being positioned, and
the graphic driver positioning the remaining characters based on the
character advances. OPT_LINE extends the word concept to entire
lines. Reducing the number of positioning operations performed by
the display improves display performance, but it may result in a loss
of accuracy when font sizes are rounded, depending on the abilities
of the underlying graphics environment. Note that AGM- and PDF-based
environments can use OPT_LINE for maximum performance without losing
accuracy.public void gfxDraw(GFXEnv poGfxEnv, Rect poInvalid, TextSelection poSelection)
public void gfxDraw(GFXEnv poGfxEnv)
public TextLayout format(boolean bAllowCharGlyphs)
bAllowCharGlyphs - - True if glyph IDs can be replaced with
their corresponding Unicode character IDs where such corresponding
characters exist. False if all output glyphs are to be represented
by glyph IDs.public int getLayoutOrientation()
public void copyFrom(TextFrame oSource)
oSource - - Source frame to copy.public abstract UnitSpan minWidth()
All frames have both a minimum and maximum width, which may or may not be the same. This method returns the minimum width.
public abstract UnitSpan minHeight()
All frames have both a minimum and maximum height, which may or may not be the same. This method returns the minimum height.
public abstract UnitSpan maxWidth()
All frames have both a minimum and maximum width, which may or may not be the same. This method returns the maximum width.
public abstract UnitSpan maxHeight()
All frames have both a minimum and maximum height, which may or may not be the same. This method returns the maximum height.
public abstract TextFrame cloneFrame()
The copy must have the same geometry as this object. It is up to AXTE to subsequently manage the clones layout and relationship to content.
public void releaseDisposableMaps(com.adobe.xfa.text.DispMapSet poMaps)
public int getLineCount()
public int combCells()
Copyright © 2010 - 2020 Adobe. All Rights Reserved