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);
});
}
Aggregations