|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
java.lang.Objectjavax.swing.plaf.ComponentUI
javax.swing.plaf.TableHeaderUI
javax.swing.plaf.basic.BasicTableHeaderUI
public class BasicTableHeaderUI
BasicTableHeaderUI 实现
| 嵌套类摘要 | |
|---|---|
class |
BasicTableHeaderUI.MouseInputHandler
此内部类因编译器故障而被标记为“公开”。 |
| 字段摘要 | |
|---|---|
protected JTableHeader |
header
要将绘制委托给此 UI 的 JTableHeader。 |
protected MouseInputListener |
mouseInputListener
|
protected CellRendererPane |
rendererPane
|
| 构造方法摘要 | |
|---|---|
BasicTableHeaderUI()
|
|
| 方法摘要 | |
|---|---|
protected MouseInputListener |
createMouseInputListener()
创建 JTableHeader 的鼠标侦听器。 |
static ComponentUI |
createUI(JComponent h)
|
int |
getBaseline(JComponent c,
int width,
int height)
返回基线。 |
Dimension |
getMaximumSize(JComponent c)
返回标题的最大大小。 |
Dimension |
getMinimumSize(JComponent c)
返回标题的最小大小。 |
Dimension |
getPreferredSize(JComponent c)
返回标题的首选大小。 |
protected int |
getRolloverColumn()
返回鼠标当前位于其上的列标题的索引。 |
protected void |
installDefaults()
初始化 JTableHeader 属性,例如,字体、前景和背景。 |
protected void |
installKeyboardActions()
在 JTableHeader 上注册所有的键盘动作。 |
protected void |
installListeners()
将侦听器附加到 JTableHeader 上。 |
void |
installUI(JComponent c)
配置指定组件,使其适合外观。 |
void |
paint(Graphics g,
JComponent c)
绘制指定组件,使其适合外观。 |
protected void |
rolloverColumnUpdated(int oldColumn,
int newColumn)
每次更新表标题中的翻转列时调用此方法。 |
protected void |
uninstallDefaults()
|
protected void |
uninstallKeyboardActions()
注销默认键动作。 |
protected void |
uninstallListeners()
|
void |
uninstallUI(JComponent c)
在 installUI 期间,在指定组件上反向执行的配置操作。 |
| 从类 javax.swing.plaf.ComponentUI 继承的方法 |
|---|
contains, getAccessibleChild, getAccessibleChildrenCount, getBaselineResizeBehavior, update |
| 从类 java.lang.Object 继承的方法 |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| 字段详细信息 |
|---|
protected JTableHeader header
protected CellRendererPane rendererPane
protected MouseInputListener mouseInputListener
| 构造方法详细信息 |
|---|
public BasicTableHeaderUI()
| 方法详细信息 |
|---|
protected MouseInputListener createMouseInputListener()
public static ComponentUI createUI(JComponent h)
public void installUI(JComponent c)
ComponentUI 复制的描述ComponentUI 实例将作为 UI 委托安装在指定组件上时,可调用此方法。此方法应该为外观完整地配置组件,包括以下方面:
LayoutManager。
PropertyChangeListener。
ComponentUI 中的 installUIc - 将安装此 UI 委托的组件ComponentUI.uninstallUI(javax.swing.JComponent),
JComponent.setUI(javax.swing.plaf.ComponentUI),
JComponent.updateUI()protected void installDefaults()
installUI(javax.swing.JComponent)protected void installListeners()
protected void installKeyboardActions()
public void uninstallUI(JComponent c)
ComponentUI 复制的描述installUI 期间,在指定组件上反向执行的配置操作。当此 UIComponent 实例将作为 UI 委托从指定组件上移除时,可调用此方法。此方法应该取消在 installUI 中执行的配置操作,非常小心地使 JComponent 实例处于某种洁净状态(没有额外的侦听器、没有特定于外观的属性对象等等)。配置内容应该包括以下方面:
ComponentUI 中的 uninstallUIc - 从中移除此 UI 委托的组件;此参数常被忽略,但如果 UI 对象是无状态的并由多个组件共享,则可以使用该参数ComponentUI.installUI(javax.swing.JComponent),
JComponent.updateUI()protected void uninstallDefaults()
protected void uninstallListeners()
protected void uninstallKeyboardActions()
protected int getRolloverColumn()
rolloverColumnUpdated(int, int)
protected void rolloverColumnUpdated(int oldColumn,
int newColumn)
oldColumn - 以前翻转列的索引;如果鼠标不在列上,则为 -1newColumn - 新翻转列的索引;如果鼠标不在列上,则为 -1getRolloverColumn(),
JTableHeader.getHeaderRect(int)
public int getBaseline(JComponent c,
int width,
int height)
ComponentUI 中的 getBaselinec - 为其请求基线的 JComponentwidth - 为其获取基线的宽度height - 为其获取基线的高度
NullPointerException - 如果 c 为 null
IllegalArgumentException - 如果宽度或高度 < 0JComponent.getBaseline(int, int)
public void paint(Graphics g,
JComponent c)
ComponentUI 复制的描述ComponentUI.update 方法中调用此方法。子类应该重写此方法并使用指定 Graphics 对象来呈现组件的内容。
ComponentUI 中的 paintg - 将在其中进行绘制的 Graphics 上下文c - 将绘制的组件;此参数常被忽略,但如果 UI 对象是无状态的并由多个组件共享,则可以使用该参数ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)public Dimension getMinimumSize(JComponent c)
ComponentUI 中的 getMinimumSizec - 将查询其最小大小的组件;此参数常被忽略,但如果 UI 对象是无状态的并由多个组件共享,则可以使用该参数
Dimension 对象或 nullJComponent.getMinimumSize(),
LayoutManager.minimumLayoutSize(java.awt.Container),
ComponentUI.getPreferredSize(javax.swing.JComponent)public Dimension getPreferredSize(JComponent c)
ComponentUI 中的 getPreferredSizec - 将查询其首选大小的组件;此参数常被忽略,但如果 UI 对象是无状态的并由多个组件共享,则可以使用该参数JComponent.getPreferredSize(),
LayoutManager.preferredLayoutSize(java.awt.Container)public Dimension getMaximumSize(JComponent c)
ComponentUI 中的 getMaximumSizec - 将查询其最大大小的组件;此参数常被忽略,但如果 UI 对象是无状态的并由多个组件共享,则可以使用该参数
Dimension 对象或 nullJComponent.getMaximumSize(),
LayoutManager2.maximumLayoutSize(java.awt.Container)
|
JavaTM Platform Standard Ed. 6 |
|||||||||
| 上一个类 下一个类 | 框架 无框架 | |||||||||
| 摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 | |||||||||
版权所有 2007 Sun Microsystems, Inc. 保留所有权利。 请遵守许可证条款。另请参阅文档重新分发政策。