Search in sources :

Example 1 with MonitorView

use of org.karnak.frontend.dicom.monitor.MonitorView in project karnak by OsiriX-Foundation.

the class DicomMainView method createMenu.

private void createMenu() {
    tabDicomEchoView = new Tab("DICOM Echo");
    pageDicomEchoView = new DicomEchoView();
    tabDicomWorkListView = new Tab("DICOM Worklist");
    pageDicomWorkListView = new DicomWorkListView();
    tabMonitorView = new Tab("Monitor");
    pageMonitorView = new MonitorView();
    tabsToPages = new HashMap<>();
    tabsToPages.put(tabDicomEchoView, pageDicomEchoView);
    tabsToPages.put(tabDicomWorkListView, pageDicomWorkListView);
    tabsToPages.put(tabMonitorView, pageMonitorView);
    menu = new Tabs(tabDicomEchoView, tabDicomWorkListView, tabMonitorView);
    add(menu);
    pagesShown = Stream.of(pageDicomEchoView).collect(Collectors.toSet());
    add(pageDicomEchoView);
    menu.addSelectedChangeListener(event -> {
        pagesShown.forEach(page -> page.setVisible(false));
        pagesShown.clear();
        Component selectedPage = tabsToPages.get(menu.getSelectedTab());
        selectedPage.setVisible(true);
        pagesShown.add(selectedPage);
        add(selectedPage);
    });
}
Also used : Tab(com.vaadin.flow.component.tabs.Tab) DicomWorkListView(org.karnak.frontend.dicom.mwl.DicomWorkListView) Tabs(com.vaadin.flow.component.tabs.Tabs) DicomEchoView(org.karnak.frontend.dicom.echo.DicomEchoView) Component(com.vaadin.flow.component.Component) MonitorView(org.karnak.frontend.dicom.monitor.MonitorView)

Aggregations

Component (com.vaadin.flow.component.Component)1 Tab (com.vaadin.flow.component.tabs.Tab)1 Tabs (com.vaadin.flow.component.tabs.Tabs)1 DicomEchoView (org.karnak.frontend.dicom.echo.DicomEchoView)1 MonitorView (org.karnak.frontend.dicom.monitor.MonitorView)1 DicomWorkListView (org.karnak.frontend.dicom.mwl.DicomWorkListView)1