APIdia Launch Partner
Top Description Inners Fields Constructors Methods
sun.font

pack-priv abstract Class Underline

extends Object
Class Inheritance
Known Direct Subclasses
sun.font.Underline.StandardUnderline, sun.font.Underline.IMGrayUnderline
Imports
java.awt.BasicStroke, .Graphics2D, .Shape, .Stroke, java.awt.geom.GeneralPath, .Line2D, java.awt.font.TextAttribute, java.util.concurrent.ConcurrentHashMap

This class provides drawing and bounds-measurement of underlines. Additionally, it has a factory method for obtaining underlines from values of underline attributes.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private static class

Field Summary

Modifier and TypeField and Description
private static final float
private static final boolean
private static final Underline[]
private static final ConcurrentHashMap<Object, Underline>
private static final boolean

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv abstract void
drawUnderline(Graphics2D g2d, float thickness, float x1, float x2, float y)

Draws the underline into g2d.

pack-priv abstract float
getLowerDrawLimit(float thickness)

Returns the bottom of the bounding rectangle for this underline.

pack-priv static Underline
getUnderline(Object value)

Return the Underline for the given value of TextAttribute.INPUT_METHOD_UNDERLINE or TextAttribute.UNDERLINE.

pack-priv static Underline
getUnderline(int index)

pack-priv abstract Shape
getUnderlineShape(float thickness, float x1, float x2, float y)

Returns a Shape representing the underline.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

DEFAULT_THICKNESSback to summary
private static final float DEFAULT_THICKNESS
IGNORE_THICKNESSback to summary
private static final boolean IGNORE_THICKNESS
UNDERLINE_LISTback to summary
private static final Underline[] UNDERLINE_LIST
UNDERLINESback to summary
private static final ConcurrentHashMap<Object, Underline> UNDERLINES
USE_THICKNESSback to summary
private static final boolean USE_THICKNESS

Constructor Detail

Underlineback to summary
pack-priv Underline()

Method Detail

drawUnderlineback to summary
pack-priv abstract void drawUnderline(Graphics2D g2d, float thickness, float x1, float x2, float y)

Draws the underline into g2d. The thickness should be obtained from a LineMetrics object. Note that some underlines ignore the thickness parameter. The underline is drawn from (x1, y) to (x2, y).

getLowerDrawLimitback to summary
pack-priv abstract float getLowerDrawLimit(float thickness)

Returns the bottom of the bounding rectangle for this underline.

getUnderlineback to summary
pack-priv static Underline getUnderline(Object value)

Return the Underline for the given value of TextAttribute.INPUT_METHOD_UNDERLINE or TextAttribute.UNDERLINE. If value is not an input method underline value or TextAttribute.UNDERLINE_ON, null is returned.

getUnderlineback to summary
pack-priv static Underline getUnderline(int index)
getUnderlineShapeback to summary
pack-priv abstract Shape getUnderlineShape(float thickness, float x1, float x2, float y)

Returns a Shape representing the underline. The thickness should be obtained from a LineMetrics object. Note that some underlines ignore the thickness parameter.

sun.font back to summary

private Class Underline.IMGrayUnderline

extends Underline
Class Inheritance

Field Summary

Modifier and TypeField and Description
private BasicStroke

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv void
drawUnderline(Graphics2D g2d, float thickness, float x1, float x2, float y)

Implements abstract sun.font.Underline.drawUnderline.

Draws the underline into g2d.

pack-priv float
getLowerDrawLimit(float thickness)

Implements abstract sun.font.Underline.getLowerDrawLimit.

Returns the bottom of the bounding rectangle for this underline.

pack-priv Shape
getUnderlineShape(float thickness, float x1, float x2, float y)

Implements abstract sun.font.Underline.getUnderlineShape.

Returns a Shape representing the underline.

Inherited from sun.font.Underline:
getUnderlinegetUnderline

Field Detail

strokeback to summary
private BasicStroke stroke

Constructor Detail

IMGrayUnderlineback to summary
pack-priv IMGrayUnderline()

