public static final class JTree.DropLocation extends TransferHandler.DropLocation
TransferHandler.DropLocation
表示一个
JTree
下降位置的子类。
JTree.getDropLocation()
Modifier and Type | Method and Description |
---|---|
int |
getChildIndex()
返回指数在下降的数据应插入相对于路径返回
getPath() 。
|
TreePath |
getPath()
返回丢弃数据应放在树中的路径。
|
String |
toString()
返回此下拉位置的字符串表示形式。
|
getDropPoint
public int getChildIndex()
getPath()
。
DropMode.USE_SELECTION
滴模式和DropMode.ON
,这个指标是不重要的(它总是会-1
)作为唯一有趣的数据路径,删除操作发生。
DropMode.INSERT
滴模式,该指标表明指数的数据应该被插入到由getPath()
父路径。-1
表明下降发生在父母本身,在大多数情况下,应视为插入开始或儿童家长的列表的末尾。
对于DropMode.ON_OR_INSERT
,该值将被插入索引,如上所述,或-1
如果下降发生在道路本身。
getPath()
public TreePath getPath()
此值的解释取决于组件上的下拉模式。如果滴模式是DropMode.USE_SELECTION
或DropMode.ON
,返回值是路径树中的数据已(或将)下降。null
表明滴在空的空间,与一个特定的路径不相关。
如果滴模式是DropMode.INSERT
,返回值是指应成为新数据的父路径,在这种情况下,getChildIndex()
表示新项目应插入这个父路径。一个null
路径表明没有父路径已经确定,可为多种原因发生:
null
案例。
如果滴模式是DropMode.ON_OR_INSERT
,getChildIndex
可用于确定是否下降是在顶部的路径本身(-1
)或指数在它应插入路径(除了-1
值)。
getChildIndex()
public String toString()
toString
方法重写,继承类
TransferHandler.DropLocation
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.