public class TextDispStr extends TextSparseStream
The layout actually happens through a companion class, jfTextDisplay. When the application needs to perform layout-related operations, it calls the Createdisplay() method. The first call for a jfTextDispStr instance will create the companion display object; subsequent calls simply return a pointer to the already created display.
Note that there are a number of operations on other text classes that may not work until the display exists. For example, caret/position translation and vertical movement.
DEFAULT_STREAM
LEVEL_CORRECT_SPACING, LEVEL_NORMAL, LEVEL_V6
Constructor and Description |
---|
TextDispStr()
Default constructor.
|
TextDispStr(String sSource)
Constructor with source text string.
|
TextDispStr(TextDispStr oSource)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
allowOverflow()
Query whether the displayable stream allows horizontal overflow.
|
void |
allowOverflow(boolean bNewAllow)
Change the value of the AllowOverflow setting.
|
int |
combCells()
Query the number of comb cells to use for comb justification.
|
void |
combCells(int nCombCells)
Change the number of comb cells to use for comb justification.
|
boolean |
enforceJustifyHeight()
Return TRUE if a specific height is to be used to vertically justify
a stream and FALSE otherwise.
|
boolean |
enforceJustifyWidth()
Return TRUE if a specific width is to be used to horizontally justify
a stream and FALSE otherwise.
|
boolean |
equals(Object object)
Compare text streams for content equality.
|
Rect |
extent()
Query the graphical extent of the text.
|
int |
hashCode() |
UnitSpan |
justifyHeight()
Return the stream's justify height.
|
boolean |
justifyHPoint()
Query whether horizontal justification occurs at a point.
|
boolean |
justifyVPoint()
Query whether vertical justification occurs at a point.
|
UnitSpan |
justifyWidth()
Return the stream's justify width.
|
UnitSpan |
maxHeight()
Return the stream's maximum height.
|
UnitSpan |
maxWidth()
Return the stream's maximum width.
|
UnitSpan |
minHeight()
Return the stream's minimum height.
|
UnitSpan |
minWidth()
Return the stream's minimum width.
|
boolean |
notEqual(TextDispStr oCompare)
Compare text streams for content inequality.
|
TextFrame |
onLoadFrame(int nIndex)
Client-implemented event handler to load a frame's content.
|
Rect |
runtimeExtent()
Query the extent of the underlying text.
|
boolean |
unlimitedHeight()
Query whether the stream has an unlimited height.
|
boolean |
unlimitedWidth()
Query whether the stream has an unlimited width.
|
appendFrame, appendFrame, appendFrameRef, appendFrameRef, createDisplay, defaultDirection, defaultDirection, forceFrame, forceFrame, getContext, getFrame, getFrameCount, insertFrame, insertFrameRef, onFrameRemoved, onNewFrame, onRemoveFrame, removeFrame, removeFrame, setContext, setFrame, setFrameCount, setFrameRef
allowNewLines, allowNewLines, anyNewLines, append, append, append, append, append, append, cascadeLegacyLevel, coalesceMarker, contiguousText, copyFrom, currentSize, debug, display, enumEmbed, enumField, enumMarker, find, find, findRangeMarkerOver, fontService, fontService, gfxSource, gfxSource, isDescendentOf, isDescendentOf, legacyPositioning, markup, markup, markup, markup, markup, maxSize, maxSize, notEqual, position, posnCount, posnInsert, posnInsert, posnInsertPara, posnNext, posnNextAttr, posnNextChar, posnNextEmbed, posnNextField, posnNextType, posnNextType, posnPrev, posnPrevAttr, posnPrevChar, posnPrevEmbed, posnPrevField, posnPrevType, posnPrevType, posnUpdateStreamLoc, rangeEnumMarker, rangeMarker, rangeMarkerInternal, removeMarker, setText, spaceLeft, splitMarker, suppressFormat, text, text, updateNotification
getLegacyLevel, hasCorrectPositioning, hasLegacyPositioning, hasNormalPositioning, setLegacyLevel
public TextDispStr()
The text stream contains no content and has no pool/mapping assocotiation. The display is not automatically created.
public TextDispStr(TextDispStr oSource)
Copy all stream content from the source stream. The display is not automatically created.
oSource
- - Source stream to copy content from.public TextDispStr(String sSource)
Create a text stream whose initial content is copied from the given string. The text stream initially has no attribute pool association. The display is not automatically created.
sSource
- - String whose contents are to be copied to the text
stream.public boolean equals(Object object)
TextStream
Compare this stream against the one passed on the parameter oCompare for content equality. The graphics sources of the streams are not compared. To be equal, the streams' content must match in all aspects: raw text, attributes, embedded field content, and so on.
equals
in class TextStream
object
- Text Stream object to compare againstpublic int hashCode()
hashCode
in class TextStream
public Rect extent()
This method returns the graphical extent of the text as a rectangle. This extent is defined as the minimum of the text's graphical size and the maximum graphical size (see below) of the displayable stream. For example, consider a text block with a small amount of text. The returned value will be the size of the text block. If that block's text grows to the point where scrolling is requied, the returned value will be the total graphical extent of all of the block's text.
public Rect runtimeExtent()
This likely exists for historical reasons only. It simply returns the same extent as the Extent() method. In some (but not all) cases, it will create the display for the caller. return A rectangle indicating the extent of the text.
public boolean allowOverflow()
A displayable stream can be told to restrict its content horizontally to the graphical space alotted, or to allow the content to overflow (effectively turning off word-wrapping). This is not to be confused with the MaxSize() method of the base text stream class which restricts by number of characters. This is a legacy feature that applied to single-line text objects. There were cases where the graphical space wasn't quite large enough for the maximum number of characters. Allowing overflow prevented word-wrapping or scrolling.
public void allowOverflow(boolean bNewAllow)
bNewAllow
- - TRUE if the stream is to allow horizontal
overflow; FALSE if not (though some displayable stream types
inherently allow overflow).public boolean justifyVPoint()
The text label class performs vertical justification at a point. The text block and region have a nominal height. Vertical justification occurs within this height. This method asks the stream what sort of vertical justification it supports.
public boolean justifyHPoint()
The text label class performs horizontal justification at a point. The text block and region have a nominal width. Horizontal justification occurs within this width. This method asks the stream what sort of horizontal justification 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 int combCells()
Comb justification requires that the number of available cells be known so that shorter text strings can be placed accordingly. This method returns the number of cells to use. If the number is zero, the stream's MaxSize() value is used. If that is also zero, the actual number of _characters_ is used. The reason for a number of cells separate from MaxSize() is because the latter counts characters and in some languages, several characters may share the same cell (e.g., for separate accent characters).
public void combCells(int nCombCells)
For more information on this attribute, please see the first overload of this method.
nCombCells
- - New number of comb cells.public boolean notEqual(TextDispStr oCompare)
Compare this stream against the one passed on the parameter oCompare for content inequality. The graphics sources of the streams are not compared. This is the exact opposite of the equality comparison. The display does not participate in the comparison. For some reason, the extent and AllowOverflow flag also do not participate in the comparison.
oCompare
- - Stream to compare againstpublic UnitSpan minWidth()
All streams have both a minimum and maximum width, which may or may not be the same. This method returns the minimum.
public UnitSpan minHeight()
All streams have both a minimum and maximum height, which may or may not be the same. This method returns the minimum. @return Minimum height allowed for the stream. A value of zero is possible, as is a value less than zero. In the latter case, it indicates that the stream is verrically justified at a point, though callers should use the JustifyVPoint() method to test for this.
public UnitSpan maxWidth()
All streams have both a minimum and maximum width, which may or may not be the same. This method returns the maximum. @return maximum width allowed for the stream. A value of zero is possible, as is a value less than zero. In the latter case, it indicates that the stream has unlimited width, though callers should use the UnlimitedWidth() method to test for this.
public UnitSpan maxHeight()
All streams have both a minimum and maximum height, which may or may not be the same. This method returns the maximum. @return maximum height allowed for the stream. A value of zero is possible, as is a value less than zero. In the latter case, it indicates that the stream has unlimited height, though callers should use the Unlimitedheight() method to test for this.
public UnitSpan justifyHeight()
All display streams have a notion of justify height and width which are the extents by which the justification is to take place. The default is max height however it can differ from the stream min/max sizes. Note that this value may never be set, in which case the justification uses default. Callers should call EnforceJustifyHeight() to test if a specific justification height has been set.
public boolean enforceJustifyHeight()
public UnitSpan justifyWidth()
All display streams have a notion of justify height and width which are the extents by which the justification is to take place. This can be different from the stream min/max sizes. This value may never be set, in which case the justification uses the stream sizes. Callers should call EnforceJustifyHeight() to test if a specific justification height has been set.
public boolean enforceJustifyWidth()
public TextFrame onLoadFrame(int nIndex)
TextSparseStream
The client implementation is expected to call SetFrame() or SetFrameRef() before returning.
onLoadFrame
in class TextSparseStream
nIndex
- - Index number of frame to load. The client can assume
that the frame is currently null.Copyright © 2010 - 2020 Adobe. All Rights Reserved