is new.
java.lang.Objectjavax.swing.plaf.synth.SynthGraphicsUtils
public class SynthGraphicsUtils
Wrapper for primitive graphics calls.
| Constructor Summary | |
|---|---|
|
SynthGraphicsUtils
() Creates a SynthGraphicsUtils. |
|
| Method Summary | |
|---|---|
| int |
computeStringWidth
(
SynthContext
ss,
Font
font,
FontMetrics
metrics,
String
text) Returns the size of the passed in string. |
| void |
drawLine
(
SynthContext
context,
Object
paintKey,
Graphics
g, int x1, int y1, int x2, int y2) Draws a line between the two end points. |
void
|
drawLine
(
SynthContext
context,
Object
paintKey,
Graphics
g, int x1, int y1, int x2, int y2,
Object
Draws a line between the two end points.
|
| int |
getMaximumCharHeight
(
SynthContext
context) Returns the maximum height of the the Font from the passed in SynthContext. |
| Dimension |
getMaximumSize
(
SynthContext
ss,
Font
font,
String
text,
Icon
icon, int hAlign, int vAlign, int hTextPosition, int vTextPosition, int iconTextGap, int mnemonicIndex) Returns the maximum size needed to properly render an icon and text. |
| Dimension |
getMinimumSize
(
SynthContext
ss,
Font
font,
String
text,
Icon
icon, int hAlign, int vAlign, int hTextPosition, int vTextPosition, int iconTextGap, int mnemonicIndex) Returns the minimum size needed to properly render an icon and text. |
| Dimension |
getPreferredSize
(
SynthContext
ss,
Font
font,
String
text,
Icon
icon, int hAlign, int vAlign, int hTextPosition, int vTextPosition, int iconTextGap, int mnemonicIndex) Returns the preferred size needed to properly render an icon and text. |
| String |
layoutText
(
SynthContext
ss,
FontMetrics
fm,
String
text,
Icon
icon, int hAlign, int vAlign, int hTextPosition, int vTextPosition,
Rectangle
viewR,
Rectangle
iconR,
Rectangle
textR, int iconTextGap) Lays out text and an icon returning, by reference, the location to place the icon and text. |
| void |
paintText
(
SynthContext
ss,
Graphics
g,
String
text,
Icon
icon, int hAlign, int vAlign, int hTextPosition, int vTextPosition, int iconTextGap, int mnemonicIndex, int textOffset) Paints an icon and text. |
| void |
paintText
(
SynthContext
ss,
Graphics
g,
String
text, int x, int y, int mnemonicIndex) Paints text at the specified location. |
| void |
paintText
(
SynthContext
ss,
Graphics
g,
String
text,
Rectangle
bounds, int mnemonicIndex) Paints text at the specified location. |
| Methods inherited from class java.lang. Object |
|---|
| clone , equals , finalize , getClass , hashCode , notify , notifyAll , toString , wait , wait , wait |
| Constructor Detail |
|---|
public SynthGraphicsUtils()
| Method Detail |
|---|
public void drawLine(SynthContext context,
Object paintKey,
Graphics g,
int x1,
int y1,
int x2,
int y2)
drawLine
public void
drawLine
(
SynthContext
context,
Object
paintKey,
Graphics
g, int x1, int y1, int x2, int y2,
Object
styleKey)
Draws a line between the two end points.
This implementation supports only one line style key, "dashed". The "dashed" line style is applied only to vertical and horizontal lines.
Specifying null or any key different from "dashed" will draw solid lines.
Parameters:
context - identifies hosting region
paintKey - identifies the portion of the component being asked to paint, may be null
g - Graphics object to paint to
x1 - x origin
y1 - y origin
x2 - x destination
y2 - y destination
styleKey - identifies the requested style of the line (e.g. "dashed")
Since:
1.6
public String layoutText(SynthContext ss,
FontMetrics fm,
String text,
Icon icon,
int hAlign,
int vAlign,
int hTextPosition,
int vTextPosition,
Rectangle viewR,
Rectangle iconR,
Rectangle textR,
int iconTextGap)
public int computeStringWidth(SynthContext ss,
Font font,
FontMetrics metrics,
String text)
public Dimension getMinimumSize(SynthContext ss,
Font font,
String text,
Icon icon,
int hAlign,
int vAlign,
int hTextPosition,
int vTextPosition,
int iconTextGap,
int mnemonicIndex)
public Dimension getMaximumSize(SynthContext ss,
Font font,
String text,
Icon icon,
int hAlign,
int vAlign,
int hTextPosition,
int vTextPosition,
int iconTextGap,
int mnemonicIndex)
public int getMaximumCharHeight(SynthContext context)
public Dimension getPreferredSize(SynthContext ss,
Font font,
String text,
Icon icon,
int hAlign,
int vAlign,
int hTextPosition,
int vTextPosition,
int iconTextGap,
int mnemonicIndex)
public void paintText(SynthContext ss,
Graphics g,
String text,
Rectangle bounds,
int mnemonicIndex)
public void paintText(SynthContext ss,
Graphics g,
String text,
int x,
int y,
int mnemonicIndex)
public void paintText(SynthContext ss,
Graphics g,
String text,
Icon icon,
int hAlign,
int vAlign,
int hTextPosition,
int vTextPosition,
int iconTextGap,
int mnemonicIndex,
int textOffset)