public class BasicGraphicsUtils extends Object
public BasicGraphicsUtils()
public static void drawEtchedRect(Graphics g, int x, int y, int w, int h, Color shadow, Color darkShadow, Color highlight, Color lightHighlight)
public static Insets getEtchedInsets()
Returns the amount of space taken up by a border drawn by drawEtchedRect()
public static void drawGroove(Graphics g, int x, int y, int w, int h, Color shadow, Color highlight)
public static Insets getGrooveInsets()
Returns the amount of space taken up by a border drawn by drawGroove()
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)
public static void drawLoweredBezel(Graphics g, int x, int y, int w, int h, Color shadow, Color darkShadow, Color highlight, Color lightHighlight)
public static void drawString(Graphics g, String text, int underlinedChar, int x, int y)
Draw a string with the graphics g
at location (x,y) just like g.drawString
would. The first occurrence of underlineChar
in text will be underlined. The matching algorithm is not case sensitive.
public static void drawStringUnderlineCharAt(Graphics g, String text, int underlinedIndex, int x, int y)
Draw a string with the graphics g
at location (x
, y
) just like g.drawString
would. The character at index underlinedIndex
in text will be underlined. If index
is beyond the bounds of text
(including < 0), nothing will be underlined.
g
- Graphics to draw withtext
- String to drawunderlinedIndex
- Index of character in text to underlinex
- x coordinate to draw aty
- y coordinate to draw atpublic static void drawDashedRect(Graphics g, int x, int y, int width, int height)
public static Dimension getPreferredButtonSize(AbstractButton b, int textIconGap)
© 1993–2017, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.