Wrapper for primitive graphics calls.
drawLine
public void drawLine(SynthContext context,
Object paintKey,
Graphics g,
int x1,
int y1,
int x2,
int y2) Draws a line between the two end points.
context - Identifies hosting region.paintKey - Identifies the portion of the component being asked
to paint, may be null.g - Graphics object to paint tox1 - x originy1 - y originx2 - x destinationy2 - y destination
getMaximumCharHeight
public int getMaximumCharHeight(SynthContext context)
Returns the maximum height of the the Font from the passed in
SynthContext.
context - SynthContext used to determine font.
- maximum height of the characters for the font from the passed
in context.
getMaximumSize
public 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.
ss - SynthContextfont - Font to usetext - Text to layouticon - Icon to layouthAlign - horizontal alignmentvAlign - vertical alignmenthTextPosition - horizontal text positionvTextPosition - vertical text positioniconTextGap - gap between icon and textmnemonicIndex - Index into text to render the mnemonic at, -1
indicates no mnemonic.
getMinimumSize
public 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.
ss - SynthContextfont - Font to usetext - Text to layouticon - Icon to layouthAlign - horizontal alignmentvAlign - vertical alignmenthTextPosition - horizontal text positionvTextPosition - vertical text positioniconTextGap - gap between icon and textmnemonicIndex - Index into text to render the mnemonic at, -1
indicates no mnemonic.
getPreferredSize
public 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.
ss - SynthContextfont - Font to usetext - Text to layouticon - Icon to layouthAlign - horizontal alignmentvAlign - vertical alignmenthTextPosition - horizontal text positionvTextPosition - vertical text positioniconTextGap - gap between icon and textmnemonicIndex - Index into text to render the mnemonic at, -1
indicates no mnemonic.
layoutText
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) Lays out text and an icon returning, by reference, the location to
place the icon and text.
ss - SynthContextfm - FontMetrics for the Font to use, this may be ignoredtext - Text to layouticon - Icon to layouthAlign - horizontal alignmentvAlign - vertical alignmenthTextPosition - horizontal text positionvTextPosition - vertical text positionviewR - Rectangle to layout text and icon in.iconR - Rectangle to place icon bounds intextR - Rectangle to place text iniconTextGap - gap between icon and text
paintText
public void paintText(SynthContext ss,
Graphics g,
String text,
int x,
int y,
int mnemonicIndex) Paints text at the specified location. This will not attempt to
render the text as html nor will it offset by the insets of the
component.
ss - SynthContextg - Graphics used to render string in.text - Text to renderx - X location to draw text at.y - Upper left corner to draw text at.mnemonicIndex - Index to draw string at.
paintText
public void paintText(SynthContext ss,
Graphics g,
String text,
Rectangle bounds,
int mnemonicIndex) Paints text at the specified location. This will not attempt to
render the text as html nor will it offset by the insets of the
component.
ss - SynthContextg - Graphics used to render string in.text - Text to renderbounds - Bounds of the text to be drawn.mnemonicIndex - Index to draw string at.
paintText
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) Paints an icon and text. This will render the text as html, if
necessary, and offset the location by the insets of the component.
ss - SynthContextg - Graphics to render string and icon intotext - Text to layouticon - Icon to layouthAlign - horizontal alignmentvAlign - vertical alignmenthTextPosition - horizontal text positionvTextPosition - vertical text positioniconTextGap - gap between icon and textmnemonicIndex - Index into text to render the mnemonic at, -1
indicates no mnemonic.textOffset - Amount to offset the text when painting