Java TreeModelIndex Example

说明

java treemodelindex示例是从最受好评的开源项目中提取的实现代码,你可以参考下面示例的使用方式。

编程语言: Java

类/类型: TreeModelIndex

示例#1
文件: TreeModelIndex_Root_TestCase.java项目: protegeproject/graphtree

 @Test
 public void removeRootShouldRemoveIndexAgainstTreeNodeId() {
   index.addRoot(A);
   assertThat(index.getTreeNodeData(idA), equalTo(A));
   index.removeRoot(idA);
   assertThat(index.getTreeNodeData(idA), nullValue());
 }

示例#2
文件: TreeModelIndex_Root_TestCase.java项目: protegeproject/graphtree

 @Test
 public void removeRootShouldRemoveIndexAgainstUserObject() {
   index.addRoot(A);
   assertThat(index.getTreeNodesForUserObject(userObjectA), hasItem(A));
   index.removeRoot(A.getId());
   assertThat(index.getTreeNodesForUserObject(userObjectA), is(empty()));
 }

示例#3
文件: TreeModelIndex_Root_TestCase.java项目: protegeproject/graphtree

 @Test
 public void addRootShouldIndexAgainstUserObject() {
   index.addRoot(A);
   List<TreeNodeData<U>> result = index.getTreeNodesForUserObject(userObjectA);
   assertThat(result.size(), equalTo(1));
   assertThat(result, hasItem(A));
 }

示例#4
文件: TreeModelIndex_Root_TestCase.java项目: protegeproject/graphtree

 @Test
 public void addRootShouldAddRoot() {
   index.addRoot(A);
   List<TreeNodeData<U>> roots = index.getRoots();
   assertThat(roots.size(), equalTo(1));
   assertThat(roots, hasItem(A));
 }

示例#5
文件: TreeModelIndex_Root_TestCase.java项目: protegeproject/graphtree

 @Test
 public void addRootShouldIndexAgainstTreeNodeId() {
   index.addRoot(A);
   TreeNodeData<U> result = index.getTreeNodeData(idA);
   assertThat(result, equalTo(A));
 }

展开阅读全文