Method Detail

drawUnderlineback to summary
pack-priv void drawUnderline(Graphics2D g2d, float thickness, float x1, float x2, float y)

Implements abstract sun.font.Underline.drawUnderline.

Doc from sun.font.Underline.drawUnderline.

Draws the underline into g2d. The thickness should be obtained from a LineMetrics object. Note that some underlines ignore the thickness parameter. The underline is drawn from (x1, y) to (x2, y).

getLowerDrawLimitback to summary
pack-priv float getLowerDrawLimit(float thickness)

Implements abstract sun.font.Underline.getLowerDrawLimit.

Doc from sun.font.Underline.getLowerDrawLimit.

Returns the bottom of the bounding rectangle for this underline.

getUnderlineShapeback to summary
pack-priv Shape getUnderlineShape(float thickness, float x1, float x2, float y)

Implements abstract sun.font.Underline.getUnderlineShape.

Doc from sun.font.Underline.getUnderlineShape.

Returns a Shape representing the underline. The thickness should be obtained from a LineMetrics object. Note that some underlines ignore the thickness parameter.

sun.font back to summary

private final Class Underline.StandardUnderline

extends Underline
Class Inheritance

Field Summary

Modifier and TypeField and Description
private BasicStroke
private float[]
private float
private float
private boolean

Constructor Summary

AccessConstructor and Description
pack-priv
StandardUnderline(float shift, float thicknessMultiplier, float[] dashPattern, boolean useThickness)

Method Summary

Modifier and TypeMethod and Description
private BasicStroke
createStroke(float lineThickness)

pack-priv void
drawUnderline(Graphics2D g2d, float thickness, float x1, float x2, float y)

Implements abstract sun.font.Underline.drawUnderline.

Draws the underline into g2d.

private float
getLineThickness(float thickness)

pack-priv float
getLowerDrawLimit(float thickness)

Implements abstract sun.font.Underline.getLowerDrawLimit.

Returns the bottom of the bounding rectangle for this underline.

private Stroke
getStroke(float thickness)

pack-priv Shape
getUnderlineShape(float thickness, float x1, float x2, float y)

Implements abstract sun.font.Underline.getUnderlineShape.

Returns a Shape representing the underline.

Inherited from sun.font.Underline:
getUnderlinegetUnderline

Field Detail

cachedStrokeback to summary
private BasicStroke cachedStroke
dashPatternback to summary
private float[] dashPattern
shiftback to summary
private float shift
thicknessMultiplierback to summary
private float thicknessMultiplier
useThicknessback to summary
private boolean useThickness

Constructor Detail

StandardUnderlineback to summary
pack-priv StandardUnderline(float shift, float thicknessMultiplier, float[] dashPattern, boolean useThickness)

Method Detail

createStrokeback to summary
private BasicStroke createStroke(float lineThickness)
drawUnderlineback to summary
pack-priv void drawUnderline(Graphics2D g2d, float thickness, float x1, float x2, float y)

Implements abstract sun.font.Underline.drawUnderline.

Doc from sun.font.Underline.drawUnderline.

Draws the underline into g2d. The thickness should be obtained from a LineMetrics object. Note that some underlines ignore the thickness parameter. The underline is drawn from (x1, y) to (x2, y).

getLineThicknessback to summary
private float getLineThickness(float thickness)
getLowerDrawLimitback to summary
pack-priv float getLowerDrawLimit(float thickness)

Implements abstract sun.font.Underline.getLowerDrawLimit.

Doc from sun.font.Underline.getLowerDrawLimit.

Returns the bottom of the bounding rectangle for this underline.

getStrokeback to summary
private Stroke getStroke(float thickness)
getUnderlineShapeback to summary
pack-priv Shape getUnderlineShape(float thickness, float x1, float x2, float y)

Implements abstract sun.font.Underline.getUnderlineShape.

Doc from sun.font.Underline.getUnderlineShape.

Returns a Shape representing the underline. The thickness should be obtained from a LineMetrics object. Note that some underlines ignore the thickness parameter.