Search in sources :

Example 16 with Pair

use of de.catma.util.Pair in project catma by forTEXT.

the class TPGraphProjectHandler method ensureProjectRevisionIsLoaded.

@Override
public void ensureProjectRevisionIsLoaded(ExecutionListener<TagManager> openProjectListener, ProgressListener progressListener, String revisionHash, final TagManager tagManager, Supplier<List<TagsetDefinition>> tagsetsSupplier, Supplier<List<SourceDocument>> documentsSupplier, CollectionsSupplier collectionsSupplier, boolean forceGraphReload, BackgroundService backgroundService) throws Exception {
    logger.info(String.format("Checking if Project %1$s with revision %2$s is present in the graph", projectReference.getProjectId(), revisionHash));
    GraphTraversalSource g = graph.traversal();
    if (forceGraphReload || !g.V().has(nt(ProjectRevision), "revisionHash", revisionHash).hasNext()) {
        logger.info(String.format("Loading Project %1$s with revision %2$s into the graph", projectReference.getProjectId(), revisionHash));
        ((TinkerGraph) graph).clear();
        backgroundService.submit(new GraphLoadJob(graph, projectReference, tagManager, user, revisionHash, tagsetsSupplier, documentsSupplier, collectionsSupplier, fileInfoProvider), new ExecutionListener<Pair<TagManager, Graph>>() {

            @Override
            public void done(Pair<TagManager, Graph> result) {
                graph = result.getSecond();
                openProjectListener.done(result.getFirst());
            }

            @Override
            public void error(Throwable t) {
                openProjectListener.error(t);
            }
        }, progressListener);
    } else {
        logger.info(String.format("Project %1$s with revision %2$s already present in the graph", projectReference.getProjectId(), revisionHash));
        openProjectListener.done(tagManager);
    }
}
Also used : GraphTraversalSource(org.apache.tinkerpop.gremlin.process.traversal.dsl.graph.GraphTraversalSource) TagManager(de.catma.tag.TagManager) Graph(org.apache.tinkerpop.gremlin.structure.Graph) TinkerGraph(org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph) TinkerGraph(org.apache.tinkerpop.gremlin.tinkergraph.structure.TinkerGraph) Pair(de.catma.util.Pair)

Example 17 with Pair

use of de.catma.util.Pair in project catma by forTEXT.

the class GraphLoadJob method call.

@Override
public Pair<TagManager, Graph> call() throws Exception {
    getProgressListener().setProgress("Start loading project %1$s...", projectReference.getName());
    logger.info("Start loading " + projectReference.getName() + " " + projectReference.getProjectId());
    Vertex userV = graph.addVertex(nt(User));
    userV.property("userId", user.getIdentifier());
    Vertex projectV = graph.addVertex(nt(Project));
    projectV.property("propertyId", projectReference.getProjectId());
    userV.addEdge(rt(hasProject), projectV);
    Vertex projectRevV = graph.addVertex(nt(ProjectRevision));
    projectRevV.property("revisionHash", revisionHash);
    projectV.addEdge(rt(hasRevision), projectRevV);
    List<TagsetDefinition> tagsets = tagsetsSupplier.get();
    getProgressListener().setProgress("Loading Tagsets...");
    tagManager.load(tagsets);
    for (TagsetDefinition tagset : tagsets) {
        getProgressListener().setProgress("Indexing Tagset %1$s...", tagset.getName());
        Vertex tagsetV = graphWriter.addTagset(projectRevV, tagset);
        graphWriter.addHasParentRelations(tagsetV, tagset);
    }
    final List<SourceDocument> documents = documentsSupplier.get();
    for (SourceDocument document : documents) {
        getProgressListener().setProgress("Indexing Document %1$s...", document.toString());
        graphWriter.addDocument(projectRevV, document);
    }
    final List<AnnotationCollection> collections = collectionsSupplier.get(tagManager.getTagLibrary());
    for (AnnotationCollection collection : collections) {
        getProgressListener().setProgress("Indexing Collection %1$s...", collection.toString());
        graphWriter.addCollection(revisionHash, revisionHash, collection);
    }
    getProgressListener().setProgress("Finished loading project %1$s", projectReference.getName());
    logger.info("Finished loading " + projectReference.getName() + " " + projectReference.getProjectId());
    return new Pair<>(tagManager, graph);
}
Also used : Vertex(org.apache.tinkerpop.gremlin.structure.Vertex) TagsetDefinition(de.catma.tag.TagsetDefinition) AnnotationCollection(de.catma.document.annotation.AnnotationCollection) SourceDocument(de.catma.document.source.SourceDocument) Pair(de.catma.util.Pair)

