JavaTM Platform
Standard Ed. 6

javax.swing.border
类 EmptyBorder

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

public class EmptyBorder
     
extends AbstractBorder
implements Serializable

该类提供了一个占用空间但不执行绘制的空透明边框。

警告:此类已序列化的对象将不再与以后的 Swing 版本兼容。当前的序列化支持适合于在运行相同 Swing 版本的应用程序之间短期存储或 RMI。从 1.4 版开始,已在 java.beans 包中加入对所有 JavaBeansTM 的长期存储支持。请参见 XMLEncoder


字段摘要
protected  int bottom
           
protected  int left
           
protected  int right
           
protected  int top
           
 
构造方法摘要
EmptyBorder(Insets borderInsets)
          创建具有指定 insets 的空边框
EmptyBorder(int top, int left, int bottom, int right)
          创建具有指定 insets 的空边框
 
方法摘要
 Insets getBorderInsets()
          返回此边框的 insets。
 Insets getBorderInsets(Component c)
          返回此边框的 insets
 Insets getBorderInsets(Component c, Insets insets)
          用此边框的当前 Insets 重新初始化 insets 参数
 boolean isBorderOpaque()
          返回此边框是否透明。
 void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
          默认情况下不执行绘制。
 
从类 javax.swing.border.AbstractBorder 继承的方法
getBaseline, getBaselineResizeBehavior, getInteriorRectangle, getInteriorRectangle
 
从类 java.lang.Object 继承的方法
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

字段详细信息

left

protected int left

right

protected int right

top

protected int top

bottom

protected int bottom
构造方法详细信息

EmptyBorder

public EmptyBorder(int top,
                   int left,
                   int bottom,
                   int right)
创建具有指定 insets 的空边框

参数:
top - 边框顶部 inset
left - 边框左部 inset
bottom - 边框底部 inset
right - 边框右部 inset

EmptyBorder

public EmptyBorder(Insets borderInsets)
创建具有指定 insets 的空边框

参数:
borderInsets - 边框的 insets
方法详细信息

paintBorder

public void paintBorder(Component c,
                        Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)
默认情况下不执行绘制。

指定者:
接口 Border 中的 paintBorder
覆盖:
AbstractBorder 中的 paintBorder
参数:
c - 要为其绘制边框的组件
g - 绘制的图形
x - 所绘制边框的 x 坐标位置
y - 所绘制边框的 y 坐标位置
width - 所绘制边框的宽度
height - 所绘制边框的高度

getBorderInsets

public Insets getBorderInsets(Component c)
返回此边框的 insets

指定者:
接口 Border 中的 getBorderInsets
覆盖:
AbstractBorder 中的 getBorderInsets
参数:
c - 应用此边框 insets 值的组件
返回:
已初始化为 0 的新 Insets 对象
从以下版本开始:
1.3

getBorderInsets

public Insets getBorderInsets(Component c,
                              Insets insets)
用此边框的当前 Insets 重新初始化 insets 参数

覆盖:
AbstractBorder 中的 getBorderInsets
参数:
c - 应用此边框 insets 值的组件
insets - 要重新初始化的对象
返回:
insets 对象

getBorderInsets

public Insets getBorderInsets()
返回此边框的 insets。

从以下版本开始:
1.3

isBorderOpaque

public boolean isBorderOpaque()
返回此边框是否透明。默认情况下返回 false。

指定者:
接口 Border 中的 isBorderOpaque
覆盖:
AbstractBorder 中的 isBorderOpaque
返回:
false

JavaTM Platform
Standard Ed. 6

提交错误或意见
有关更多的 API 参考资料和开发人员文档,请参阅 Java SE 开发人员文档。该文档包含更详细的、面向开发人员的描述,以及总体概述、术语定义、使用技巧和工作代码示例。

版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策