- java.lang.Object
-
- javax.swing.plaf.basic.BasicGraphicsUtils
-
public class BasicGraphicsUtils extends Object
-
-
Constructor Summary
Constructors Constructor and Description BasicGraphicsUtils()
-
Method Summary
Methods Modifier and Type Method and Description static void
drawBezel(Graphics g, int x, int y, int w, int h, boolean isPressed, boolean isDefault, Color shadow, Color darkShadow, Color highlight, Color lightHighlight)
static void
drawDashedRect(Graphics g, int x, int y, int width, int height)
static void
drawEtchedRect(Graphics g, int x, int y, int w, int h, Color shadow, Color darkShadow, Color highlight, Color lightHighlight)
static void
drawGroove(Graphics g, int x, int y, int w, int h, Color shadow, Color highlight)
static void
drawLoweredBezel(Graphics g, int x, int y, int w, int h, Color shadow, Color darkShadow, Color highlight, Color lightHighlight)
static void
drawString(Graphics g, String text, int underlinedChar, int x, int y)
Draw a string with the graphicsg
at location (x,y) just likeg.drawString
would.static void
drawStringUnderlineCharAt(Graphics g, String text, int underlinedIndex, int x, int y)
Draw a string with the graphicsg
at location (x
,y
) just likeg.drawString
would.static Insets
getEtchedInsets()
Returns the amount of space taken up by a border drawn bydrawEtchedRect()
static Insets
getGrooveInsets()
Returns the amount of space taken up by a border drawn bydrawGroove()
static Dimension
getPreferredButtonSize(AbstractButton b, int textIconGap)
-
-
-
Method Detail
-
drawEtchedRect
public static void drawEtchedRect(Graphics g, int x, int y, int w, int h, Color shadow, Color darkShadow, Color highlight, Color lightHighlight)
-
getEtchedInsets
public static Insets getEtchedInsets()
Returns the amount of space taken up by a border drawn bydrawEtchedRect()
- Returns:
- the inset of an etched rect
-
drawGroove
public static void drawGroove(Graphics g, int x, int y, int w, int h, Color shadow, Color highlight)
-
getGrooveInsets
public static Insets getGrooveInsets()
Returns the amount of space taken up by a border drawn bydrawGroove()
- Returns:
- the inset of a groove border
-
drawBezel
public static void drawBezel(Graphics g, int x, int y, int w, int h, boolean isPressed, boolean isDefault, Color shadow, Color darkShadow, Color highlight, Color lightHighlight)
-
drawLoweredBezel
public static void drawLoweredBezel(Graphics g, int x, int y, int w, int h, Color shadow, Color darkShadow, Color highlight, Color lightHighlight)
-
drawString
public static void drawString(Graphics g, String text, int underlinedChar, int x, int y)
Draw a string with the graphicsg
at location (x,y) just likeg.drawString
would. The first occurrence ofunderlineChar
in text will be underlined. The matching algorithm is not case sensitive.
-
drawStringUnderlineCharAt
public static void drawStringUnderlineCharAt(Graphics g, String text, int underlinedIndex, int x, int y)
Draw a string with the graphicsg
at location (x
,y
) just likeg.drawString
would. The character at indexunderlinedIndex
in text will be underlined. Ifindex
is beyond the bounds oftext
(including < 0), nothing will be underlined.- Parameters:
g
- Graphics to draw withtext
- String to drawunderlinedIndex
- Index of character in text to underlinex
- x coordinate to draw aty
- y coordinate to draw at- Since:
- 1.4
-
drawDashedRect
public static void drawDashedRect(Graphics g, int x, int y, int width, int height)
-
getPreferredButtonSize
public static Dimension getPreferredButtonSize(AbstractButton b, int textIconGap)
-
-
Document created the 11/06/2005, last modified the 04/03/2020
Source of the printed document:https://www.gaudry.be/en/java-api-rf-javax/swing/plaf/basic/basicgraphicsutils.html
The infobrol is a personal site whose content is my sole responsibility. The text is available under CreativeCommons license (BY-NC-SA). More info on the terms of use and the author.
References
These references and links indicate documents consulted during the writing of this page, or which may provide additional information, but the authors of these sources can not be held responsible for the content of this page.
The author This site is solely responsible for the way in which the various concepts, and the freedoms that are taken with the reference works, are presented here. Remember that you must cross multiple source information to reduce the risk of errors.