|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjavax.swing.border.AbstractBorder
javax.swing.border.LineBorder
public class LineBorder
实现单色、任意厚度线边框的类。
警告:此类的已序列化对象与以后的 Swing 版本不兼容。当前序列化支持适用于短期存储,或适用于在运行相同 Swing 版本的应用程序之间进行 RMI(Remote Method Invocation,远程方法调用)。从 1.4 版本开始,已在 java.beans 包中添加了支持所有 JavaBeansTM 长期存储的功能。请参见 XMLEncoder。
| 字段摘要 | |
|---|---|
protected Color |
lineColor
|
protected boolean |
roundedCorners
|
protected int |
thickness
|
| 构造方法摘要 | |
|---|---|
LineBorder(Color color)
创建具有指定颜色、厚度为 1(thickness = 1)的线边框。 |
|
LineBorder(Color color,
int thickness)
创建具有指定颜色和厚度的线边框。 |
|
LineBorder(Color color,
int thickness,
boolean roundedCorners)
创建具有指定颜色、厚度和拐角形状的线条边框。 |
|
| 方法摘要 | |
|---|---|
static Border |
createBlackLineBorder()
获取一个颜色为黑色、厚度为 1 的线边框的便捷方法。 |
static Border |
createGrayLineBorder()
获取一个颜色为灰色、厚度为 1 的线条边框的便捷方法。 |
Insets |
getBorderInsets(Component c)
返回边框的 insets。 |
Insets |
getBorderInsets(Component c,
Insets insets)
用此边框的当前 Insets 重新初始化 insets 参数。 |
Color |
getLineColor()
返回边框的颜色。 |
boolean |
getRoundedCorners()
返回是否将此边框绘制为圆弧拐角边框。 |
int |
getThickness()
返回边框的厚度。 |
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 |
| 字段详细信息 |
|---|
protected int thickness
protected Color lineColor
protected boolean roundedCorners
| 构造方法详细信息 |
|---|
public LineBorder(Color color)
color - 边框的颜色。
public LineBorder(Color color,
int thickness)
color - 边框的颜色thickness - 边框的厚度
public LineBorder(Color color,
int thickness,
boolean roundedCorners)
color - 边框的颜色thickness - 边框的厚度roundedCorners - 边框拐角是否应为弧形| 方法详细信息 |
|---|
public static Border createBlackLineBorder()
public static Border createGrayLineBorder()
public void paintBorder(Component c,
Graphics g,
int x,
int y,
int width,
int height)
Border 中的 paintBorderAbstractBorder 中的 paintBorderc - 要为其绘制边框的组件g - 绘制的图形x - 所绘制边框的 x 坐标位置y - 所绘制边框的 y 坐标位置width - 所绘制边框的宽度height - 所绘制边框的高度public Insets getBorderInsets(Component c)
Border 中的 getBorderInsetsAbstractBorder 中的 getBorderInsetsc - 要应用此边框 insets 值的组件
Insets 对象
public Insets getBorderInsets(Component c,
Insets insets)
AbstractBorder 中的 getBorderInsetsc - 应用此边框 insets 值的组件insets - 要重新初始化的对象
insets 对象public Color getLineColor()
public int getThickness()
public boolean getRoundedCorners()
public boolean isBorderOpaque()
Border 中的 isBorderOpaqueAbstractBorder 中的 isBorderOpaque
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。