use of de.catma.ui.component.IconButton in project catma by forTEXT.
the class VizMaxPanel method initComponents.
private void initComponents(String name) {
setSizeFull();
setMargin(false);
HorizontalLayout titlePanel = new HorizontalLayout();
titlePanel.setMargin(false);
titlePanel.setWidth("100%");
nameLabel = new TextField(null, name);
nameLabel.addStyleName("viz-max-panel-name");
titlePanel.addComponent(nameLabel);
titlePanel.setComponentAlignment(nameLabel, Alignment.TOP_CENTER);
titlePanel.setExpandRatio(nameLabel, 1.f);
btMinViz = new IconButton(VaadinIcons.COMPRESS_SQUARE);
titlePanel.addComponent(btMinViz);
titlePanel.setComponentAlignment(btMinViz, Alignment.TOP_CENTER);
addComponent(titlePanel);
mainContentSplitPanel = new HorizontalSplitPanel();
mainContentSplitPanel.setSplitPosition(40, Sizeable.Unit.PERCENTAGE);
addComponent(mainContentSplitPanel);
setExpandRatio(mainContentSplitPanel, 1f);
// left column
VerticalSplitPanel resultSelectionSplitPanel = new VerticalSplitPanel();
mainContentSplitPanel.addComponent(resultSelectionSplitPanel);
// top left
topLeftPanel = new VerticalLayout();
topLeftPanel.setSizeFull();
topLeftPanel.setMargin(new MarginInfo(false, false, false, false));
resultSelectionSplitPanel.addComponent(topLeftPanel);
queryResultBox = new ComboBox<QuerySelection>();
queryResultBox.setWidth("100%");
queryResultBox.setEmptySelectionCaption("Select a resultset");
queryResultBox.setEmptySelectionAllowed(false);
queryResultBox.setItemCaptionGenerator(querySelection -> querySelection.getSetting().getQueryId().toString());
// bottom left
selectedResultsPanel = new QueryResultPanel(project, kwicProviderCache, DisplaySetting.GROUPED_BY_PHRASE, item -> handleItemRemoval(item));
selectedResultsPanel.addToButtonBarLeft(queryResultBox);
selectedResultsPanel.setSizeFull();
selectedResultsPanel.setMargin(new MarginInfo(false, false, false, false));
resultSelectionSplitPanel.addComponent(selectedResultsPanel);
// right column
mainContentSplitPanel.addComponent(visualization);
}
use of de.catma.ui.component.IconButton in project catma by forTEXT.
the class VizMinPanel method initComponents.
private void initComponents(String title) {
addStyleName("analyze-card");
setMargin(false);
setSpacing(false);
titleLabel = new TextField(null, title);
titleLabel.setWidth("90%");
titleLabel.addStyleName("analyze-card-infobar");
HorizontalLayout buttonBar = new HorizontalLayout();
buttonBar.setWidth("100%");
buttonBar.addStyleName("analyze-card-buttonbar");
btRemove = new IconButton(VaadinIcons.ERASER);
btMaximize = new IconButton(VaadinIcons.EXPAND_SQUARE);
buttonBar.addComponents(btRemove, btMaximize);
buttonBar.setComponentAlignment(btRemove, Alignment.MIDDLE_RIGHT);
buttonBar.setComponentAlignment(btMaximize, Alignment.MIDDLE_RIGHT);
buttonBar.setExpandRatio(btRemove, 1f);
addComponents(titleLabel, buttonBar);
}
use of de.catma.ui.component.IconButton in project catma by forTEXT.
the class WordPanel method initComponents.
private void initComponents() {
setSpacing(true);
setMargin(true);
setSizeFull();
String next = "first ";
if (withPositionBox) {
next = "next ";
}
startsWithField = new TextField();
startsWithField.setCaption(MessageFormat.format("The {0} word starts with", next));
addComponent(startsWithField);
containsField = new TextField();
containsField.setCaption(MessageFormat.format("The {0} word contains", next));
addComponent(containsField);
endsWithField = new TextField();
endsWithField.setCaption(MessageFormat.format("The {0} word ends with", next));
addComponent(endsWithField);
exactField = new TextField();
exactField.setCaption(MessageFormat.format("The {0} word is exactly", next));
addComponent(exactField);
if (withPositionBox) {
List<PositionItem> options = new ArrayList<PositionItem>();
for (int i = 1; i <= 10; i++) {
options.add(new PositionItem(i, MessageFormat.format("{0,number,integer} {1} after the previous word", i, ((i == 1) ? "word" : "words"))));
}
positionBox = new ComboBox<PositionItem>("The position of this word is", options);
addComponent(positionBox);
positionBox.setEmptySelectionAllowed(false);
positionBox.setValue(options.get(0));
btRemove = new IconButton(VaadinIcons.ERASER);
addComponent(btRemove);
setComponentAlignment(btRemove, Alignment.MIDDLE_CENTER);
}
}
use of de.catma.ui.component.IconButton in project catma by forTEXT.
the class AnalyzeView method initComponents.
private void initComponents(Corpus corpus) {
setSizeFull();
setSpacing(true);
// left column Queries
VerticalLayout queryPanel = new VerticalLayout();
queryPanel.setSizeFull();
Label searchPanelLabel = new Label("Queries");
btQueryOptions = new IconButton(VaadinIcons.ELLIPSIS_DOTS_V);
// TODO: no query options so far
btQueryOptions.setVisible(false);
HorizontalLayout queryHeaderPanel = new HorizontalLayout(searchPanelLabel, btQueryOptions);
queryHeaderPanel.setWidth("100%");
queryHeaderPanel.setExpandRatio(searchPanelLabel, 1.0f);
queryHeaderPanel.setComponentAlignment(searchPanelLabel, Alignment.MIDDLE_CENTER);
queryHeaderPanel.setComponentAlignment(btQueryOptions, Alignment.MIDDLE_RIGHT);
queryPanel.addComponent(queryHeaderPanel);
VerticalLayout searchPanel = createSearchPanel();
queryPanel.addComponent(searchPanel);
resultsPanel = new VerticalLayout();
resultsPanel.setMargin(new MarginInfo(false, true, false, false));
resultsPanel.setWidth("100%");
Panel resultsScrollPanel = new Panel();
resultsScrollPanel.setSizeFull();
resultsScrollPanel.addStyleName(MaterialTheme.PANEL_BORDERLESS);
resultsScrollPanel.setContent(resultsPanel);
queryPanel.addComponent(resultsScrollPanel);
queryPanel.setExpandRatio(resultsScrollPanel, 1f);
// right column Visualizations
VerticalLayout vizPanel = new VerticalLayout();
vizPanel.setSizeFull();
Label vizPanelLabel = new Label("Visualizations");
btVizOptions = new IconButton(VaadinIcons.ELLIPSIS_DOTS_V);
// TODO: no viz options so far
btVizOptions.setVisible(false);
HorizontalLayout vizHeaderPanel = new HorizontalLayout(vizPanelLabel, btVizOptions);
vizHeaderPanel.setWidth("100%");
vizHeaderPanel.setExpandRatio(vizPanelLabel, 1.0f);
vizHeaderPanel.setComponentAlignment(vizPanelLabel, Alignment.MIDDLE_CENTER);
vizHeaderPanel.setComponentAlignment(btVizOptions, Alignment.MIDDLE_RIGHT);
vizPanel.addComponent(vizHeaderPanel);
HorizontalLayout vizIconsPanel = createVizIconsPanel();
vizIconsPanel.setWidth("100%");
vizPanel.addComponent(vizIconsPanel);
vizCardsPanel = new VerticalLayout();
vizCardsPanel.setWidth("100%");
Panel vizCardsScrollPanel = new Panel();
vizCardsScrollPanel.setSizeFull();
vizCardsScrollPanel.addStyleName(MaterialTheme.PANEL_BORDERLESS);
vizCardsScrollPanel.setContent(vizCardsPanel);
vizPanel.addComponent(vizCardsScrollPanel);
vizPanel.setExpandRatio(vizCardsScrollPanel, 1.0f);
// drawer
analyzeResourcePanel = new AnalyzeResourcePanel(this.eventBus, this.project, corpus, () -> corpusChanged());
drawer = new SliderPanelBuilder(analyzeResourcePanel).mode(SliderMode.LEFT).expanded(corpus.isEmpty()).build();
addComponent(drawer);
// content
contentPanel = new HorizontalLayout();
contentPanel.setSpacing(false);
contentPanel.setMargin(false);
contentPanel.setSizeFull();
contentPanel.addComponent(queryPanel);
contentPanel.setExpandRatio(queryPanel, 0.5f);
contentPanel.addComponent(vizPanel);
contentPanel.setExpandRatio(vizPanel, 0.5f);
addComponent(contentPanel);
setExpandRatio(contentPanel, 1f);
}
use of de.catma.ui.component.IconButton in project catma by forTEXT.
the class AnnotationDetailsPanel method initComponents.
private void initComponents() {
setSpacing(true);
setMargin(false);
setSizeFull();
addStyleName("annotation-details-panel");
HorizontalLayout headerPanel = new HorizontalLayout();
headerPanel.setWidth("100%");
addComponent(headerPanel);
btClearSelected = new IconButton(VaadinIcons.ERASER);
btClearSelected.setDescription("Clear the list of selected Annotations");
headerPanel.addComponent(btClearSelected);
headerPanel.setComponentAlignment(btClearSelected, Alignment.TOP_RIGHT);
headerPanel.setExpandRatio(btClearSelected, 1.0f);
btMinimize = new IconButton(VaadinIcons.ANGLE_DOUBLE_DOWN);
headerPanel.addComponent(btMinimize);
headerPanel.setComponentAlignment(btMinimize, Alignment.TOP_RIGHT);
annotationDetailData = new TreeData<>();
annotationDetailsProvider = new TreeDataProvider<>(annotationDetailData);
annotationDetailsTree = TreeGridFactory.createDefaultGrid(annotationDetailsProvider);
annotationDetailsTree.setSizeFull();
annotationDetailsTree.addStyleNames("annotation-details-panel-annotation-details-grid", "flat-undecorated-icon-buttonrenderer");
annotationDetailsTree.addColumn(annotationTreeItem -> annotationTreeItem.getDetail(), new HtmlRenderer()).setCaption("Annotation").setWidth(200).setSortable(false);
annotationDetailsTree.addColumn(annotationTreeItem -> annotationTreeItem.getTag()).setCaption("Tag").setSortable(false).setWidth(80);
annotationDetailsTree.addColumn(annotationTreeItem -> annotationTreeItem.getAuthor()).setCaption("Author").setSortable(false).setWidth(60);
annotationDetailsTree.addColumn(annotationTreeItem -> annotationTreeItem.getCollection()).setCaption("Collection").setSortable(false).setWidth(60);
annotationDetailsTree.addColumn(annotationTreeItem -> annotationTreeItem.getTagset()).setCaption("Tagset").setSortable(false).setWidth(70);
annotationDetailsTree.addColumn(annotationTreeItem -> annotationTreeItem.getAnnotationId()).setCaption("Annotation ID").setHidable(true).setHidden(true).setSortable(false).setWidth(100);
ButtonRenderer<AnnotationTreeItem> editAnnotationRenderer = new ButtonRenderer<AnnotationTreeItem>(clickEvent -> handleEditAnnotationRequest(clickEvent));
editAnnotationRenderer.setHtmlContentAllowed(true);
annotationDetailsTree.addColumn(annotationTreeItem -> annotationTreeItem.getEditIcon(), editAnnotationRenderer).setWidth(50);
ButtonRenderer<AnnotationTreeItem> deleteAnnotationRenderer = new ButtonRenderer<AnnotationTreeItem>(clickEvent -> handleDeleteAnnotationRequest(clickEvent));
deleteAnnotationRenderer.setHtmlContentAllowed(true);
annotationDetailsTree.addColumn(annotationTreeItem -> annotationTreeItem.getDeleteIcon(), deleteAnnotationRenderer).setExpandRatio(1);
annotationDetailsTree.setDescriptionGenerator(new DescriptionGenerator<AnnotationTreeItem>() {
@Override
public String apply(AnnotationTreeItem annotationTreeItem) {
return annotationTreeItem.getDescription();
}
}, ContentMode.HTML);
ActionGridComponent<TreeGrid<AnnotationTreeItem>> annotationDetailsGridComponent = new ActionGridComponent<>(new Label("Selected Annotations"), annotationDetailsTree);
annotationDetailsGridComponent.setMargin(false);
addComponent(annotationDetailsGridComponent);
setExpandRatio(annotationDetailsGridComponent, 1.0f);
}
Aggregations