public class EtchedBorder extends AbstractBorder
警告:序列化该类的对象与以后的Swing版本不兼容。当前的序列化支持适用于短期贮藏或RMI运行相同Swing版本的应用程序之间。为1.4,为所有JavaBeans™长期存储的支持已被添加到java.beans
包。请看XMLEncoder
。
Modifier and Type | Field and Description |
---|---|
protected int |
etchType |
protected Color |
highlight |
static int |
LOWERED
降低蚀刻型。
|
static int |
RAISED
凸起蚀刻型。
|
protected Color |
shadow |
Constructor and Description |
---|
EtchedBorder()
创建一个降低蚀刻边界的颜色将由组件传递到paintborder方法的背景颜色。
|
EtchedBorder(Color highlight, Color shadow)
用指定的亮点和阴影颜色创建一个降低的蚀刻边框。
|
EtchedBorder(int etchType)
创建一个具有指定蚀刻蚀刻边界类型的颜色将由组件传递到paintborder方法的背景颜色。
|
EtchedBorder(int etchType, Color highlight, Color shadow)
用指定的蚀刻类型创建一个蚀刻的边框,突出显示和阴影颜色。
|
Modifier and Type | Method and Description |
---|---|
Insets |
getBorderInsets(Component c, Insets insets)
初始化参数和边界的插图插图。
|
int |
getEtchType()
在蚀刻的边框上设置蚀刻类型的返回。
|
Color |
getHighlightColor()
返回蚀刻边框的突出显示颜色。
|
Color |
getHighlightColor(Component c)
当渲染到指定的组件时返回蚀刻边框的突出显示颜色。
|
Color |
getShadowColor()
返回蚀刻边框的阴影颜色。
|
Color |
getShadowColor(Component c)
当渲染到指定组件时返回蚀刻边框的阴影颜色。
|
boolean |
isBorderOpaque()
返回是否边框是不透明的。
|
void |
paintBorder(Component c, Graphics g, int x, int y, int width, int height)
用指定的位置和大小绘制指定组件的边框。
|
getBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangle
public static final int RAISED
public static final int LOWERED
protected int etchType
protected Color highlight
protected Color shadow
public EtchedBorder()
public EtchedBorder(int etchType)
etchType
型蚀刻被划定的边界
public EtchedBorder(Color highlight, Color shadow)
highlight
-颜色使用蚀刻的亮点
shadow
-使用的颜色为蚀刻的暗影
@ConstructorProperties(value={"etchType","highlightColor","shadowColor"}) public EtchedBorder(int etchType, Color highlight, Color shadow)
etchType
型蚀刻被划定的边界
highlight
-颜色使用蚀刻的亮点
shadow
-使用的颜色为蚀刻的暗影
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
paintBorder
接口
Border
paintBorder
方法重写,继承类
AbstractBorder
c
的组件,这个边界是被涂
g
-绘制的图形
x
-画边框的位置
y
-画边框的位置
width
-画的边框宽度
height
-画边框的高度
public Insets getBorderInsets(Component c, Insets insets)
getBorderInsets
方法重写,继承类
AbstractBorder
c
的组件,这个边界值运用插图
insets
-重新初始化对象
insets
对象
public boolean isBorderOpaque()
isBorderOpaque
接口
Border
isBorderOpaque
方法重写,继承类
AbstractBorder
public int getEtchType()
public Color getHighlightColor(Component c)
c
的成分,突出的可能来源
public Color getHighlightColor()
public Color getShadowColor(Component c)
c
-组件的阴影可能来源
public Color getShadowColor()
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.