use of de.catma.ui.module.analyze.resourcepanel.AnalyzeResourcePanel 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);
}
Aggregations