use of de.catma.ui.module.analyze.visualization.ExpansionListener in project catma by forTEXT.
the class VizMaxPanel method initActions.
private void initActions(MinimizeListener leaveListener) {
btMinViz.addClickListener(clickEvent -> leaveListener.onMinimize(this));
queryResultBox.addSelectionListener(new SingleSelectionListener<QuerySelection>() {
@Override
public void selectionChange(SingleSelectionEvent<QuerySelection> event) {
setQueryResultPanel(event.getValue());
}
});
visualization.setExpansionListener(new ExpansionListener() {
@Override
public void expand() {
mainContentSplitPanel.setSplitPosition(0);
}
@Override
public void compress() {
mainContentSplitPanel.setSplitPosition(50);
}
});
selectedResultsPanel.setDisplaySettingChangeListener(displaySettings -> visualization.setDisplaySetting(displaySettings));
selectedResultsPanel.addOptionsMenuItem("Remove all", mi -> handleItemRemoval(selectedResultsPanel.getFilteredQueryResult()));
selectedResultsPanel.addItemSelectionListener(selectionEvent -> handleSelectedResultItemClick(selectionEvent));
}
use of de.catma.ui.module.analyze.visualization.ExpansionListener in project catma by forTEXT.
the class TaggerView method initActions.
private void initActions() {
btClearSearchHighlights.addClickListener(new ClickListener() {
@Override
public void buttonClick(ClickEvent event) {
tagger.removeHighlights();
}
});
cbTraceSelection.addClickListener(clickEvent -> {
boolean traceSelection = (boolean) cbTraceSelection.getData();
traceSelection = !traceSelection;
cbTraceSelection.setData(traceSelection);
tagger.setTraceSelection(traceSelection);
if (traceSelection) {
cbTraceSelection.addStyleName("tagger-trace-checkbox-selected");
} else {
cbTraceSelection.removeStyleName("tagger-trace-checkbox-selected");
}
});
cbAutoShowComments.addClickListener(clickEvent -> {
boolean autoShowComments = (boolean) cbAutoShowComments.getData();
autoShowComments = !autoShowComments;
cbAutoShowComments.setData(autoShowComments);
if (autoShowComments) {
cbAutoShowComments.setIcon(VaadinIcons.COMMENT);
try {
TaggerView.this.comments.clear();
TaggerView.this.comments.addAll(TaggerView.this.project.getComments(sourceDocument.getUuid()));
tagger.updateComments(comments);
} catch (IOException e) {
logger.log(Level.SEVERE, "unable to reload comments", e);
}
} else {
cbAutoShowComments.setIcon(VaadinIcons.COMMENT_O);
}
});
btAnalyze.addClickListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
analyzeDocument();
}
});
linesPerPageSlider.addValueChangeListener(new ValueChangeListener<Double>() {
public void valueChange(ValueChangeEvent<Double> event) {
Double perCentValue = (Double) linesPerPageSlider.getValue();
int lines = (int) ((totalLineCount / 100.0) * perCentValue);
List<ClientTagInstance> absoluteTagInstances = pager.getAbsoluteTagInstances();
Page currentPage = null;
if (pager.hasPages()) {
currentPage = pager.getCurrentPage();
}
pager.setMaxPageLengthInLines(lines);
if (pager.hasPages()) {
// recalculate pages
try {
pager.setText(sourceDocument.getContent(), comments);
int previousPageNumber = pager.getPageNumberFor(currentPage.getPageStart());
tagger.setPage(previousPageNumber);
tagger.setTagInstancesVisible(absoluteTagInstances, true);
pagerComponent.setPage(previousPageNumber);
} catch (IOException e) {
errorHandler.showAndLogError("Error showing the Document!", e);
}
}
}
});
resourcePanel.setSelectionListener(new ResourceSelectionListener() {
@Override
public void resourcesChanged() {
AnnotationCollection selectedEditableCollection = annotationPanel.getSelectedEditableCollection();
List<AnnotationCollectionReference> selectedAnnotationCollectionRefs = resourcePanel.getSelectedAnnotationCollectionReferences();
for (AnnotationCollection collection : userMarkupCollectionManager.getUserMarkupCollections()) {
userMarkupCollectionManager.remove(collection.getId());
annotationPanel.removeCollection(collection.getId());
tagger.setVisible(collection.getTagReferences(), false);
}
userMarkupCollectionManager.clear();
for (AnnotationCollectionReference collectionReference : selectedAnnotationCollectionRefs) {
try {
AnnotationCollection collection = project.getUserMarkupCollection(collectionReference);
setAnnotationCollectionSelected(new AnnotationCollectionReference(collection), true);
} catch (IOException e) {
((ErrorHandler) UI.getCurrent()).showAndLogError("error refreshing Annotation Collection!", e);
}
}
if ((selectedEditableCollection != null) && (userMarkupCollectionManager.contains(selectedEditableCollection.getId()))) {
annotationPanel.setSelectedEditableCollection(userMarkupCollectionManager.getUserMarkupCollection(selectedEditableCollection.getId()));
}
annotationPanel.clearTagsets();
tagsetsSelected(resourcePanel.getSelectedTagsets());
}
@Override
public void documentSelected(SourceDocument sourceDocument) {
setSourceDocument(sourceDocument, null);
}
@Override
public void annotationCollectionSelected(AnnotationCollectionReference collectionReference, boolean selected) {
setAnnotationCollectionSelected(collectionReference, selected);
}
@Override
public void tagsetsSelected(Collection<TagsetDefinition> tagsets) {
try {
annotationPanel.setTagsets(tagsets);
if (taggerContextMenu != null) {
taggerContextMenu.setTagsets(tagsets);
}
for (AnnotationCollection collection : userMarkupCollectionManager.getUserMarkupCollections()) {
tagger.setVisible(collection.getTagReferences(), false);
List<TagReference> visibleRefs = annotationPanel.getVisibleTagReferences(collection.getTagReferences());
if (!visibleRefs.isEmpty()) {
tagger.setVisible(visibleRefs, true);
}
}
} catch (Exception e) {
errorHandler.showAndLogError("Error handling Tagset!", e);
}
}
});
annotationPanel.setTagReferenceSelectionChangeListener((tagReferences, selected) -> {
if (!tagReferences.isEmpty()) {
tagger.setVisible(tagReferences, selected);
}
});
kwicPanel.setExpansionListener(new ExpansionListener() {
@Override
public void expand() {
// we hide on expand and on compress since both is considered a "close"
hideKwicPanel();
}
@Override
public void compress() {
// we hide on expand and on compress since both is considered a "close"
hideKwicPanel();
}
});
kwicPanel.addItemClickListener(itemClick -> {
if (itemClick.getMouseEventDetails().isDoubleClick()) {
show(itemClick.getItem().getRange());
}
});
}
use of de.catma.ui.module.analyze.visualization.ExpansionListener in project catma by forTEXT.
the class VegaPanel method initActions.
private void initActions() {
vega.setValueChangeListener(changeEvent -> handleVegaValueChange(changeEvent.getValue()));
btUpdate.addClickListener(event -> handleScriptUpdate(true));
btHelp.addClickListener(new ClickListener() {
public void buttonClick(ClickEvent event) {
if (vegaHelpWindow.getParent() == null) {
UI.getCurrent().addWindow(vegaHelpWindow);
} else {
UI.getCurrent().removeWindow(vegaHelpWindow);
}
}
});
btShowCode.addClickListener(event -> toggleSpecView(true));
btHideCode.addClickListener(event -> toggleSpecView(false));
btExpandCompressTopLeft.addClickListener(clickEvent -> handleMaxMinRequest());
btExpandCompressRight.addClickListener(clickEvent -> handleMaxMinRequest());
kwicPanel.setExpansionListener(new ExpansionListener() {
@Override
public void expand() {
toggleKwicVisible(true);
}
@Override
public void compress() {
toggleKwicVisible(false);
}
});
cbPublicExposure.addValueChangeListener(event -> handlePublicExposureValueChange(event));
}
Aggregations