@Test public void testIsLeaf() { final Object root = this.model.getRoot(); Assert.assertFalse(this.model.isLeaf(root)); final Object groupNode1 = this.model.getChild(root, 0); final Object groupNode2 = this.model.getChild(root, 1); final Object groupNode3 = this.model.getChild(root, 2); Assert.assertFalse(this.model.isLeaf(groupNode1)); Assert.assertTrue(this.model.isLeaf(groupNode2)); Assert.assertFalse(this.model.isLeaf(groupNode3)); final Object childNodeA1 = this.model.getChild(groupNode1, 0); final Object childNodeA2 = this.model.getChild(groupNode1, 1); final Object childNodeC1 = this.model.getChild(groupNode3, 0); final Object childNodeC2 = this.model.getChild(groupNode3, 1); final Object childNodeC3 = this.model.getChild(groupNode3, 2); final Object childNodeC4 = this.model.getChild(groupNode3, 3); Assert.assertTrue(this.model.isLeaf(childNodeA1)); Assert.assertTrue(this.model.isLeaf(childNodeA2)); Assert.assertTrue(this.model.isLeaf(childNodeC1)); Assert.assertTrue(this.model.isLeaf(childNodeC2)); Assert.assertTrue(this.model.isLeaf(childNodeC3)); Assert.assertTrue(this.model.isLeaf(childNodeC4)); }
@Override public boolean isLeaf(final Object node) { if (node instanceof UUID) { return !this.relationGroups.containsKey(node) || this.relationGroups.get(node).isEmpty(); } return this.relationGroups.isEmpty(); }
RelationTreeModel extends AbstractTreeTableModel implements ISemanticalRelationProvider { @Override public boolean isLeaf(final Object node) { if (node instanceof UUID) { return !this.relationGroups.containsKey(node) || this.relationGroups.get(node).isEmpty(); } return this.relationGroups.isEmpty(); } }
RelationTreeModel extends AbstractTreeTableModel implements ISemanticalRelationProvider { @Override public boolean isLeaf(final Object node) { if (node instanceof UUID) { return !this.relationGroups.containsKey(node) || this.relationGroups.get(node).isEmpty(); } return this.relationGroups.isEmpty(); } RelationTreeModel(final ISemanticalRelationProvider relationProvider); }
RelationTreeModel extends AbstractTreeTableModel implements ISemanticalRelationProvider { @Override public boolean isLeaf(final Object node) { if (node instanceof UUID) { return !this.relationGroups.containsKey(node) || this.relationGroups.get(node).isEmpty(); } return this.relationGroups.isEmpty(); } RelationTreeModel(final ISemanticalRelationProvider relationProvider); @Override List<List<RelationTemplate>> provideRelationTemplates(); @Override Object getChild(final Object parent, final int index); @Override int getChildCount(final Object parent); @Override boolean isLeaf(final Object node); @Override int getIndexOfChild(final Object parent, final Object child); @Override int getColumnCount(); @Override String getColumnName(final int columnIndex); @Override Class<?> getColumnClass(final int columnIndex); @Override boolean isCellEditable(final Object node, final int columnIndex); @Override String getValueAt(final Object node, final int columnIndex); @Override void setValueAt(final Object value, final Object node, final int column); TreePath addGroupEntry(); RelationTemplate getTemplateAtPath(final TreePath path); TreePath addTemplateEntryToGroup(final TreePath groupPath); void updateTemplateEntry(final TreePath targetPath, final RelationTemplate newState); void moveEntry(final TreePath targetPath, final boolean moveDown); void removeEntry(final TreePath targetPath); }
RelationTreeModel extends AbstractTreeTableModel implements ISemanticalRelationProvider { @Override public boolean isLeaf(final Object node) { if (node instanceof UUID) { return !this.relationGroups.containsKey(node) || this.relationGroups.get(node).isEmpty(); } return this.relationGroups.isEmpty(); } RelationTreeModel(final ISemanticalRelationProvider relationProvider); @Override List<List<RelationTemplate>> provideRelationTemplates(); @Override Object getChild(final Object parent, final int index); @Override int getChildCount(final Object parent); @Override boolean isLeaf(final Object node); @Override int getIndexOfChild(final Object parent, final Object child); @Override int getColumnCount(); @Override String getColumnName(final int columnIndex); @Override Class<?> getColumnClass(final int columnIndex); @Override boolean isCellEditable(final Object node, final int columnIndex); @Override String getValueAt(final Object node, final int columnIndex); @Override void setValueAt(final Object value, final Object node, final int column); TreePath addGroupEntry(); RelationTemplate getTemplateAtPath(final TreePath path); TreePath addTemplateEntryToGroup(final TreePath groupPath); void updateTemplateEntry(final TreePath targetPath, final RelationTemplate newState); void moveEntry(final TreePath targetPath, final boolean moveDown); void removeEntry(final TreePath targetPath);  }