public abstract class AbstractBorder extends Object implements Border, Serializable
警告:序列化该类的对象与以后的Swing版本不兼容。当前的序列化支持适用于短期贮藏或RMI运行相同Swing版本的应用程序之间。为1.4,为所有JavaBeans™长期存储的支持已被添加到java.beans
包。请看XMLEncoder
。
Constructor and Description |
---|
AbstractBorder() |
Modifier and Type | Method and Description |
---|---|
int |
getBaseline(Component c, int width, int height)
返回基线。
|
Component.BaselineResizeBehavior |
getBaselineResizeBehavior(Component c)
返回一个枚举指示一个成分变化大小变化的基线。
|
Insets |
getBorderInsets(Component c)
此默认实现返回一个新的
Insets 对象是由
getBorderInsets(Component,Insets) 方法初始化。
|
Insets |
getBorderInsets(Component c, Insets insets)
重新初始化插入参数与本边境目前的插图。
|
static Rectangle |
getInteriorRectangle(Component c, Border b, int x, int y, int width, int height)
返回一个矩形使用参数减去边界的插图。
|
Rectangle |
getInteriorRectangle(Component c, int x, int y, int width, int height)
这种方便的方法调用静态方法。
|
boolean |
isBorderOpaque()
此默认实现返回错误。
|
void |
paintBorder(Component c, Graphics g, int x, int y, int width, int height)
此默认实现不画。
|
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height)
paintBorder
接口
Border
c
的组件,这个边界是被涂
g
-绘制的图形
x
-画边框的位置
y
-画边框的位置
width
-画的边框宽度
height
-画边框的高度
public Insets getBorderInsets(Component c)
Insets
对象是由
getBorderInsets(Component,Insets)
方法初始化。默认情况下,
top
,
left
,
bottom
,和
right
字段设置为
0
。
getBorderInsets
接口
Border
c
的组件,这个边界值运用插图
Insets
对象
public Insets getBorderInsets(Component c, Insets insets)
c
的组件,这个边界值运用插图
insets
-重新初始化对象
insets
对象
public boolean isBorderOpaque()
isBorderOpaque
接口
Border
public Rectangle getInteriorRectangle(Component c, int x, int y, int width, int height)
c
的组件,这个边界被计算
x
-边界的位置
y
-边界的位置
width
-边框的宽度
height
-边界的高度
Rectangle
包含内部协调
public static Rectangle getInteriorRectangle(Component c, Border b, int x, int y, int width, int height)
c
的组件,这个边界被计算
b
-
Border
对象
x
-边界的位置
y
-边界的位置
width
-边框的宽度
height
-边界的高度
Rectangle
包含内部协调
public int getBaseline(Component c, int width, int height)
默认实现返回- 1。支持基线的子类应适当重写。如果一个值> = 0返回,然后组成有一个有效的基线为任何规模的> =最小尺寸和getBaselineResizeBehavior
可以用来确定基线的改变大小。
c
-
Component
基线被要求
width
的宽度得到基线
height
-高度得到基线
IllegalArgumentException
如果宽度或高度小于0
Component.getBaseline(int,int)
,
Component.getBaselineResizeBehavior()
public Component.BaselineResizeBehavior getBaselineResizeBehavior(Component c)
默认的实现返回BaselineResizeBehavior.OTHER
,亚基线应重写适当支持。子类应该不会再回来null
;如果基线无法计算回报BaselineResizeBehavior.OTHER
。来电者应该先问用getBaseline
基线,如果值> = 0返回使用此方法。此方法返回比其他BaselineResizeBehavior.OTHER
即使getBaseline
返回值小于0的值是可以接受的。
c
-
Component
返回基线调整行为
Component.getBaseline(int,int)
,
Component.getBaselineResizeBehavior()
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.