@Test public void testProvideRelationTemplates() { final List<List<RelationTemplate>> expectedTemplates = RelationTreeModelTest.relationProvider.provideRelationTemplates(); final List<List<RelationTemplate>> actualTemplates = this.model.provideRelationTemplates(); Assert.assertNotSame(expectedTemplates, actualTemplates); Assert.assertEquals(expectedTemplates, actualTemplates); }
@Override public List<List<RelationTemplate>> provideRelationTemplates() { final List<List<RelationTemplate>> result = new ArrayList<>(this.relationGroups.size()); for (final List<UUID> templateIdsInSingleGroup : this.relationGroups.values()) { final List<RelationTemplate> resultGroup = new ArrayList<>(templateIdsInSingleGroup.size()); for (final UUID singleTemplateId : templateIdsInSingleGroup) { resultGroup.add(this.relationTemplates.get(singleTemplateId)); } result.add(resultGroup); } return result; }
RelationTreeModel extends AbstractTreeTableModel implements ISemanticalRelationProvider { @Override public List<List<RelationTemplate>> provideRelationTemplates() { final List<List<RelationTemplate>> result = new ArrayList<>(this.relationGroups.size()); for (final List<UUID> templateIdsInSingleGroup : this.relationGroups.values()) { final List<RelationTemplate> resultGroup = new ArrayList<>(templateIdsInSingleGroup.size()); for (final UUID singleTemplateId : templateIdsInSingleGroup) { resultGroup.add(this.relationTemplates.get(singleTemplateId)); } result.add(resultGroup); } return result; } }
RelationTreeModel extends AbstractTreeTableModel implements ISemanticalRelationProvider { @Override public List<List<RelationTemplate>> provideRelationTemplates() { final List<List<RelationTemplate>> result = new ArrayList<>(this.relationGroups.size()); for (final List<UUID> templateIdsInSingleGroup : this.relationGroups.values()) { final List<RelationTemplate> resultGroup = new ArrayList<>(templateIdsInSingleGroup.size()); for (final UUID singleTemplateId : templateIdsInSingleGroup) { resultGroup.add(this.relationTemplates.get(singleTemplateId)); } result.add(resultGroup); } return result; } RelationTreeModel(final ISemanticalRelationProvider relationProvider); }
RelationTreeModel extends AbstractTreeTableModel implements ISemanticalRelationProvider { @Override public List<List<RelationTemplate>> provideRelationTemplates() { final List<List<RelationTemplate>> result = new ArrayList<>(this.relationGroups.size()); for (final List<UUID> templateIdsInSingleGroup : this.relationGroups.values()) { final List<RelationTemplate> resultGroup = new ArrayList<>(templateIdsInSingleGroup.size()); for (final UUID singleTemplateId : templateIdsInSingleGroup) { resultGroup.add(this.relationTemplates.get(singleTemplateId)); } result.add(resultGroup); } return result; } 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 List<List<RelationTemplate>> provideRelationTemplates() { final List<List<RelationTemplate>> result = new ArrayList<>(this.relationGroups.size()); for (final List<UUID> templateIdsInSingleGroup : this.relationGroups.values()) { final List<RelationTemplate> resultGroup = new ArrayList<>(templateIdsInSingleGroup.size()); for (final UUID singleTemplateId : templateIdsInSingleGroup) { resultGroup.add(this.relationTemplates.get(singleTemplateId)); } result.add(resultGroup); } return result; } 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);  }