public class BasicGraphicsUtils extends Object
Constructor and Description |
---|
BasicGraphicsUtils() |
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)
绘制一个字符串图形
g 在位置(x,y)就像
g.drawString 会。
|
static void |
drawStringUnderlineCharAt(Graphics g, String text, int underlinedIndex, int x, int y)
画一个字符串与图形
g 在位置(
x ,
y )就像
g.drawString 会。
|
static Insets |
getEtchedInsets()
返回由
drawEtchedRect() 绘制的边框占用的空间
|
static Insets |
getGrooveInsets()
返回由
drawGroove() 绘制的边框占用的空间
|
static Dimension |
getPreferredButtonSize(AbstractButton b, int textIconGap) |
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()
drawEtchedRect()
绘制的边框所占用的空间量
public static void drawGroove(Graphics g, int x, int y, int w, int h, Color shadow, Color highlight)
public static Insets getGrooveInsets()
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)
g
在位置(x,y)就像g.drawString
会。
文字中第一次出现underlineChar
将被强调。
匹配算法不区分大小写。
public static void drawStringUnderlineCharAt(Graphics g, String text, int underlinedIndex, int x, int y)
g
在位置( x
, y
)就像g.drawString
会。
索引号为underlinedIndex
的文字中的字符将被加下划线。
如果index
超出了text
(包括<0)的范围,则不会强调任何内容。
g
- 图形绘制
text
- 要绘制的字符串
underlinedIndex
- 文本中下划线的字符索引
x
- x坐标绘制
y
- y坐标绘制
public static void drawDashedRect(Graphics g, int x, int y, int width, int height)
public static Dimension getPreferredButtonSize(AbstractButton b, int textIconGap)
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.