APIdia Launch Partner
Top Fields Methods
sun.font

public Interface TextLineComponent

Known Direct Implementers
sun.font.ExtendedTextSourceLabel, sun.font.GraphicComponent
Imports
java.awt.Graphics2D, .Rectangle, .Shape, java.awt.font.GlyphJustificationInfo, .FontRenderContext, .LineMetrics, java.awt.geom.AffineTransform, .Rectangle2D

Field Summary

Modifier and TypeField and Description
public static final int
LEFT_TO_RIGHT

Force subset characters to run left-to-right.

public static final int
RIGHT_TO_LEFT

Force subset characters to run right-to-left.

public static final int
UNCHANGED

Leave subset character direction and ordering unchanged.

Method Summary

Modifier and TypeMethod and Description
public TextLineComponent
applyJustificationDeltas(float[] deltas, int deltaStart, boolean[] flags)

Apply deltas to the data in this component, starting at offset deltaStart, and return the new component.

public boolean
public void
draw(Graphics2D g2d, float x, float y)

public float
public float
getAdvanceBetween(int start, int limit)

public AffineTransform
public float
getCharAdvance(int index)

public Rectangle2D
public float
getCharX(int index)

public float
getCharY(int index)

public CoreMetrics
public Rectangle2D
public void
getJustificationInfos(GlyphJustificationInfo[] infos, int infoStart, int charStart, int charLimit)

Return GlyphJustificationInfo objects for the characters between charStart and charLimit, starting at offset infoStart.

public int
getLineBreakIndex(int start, float width)

public Rectangle2D
public int
public int
getNumJustificationInfos()

Return the number of justification records this uses.

public Shape
getOutline(float x, float y)

public Rectangle
getPixelBounds(FontRenderContext frc, float x, float y)

public TextLineComponent
getSubset(int start, int limit, int
one of the constants LEFT_TO_RIGHT, RIGHT_TO_LEFT, or UNCHANGED
dir
)

Return a TextLineComponent for the characters in the range start, limit.

public Rectangle2D
public boolean

Field Detail

LEFT_TO_RIGHTback to summary
public static final int LEFT_TO_RIGHT

Force subset characters to run left-to-right.

RIGHT_TO_LEFTback to summary
public static final int RIGHT_TO_LEFT

Force subset characters to run right-to-left.

UNCHANGEDback to summary
public static final int UNCHANGED

Leave subset character direction and ordering unchanged.

Method Detail

applyJustificationDeltasback to summary
public TextLineComponent applyJustificationDeltas(float[] deltas, int deltaStart, boolean[] flags)

Apply deltas to the data in this component, starting at offset deltaStart, and return the new component. There are two floats for each justification info, for a total of 2 * getNumJustificationInfos. The first delta is the left adjustment, the second is the right adjustment.

If flags[0] is true on entry, rejustification is allowed. If the new component requires rejustification (ligatures were formed or split), flags[0] will be set on exit.

caretAtOffsetIsValidback to summary
public boolean caretAtOffsetIsValid(int index)
drawback to summary
public void draw(Graphics2D g2d, float x, float y)
getAdvanceback to summary
public float getAdvance()
getAdvanceBetweenback to summary
public float getAdvanceBetween(int start, int limit)
getBaselineTransformback to summary
public AffineTransform getBaselineTransform()
getCharAdvanceback to summary
public float getCharAdvance(int index)
getCharVisualBoundsback to summary
public Rectangle2D getCharVisualBounds(int index)
getCharXback to summary
public float getCharX(int index)
getCharYback to summary
public float getCharY(int index)
getCoreMetricsback to summary
public CoreMetrics getCoreMetrics()
getItalicBoundsback to summary
public Rectangle2D getItalicBounds()
getJustificationInfosback to summary
public void getJustificationInfos(GlyphJustificationInfo[] infos, int infoStart, int charStart, int charLimit)

Return GlyphJustificationInfo objects for the characters between charStart and charLimit, starting at offset infoStart. Infos will be in visual order. All positions between infoStart and getNumJustificationInfos will be set. If a position corresponds to a character outside the provided range, it is set to null.

getLineBreakIndexback to summary
public int getLineBreakIndex(int start, float width)
getLogicalBoundsback to summary
public Rectangle2D getLogicalBounds()
getNumCharactersback to summary
public int getNumCharacters()
getNumJustificationInfosback to summary
public int getNumJustificationInfos()

Return the number of justification records this uses.

getOutlineback to summary
public Shape getOutline(float x, float y)
getPixelBoundsback to summary
public Rectangle getPixelBounds(FontRenderContext frc, float x, float y)
getSubsetback to summary
public TextLineComponent getSubset(int start, int limit, int dir)

Return a TextLineComponent for the characters in the range start, limit. The range is relative to this TextLineComponent (ie, the first character is at 0).

Parameters
dir:int

one of the constants LEFT_TO_RIGHT, RIGHT_TO_LEFT, or UNCHANGED

getVisualBoundsback to summary
public Rectangle2D getVisualBounds()
isSimpleback to summary
public boolean isSimple()