Class GFXDriver
- java.lang.Object
-
- com.adobe.xfa.gfx.GFXDriver
-
- Direct Known Subclasses:
LayoutDriver
public abstract class GFXDriver extends java.lang.ObjectA base class used by the text and gfx packages to render/position objects within their respective environment.
-
-
Field Summary
Fields Modifier and Type Field Description static intACTIVEstatic intCAP_PIX_HEIGHTstatic intCAP_PIX_WIDTHstatic intCAP_REAL_HEIGHTstatic intCAP_REAL_WIDTHstatic intCAP_TYPEstatic intDRAW_2Dstatic intDRAW_3Dstatic intDRAW_WELLstatic intINACTIVEstatic intMAPPING_FULLstatic intMAPPING_LEGACYstatic intMAPPING_SUPPRESSCharacter to glyph mapping level required by the driver.java.util.List<com.adobe.xfa.gfx.GFXDriver.AnglePair>moAngleStackjava.util.List<Rect>moClipStackstatic intMODE_OPAQUEstatic intMODE_TRANSPARENTjava.util.List<CoordPair>moOffsetStackstatic intPUSHEDstatic intTYPE_PRINTERstatic intTYPE_SCREEN
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract voidabsFillRect(Rect oRect, int eDrawMode)voidabsGlyphs(int[] pnGlyphs, int length)abstract voidabsLine(CoordPair oEnd, int eDrawMode)voidabsLine(CoordPair oStart, CoordPair oEnd, int eDrawMode)CoordPairabsPosition()voidabsPosition(CoordPair oStart)abstract voidabsText(java.lang.String oText, int eDrawMode)Angleangle()Angleangle(boolean bRelative)UnitSpancharSpacing()Returns the character spacing currently in effect for this driver.voidcharSpacing(UnitSpan oNewSpacing)Set a new character spacing for subsequent text output.booleancharSpacingSupported()Query whether this driver implementation supports character spacing.voidclearStacks()RectclipRect()RectclipRect(boolean bRelative)intdevH(UnitSpan oHeight)GFXDevPointdevPoint(CoordPair oPoint)GFXDevRectdevRect(Rect oRect)UnitSpandevUnitX()UnitSpandevUnitY()intdevW(UnitSpan oWidth)intdevX(UnitSpan oX)intdevY(UnitSpan oY)intdotsPerInch()booleandraw3dEffects()voiddraw3dEffects(boolean b3dEffects)GFXEnvenv()GFXFillAttrfillAttr()voidfillAttr(GFXFillAttr poNewAttr)voidfit(double dScale, CoordPair oOrigin, int nFit)FontInstancefontInstance()voidfontInstance(FontInstance poNewFont)intgetMappingLevel()Return the mapping required by the driver.intglyphOrientation()voidglyphOrientation(int eNewGlyphOrientation)abstract intheight()UnitSpanheightInUnits()abstract booleaninteractive()GFXLineAttrlineAttr()voidlineAttr(GFXLineAttr poNewAttr)voidmapChars(int nIndex, int nLength)Legacy character/glyph mapping.voidmapGlyphs(GFXMappingList oMappings, boolean bIsRTL)Full character/glyph mapping.intmode()voidmode(int eNewMode)CoordPairnonPrintOffset()CoordPairoffset()CoordPairoffset(boolean bRelative)CoordPairoffsetPoint(CoordPair oPoint)voidparaHint()voidpopAngle()voidpopClipRect()voidpopOffset()voidpopRenderContext()Restore the rendering context.voidpushAngle(boolean bRelative, Angle oAngle, boolean bOffsetPoint, CoordPair oRotationPoint)voidpushClipRect(boolean bRelative, Rect oClipRect)voidpushOffset(boolean bRelative, CoordPair oOffset)voidpushRenderContext(int[] pcText, int pnCharIndex)Indicates the caller needs to perform some specific rendering without losing the overall rendering context.voidrelFillRect(Rect oRect)voidrelFillRect(Rect oRect, int eDrawMode)voidrelGlyphs(int[] pnGlyphs, int length)voidrelLine(CoordPair oEnd, int eDrawMode)voidrelLine(CoordPair oStart, CoordPair oEnd)voidrelLine(CoordPair oStart, CoordPair oEnd, int eDrawMode)CoordPairrelPosition()voidrelPosition(CoordPair oStart)voidrelText(java.lang.String oText)voidrelText(java.lang.String oText, int eDrawMode)voidresolutionChanged()CoordPairrotatePoint(CoordPair oPoint)CoordPairrotationPoint(boolean bRelative)doublescale()voidsetUnicodeChars(int[] text)Set the Unicode characters that are about to be rendered by subsequent calls to the driver.GFXTextAttrtextAttr()voidtextAttr(GFXTextAttr poNewAttr)UnitSpanunitH(int lHeight)CoordPairunitPoint(int lX, int lY)RectunitRect(int lLeft, int lTop, int lRight, int lBottom)UnitSpanunitW(int lWidth)UnitSpanunitX(int lX)UnitSpanunitY(int lY)RectvisibleArea()abstract intwidth()UnitSpanwidthInUnits()UnitSpanwordSpacing()Returns the word spacing currently in effect for this driver.voidwordSpacing(UnitSpan oNewSpacing)Set a new word spacing for subsequent text output.booleanwordSpacingSupported()Query whether this driver implementation supports word spacing.
-
-
-
Field Detail
-
MODE_OPAQUE
public static final int MODE_OPAQUE
- See Also:
- Constant Field Values
-
MODE_TRANSPARENT
public static final int MODE_TRANSPARENT
- See Also:
- Constant Field Values
-
TYPE_PRINTER
public static final int TYPE_PRINTER
- See Also:
- Constant Field Values
-
TYPE_SCREEN
public static final int TYPE_SCREEN
- See Also:
- Constant Field Values
-
CAP_TYPE
public static final int CAP_TYPE
- See Also:
- Constant Field Values
-
CAP_PIX_WIDTH
public static final int CAP_PIX_WIDTH
- See Also:
- Constant Field Values
-
CAP_PIX_HEIGHT
public static final int CAP_PIX_HEIGHT
- See Also:
- Constant Field Values
-
CAP_REAL_WIDTH
public static final int CAP_REAL_WIDTH
- See Also:
- Constant Field Values
-
CAP_REAL_HEIGHT
public static final int CAP_REAL_HEIGHT
- See Also:
- Constant Field Values
-
DRAW_2D
public static final int DRAW_2D
- See Also:
- Constant Field Values
-
DRAW_3D
public static final int DRAW_3D
- See Also:
- Constant Field Values
-
DRAW_WELL
public static final int DRAW_WELL
- See Also:
- Constant Field Values
-
ACTIVE
public static final int ACTIVE
- See Also:
- Constant Field Values
-
INACTIVE
public static final int INACTIVE
- See Also:
- Constant Field Values
-
PUSHED
public static final int PUSHED
- See Also:
- Constant Field Values
-
MAPPING_SUPPRESS
public static final int MAPPING_SUPPRESS
Character to glyph mapping level required by the driver.Some driver implementations do more than rendering; they may need to reconstiture the original text and understand how it relates to the rendered glyphs. This enumeration allows a driver to indicate what sort of character/glyph mapping it requires. If the caller is using the driver to render text, it must provide mapping information in accordance with what the driver needs.
- MAPPING_SUPPRESS: No character/glyph mapping is required.
- MAPPING_FULL: Full mapping information must be provided by the caller. Note that there may be a performance hit if the caller must generate full mapping information when it is not required by the driver.
- MAPPING_LEGACY: The caller must simpler, legacy mapping information.
- See Also:
- Constant Field Values
-
MAPPING_FULL
public static final int MAPPING_FULL
- See Also:
- Constant Field Values
-
MAPPING_LEGACY
public static final int MAPPING_LEGACY
- See Also:
- Constant Field Values
-
moOffsetStack
public java.util.List<CoordPair> moOffsetStack
-
moAngleStack
public java.util.List<com.adobe.xfa.gfx.GFXDriver.AnglePair> moAngleStack
-
moClipStack
public java.util.List<Rect> moClipStack
-
-
Constructor Detail
-
GFXDriver
public GFXDriver(GFXEnv env)
-
-
Method Detail
-
env
public GFXEnv env()
-
devW
public int devW(UnitSpan oWidth)
-
devH
public int devH(UnitSpan oHeight)
-
devPoint
public GFXDevPoint devPoint(CoordPair oPoint)
-
devRect
public GFXDevRect devRect(Rect oRect)
-
devX
public int devX(UnitSpan oX)
-
devY
public int devY(UnitSpan oY)
-
devUnitX
public UnitSpan devUnitX()
-
devUnitY
public UnitSpan devUnitY()
-
fit
public void fit(double dScale, CoordPair oOrigin, int nFit)
-
scale
public double scale()
-
unitW
public UnitSpan unitW(int lWidth)
-
unitH
public UnitSpan unitH(int lHeight)
-
unitPoint
public CoordPair unitPoint(int lX, int lY)
-
unitRect
public Rect unitRect(int lLeft, int lTop, int lRight, int lBottom)
-
unitX
public UnitSpan unitX(int lX)
-
unitY
public UnitSpan unitY(int lY)
-
mode
public int mode()
-
mode
public void mode(int eNewMode)
-
lineAttr
public GFXLineAttr lineAttr()
-
lineAttr
public void lineAttr(GFXLineAttr poNewAttr)
-
fillAttr
public GFXFillAttr fillAttr()
-
fillAttr
public void fillAttr(GFXFillAttr poNewAttr)
-
textAttr
public GFXTextAttr textAttr()
-
textAttr
public void textAttr(GFXTextAttr poNewAttr)
-
fontInstance
public FontInstance fontInstance()
-
fontInstance
public void fontInstance(FontInstance poNewFont)
-
glyphOrientation
public int glyphOrientation()
-
glyphOrientation
public void glyphOrientation(int eNewGlyphOrientation)
-
charSpacing
public UnitSpan charSpacing()
Returns the character spacing currently in effect for this driver.Note that not all driver implementations support character spacing.
- Returns:
- Character spacing value currently in effect for this driver. The default implementation returns zero.
-
charSpacing
public void charSpacing(UnitSpan oNewSpacing)
Set a new character spacing for subsequent text output.Note that not all driver implementations support character spacing.
- Parameters:
oNewSpacing- - New character spacing value. Negative values are allowed.
-
charSpacingSupported
public boolean charSpacingSupported()
Query whether this driver implementation supports character spacing.If it does not, there is no point in calling the CharSpacing() overloads. AXTE uses the result of this method to determine whether a text run with a spacing override must be rendered as individual glyphs or can be put out as a run.
- Returns:
- True if the driver supports character spacing; false if not. The default implementation returns false.
-
wordSpacing
public UnitSpan wordSpacing()
Returns the word spacing currently in effect for this driver.Note that not all driver implementations support word spacing.
- Returns:
- Word spacing value currently in effect for this driver. The default implementation returns zero.
-
wordSpacing
public void wordSpacing(UnitSpan oNewSpacing)
Set a new word spacing for subsequent text output.Note that not all driver implementations support word spacing. Note also that word and character spacing support are independent of each other. A driver may support one, the other, both or neither.
- Parameters:
oNewSpacing- - New word spacing value. Negative values are allowed.
-
wordSpacingSupported
public boolean wordSpacingSupported()
Query whether this driver implementation supports word spacing.If it does not, there is no point in calling the WordSpacing() overloads.
- Returns:
- True if the driver supports word spacing; false if not. The default implementation returns false.
-
pushOffset
public void pushOffset(boolean bRelative, CoordPair oOffset)
-
popOffset
public void popOffset()
-
offset
public CoordPair offset(boolean bRelative)
-
offset
public CoordPair offset()
-
pushAngle
public void pushAngle(boolean bRelative, Angle oAngle, boolean bOffsetPoint, CoordPair oRotationPoint)
-
popAngle
public void popAngle()
-
angle
public Angle angle(boolean bRelative)
-
angle
public Angle angle()
-
rotationPoint
public CoordPair rotationPoint(boolean bRelative)
-
pushClipRect
public void pushClipRect(boolean bRelative, Rect oClipRect)
-
popClipRect
public void popClipRect()
-
clipRect
public Rect clipRect(boolean bRelative)
-
clipRect
public Rect clipRect()
-
clearStacks
public void clearStacks()
-
relPosition
public CoordPair relPosition()
-
relPosition
public void relPosition(CoordPair oStart)
-
relLine
public void relLine(CoordPair oEnd, int eDrawMode)
-
relFillRect
public void relFillRect(Rect oRect, int eDrawMode)
-
relFillRect
public void relFillRect(Rect oRect)
-
relText
public void relText(java.lang.String oText, int eDrawMode)
-
relText
public void relText(java.lang.String oText)
-
relGlyphs
public void relGlyphs(int[] pnGlyphs, int length)
-
absPosition
public CoordPair absPosition()
-
absPosition
public void absPosition(CoordPair oStart)
-
absLine
public abstract void absLine(CoordPair oEnd, int eDrawMode)
-
absFillRect
public abstract void absFillRect(Rect oRect, int eDrawMode)
-
absText
public abstract void absText(java.lang.String oText, int eDrawMode)
-
absGlyphs
public void absGlyphs(int[] pnGlyphs, int length)
-
setUnicodeChars
public void setUnicodeChars(int[] text)
Set the Unicode characters that are about to be rendered by subsequent calls to the driver.If the driver requires any sort of mapping, the caller must provide the raw Unicode content through this call before calling any of the text rendering methods RelText(), AbsText(), RelGlyphs() or AbsGlyphs() to render that content.
The caller typically calls this method once for each "line" of text and then makes one or more calls to the text rendering methods to render the text of the line. If the driver requires mapping, each text rendering call must be preceded by an appropriate call, in order to determine how the rendering run maps to the Unicode content.
- Parameters:
text- - Unicode text content, UTF32 format.
-
pushRenderContext
public void pushRenderContext(int[] pcText, int pnCharIndex)Indicates the caller needs to perform some specific rendering without losing the overall rendering context.The SetUnicodeChars() method establishes a context that the driver may need for subsequent rendering and mapping calls. There are situations where that context needs to be put on hold, while the caller goes off and performs some other sort of rendering, before coming back to the context originally set by SetUnicodeChars().
In particular, consider the case where a tab leader is filled with a sequence of repeating glyphs. The caller will call SetUnicodeChars() with the Unicode content of the complete line, which contains text and tab characters. In filling the leader for a single tab, it will push a new context, with the text used to fill the tab leader. After rendering the tab leader, it will pop the context back to that of the original line.
- Parameters:
pcText- - New Unicode text context to establish.pnCharIndex- - (optional) Index of the character in the parent context that led to this new context. For example, in the case of tab leaders, this would be the index of a tab character. A future overload may allow for a more elaborate mapping specification.
-
popRenderContext
public void popRenderContext()
Restore the rendering context. Please see the description of PushRenderContext() for a description of rendering contexts. The client must call this once for each call it makes to PushRenderContext().
-
mapChars
public void mapChars(int nIndex, int nLength)Legacy character/glyph mapping.If the driver needs legacy mapping, the caller must preceed each call to a text rendering method with a call to this method. Legacy mapping can describe only simple character/glyph relationships:
- A sequence of N consecutive characters mapping 1:1, left-to-right to N consecutive glyphs.
- A sequence of N consecutive characters mapping N:1 to a single glyph.
If the driver uses legacy mapping, the caller must break each ligature and each RTL glyph out into its own run.
-
mapGlyphs
public void mapGlyphs(GFXMappingList oMappings, boolean bIsRTL)
Full character/glyph mapping.If the driver needs legacy mapping, the caller must preceed each call to a text rendering method with a call to this method. Full mapping supports 1:1, N:1, 1:M and N:M mappings, as well as mappings that involve non-contiguous runs of Unicode content and glyph output.
- Parameters:
oMappings- - Description of the mappings for the subsequent text rendering call. The Unicode character indexes in the mappings are relative to the line's text passed in SetUnicodeChars(). The glyph indexes are zero-based, relative to the glyphs in the next text rendering call.bIsRTL- - True if the subsequent run represents RTL text; FALSE for LTR text.
-
getMappingLevel
public int getMappingLevel()
Return the mapping required by the driver.- Returns:
- Mapping level that the client must implement in order to satisfy the driver's needs.
-
dotsPerInch
public int dotsPerInch()
-
height
public abstract int height()
-
width
public abstract int width()
-
interactive
public abstract boolean interactive()
-
visibleArea
public Rect visibleArea()
-
nonPrintOffset
public CoordPair nonPrintOffset()
-
paraHint
public void paraHint()
-
resolutionChanged
public void resolutionChanged()
-
heightInUnits
public UnitSpan heightInUnits()
-
widthInUnits
public UnitSpan widthInUnits()
-
draw3dEffects
public boolean draw3dEffects()
-
draw3dEffects
public void draw3dEffects(boolean b3dEffects)
-
-