use of de.catma.tag.TagDefinition in project catma by forTEXT.
the class Page method removeTagInstances.
public void removeTagInstances(Set<TagDefinition> tagDefinitions) {
// page needs rebuild
pageDiv = null;
Set<String> tagDefUUIds = new HashSet<String>();
for (TagDefinition td : tagDefinitions) {
tagDefUUIds.add(td.getUuid());
}
Iterator<Map.Entry<String, ClientTagInstance>> iterator = relativeTagInstances.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<String, ClientTagInstance> entry = iterator.next();
if (tagDefUUIds.contains(entry.getValue().getTagDefinitionID())) {
iterator.remove();
removeRelativeTagInstanceFromLine(entry.getKey());
}
}
}
use of de.catma.tag.TagDefinition in project catma by forTEXT.
the class AnnotationPanel method showExpandedProperties.
private void showExpandedProperties(TagDataItem tagDataItem) {
TagDefinition tag = tagDataItem.getTag();
PropertyDataItem lastPropertyDataItem = null;
for (PropertyDefinition propertyDefinition : tag.getUserDefinedPropertyDefinitions()) {
lastPropertyDataItem = new PropertyDataItem(propertyDefinition);
tagsetGrid.getTreeData().addItem(tagDataItem, lastPropertyDataItem);
}
List<TagsetTreeItem> children = tagsetData.getChildren(tagDataItem).stream().filter(tagsetTreeItem -> tagsetTreeItem instanceof TagDataItem).collect(Collectors.toList());
for (int i = children.size() - 1; i >= 0; i--) {
tagsetData.moveAfterSibling(children.get(i), lastPropertyDataItem);
}
tagsetGrid.expand(tagDataItem);
}
use of de.catma.tag.TagDefinition in project catma by forTEXT.
the class AnnotationPanel method expandTagsetDefinition.
private void expandTagsetDefinition(TagsetDefinition tagset) {
for (TagDefinition tag : tagset) {
TagDataItem item = new TagDataItem(tag);
tagsetGrid.expand(item);
}
}
use of de.catma.tag.TagDefinition in project catma by forTEXT.
the class AnnotationPanel method addTagSubTree.
private void addTagSubTree(TagsetDefinition tagset, TagDefinition tag, TagDataItem parentItem) {
for (TagDefinition childDefinition : tagset.getDirectChildren(tag)) {
TagDataItem childItem = new TagDataItem(childDefinition);
tagsetData.addItem(parentItem, childItem);
addTagSubTree(tagset, childDefinition, childItem);
}
}
use of de.catma.tag.TagDefinition in project catma by forTEXT.
the class EditAnnotationPropertiesDialog method createComponents.
private void createComponents(Project project) {
propertyTabSheet = new TabSheet();
propertyTabSheet.setSizeFull();
String tagId = annotation.getTagInstance().getTagDefinitionId();
TagDefinition tag = project.getTagManager().getTagLibrary().getTagDefinition(tagId);
for (PropertyDefinition propertyDef : tag.getUserDefinedPropertyDefinitions()) {
Property property = annotation.getTagInstance().getUserDefinedPropetyByUuid(propertyDef.getUuid());
if (property == null) {
property = new Property(propertyDef.getUuid(), Collections.emptySet());
}
propertyTabSheet.addTab(new EditPropertyTab(property, propertyDef.getPossibleValueList()), propertyDef.getName());
}
}
Aggregations