java.applet

java.awt

java.awt.color

java.awt.datatransfer

java.awt.dnd

java.awt.event

java.awt.font

java.awt.geom

java.awt.im

java.awt.im.spi

java.awt.image

java.awt.image.renderable

java.awt.print

java.beans

java.beans.beancontext

java.io

java.lang

java.lang.annotation

java.lang.instrument

java.lang.management

java.lang.ref

java.lang.reflect

java.math

java.net

java.nio

java.nio.channels

java.nio.channels.spi

java.nio.charset

java.nio.charset.spi

java.rmi

java.rmi.activation

java.rmi.dgc

java.rmi.registry

java.rmi.server

java.security

java.security.acl

java.security.cert

java.security.interfaces

java.security.spec

java.sql

java.text

java.util

java.util.concurrent

java.util.concurrent.atomic

java.util.concurrent.locks

java.util.jar

java.util.logging

java.util.prefs

java.util.regex

java.util.zip

javax.accessibility

javax.activity

javax.crypto

javax.crypto.interfaces

javax.crypto.spec

javax.imageio

javax.imageio.event

javax.imageio.metadata

javax.imageio.plugins.bmp

javax.imageio.plugins.jpeg

javax.imageio.spi

javax.imageio.stream

javax.management

javax.management.loading

javax.management.modelmbean

javax.management.monitor

javax.management.openmbean

javax.management.relation

javax.management.remote

javax.management.remote.rmi

javax.management.timer

javax.naming

javax.naming.directory

javax.naming.event

javax.naming.ldap

javax.naming.spi

javax.net

javax.net.ssl

javax.print

javax.print.attribute

javax.print.attribute.standard

javax.print.event

javax.rmi

javax.rmi.CORBA

javax.rmi.ssl

javax.security.auth

javax.security.auth.callback

javax.security.auth.kerberos

javax.security.auth.login

javax.security.auth.spi

javax.security.auth.x500

javax.security.cert

javax.security.sasl

javax.sound.midi

javax.sound.midi.spi

javax.sound.sampled

javax.sound.sampled.spi

javax.sql

javax.sql.rowset

javax.sql.rowset.serial

javax.sql.rowset.spi

javax.swing

javax.swing.border

javax.swing.colorchooser

javax.swing.event

javax.swing.filechooser

javax.swing.plaf

javax.swing.plaf.basic

javax.swing.plaf.metal

javax.swing.plaf.multi

javax.swing.plaf.synth

javax.swing.table

javax.swing.text

javax.swing.text

javax.swing.text.parser

javax.swing.text.rtf

javax.swing.tree

javax.swing.undo

javax.transaction

javax.transaction.xa

javax.xml

javax.xml.datatype

javax.xml.namespace

javax.xml.parsers

javax.xml.transform

javax.xml.transform.dom

javax.xml.transform.sax

javax.xml.transform.stream

javax.xml.validation

javax.xml.xpath

org.ietf.jgss

org.omg.CORBA

org.omg.CORBA_2_3

org.omg.CORBA_2_3.portable

org.omg.CORBA.DynAnyPackage

org.omg.CORBA.ORBPackage

org.omg.CORBA.portable

org.omg.CORBA.TypeCodePackage

org.omg.CosNaming

org.omg.CosNaming.NamingContextExtPackage

org.omg.CosNaming.NamingContextPackage

org.omg.Dynamic

org.omg.DynamicAny

org.omg.DynamicAny.DynAnyFactoryPackage

org.omg.DynamicAny.DynAnyPackage

org.omg.IOP

org.omg.IOP.CodecFactoryPackage

org.omg.IOP.CodecPackage

org.omg.Messaging

org.omg.PortableInterceptor

org.omg.PortableInterceptor.ORBInitInfoPackage

org.omg.PortableServer

org.omg.PortableServer.CurrentPackage

org.omg.PortableServer.POAManagerPackage

org.omg.PortableServer.POAPackage

org.omg.PortableServer.portable

org.omg.PortableServer.ServantLocatorPackage

org.omg.SendingContext

org.omg.stub.java.rmi

org.w3c.dom

org.w3c.dom.bootstrap

org.w3c.dom.events

org.w3c.dom.ls

org.xml.sax

org.xml.sax.ext

org.xml.sax.helpers

