所有类


javax.swing.border
类 EtchedBorder

java.lang.Object
  继承者 javax.swing.border.AbstractBorder
      继承者 javax.swing.border.EtchedBorder
所有已实现的接口:
Serializable, Border
直接已知子类:
BorderUIResource.EtchedBorderUIResource

public class EtchedBorder
   
   
   
   
   
extends AbstractBorder

该类实现简单的浮雕化边框,它既可以是阴刻浮雕化边框,也可以是阳刻浮雕化边框。如果创建边框时未初始化任何高亮/阴影颜色,则这些颜色将从传递给 paintBorder() 方法的组件参数的背景色动态派生。

警告:此类的已序列化对象与以后的 Swing 版本不兼容。当前序列化支持适用于短期存储,或适用于在运行相同 Swing 版本的应用程序之间进行 RMI(Remote Method Invocation,远程方法调用)。从 1.4 版本开始,已在 java.beans 包中添加了支持所有 JavaBeansTM 长期存储的功能。请参见 XMLEncoder


字段摘要
protected  intetchType
           
protected  Colorhighlight
           
static intLOWERED
          阴刻浮雕化类型。
static intRAISED
          阳刻浮雕化类型。
protected  Colorshadow
           
 
构造方法摘要
EtchedBorder()
          创建一个阴刻浮雕化类型的边框,其颜色将从传递给 paintBorder 方法的组件的背景色派生。
EtchedBorder(Color highlight, Color shadow)
          创建具有指定高亮和阴影颜色的阴刻浮雕化边框
EtchedBorder(int etchType)
          创建具有指定蚀刻类型的浮雕化边框,其颜色将从传递给 paintBorder 方法的组件的背景色派生
EtchedBorder(int etchType, Color highlight, Color shadow)
          创建具有指定蚀刻类型、高亮和阴影颜色的浮雕化边框
 
方法摘要
 InsetsgetBorderInsets(Component c)
          返回边框的 insets
 InsetsgetBorderInsets(Component c, Insets insets)
          用此边框的当前 Insets 重新初始化 insets 参数
 intgetEtchType()
          返回浮雕化边框设置的蚀刻类型。
 ColorgetHighlightColor()
          返回浮雕化边框的高亮颜色。
 ColorgetHighlightColor(Component c)
          返回浮雕化边框在指定组件上呈现的高亮颜色。
 ColorgetShadowColor()
          返回浮雕化边框的阴影颜色。
 ColorgetShadowColor(Component c)
          返回浮雕化边框在指定组件上呈现的阴影颜色。
 booleanisBorderOpaque()
          返回边框是否透明。
 voidpaintBorder(Component c, Graphics g, int x, int y, int width, int height)
          按照指定的位置和尺寸为指定的组件绘制边框
 
从类 javax.swing.border.AbstractBorder 继承的方法
getInteriorRectangle, getInteriorRectangle
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

RAISED

public static final int RAISED
阳刻浮雕化类型。

另请参见:
常量字段值

LOWERED

public static final int LOWERED
阴刻浮雕化类型。

另请参见:
常量字段值

etchType

protected int etchType

highlight

protected Color highlight

shadow

protected Color shadow
构造方法详细信息

EtchedBorder

public EtchedBorder()
创建一个阴刻浮雕化类型的边框,其颜色将从传递给 paintBorder 方法的组件的背景色派生。


EtchedBorder

public EtchedBorder(int etchType)
创建具有指定蚀刻类型的浮雕化边框,其颜色将从传递给 paintBorder 方法的组件的背景色派生

参数:
etchType - 边框要绘制的蚀刻类型

EtchedBorder

public EtchedBorder(Color highlight,
                    Color shadow)
创建具有指定高亮和阴影颜色的阴刻浮雕化边框

参数:
highlight - 用于浮雕化高亮的颜色
shadow - 用于浮雕化阴影的颜色