所有类


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 实现。


嵌套类摘要
 classBasicListUI.FocusHandler
          此内部类因编译器故障而被标记为“公开”。
 classBasicListUI.ListDataHandler
          在 installUI 时和只要 JList.model 属性更改时就要添加到 JList 模型的 ListDataListener。
 classBasicListUI.ListSelectionHandler
          在 installUI 时和只要 JList.selectionModel 属性更改时就要添加到 JList 模型的 ListSelectionListener。
 classBasicListUI.MouseInputHandler
          鼠标输入和 JList 的焦点处理。
 classBasicListUI.PropertyChangeHandler
          在 installUI 时添加到 JList 的 PropertyChangeListener。
 
字段摘要
protected  intcellHeight
           
protected  int[]cellHeights
           
protected static intcellRendererChanged
           
protected  intcellWidth
           
protected static intfixedCellHeightChanged
           
protected static intfixedCellWidthChanged
           
protected  FocusListenerfocusListener
           
protected static intfontChanged
           
protected  JListlist
           
protected  ListDataListenerlistDataListener
           
protected  ListSelectionListenerlistSelectionListener
           
protected static intmodelChanged
           
protected  MouseInputListenermouseInputListener
           
protected  PropertyChangeListenerpropertyChangeListener
           
protected static intprototypeCellValueChanged
           
protected  CellRendererPanerendererPane
           
protected static intselectionModelChanged
           
protected  intupdateLayoutStateNeeded
           
 
构造方法摘要
BasicListUI()
           
 
方法摘要
protected  intconvertRowToY(int row)
          返回指定行的原点的 JList 相对 Y 坐标,如果 row 无效,则返回 -1。
protected  intconvertYToRow(int y0)
          基于当前布局,将 JList 相对坐标转换为包含它的行。
protected  FocusListenercreateFocusListener()
           
protected  ListDataListenercreateListDataListener()
          创建在需要时由模型添加到 JList 的 ListDataListener 的实例。
protected  ListSelectionListenercreateListSelectionListener()
          创建在需要时由 selectionModel 添加到 JList 的 ListSelectionHandler 的实例。
protected  MouseInputListenercreateMouseInputListener()
          创建实现 MouseInputListener 的委托。
protected  PropertyChangeListenercreatePropertyChangeListener()
          创建由 installUI() 添加到 JList 的 PropertyChangeHandler 的实例。
static ComponentUIcreateUI(JComponent list)
          返回 BasicListUI 的新实例。
 RectanglegetCellBounds(JList list, int index1, int index2)
          返回在 JList 坐标中指定项的边界,如果索引无效,则返回 null。
 DimensiongetPreferredSize(JComponent c)
          列表的 preferredSize 依赖于布局方向。
protected  intgetRowHeight(int row)
          返回基于当前布局的指定行的高度。
 PointindexToLocation(JList list, int index)
          返回在 JList 坐标中指定项的原点,如果索引无效,则返回 null。
protected  voidinstallDefaults()
          初始化 JList 属性(如字体、前景和背景)并添加 CellRendererPane。
protected  voidinstallKeyboardActions()
          在与 BasicListUI 关联的 JList 上注册键盘绑定。
protected  voidinstallListeners()
          为 JList、其模型及其 selectionModel 创建并安装侦听器。
 voidinstallUI(JComponent c)
          按顺序调用 installDefaults()installListeners()installKeyboardActions() 来初始化 this.list
 intlocationToIndex(JList list, Point location)
          将 JList 坐标中的点转换为该处单元格最接近的索引。
protected  voidmaybeUpdateLayoutState()
          如果 updateLayoutStateNeeded 为非零,则调用 updateLayoutState() 并重置 updateLayoutStateNeeded。
 voidpaint(Graphics g, JComponent c)
          绘制与 Graphics 对象 clipRect 相交的行。
protected  voidpaintCell(Graphics g, int row, Rectangle rowBounds, ListCellRenderer cellRenderer, ListModel dataModel, ListSelectionModel selModel, int leadIndex)
          绘制一个 List 单元格:计算相关状态,获取“橡皮图章”单元格渲染器组件,然后使用 CellRendererPane 来绘制它。
protected  voidselectNextIndex()
          选择下一行并强行使其可见。
protected  voidselectPreviousIndex()
          选择前一行并强行使其可见。
protected  voiduninstallDefaults()
          将尚未显式重写的 JList 属性设置为 null。
protected  voiduninstallKeyboardActions()
          注销根据 installKeyboardActions 安装的键盘动作。
protected  voiduninstallListeners()
          移除 JList、其模型及其 selectionModel 的侦听器。
 voiduninstallUI(JComponent c)
          按顺序调用 uninstallListeners()uninstallKeyboardActions()uninstallDefaults() 来取消初始化 this.list
protected  voidupdateLayoutState()
          基于当前字体和 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