Search in sources :

Example 1 with AnalyzeResourcePanel

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);
}
Also used : Panel(com.vaadin.ui.Panel) SliderPanel(org.vaadin.sliderpanel.SliderPanel) RefreshQueryResultPanel(de.catma.ui.module.analyze.queryresultpanel.RefreshQueryResultPanel) KwicPanel(de.catma.ui.module.analyze.visualization.kwic.KwicPanel) DoubleTreePanel(de.catma.ui.module.analyze.visualization.doubletree.DoubleTreePanel) QueryResultPanel(de.catma.ui.module.analyze.queryresultpanel.QueryResultPanel) VegaPanel(de.catma.ui.module.analyze.visualization.vega.VegaPanel) AnalyzeResourcePanel(de.catma.ui.module.analyze.resourcepanel.AnalyzeResourcePanel) IconButton(de.catma.ui.component.IconButton) MarginInfo(com.vaadin.shared.ui.MarginInfo) SliderPanelBuilder(org.vaadin.sliderpanel.SliderPanelBuilder) Label(com.vaadin.ui.Label) VerticalLayout(com.vaadin.ui.VerticalLayout) AnalyzeResourcePanel(de.catma.ui.module.analyze.resourcepanel.AnalyzeResourcePanel) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Aggregations

MarginInfo (com.vaadin.shared.ui.MarginInfo)1 HorizontalLayout (com.vaadin.ui.HorizontalLayout)1 Label (com.vaadin.ui.Label)1 Panel (com.vaadin.ui.Panel)1 VerticalLayout (com.vaadin.ui.VerticalLayout)1 IconButton (de.catma.ui.component.IconButton)1 QueryResultPanel (de.catma.ui.module.analyze.queryresultpanel.QueryResultPanel)1 RefreshQueryResultPanel (de.catma.ui.module.analyze.queryresultpanel.RefreshQueryResultPanel)1 AnalyzeResourcePanel (de.catma.ui.module.analyze.resourcepanel.AnalyzeResourcePanel)1 DoubleTreePanel (de.catma.ui.module.analyze.visualization.doubletree.DoubleTreePanel)1 KwicPanel (de.catma.ui.module.analyze.visualization.kwic.KwicPanel)1 VegaPanel (de.catma.ui.module.analyze.visualization.vega.VegaPanel)1 SliderPanel (org.vaadin.sliderpanel.SliderPanel)1 SliderPanelBuilder (org.vaadin.sliderpanel.SliderPanelBuilder)1