Example 18 with Pair

use of de.catma.util.Pair in project catma by forTEXT.

the class AnnotationPanel method initListeners.

private void initListeners() {
    tagChangedListener = new PropertyChangeListener() {

        @SuppressWarnings("unchecked")
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            Object newValue = evt.getNewValue();
            Object oldValue = evt.getOldValue();
            if (oldValue == null) {
                // created
                Pair<TagsetDefinition, TagDefinition> value = (Pair<TagsetDefinition, TagDefinition>) newValue;
                TagsetDefinition tagset = value.getFirst();
                TagDefinition tag = value.getSecond();
                if (tag.getParentUuid().isEmpty()) {
                    Optional<TagsetTreeItem> optionalTagsetItem = findItem(tagset.getUuid());
                    optionalTagsetItem.ifPresent(tagsetItem -> {
                        if (tagsetData.contains(tagsetItem)) {
                            tagsetData.addItem(tagsetItem, new TagDataItem(tag));
                            tagsetDataProvider.refreshAll();
                            tagsetGrid.expand(tagsetItem);
                        }
                    });
                } else {
                    TagDefinition parentTag = project.getTagManager().getTagLibrary().getTagDefinition(tag.getParentUuid());
                    Optional<TagsetTreeItem> optionalParentTagItem = findItem(parentTag.getUuid());
                    optionalParentTagItem.ifPresent(parentTagItem -> {
                        if (tagsetData.contains(parentTagItem)) {
                            tagsetData.addItem(parentTagItem, new TagDataItem(tag));
                            tagsetDataProvider.refreshAll();
                            tagsetGrid.expand(parentTagItem);
                        }
                    });
                }
            } else if (newValue == null) {
                // removed
                Pair<TagsetDefinition, TagDefinition> deleted = (Pair<TagsetDefinition, TagDefinition>) oldValue;
                TagDefinition deletedTag = deleted.getSecond();
                Optional<TagsetTreeItem> optionalDeletedItem = findItem(deletedTag.getUuid());
                optionalDeletedItem.ifPresent(deletedItem -> {
                    if (tagsetData.contains(deletedItem)) {
                        tagsetData.removeItem(deletedItem);
                        tagsetDataProvider.refreshAll();
                        tagsetGrid.deselect(deletedItem);
                    }
                });
            } else {
                // update
                TagDefinition tag = (TagDefinition) newValue;
                TagsetDefinition tagset = (TagsetDefinition) oldValue;
                Optional<TagsetTreeItem> optionalTagsetItem = findItem(tagset.getUuid());
                optionalTagsetItem.ifPresent(tagsetItem -> {
                    if (tagsetData.contains(tagsetItem)) {
                        Optional<TagsetTreeItem> optionalTagDataItem = findItem((TagsetDataItem) tagsetItem, tag.getUuid());
                        optionalTagDataItem.ifPresent(tagDataItem -> {
                            TagsetTreeItem parent = tagsetData.getParent(tagDataItem);
                            tagsetData.removeItem(tagDataItem);
                            ((TagDataItem) tagDataItem).setPropertiesExpanded(true);
                            tagsetData.addItem(parent, tagDataItem);
                            // TODO: sort
                            tagsetDataProvider.refreshAll();
                            showExpandedProperties(((TagDataItem) tagDataItem));
                        });
                    }
                });
            }
        }
    };
    project.getTagManager().addPropertyChangeListener(TagManagerEvent.tagDefinitionChanged, tagChangedListener);
    propertyDefinitionChangedListener = new PropertyChangeListener() {

        @SuppressWarnings("unchecked")
        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            Object newValue = evt.getNewValue();
            Object oldValue = evt.getOldValue();
            TagDefinition tag = null;
            if (oldValue == null) {
                // created
                Pair<PropertyDefinition, TagDefinition> newData = (Pair<PropertyDefinition, TagDefinition>) newValue;
                tag = newData.getSecond();
            } else if (newValue == null) {
                // removed
                Pair<PropertyDefinition, Pair<TagDefinition, TagsetDefinition>> oldData = (Pair<PropertyDefinition, Pair<TagDefinition, TagsetDefinition>>) oldValue;
                tag = oldData.getSecond().getFirst();
            } else {
                // update
                tag = (TagDefinition) oldValue;
            }
            Optional<TagsetTreeItem> optionalParentItem = Optional.empty();
            if (tag.getParentUuid().isEmpty()) {
                optionalParentItem = findItem(project.getTagManager().getTagLibrary().getTagsetDefinition(tag.getTagsetDefinitionUuid()).getUuid());
            } else {
                optionalParentItem = findItem(project.getTagManager().getTagLibrary().getTagDefinition(tag.getParentUuid()).getUuid());
            }
            if (optionalParentItem.isPresent()) {
                TagsetTreeItem parentItem = optionalParentItem.get();
                final String tagId = tag.getUuid();
                tagsetData.getChildren(parentItem).stream().filter(tagsetTreeItem -> tagsetTreeItem instanceof TagDataItem).map(tagsetTreeItem -> (TagDataItem) tagsetTreeItem).filter(tagDataItem -> tagDataItem.getTag().getUuid().equals(tagId)).findFirst().ifPresent(tagDataItem -> {
                    tagsetDataProvider.refreshItem(tagDataItem);
                    tagDataItem.setPropertiesExpanded(false);
                    hideExpandedProperties(tagDataItem);
                    tagDataItem.setPropertiesExpanded(true);
                    showExpandedProperties(tagDataItem);
                });
            }
            tagsetDataProvider.refreshAll();
            tagsetGrid.deselectAll();
        }
    };
    project.getTagManager().addPropertyChangeListener(TagManagerEvent.userPropertyDefinitionChanged, propertyDefinitionChangedListener);
}
Also used : ArrayListMultimap(com.google.common.collect.ArrayListMultimap) BackgroundServiceProvider(de.catma.backgroundservice.BackgroundServiceProvider) VerticalSplitPanel(com.vaadin.ui.VerticalSplitPanel) Alignment(com.vaadin.ui.Alignment) UI(com.vaadin.ui.UI) XmlMarkupCollectionSerializationHandler(de.catma.serialization.intrinsic.xml.XmlMarkupCollectionSerializationHandler) SearchFilterProvider(de.catma.ui.component.actiongrid.SearchFilterProvider) ErrorHandler(de.catma.ui.module.main.ErrorHandler) TreeDataProvider(com.vaadin.data.provider.TreeDataProvider) VaadinIcons(com.vaadin.icons.VaadinIcons) IconButton(de.catma.ui.component.IconButton) Collection(java.util.Collection) Set(java.util.Set) TreeGrid(com.vaadin.ui.TreeGrid) Collectors(java.util.stream.Collectors) ItemClick(com.vaadin.ui.Grid.ItemClick) TagReference(de.catma.document.annotation.TagReference) Objects(java.util.Objects) List(java.util.List) Type(com.vaadin.ui.Notification.Type) RendererClickEvent(com.vaadin.ui.renderers.ClickableRenderer.RendererClickEvent) PropertyChangeListener(java.beans.PropertyChangeListener) TagDefinition(de.catma.tag.TagDefinition) Optional(java.util.Optional) SingleTextInputDialog(de.catma.ui.dialog.SingleTextInputDialog) CollectionChangeEvent(de.catma.project.event.CollectionChangeEvent) SelectionMode(com.vaadin.ui.Grid.SelectionMode) StyleGenerator(com.vaadin.ui.StyleGenerator) RBACPermission(de.catma.rbac.RBACPermission) PropertyDefinition(de.catma.tag.PropertyDefinition) VerticalLayout(com.vaadin.ui.VerticalLayout) AnnotationCollectionManager(de.catma.document.annotation.AnnotationCollectionManager) ComboBox(com.vaadin.ui.ComboBox) Multimap(com.google.common.collect.Multimap) ActionGridComponent(de.catma.ui.component.actiongrid.ActionGridComponent) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) EventBus(com.google.common.eventbus.EventBus) AddEditPropertyDialog(de.catma.ui.module.tags.AddEditPropertyDialog) MaterialTheme(com.github.appreciated.material.MaterialTheme) EditTagDialog(de.catma.ui.module.tags.EditTagDialog) Notification(com.vaadin.ui.Notification) Label(com.vaadin.ui.Label) TagsetDefinition(de.catma.tag.TagsetDefinition) Pair(de.catma.util.Pair) TreeGridFactory(de.catma.ui.component.TreeGridFactory) IDGenerator(de.catma.util.IDGenerator) Subscribe(com.google.common.eventbus.Subscribe) ButtonRenderer(com.vaadin.ui.renderers.ButtonRenderer) SaveCancelListener(de.catma.ui.dialog.SaveCancelListener) PropertyChangeEvent(java.beans.PropertyChangeEvent) ListDataProvider(com.vaadin.data.provider.ListDataProvider) TreeData(com.vaadin.data.TreeData) AnnotationCollectionReference(de.catma.document.annotation.AnnotationCollectionReference) Project(de.catma.project.Project) AddSubtagDialog(de.catma.ui.module.tags.AddSubtagDialog) IOException(java.io.IOException) AddParenttagDialog(de.catma.ui.module.tags.AddParenttagDialog) SourceDocument(de.catma.document.source.SourceDocument) AnnotationCollection(de.catma.document.annotation.AnnotationCollection) Annotation(de.catma.document.annotation.Annotation) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) TagManagerEvent(de.catma.tag.TagManager.TagManagerEvent) ContextMenu(com.vaadin.contextmenu.ContextMenu) Button(com.vaadin.ui.Button) ChangeType(de.catma.project.event.ChangeType) HorizontalLayout(com.vaadin.ui.HorizontalLayout) SerializablePredicate(com.vaadin.server.SerializablePredicate) HtmlRenderer(com.vaadin.ui.renderers.HtmlRenderer) TagDefinition(de.catma.tag.TagDefinition) PropertyChangeEvent(java.beans.PropertyChangeEvent) PropertyChangeListener(java.beans.PropertyChangeListener) Optional(java.util.Optional) PropertyDefinition(de.catma.tag.PropertyDefinition) TagsetDefinition(de.catma.tag.TagsetDefinition) Pair(de.catma.util.Pair)

