|
|||||||||
| Home >> All >> javax >> swing >> plaf >> [ basic overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
javax.swing.plaf.basic
Class BasicGraphicsUtils

java.lang.Objectjavax.swing.plaf.basic.BasicGraphicsUtils
- public class BasicGraphicsUtils
- extends java.lang.Object
A utility class providing commonly used drawing and measurement routines.
| Constructor Summary | |
BasicGraphicsUtils()
Constructor. |
|
| Method Summary | |
static void |
drawBezel(java.awt.Graphics g,
int x,
int y,
int width,
int height,
boolean isPressed,
boolean isDefault,
java.awt.Color shadow,
java.awt.Color darkShadow,
java.awt.Color highlight,
java.awt.Color lightHighlight)
Draws a border that is suitable for buttons of the Basic look and feel. |
static void |
drawDashedRect(java.awt.Graphics g,
int x,
int y,
int width,
int height)
Draws a rectangle, simulating a dotted stroke by painting only every second pixel along the one-pixel thick edge. |
static void |
drawEtchedRect(java.awt.Graphics g,
int x,
int y,
int width,
int height,
java.awt.Color shadow,
java.awt.Color darkShadow,
java.awt.Color highlight,
java.awt.Color lightHighlight)
Draws a rectangle that appears etched into the surface, given four colors that are used for drawing. |
static void |
drawGroove(java.awt.Graphics g,
int x,
int y,
int width,
int height,
java.awt.Color shadow,
java.awt.Color highlight)
Draws a rectangle that appears etched into the surface, given two colors that are used for drawing. |
static void |
drawLoweredBezel(java.awt.Graphics g,
int x,
int y,
int width,
int height,
java.awt.Color shadow,
java.awt.Color darkShadow,
java.awt.Color highlight,
java.awt.Color lightHighlight)
Draws a rectangle that appears lowered into the surface, given four colors that are used for drawing. |
static void |
drawString(java.awt.Graphics g,
java.lang.String text,
int underlinedChar,
int x,
int y)
Draws a String at the given location, underlining the first occurence of a specified character. |
static void |
drawStringUnderlineCharAt(java.awt.Graphics g,
java.lang.String text,
int underlinedIndex,
int x,
int y)
Draws a String at the given location, underlining the character at the specified index. |
static java.awt.Insets |
getEtchedInsets()
Determines the width of the border that gets painted by drawEtchedRect(java.awt.Graphics, int, int, int, int, java.awt.Color, java.awt.Color, java.awt.Color, java.awt.Color) 55 . |
static java.awt.Insets |
getGrooveInsets()
Determines the width of the border that gets painted by drawGroove(java.awt.Graphics, int, int, int, int, java.awt.Color, java.awt.Color) 55 . |
static java.awt.Dimension |
getPreferredButtonSize(javax.swing.AbstractButton b,
int textIconGap)
Determines the preferred width and height of an AbstractButton, given the gap between the button’s text and icon. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
BasicGraphicsUtils
public BasicGraphicsUtils()
- Constructor. It is utterly unclear why this class should
be constructable, but this is what the API specification
says.
| Method Detail |
drawEtchedRect
public static void drawEtchedRect(java.awt.Graphics g, int x, int y, int width, int height, java.awt.Color shadow, java.awt.Color darkShadow, java.awt.Color highlight, java.awt.Color lightHighlight)
- Draws a rectangle that appears etched into the surface, given
four colors that are used for drawing.
getEtchedInsets
public static java.awt.Insets getEtchedInsets()
- Determines the width of the border that gets painted by
drawEtchedRect(java.awt.Graphics, int, int, int, int, java.awt.Color, java.awt.Color, java.awt.Color, java.awt.Color)55 .
drawGroove
public static void drawGroove(java.awt.Graphics g, int x, int y, int width, int height, java.awt.Color shadow, java.awt.Color highlight)
- Draws a rectangle that appears etched into the surface, given
two colors that are used for drawing.
getGrooveInsets
public static java.awt.Insets getGrooveInsets()
- Determines the width of the border that gets painted by
drawGroove(java.awt.Graphics, int, int, int, int, java.awt.Color, java.awt.Color)55 .
drawBezel
public static void drawBezel(java.awt.Graphics g, int x, int y, int width, int height, boolean isPressed, boolean isDefault, java.awt.Color shadow, java.awt.Color darkShadow, java.awt.Color highlight, java.awt.Color lightHighlight)
- Draws a border that is suitable for buttons of the Basic look and
feel.
drawLoweredBezel
public static void drawLoweredBezel(java.awt.Graphics g, int x, int y, int width, int height, java.awt.Color shadow, java.awt.Color darkShadow, java.awt.Color highlight, java.awt.Color lightHighlight)
- Draws a rectangle that appears lowered into the surface, given
four colors that are used for drawing.
Compatibility with the Sun reference implementation: The Sun reference implementation seems to ignore the
xandyarguments, at least in JDK 1.3.1 and 1.4.1_01. The method always draws the rectangular area at location (0, 0). A bug report has been filed with Sun; its “bug ID” is 4880003. The GNU Classpath implementation behaves correctly, thus not replicating this bug.
drawString
public static void drawString(java.awt.Graphics g, java.lang.String text, int underlinedChar, int x, int y)
- Draws a String at the given location, underlining the first
occurence of a specified character. The algorithm for determining
the underlined position is not sensitive to case. If the
character is not part of
text, the text will be drawn without underlining. Drawing is performed in the current color and font ofg.
drawStringUnderlineCharAt
public static void drawStringUnderlineCharAt(java.awt.Graphics g, java.lang.String text, int underlinedIndex, int x, int y)
- Draws a String at the given location, underlining the character
at the specified index. Drawing is performed in the current color
and font of
g.
- Since:
- 1.4
drawDashedRect
public static void drawDashedRect(java.awt.Graphics g, int x, int y, int width, int height)
- Draws a rectangle, simulating a dotted stroke by painting only
every second pixel along the one-pixel thick edge. The color of
those pixels is the current color of the Graphics
g. Any other pixels are left unchanged.
getPreferredButtonSize
public static java.awt.Dimension getPreferredButtonSize(javax.swing.AbstractButton b, int textIconGap)
- Determines the preferred width and height of an AbstractButton,
given the gap between the button’s text and icon.
|
|||||||||
| Home >> All >> javax >> swing >> plaf >> [ basic overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
javax.swing.plaf.basic.BasicGraphicsUtils