| |||||||||
摘要: 嵌套 | 字段 | 构造方法 | 方法 | 详细信息: 字段 | 构造方法 | 方法 |
javax.swing.plaf.basic
类 BasicListUI
java.lang.Object javax.swing.plaf.ComponentUI javax.swing.plaf.ListUI javax.swing.plaf.basic.BasicListUI
public class BasicListUI
- extends ListUI
ListUI 的基本 L&F 实现。
嵌套类摘要 | |
---|---|
class | BasicListUI.FocusHandler 此内部类因编译器故障而被标记为“公开”。 |
class | BasicListUI.ListDataHandler 在 installUI 时和只要 JList.model 属性更改时就要添加到 JList 模型的 ListDataListener。 |
class | BasicListUI.ListSelectionHandler 在 installUI 时和只要 JList.selectionModel 属性更改时就要添加到 JList 模型的 ListSelectionListener。 |
class | BasicListUI.MouseInputHandler 鼠标输入和 JList 的焦点处理。 |
class | BasicListUI.PropertyChangeHandler 在 installUI 时添加到 JList 的 PropertyChangeListener。 |
字段摘要 | |
---|---|
protected int | cellHeight |
protected int[] | cellHeights |
protected static int | cellRendererChanged |
protected int | cellWidth |
protected static int | fixedCellHeightChanged |
protected static int | fixedCellWidthChanged |
protected FocusListener | focusListener |
protected static int | fontChanged |
protected JList | list |
protected ListDataListener | listDataListener |
protected ListSelectionListener | listSelectionListener |
protected static int | modelChanged |
protected MouseInputListener | mouseInputListener |
protected PropertyChangeListener | propertyChangeListener |
protected static int | prototypeCellValueChanged |
protected CellRendererPane | rendererPane |
protected static int | selectionModelChanged |
protected int | updateLayoutStateNeeded |
构造方法摘要 | |
---|---|
BasicListUI() |
方法摘要 | |
---|---|
protected int | convertRowToY(int row) 返回指定行的原点的 JList 相对 Y 坐标,如果 row 无效,则返回 -1。 |
protected int | convertYToRow(int y0) 基于当前布局,将 JList 相对坐标转换为包含它的行。 |
protected FocusListener | createFocusListener() |
protected ListDataListener | createListDataListener() 创建在需要时由模型添加到 JList 的 ListDataListener 的实例。 |
protected ListSelectionListener | createListSelectionListener() 创建在需要时由 selectionModel 添加到 JList 的 ListSelectionHandler 的实例。 |
protected MouseInputListener | createMouseInputListener() 创建实现 MouseInputListener 的委托。 |
protected PropertyChangeListener | createPropertyChangeListener() 创建由 installUI() 添加到 JList 的 PropertyChangeHandler 的实例。 |
static ComponentUI | createUI(JComponent list) 返回 BasicListUI 的新实例。 |
Rectangle | getCellBounds(JList list, int index1, int index2) 返回在 JList 坐标中指定项的边界,如果索引无效,则返回 null。 |
Dimension | getPreferredSize(JComponent c) 列表的 preferredSize 依赖于布局方向。 |
protected int | getRowHeight(int row) 返回基于当前布局的指定行的高度。 |
Point | indexToLocation(JList list, int index) 返回在 JList 坐标中指定项的原点,如果索引无效,则返回 null。 |
protected void | installDefaults() 初始化 JList 属性(如字体、前景和背景)并添加 CellRendererPane。 |
protected void | installKeyboardActions() 在与 BasicListUI 关联的 JList 上注册键盘绑定。 |
protected void | installListeners() 为 JList、其模型及其 selectionModel 创建并安装侦听器。 |
void | installUI(JComponent c) 按顺序调用 installDefaults() 、installListeners() 和 installKeyboardActions() 来初始化 this.list 。 |
int | locationToIndex(JList list, Point location) 将 JList 坐标中的点转换为该处单元格最接近的索引。 |
protected void | maybeUpdateLayoutState() 如果 updateLayoutStateNeeded 为非零,则调用 updateLayoutState() 并重置 updateLayoutStateNeeded。 |
void | paint(Graphics g, JComponent c) 绘制与 Graphics 对象 clipRect 相交的行。 |
protected void | paintCell(Graphics g, int row, Rectangle rowBounds, ListCellRenderer cellRenderer, ListModel dataModel, ListSelectionModel selModel, int leadIndex) 绘制一个 List 单元格:计算相关状态,获取“橡皮图章”单元格渲染器组件,然后使用 CellRendererPane 来绘制它。 |
protected void | selectNextIndex() 选择下一行并强行使其可见。 |
protected void | selectPreviousIndex() 选择前一行并强行使其可见。 |
protected void | uninstallDefaults() 将尚未显式重写的 JList 属性设置为 null。 |
protected void | uninstallKeyboardActions() 注销根据 installKeyboardActions 安装的键盘动作。 |
protected void | uninstallListeners() 移除 JList、其模型及其 selectionModel 的侦听器。 |
void | uninstallUI(JComponent c) 按顺序调用 uninstallListeners() 、uninstallKeyboardActions() 和 uninstallDefaults() 来取消初始化 this.list 。 |
protected void | updateLayoutState() 基于当前字体和 fixedCellWidth、fixedCellHeight 和 prototypeCellValue 的当前值重新计算 cellHeight(一个或多个)和 cellWidth 的值。 |
从类 javax.swing.plaf.ComponentUI 继承的方法 |
---|
contains, getAccessibleChild, getAccessibleChildrenCount, getMaximumSize, getMinimumSize, update |
从类 java.lang.Object 继承的方法 |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
字段详细信息 |
---|
list
protected JList list
rendererPane
protected CellRendererPane rendererPane
focusListener
protected FocusListener focusListener
mouseInputListener
protected MouseInputListener mouseInputListener
listSelectionListener
protected ListSelectionListener listSelectionListener
listDataListener
protected ListDataListener listDataListener
propertyChangeListener
protected PropertyChangeListener propertyChangeListener