Example 19 with Pair

use of de.catma.util.Pair in project catma by forTEXT.

the class AnnotationPanel method handleAddTagRequest.

private void handleAddTagRequest() {
    final Optional<TagsetDefinition> selectedTagset = tagsetGrid.getSelectedItems().stream().filter(tagsetTreeItem -> tagsetTreeItem instanceof TagsetDataItem).findFirst().map(tagsetTreeItem -> ((TagsetDataItem) tagsetTreeItem).getTagset());
    if (selectedTagset.isPresent() && !project.hasPermission(project.getRoleForTagset(selectedTagset.get().getUuid()), RBACPermission.TAGSET_WRITE)) {
        Notification.show("Info", String.format("You do not have the permission to make changes to Tagset %1$s, " + "Please contact the Project maintainer!", selectedTagset.get().getName()), Type.HUMANIZED_MESSAGE);
        return;
    }
    if (tagsets.isEmpty()) {
        if (project.isAuthorizedOnProject(RBACPermission.TAGSET_CREATE_OR_UPLOAD)) {
            Notification.show("Info", "You do not have any Tagsets to add Tags to yet, please create a Tagset first!", Type.HUMANIZED_MESSAGE);
        } else {
            Notification.show("Info", "You do not have any Tagsets to add Tags to yet, please contact the Project maintainer!", Type.HUMANIZED_MESSAGE);
        }
        return;
    }
    List<TagsetDefinition> editableTagsets = tagsets.stream().filter(tagset -> project.hasPermission(project.getRoleForTagset(tagset.getUuid()), RBACPermission.TAGSET_WRITE)).collect(Collectors.toList());
    if (editableTagsets.isEmpty()) {
        Notification.show("Info", "You do not have the permission to make changes to any of the available Tagsets! " + "Please contact the Project maintainer for changes!", Type.HUMANIZED_MESSAGE);
        return;
    }
    AddParenttagDialog addTagDialog = new AddParenttagDialog(editableTagsets, selectedTagset, new SaveCancelListener<Pair<TagsetDefinition, TagDefinition>>() {

        @Override
        public void savePressed(Pair<TagsetDefinition, TagDefinition> result) {
            project.getTagManager().addTagDefinition(result.getFirst(), result.getSecond());
        }
    });
    addTagDialog.show();
}
Also used : ArrayListMultimap(com.google.common.collect.ArrayListMultimap) BackgroundServiceProvider(de.catma.backgroundservice.BackgroundServiceProvider) VerticalSplitPanel(com.vaadin.ui.VerticalSplitPanel) Alignment(com.vaadin.ui.Alignment) UI(com.vaadin.ui.UI) XmlMarkupCollectionSerializationHandler(de.catma.serialization.intrinsic.xml.XmlMarkupCollectionSerializationHandler) SearchFilterProvider(de.catma.ui.component.actiongrid.SearchFilterProvider) ErrorHandler(de.catma.ui.module.main.ErrorHandler) TreeDataProvider(com.vaadin.data.provider.TreeDataProvider) VaadinIcons(com.vaadin.icons.VaadinIcons) IconButton(de.catma.ui.component.IconButton) Collection(java.util.Collection) Set(java.util.Set) TreeGrid(com.vaadin.ui.TreeGrid) Collectors(java.util.stream.Collectors) ItemClick(com.vaadin.ui.Grid.ItemClick) TagReference(de.catma.document.annotation.TagReference) Objects(java.util.Objects) List(java.util.List) Type(com.vaadin.ui.Notification.Type) RendererClickEvent(com.vaadin.ui.renderers.ClickableRenderer.RendererClickEvent) PropertyChangeListener(java.beans.PropertyChangeListener) TagDefinition(de.catma.tag.TagDefinition) Optional(java.util.Optional) SingleTextInputDialog(de.catma.ui.dialog.SingleTextInputDialog) CollectionChangeEvent(de.catma.project.event.CollectionChangeEvent) SelectionMode(com.vaadin.ui.Grid.SelectionMode) StyleGenerator(com.vaadin.ui.StyleGenerator) RBACPermission(de.catma.rbac.RBACPermission) PropertyDefinition(de.catma.tag.PropertyDefinition) VerticalLayout(com.vaadin.ui.VerticalLayout) AnnotationCollectionManager(de.catma.document.annotation.AnnotationCollectionManager) ComboBox(com.vaadin.ui.ComboBox) Multimap(com.google.common.collect.Multimap) ActionGridComponent(de.catma.ui.component.actiongrid.ActionGridComponent) Supplier(java.util.function.Supplier) ArrayList(java.util.ArrayList) EventBus(com.google.common.eventbus.EventBus) AddEditPropertyDialog(de.catma.ui.module.tags.AddEditPropertyDialog) MaterialTheme(com.github.appreciated.material.MaterialTheme) EditTagDialog(de.catma.ui.module.tags.EditTagDialog) Notification(com.vaadin.ui.Notification) Label(com.vaadin.ui.Label) TagsetDefinition(de.catma.tag.TagsetDefinition) Pair(de.catma.util.Pair) TreeGridFactory(de.catma.ui.component.TreeGridFactory) IDGenerator(de.catma.util.IDGenerator) Subscribe(com.google.common.eventbus.Subscribe) ButtonRenderer(com.vaadin.ui.renderers.ButtonRenderer) SaveCancelListener(de.catma.ui.dialog.SaveCancelListener) PropertyChangeEvent(java.beans.PropertyChangeEvent) ListDataProvider(com.vaadin.data.provider.ListDataProvider) TreeData(com.vaadin.data.TreeData) AnnotationCollectionReference(de.catma.document.annotation.AnnotationCollectionReference) Project(de.catma.project.Project) AddSubtagDialog(de.catma.ui.module.tags.AddSubtagDialog) IOException(java.io.IOException) AddParenttagDialog(de.catma.ui.module.tags.AddParenttagDialog) SourceDocument(de.catma.document.source.SourceDocument) AnnotationCollection(de.catma.document.annotation.AnnotationCollection) Annotation(de.catma.document.annotation.Annotation) TimeUnit(java.util.concurrent.TimeUnit) Consumer(java.util.function.Consumer) TagManagerEvent(de.catma.tag.TagManager.TagManagerEvent) ContextMenu(com.vaadin.contextmenu.ContextMenu) Button(com.vaadin.ui.Button) ChangeType(de.catma.project.event.ChangeType) HorizontalLayout(com.vaadin.ui.HorizontalLayout) SerializablePredicate(com.vaadin.server.SerializablePredicate) HtmlRenderer(com.vaadin.ui.renderers.HtmlRenderer) TagsetDefinition(de.catma.tag.TagsetDefinition) TagDefinition(de.catma.tag.TagDefinition) AddParenttagDialog(de.catma.ui.module.tags.AddParenttagDialog) Pair(de.catma.util.Pair)

