public abstract class ListUI extends ComponentUI
JList可插拔外观和代理。
| Constructor and Description |
|---|
ListUI() |
| Modifier and Type | Method and Description |
|---|---|
abstract Rectangle |
getCellBounds(JList list, int index1, int index2)
返回给定列表的坐标系中由两个索引指定的单元格范围的边界矩形。
|
abstract Point |
indexToLocation(JList list, int index)
返回列表坐标系中指定项目的给定
JList中的原点。
|
abstract int |
locationToIndex(JList list, Point location)
返回指定的细胞指数
JList列表中的坐标系中最接近指定位置。
|
contains, createUI, getAccessibleChild, getAccessibleChildrenCount, getBaseline, getBaselineResizeBehavior, getMaximumSize, getMinimumSize, getPreferredSize, installUI, paint, uninstallUI, updatepublic abstract int locationToIndex(JList list, Point location)
JList列表中的坐标系中最接近指定位置。
要确定单元格实际是否包含指定的位置,请按照getCellBounds的规定将该点与单元格的边界进行getCellBounds 。
如果列表的模型为空,此方法返回-1 。
list - 列表
location - 点的坐标
-1 ,或
-1
NullPointerException - 如果
location为空
public abstract Point indexToLocation(JList list, int index)
JList中的原点。
如果索引无效,则返回null 。
list - 列表
index - 细胞指数
null
public abstract Rectangle getCellBounds(JList list, int index1, int index2)
如果较小的索引在列表的单元格范围之外,则此方法返回null 。 如果较小的索引有效,但较大的索引在列表的范围之外,则仅返回第一个索引的边界。 否则返回有效范围的范围。
list - 列表
index1 - 范围内的第一个索引
index2 - 范围内的第二个指数
null
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.