Search in sources :

Example 1 with Visualization

use of de.catma.ui.module.analyze.visualization.Visualization 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);
}
Also used : DisplaySetting(de.catma.ui.module.analyze.queryresultpanel.DisplaySetting) LoadingCache(com.google.common.cache.LoadingCache) TextField(com.vaadin.ui.TextField) QueryResultPanelSetting(de.catma.ui.module.analyze.queryresultpanel.QueryResultPanelSetting) QueryResultPanel(de.catma.ui.module.analyze.queryresultpanel.QueryResultPanel) VerticalLayout(com.vaadin.ui.VerticalLayout) VerticalSplitPanel(com.vaadin.ui.VerticalSplitPanel) SelectionEvent(com.vaadin.event.selection.SelectionEvent) Alignment(com.vaadin.ui.Alignment) ComboBox(com.vaadin.ui.ComboBox) SingleSelectionEvent(com.vaadin.event.selection.SingleSelectionEvent) ComponentContainer(com.vaadin.ui.ComponentContainer) QueryResultRowArray(de.catma.queryengine.result.QueryResultRowArray) SingleSelectionListener(com.vaadin.event.selection.SingleSelectionListener) KwicProvider(de.catma.indexer.KwicProvider) VaadinIcons(com.vaadin.icons.VaadinIcons) AbstractOrderedLayout(com.vaadin.ui.AbstractOrderedLayout) IconButton(de.catma.ui.component.IconButton) ListDataProvider(com.vaadin.data.provider.ListDataProvider) ExpansionListener(de.catma.ui.module.analyze.visualization.ExpansionListener) Project(de.catma.project.Project) Collection(java.util.Collection) HorizontalSplitPanel(com.vaadin.ui.HorizontalSplitPanel) Visualization(de.catma.ui.module.analyze.visualization.Visualization) ValueChangeListener(com.vaadin.data.HasValue.ValueChangeListener) Sizeable(com.vaadin.server.Sizeable) MarginInfo(com.vaadin.shared.ui.MarginInfo) List(java.util.List) Button(com.vaadin.ui.Button) HorizontalLayout(com.vaadin.ui.HorizontalLayout) QueryResultRowItem(de.catma.ui.module.analyze.queryresultpanel.QueryResultRowItem) KwicPanel(de.catma.ui.module.analyze.visualization.kwic.KwicPanel) IconButton(de.catma.ui.component.IconButton) MarginInfo(com.vaadin.shared.ui.MarginInfo) QueryResultPanel(de.catma.ui.module.analyze.queryresultpanel.QueryResultPanel) HorizontalSplitPanel(com.vaadin.ui.HorizontalSplitPanel) TextField(com.vaadin.ui.TextField) VerticalLayout(com.vaadin.ui.VerticalLayout) VerticalSplitPanel(com.vaadin.ui.VerticalSplitPanel) HorizontalLayout(com.vaadin.ui.HorizontalLayout)

Aggregations

LoadingCache (com.google.common.cache.LoadingCache)1 ValueChangeListener (com.vaadin.data.HasValue.ValueChangeListener)1 ListDataProvider (com.vaadin.data.provider.ListDataProvider)1 SelectionEvent (com.vaadin.event.selection.SelectionEvent)1 SingleSelectionEvent (com.vaadin.event.selection.SingleSelectionEvent)1 SingleSelectionListener (com.vaadin.event.selection.SingleSelectionListener)1 VaadinIcons (com.vaadin.icons.VaadinIcons)1 Sizeable (com.vaadin.server.Sizeable)1 MarginInfo (com.vaadin.shared.ui.MarginInfo)1 AbstractOrderedLayout (com.vaadin.ui.AbstractOrderedLayout)1 Alignment (com.vaadin.ui.Alignment)1 Button (com.vaadin.ui.Button)1 ComboBox (com.vaadin.ui.ComboBox)1 ComponentContainer (com.vaadin.ui.ComponentContainer)1 HorizontalLayout (com.vaadin.ui.HorizontalLayout)1 HorizontalSplitPanel (com.vaadin.ui.HorizontalSplitPanel)1 TextField (com.vaadin.ui.TextField)1 VerticalLayout (com.vaadin.ui.VerticalLayout)1 VerticalSplitPanel (com.vaadin.ui.VerticalSplitPanel)1 KwicProvider (de.catma.indexer.KwicProvider)1