|
Extension SDK 10.1.2 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object oracle.javatools.editor.underline.SimpleLinePainter
The SimpleLinePainter
is an implementation of the
which paints a straight
underline of a given thickness. UnderlinePainter
Field Summary | |
protected boolean |
fromBaseline
Whether the line is painted from the baseline (extending downwards for thickness) or from the descent below the baseline (extending upwards for thickness.) |
static int |
MAX_THICKNESS
The maximum thickness that can be specified to the line painter. |
protected int |
thickness
The thickness of the line to paint. |
Constructor Summary | |
SimpleLinePainter(int thickness,
boolean fromBaseline)
Constructs a new SimpleLinePainter of the specified
thickness. |
Method Summary | |
protected int |
getYPos(int yBaseline,
int descent)
Utility routine to calculate the appropriate y position to start painting downwards from, based on the requested paint position (from baseline or from bottom), and the yBaseline coordinate and the descent.) |
void |
paintUnderline(java.awt.Graphics graphics,
java.awt.Color color,
int xPos,
int width,
int yBaseline,
int descent)
Paints the underline using this implementation of the UnderlinePainter . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int MAX_THICKNESS
protected final int thickness
protected final boolean fromBaseline
Constructor Detail |
public SimpleLinePainter(int thickness, boolean fromBaseline)
SimpleLinePainter
of the specified
thickness. Any thickness greater than MAX_THICKNESS will be
automatically reduced. If fromBaseline is true, the line is
painted from the baseline (downwards for thickness) or from the
descent below the baseline (extending upwards for thickness.)
thickness
- the thickness of the line to paintfromBaseline
- true if the underline extends from the baselineMethod Detail |
protected int getYPos(int yBaseline, int descent)
yBaseline
- the y position of the baselinedescent
- the descent of the text below the baselinepublic void paintUnderline(java.awt.Graphics graphics, java.awt.Color color, int xPos, int width, int yBaseline, int descent)
UnderlinePainter
.
paintUnderline
in interface UnderlinePainter
graphics
- the graphics context to paint intocolor
- the color to use for painting the underlinexPos
- the x position to start painting fromwidth
- the width of the underline to paintyBaseline
- the y position of the baseline of the text we are
drawing an underline fordescent
- the descent of the font the text was drawn with
|
Extension SDK | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1997, 2004, Oracle. All rights reserved.