public class StrokeBorder extends AbstractBorder
警告:序列化该类的对象与以后的Swing版本不兼容。当前的序列化支持适用于短期贮藏或RMI运行相同Swing版本的应用程序之间。为1.4,为所有JavaBeans™长期存储的支持已被添加到java.beans包。请看XMLEncoder。
| Constructor and Description |
|---|
StrokeBorder(BasicStroke stroke)
创建一个边境的指定
stroke。
|
StrokeBorder(BasicStroke stroke, Paint paint)
创建一个边境指定的
stroke和
paint。
|
| Modifier and Type | Method and Description |
|---|---|
Insets |
getBorderInsets(Component c, Insets insets)
重新初始化这个边境的插图
insets参数。
|
Paint |
getPaint()
返回用于边境在渲染生成彩色的
Paint对象。
|
BasicStroke |
getStroke()
返回用于中风的形状边界绘制在
BasicStroke对象。
|
void |
paintBorder(Component c, Graphics g, int x, int y, int width, int height)
用指定的位置和大小绘制指定组件的边框。
|
getBaseline, getBaselineResizeBehavior, getBorderInsets, getInteriorRectangle, getInteriorRectangle, isBorderOpaquepublic StrokeBorder(BasicStroke stroke)
stroke。组件的前景颜色将被用于渲染边框。
stroke用于中风的形状
BasicStroke对象
NullPointerException -如果指定
stroke是
null
@ConstructorProperties(value={"stroke","paint"}) public StrokeBorder(BasicStroke stroke, Paint paint)
stroke和
paint。如果指定的
paint是
null,组件的前景颜色将用于渲染边界。
stroke用于中风的形状
BasicStroke对象
paint -用于生成一个颜色的
Paint对象
NullPointerException -如果指定
stroke是
null
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 -画边框的高度
NullPointerException -如果指定
g是
null
public Insets getBorderInsets(Component c, Insets insets)
insets参数。每个插图是最小的(最接近负无穷大)整数的值是大于或等于中风,是用来画边框线的宽度。
getBorderInsets 方法重写,继承类
AbstractBorder
c的组件,这个边界值运用插图
insets -重新初始化
Insets对象
insets参数的初始化
NullPointerException -如果指定
insets是
null
Math.ceil(double)
public BasicStroke getStroke()
BasicStroke对象。
BasicStroke对象
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.