allclasses-frame

allclasses-noframe

constant-values

deprecated-list

help-doc

JavaTM 2 Platform
Standard Ed. 5.0

javax.swing.border
类 MatteBorder

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

public class MatteBorder
extends EmptyBorder

该类提供类似衬边的边框,衬边图案既可以是纯色也可以是平铺的图标。

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


字段摘要
protected  Color color
           
protected  Icon tileIcon
           
 
从类 javax.swing.border.EmptyBorder 继承的字段
bottom, left, right, top
 
构造方法摘要
MatteBorder(Icon tileIcon)
          创建具有指定平铺图标的衬边边框。
MatteBorder(Insets borderInsets, Color matteColor)
          创建具有指定 insets 和颜色的衬边边框。
MatteBorder(Insets borderInsets, Icon tileIcon)
          创建具有指定 insets 和平铺图标的衬边边框。
MatteBorder(int top, int left, int bottom, int right, Color matteColor)
          创建具有指定 insets 和颜色的衬边边框。
MatteBorder(int top, int left, int bottom, int right, Icon tileIcon)
          创建具有指定 insets 和平铺图标的衬边边框。
 
方法摘要
 Insets getBorderInsets()
          返回此边框的 insets。
 Insets getBorderInsets(Component c)
          返回边框的 insets。
 Insets getBorderInsets(Component c, Insets insets)
          用此边框的当前 Insets 重新初始化 insets 参数。
 Color getMatteColor()
          返回平铺边框的颜色,如果使用了平铺图标,则返回 null。
 Icon getTileIcon()
          返回平铺边框的图标,如果使用了纯色,则返回 null。
 boolean isBorderOpaque()
          返回边框是否透明。
 void paintBorder(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
 

字段详细信息

color

protected Color color

tileIcon

protected Icon tileIcon
构造方法详细信息

MatteBorder

public MatteBorder(int top,
                   int left,
                   int bottom,
                   int right,
                   Color matteColor)
创建具有指定 insets 和颜色的衬边边框。

参数:
top - 边框顶部 inset
left - 边框左部 inset
bottom - 边框底部 inset
right - 边框右部 inset
matteColor - 边框呈现的颜色

MatteBorder

public MatteBorder(Insets borderInsets,
                   Color matteColor)
创建具有指定 insets 和颜色的衬边边框。

参数:
borderInsets - 边框的 insets
matteColor - 边框呈现的颜色

MatteBorder

public MatteBorder(int top,
                   int left,
                   int bottom,
                   int right,
                   Icon tileIcon)
创建具有指定 insets 和平铺图标的衬边边框。

参数:
top - 边框顶部 inset
left - 边框左部 inset
bottom - 边框底部 insetr
边框右部 - inset
tileIcon - 用于平铺边框的图标

MatteBorder

public MatteBorder(Insets borderInsets,
                   Icon tileIcon)
创建具有指定 insets 和平铺图标的衬边边框。

参数:
borderInsets - 边框的 insets
tileIcon - 用于平铺边框的图标

MatteBorder

public MatteBorder(Icon tileIcon)
创建具有指定平铺图标的衬边边框。将会根据平铺图标的大小动态计算 insets,其中顶部和底部 insets 将等于平铺图标的高度,而左部和右部 insets 将等于平铺图标的宽度。

参数:
tileIcon - 用于平铺边框的图标
方法详细信息

paintBorder

public void paintBorder(Component c,
                        Graphics g,
                        int x,
                        int y,
                        int width,
                        int height)
绘制衬边边框。

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

getBorderInsets

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

指定者:
接口 Border 中的 getBorderInsets
覆盖:
EmptyBorder 中的 getBorderInsets
参数:
c - 要应用此边框 insets 值的组件
返回:
已初始化为 0 的新 Insets 对象

getBorderInsets

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

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

getBorderInsets

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

覆盖:
EmptyBorder 中的 getBorderInsets

getMatteColor

public Color getMatteColor()
返回平铺边框的颜色,如果使用了平铺图标,则返回 null。


getTileIcon

public Icon getTileIcon()
返回平铺边框的图标,如果使用了纯色,则返回 null。


isBorderOpaque

public boolean isBorderOpaque()
返回边框是否透明。

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

JavaTM 2 Platform
Standard Ed. 5.0

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

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