Example 20 with Pair

use of de.catma.util.Pair in project catma by forTEXT.

the class TaggerView method initListeners.

private void initListeners() {
    this.tagReferencesChangedListener = new PropertyChangeListener() {

        public void propertyChange(PropertyChangeEvent evt) {
            if (evt.getNewValue() != null) {
                @SuppressWarnings("unchecked") Pair<AnnotationCollection, List<TagReference>> changeValue = (Pair<AnnotationCollection, List<TagReference>>) evt.getNewValue();
                List<TagReference> tagReferences = changeValue.getSecond();
                List<TagReference> relevantTagReferences = new ArrayList<TagReference>();
                for (TagReference tr : tagReferences) {
                    if (isRelevantTagReference(tr, userMarkupCollectionManager.getUserMarkupCollections())) {
                        relevantTagReferences.add(tr);
                    }
                }
                tagger.setVisible(relevantTagReferences, true);
                Set<String> tagInstanceUuids = new HashSet<String>();
                for (TagReference tr : relevantTagReferences) {
                    tagInstanceUuids.add(tr.getTagInstance().getUuid());
                }
                tagInstanceUuids.forEach(annotationId -> tagger.updateAnnotation(annotationId));
            } else if (evt.getOldValue() != null) {
                @SuppressWarnings("unchecked") Pair<String, Collection<String>> changeValue = (Pair<String, Collection<String>>) evt.getOldValue();
                String collectionId = changeValue.getFirst();
                Collection<String> annotationIds = changeValue.getSecond();
                if (userMarkupCollectionManager.contains(collectionId)) {
                    userMarkupCollectionManager.removeTagInstance(annotationIds, false);
                }
                tagger.removeTagInstances(annotationIds);
                annotationPanel.removeAnnotations(annotationIds);
            }
        }
    };
    project.addPropertyChangeListener(RepositoryChangeEvent.tagReferencesChanged, tagReferencesChangedListener);
    annotationPropertiesChangedListener = new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            TagInstance tagInstance = (TagInstance) evt.getOldValue();
            tagger.updateAnnotation(tagInstance.getUuid());
        }
    };
    project.addPropertyChangeListener(RepositoryChangeEvent.propertyValueChanged, annotationPropertiesChangedListener);
    tagChangedListener = new PropertyChangeListener() {

        @Override
        public void propertyChange(PropertyChangeEvent evt) {
            Object newValue = evt.getNewValue();
            Object oldValue = evt.getOldValue();
            if (oldValue == null) {
            // created
            // noop
            } else if (newValue == null) {
                // removed
                @SuppressWarnings("unchecked") Pair<TagsetDefinition, TagDefinition> deleted = (Pair<TagsetDefinition, TagDefinition>) oldValue;
                for (AnnotationCollectionReference ref : userMarkupCollectionManager.getCollections(deleted.getSecond())) {
                    setAnnotationCollectionSelected(ref, false);
                    setAnnotationCollectionSelected(ref, true);
                }
            } else {
                // update
                TagDefinition tag = (TagDefinition) newValue;
                for (AnnotationCollection collection : userMarkupCollectionManager.getUserMarkupCollections()) {
                    List<TagReference> relevantTagReferences = collection.getTagReferences(tag);
                    tagger.setVisible(relevantTagReferences, false);
                    tagger.setVisible(relevantTagReferences, true);
                }
            }
        }
    };
    project.getTagManager().addPropertyChangeListener(TagManagerEvent.tagDefinitionChanged, tagChangedListener);
}
Also used : BackgroundServiceProvider(de.catma.backgroundservice.BackgroundServiceProvider) ZonedDateTime(java.time.ZonedDateTime) VerticalSplitPanel(com.vaadin.ui.VerticalSplitPanel) EditAnnotationPropertiesDialog(de.catma.ui.module.annotate.annotationpanel.EditAnnotationPropertiesDialog) IndexedProject(de.catma.indexer.IndexedProject) ClientCommentReply(de.catma.ui.client.ui.tagger.shared.ClientCommentReply) KwicProvider(de.catma.indexer.KwicProvider) ValueOutOfBoundsException(com.vaadin.ui.Slider.ValueOutOfBoundsException) ExpansionListener(de.catma.ui.module.analyze.visualization.ExpansionListener) ExecutionListener(de.catma.backgroundservice.ExecutionListener) Slider(com.vaadin.ui.Slider) Set(java.util.Set) TagInstance(de.catma.tag.TagInstance) ClosableTab(de.catma.ui.component.tabbedview.ClosableTab) Pager(de.catma.ui.module.annotate.pager.Pager) Type(com.vaadin.ui.Notification.Type) PropertyChangeListener(java.beans.PropertyChangeListener) SliderMode(org.vaadin.sliderpanel.client.SliderMode) DefaultProgressCallable(de.catma.backgroundservice.DefaultProgressCallable) Range(de.catma.document.Range) TagManager(de.catma.tag.TagManager) VerticalLayout(com.vaadin.ui.VerticalLayout) SplitterPositionChangedListener(de.catma.ui.module.annotate.TaggerSplitPanel.SplitterPositionChangedListener) CommentMessage(de.catma.ui.events.CommentMessage) ArrayList(java.util.ArrayList) Pair(de.catma.util.Pair) SaveCancelListener(de.catma.ui.dialog.SaveCancelListener) ResourceSelectionListener(de.catma.ui.module.annotate.resourcepanel.ResourceSelectionListener) Property(de.catma.tag.Property) QueryResultRow(de.catma.queryengine.result.QueryResultRow) IOException(java.io.IOException) SourceDocument(de.catma.document.source.SourceDocument) AnnotationCollection(de.catma.document.annotation.AnnotationCollection) ValueChangeListener(com.vaadin.data.HasValue.ValueChangeListener) Annotation(de.catma.document.annotation.Annotation) TagManagerEvent(de.catma.tag.TagManager.TagManagerEvent) ClientTagInstance(de.catma.ui.client.ui.tagger.shared.ClientTagInstance) Button(com.vaadin.ui.Button) ChangeType(de.catma.project.event.ChangeType) TextRange(de.catma.ui.client.ui.tagger.shared.TextRange) HorizontalLayout(com.vaadin.ui.HorizontalLayout) AnnotateResourcePanel(de.catma.ui.module.annotate.resourcepanel.AnnotateResourcePanel) SplitterPositionChangedEvent(de.catma.ui.module.annotate.TaggerSplitPanel.SplitterPositionChangedEvent) Reply(de.catma.document.comment.Reply) ClientComment(de.catma.ui.client.ui.tagger.shared.ClientComment) URISyntaxException(java.net.URISyntaxException) UI(com.vaadin.ui.UI) ConfirmDialog(org.vaadin.dialogs.ConfirmDialog) RouteToAnalyzeEvent(de.catma.ui.events.routing.RouteToAnalyzeEvent) TaggerContextMenu(de.catma.ui.module.annotate.contextmenu.TaggerContextMenu) ErrorHandler(de.catma.ui.module.main.ErrorHandler) CatmaApplication(de.catma.ui.CatmaApplication) SliderPanel(org.vaadin.sliderpanel.SliderPanel) VaadinIcons(com.vaadin.icons.VaadinIcons) Version(de.catma.tag.Version) IconButton(de.catma.ui.component.IconButton) Collection(java.util.Collection) Logger(java.util.logging.Logger) Collectors(java.util.stream.Collectors) MarginInfo(com.vaadin.shared.ui.MarginInfo) TagReference(de.catma.document.annotation.TagReference) List(java.util.List) TaggerListener(de.catma.ui.module.annotate.Tagger.TaggerListener) Corpus(de.catma.document.corpus.Corpus) TagDefinition(de.catma.tag.TagDefinition) Optional(java.util.Optional) HazelCastService(de.catma.hazelcast.HazelCastService) SliderPanelBuilder(org.vaadin.sliderpanel.SliderPanelBuilder) ValueChangeEvent(com.vaadin.data.HasValue.ValueChangeEvent) KwicPanel(de.catma.ui.module.analyze.visualization.kwic.KwicPanel) ClickListener(com.vaadin.ui.Button.ClickListener) PagerComponent(de.catma.ui.module.annotate.pager.PagerComponent) AnnotationPanel(de.catma.ui.module.annotate.annotationpanel.AnnotationPanel) AnnotationCollectionManager(de.catma.document.annotation.AnnotationCollectionManager) PageChangeListener(de.catma.ui.module.annotate.pager.PagerComponent.PageChangeListener) UIMessageListener(de.catma.ui.UIMessageListener) User(de.catma.user.User) Level(java.util.logging.Level) HashSet(java.util.HashSet) EventBus(com.google.common.eventbus.EventBus) CommentChangeEvent(de.catma.project.event.CommentChangeEvent) Comment(de.catma.document.comment.Comment) Notification(com.vaadin.ui.Notification) Page(de.catma.ui.module.annotate.pager.Page) HazelcastConfiguration(de.catma.hazelcast.HazelcastConfiguration) TagsetDefinition(de.catma.tag.TagsetDefinition) IDGenerator(de.catma.util.IDGenerator) Subscribe(com.google.common.eventbus.Subscribe) TagLibrary(de.catma.tag.TagLibrary) PropertyChangeEvent(java.beans.PropertyChangeEvent) ClickEvent(com.vaadin.ui.Button.ClickEvent) AnnotationCollectionReference(de.catma.document.annotation.AnnotationCollectionReference) Project(de.catma.project.Project) RepositoryChangeEvent(de.catma.project.Project.RepositoryChangeEvent) ReplyChangeEvent(de.catma.project.event.ReplyChangeEvent) TabCaptionChangeListener(de.catma.ui.component.tabbedview.TabCaptionChangeListener) DateTimeFormatter(java.time.format.DateTimeFormatter) ITopic(com.hazelcast.core.ITopic) TagDefinition(de.catma.tag.TagDefinition) PropertyChangeEvent(java.beans.PropertyChangeEvent) AnnotationCollection(de.catma.document.annotation.AnnotationCollection) Set(java.util.Set) HashSet(java.util.HashSet) PropertyChangeListener(java.beans.PropertyChangeListener) AnnotationCollectionReference(de.catma.document.annotation.AnnotationCollectionReference) TagsetDefinition(de.catma.tag.TagsetDefinition) TagInstance(de.catma.tag.TagInstance) ClientTagInstance(de.catma.ui.client.ui.tagger.shared.ClientTagInstance) AnnotationCollection(de.catma.document.annotation.AnnotationCollection) Collection(java.util.Collection) TagReference(de.catma.document.annotation.TagReference) ArrayList(java.util.ArrayList) List(java.util.List) Pair(de.catma.util.Pair)

Aggregations

Pair (de.catma.util.Pair)20 TagsetDefinition (de.catma.tag.TagsetDefinition)11 TagDefinition (de.catma.tag.TagDefinition)10 IOException (java.io.IOException)10 ArrayList (java.util.ArrayList)9 List (java.util.List)8 AnnotationCollection (de.catma.document.annotation.AnnotationCollection)7 PropertyDefinition (de.catma.tag.PropertyDefinition)7 PropertyChangeEvent (java.beans.PropertyChangeEvent)7 PropertyChangeListener (java.beans.PropertyChangeListener)7 SourceDocument (de.catma.document.source.SourceDocument)6 Notification (com.vaadin.ui.Notification)5 Type (com.vaadin.ui.Notification.Type)5 UI (com.vaadin.ui.UI)5 Project (de.catma.project.Project)5 ArrayListMultimap (com.google.common.collect.ArrayListMultimap)4 Multimap (com.google.common.collect.Multimap)4 EventBus (com.google.common.eventbus.EventBus)4 HorizontalLayout (com.vaadin.ui.HorizontalLayout)4 BackgroundServiceProvider (de.catma.backgroundservice.BackgroundServiceProvider)4