public class BasicTableHeaderUI extends TableHeaderUI
| Modifier and Type | Class and Description |
|---|---|
class |
BasicTableHeaderUI.MouseInputHandler
这个类应该被视为一个“受保护”的内部类。
|
| Modifier and Type | Field and Description |
|---|---|
protected JTableHeader |
header
将绘画委托给此UI的JTableHeader。
|
protected MouseInputListener |
mouseInputListener |
protected CellRendererPane |
rendererPane |
| Constructor and Description |
|---|
BasicTableHeaderUI() |
| Modifier and Type | Method and Description |
|---|---|
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中反转在
installUI上完成的
installUI 。
|
contains, getAccessibleChild, getAccessibleChildrenCount, getBaselineResizeBehavior, updateprotected JTableHeader header
protected CellRendererPane rendererPane
protected MouseInputListener mouseInputListener
protected MouseInputListener createMouseInputListener()
public static ComponentUI createUI(JComponent h)
public void installUI(JComponent c)
ComponentUI
ComponentUI实例作为指定组件上的UI委托时,将调用此方法。
该方法应该完全配置组件的外观,包括以下内容:
LayoutManager上安装LayoutManager。 PropertyChangeListener上创建/安装PropertyChangeListener,以便适当地检测和响应组件属性的更改。 installUI在
ComponentUI类
c - 正在安装此UI代理的组件
ComponentUI.uninstallUI(javax.swing.JComponent) ,
JComponent.setUI(javax.swing.plaf.ComponentUI) ,
JComponent.updateUI()
protected void installDefaults()
protected void installListeners()
protected void installKeyboardActions()
public void uninstallUI(JComponent c)
ComponentUI
installUI上完成的installUI 。
当将此UIComponent实例作为指定组件的UI委托删除时,将调用此方法。
该方法应该撤消在installUI中执行的installUI ,小心使JComponent实例处于干净状态(无外部侦听器,外观特定属性对象等)。
这应该包括以下内容:
uninstallUI在
ComponentUI
c - 删除此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 - 以前的翻转列的索引,如果鼠标不在列上,则为-1
newColumn - 新滚动列的索引,如果鼠标不在列上,则为-1
getRolloverColumn() ,
JTableHeader.getHeaderRect(int)
public int getBaseline(JComponent c, int width, int height)
getBaseline在
ComponentUI
c -
JComponent正在请求基准
width - 获取基准的宽度
height - 获取基准的高度
NullPointerException - 如果
c是
null
IllegalArgumentException - 如果宽度或高度<0
JComponent.getBaseline(int, int)
public void paint(Graphics g, JComponent c)
ComponentUI
ComponentUI.update指定组件正在被绘制时的方法。
子类应该覆盖此方法,并使用指定的Graphics对象来呈现Graphics的内容。
paint在
ComponentUI类
g - 要绘画的
Graphics上下文
c - 正在涂漆的组件;
这个参数经常被忽略,但如果UI对象是无状态的并且被多个组件共享,则可能会被使用
ComponentUI.update(java.awt.Graphics, javax.swing.JComponent)
public Dimension getMinimumSize(JComponent c)
getMinimumSize在
ComponentUI
c - 查询最小大小的组件;
这个参数经常被忽略,但如果UI对象是无状态的并且被多个组件共享,则可能会被使用
Dimension对象或
null
JComponent.getMinimumSize() ,
LayoutManager.minimumLayoutSize(java.awt.Container) ,
ComponentUI.getPreferredSize(javax.swing.JComponent)
public Dimension getPreferredSize(JComponent c)
getPreferredSize在
ComponentUI
c - 要查询其首选大小的组件;
这个参数经常被忽略,但如果UI对象是无状态的并且被多个组件共享,则可能会被使用
JComponent.getPreferredSize() ,
LayoutManager.preferredLayoutSize(java.awt.Container)
public Dimension getMaximumSize(JComponent c)
getMaximumSize在
ComponentUI
c - 查询最大大小的组件;
这个参数经常被忽略,但如果UI对象是无状态的并且被多个组件共享,则可能会被使用
Dimension对象或
null
JComponent.getMaximumSize() ,
LayoutManager2.maximumLayoutSize(java.awt.Container)
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.