List of usage examples for com.vaadin.ui Window Window
public Window()
From source file:probe.com.view.body.quantdatasetsoverview.diseasegroupsfilters.PopupReorderGroupsLayout.java
public PopupReorderGroupsLayout(QuantCentralManager Quant_Central_Manager) { this.setStyleName("sortandselect"); this.setDescription("Reorder and select disease groups"); this.Quant_Central_Manager = Quant_Central_Manager; this.addLayoutClickListener(PopupReorderGroupsLayout.this); this.popupBodyLayout = new VerticalLayout(); VerticalLayout windowLayout = new VerticalLayout(); popupWindow = new Window() { @Override//from www. j av a 2 s . c o m public void close() { popupWindow.setVisible(false); } }; popupWindow.setContent(windowLayout); windowLayout.addComponent(popupBodyLayout); windowLayout.setComponentAlignment(popupBodyLayout, Alignment.MIDDLE_CENTER); popupWindow.setVisible(false); popupWindow.setResizable(false); popupWindow.setClosable(true); popupWindow.setStyleName(Reindeer.WINDOW_LIGHT); popupWindow.setModal(true); popupWindow.setDraggable(false); popupWindow.setCaption( "<font color='gray' style='font-weight: bold;!important'> Disease Groups</font>"); popupWindow.setCaptionAsHtml(true); popupBodyLayout.setStyleName(Reindeer.LAYOUT_WHITE); popupBodyLayout.setHeightUndefined();//(h - 50) + "px"); popupWindow.setWindowMode(WindowMode.NORMAL); UI.getCurrent().addWindow(popupWindow); popupWindow.center(); colHeaders = Quant_Central_Manager.getSelectedHeatMapRows(); rowHeaders = Quant_Central_Manager.getSelectedHeatMapRows(); Map<Integer, QuantDatasetObject> quantDSArr = Quant_Central_Manager.getFilteredDatasetsList(); patientsGroupArr = Quant_Central_Manager.getDiseaseGroupsArray(); initPopupLayout(rowHeaders, colHeaders, quantDSArr); // this.Quant_Central_Manager.setHeatMapLevelSelection(rowHeaders, colHeaders, patientsGroupArr); this.Quant_Central_Manager.registerFilterListener(PopupReorderGroupsLayout.this); }
From source file:probe.com.view.body.quantdatasetsoverview.diseasegroupsfilters.StudiesInformationPopupBtn.java
public StudiesInformationPopupBtn(QuantCentralManager Quant_Central_Manager) { // super("Study Information"); this.Quant_Central_Manager = Quant_Central_Manager; this.setStyleName(Reindeer.BUTTON_LINK); this.addStyleName("studyinfo"); this.setDescription("Show dataset information"); this.addClickListener(StudiesInformationPopupBtn.this); int selectedDsNumber = 0; Set<QuantDatasetObject> dsObjects = new TreeSet<QuantDatasetObject>(); if (Quant_Central_Manager.getSelectedDiseaseGroupsComparisonList() != null && !Quant_Central_Manager.getSelectedDiseaseGroupsComparisonList().isEmpty()) { Set<QuantDiseaseGroupsComparison> compSet = Quant_Central_Manager .getSelectedDiseaseGroupsComparisonList(); for (QuantDiseaseGroupsComparison comp : compSet) { selectedDsNumber += comp.getDatasetIndexes().length; for (int dsId : comp.getDatasetIndexes()) { DatasetInformationOverviewLayout datasetInfoLayout = new DatasetInformationOverviewLayout( (Page.getCurrent().getBrowserWindowWidth() * 90 / 100), Quant_Central_Manager.getDiseaseHashedColorMap()); datasetInfoLayout.updateDatasetForm(Quant_Central_Manager.getFullQuantDatasetMap().get(dsId)); // datasetInfoLayout.setWidth("100%"); datasetInfoLayoutDSIndexMap.put(dsId, datasetInfoLayout); dsObjects.add(Quant_Central_Manager.getFullQuantDatasetMap().get(dsId)); }//from w w w . j av a2 s. c om } } else { selectedDsNumber = Quant_Central_Manager.getFilteredDatasetsList().size(); Map<Integer, QuantDatasetObject> fullDsMap = Quant_Central_Manager.getFilteredDatasetsList(); for (QuantDatasetObject quantDs : fullDsMap.values()) { DatasetInformationOverviewLayout datasetInfoLayout = new DatasetInformationOverviewLayout( (Page.getCurrent().getBrowserWindowWidth() * 90 / 100), Quant_Central_Manager.getDiseaseHashedColorMap()); datasetInfoLayout.updateDatasetForm(quantDs); // datasetInfoLayout.setWidth("100%"); datasetInfoLayoutDSIndexMap.put(quantDs.getDsKey(), datasetInfoLayout); dsObjects.add(quantDs); } } this.studiesPopupLayout = new StudyPopupLayout(datasetInfoLayoutDSIndexMap); VerticalLayout popupBody = new VerticalLayout(); popupBody.setWidth("100%"); popupBody.addComponent(studiesPopupLayout); popupBody.setComponentAlignment(studiesPopupLayout, Alignment.TOP_CENTER); popupWindow = new Window() { @Override public void close() { popupWindow.setVisible(false); } }; popupWindow.setContent(popupBody); popupWindow.setWindowMode(WindowMode.NORMAL); popupWindow.setWidth("95%"); popupWindow.setHeight("95%"); popupWindow.setVisible(false); popupWindow.setResizable(false); popupWindow.setClosable(false); popupWindow.setStyleName(Reindeer.WINDOW_LIGHT); popupWindow.setModal(true); popupWindow.setDraggable(false); popupWindow.center(); popupWindow.setCaption( "<font color='gray' style='font-weight: bold;!important'> Study Information (" + selectedDsNumber + ")</font>"); studiesPopupLayout.setInformationData(dsObjects); UI.getCurrent().addWindow(popupWindow); popupWindow.center(); popupWindow.setCaptionAsHtml(true); popupWindow.setClosable(true); popupBody.setMargin(true); popupBody.setSpacing(true); Quant_Central_Manager.registerStudySelectionListener(StudiesInformationPopupBtn.this); }
From source file:probe.com.view.body.quantdatasetsoverview.quantproteinstabsheet.peptidescontainer.StudyInformationPopupComponent.java
/** * * @param width/*from w ww.j a va 2s . com*/ * @param protName * @param url * @param comparisonHeader */ public StudyInformationPopupComponent(int width, String protName, String url, String comparisonHeader) { int height = Page.getCurrent().getBrowserWindowHeight() - 100; popupBody = new VerticalLayout(); popupBody.setWidth((width) + "px"); popupBody.setHeightUndefined(); popupBody.setStyleName(Reindeer.LAYOUT_WHITE); popupWindow = new Window() { @Override public void close() { popupWindow.setVisible(false); } }; popupWindow.setCaption( "<font color='gray' style='font-weight: bold;!important'><a href='" + url + "'target=\"_blank\"> " + protName + " <font size='2' color='#666'> - " + comparisonHeader + "</font></a></font> "); popupWindow.setContent(popupBody); popupWindow.setWindowMode(WindowMode.NORMAL); popupWindow.setWidth((width + 40) + "px"); popupWindow.setHeight((height) + "px"); popupWindow.setVisible(false); popupWindow.setResizable(false); popupWindow.setClosable(false); popupWindow.setStyleName(Reindeer.WINDOW_LIGHT); popupWindow.setModal(true); popupWindow.setDraggable(true); UI.getCurrent().addWindow(popupWindow); popupWindow.setPositionX(30); popupWindow.setPositionY(40); popupWindow.setCaptionAsHtml(true); popupWindow.setClosable(true); popupBody.setMargin(true); popupBody.setSpacing(true); }
From source file:probe.com.view.body.welcomelayout.PublicationsInformationWindow.java
public PublicationsInformationWindow(List<Object[]> publicationList) { int height = Page.getCurrent().getBrowserWindowHeight() - 100; int width = Page.getCurrent().getBrowserWindowWidth() - 100; int columnNum = width / 250; width = columnNum * 250;//w w w . j a v a2 s. c o m VerticalLayout popupBodyWrapper = new VerticalLayout(); popupBodyWrapper.setWidth("100%"); popupBodyWrapper.setHeight("100%"); VerticalLayout popupBody = new VerticalLayout(); popupBody.setWidth((width) + "px"); popupBody.setHeightUndefined(); popupBody.setStyleName(Reindeer.LAYOUT_WHITE); popupBody.setMargin(true); popupBody.setSpacing(true); popupBodyWrapper.addComponent(popupBody); popupBodyWrapper.setComponentAlignment(popupBody, Alignment.TOP_CENTER); popupWindow = new Window() { @Override public void close() { popupWindow.setVisible(false); } }; popupWindow.setContent(popupBodyWrapper); popupWindow.setWindowMode(WindowMode.NORMAL); popupWindow.setWidth((width + 22) + "px"); popupWindow.setVisible(false); popupWindow.setResizable(false); popupWindow.setClosable(false); popupWindow.setStyleName(Reindeer.WINDOW_LIGHT); popupWindow.setModal(true); popupWindow.setDraggable(false); popupWindow.setCaption( "<font color='gray' style='font-weight: bold;!important'> Publication Information</font>"); UI.getCurrent().addWindow(popupWindow); popupWindow.center(); popupWindow.setCaptionAsHtml(true); popupWindow.setClosable(true); GridLayout publicationContainer = new GridLayout(); publicationContainer.setWidth("100%"); publicationContainer.setSpacing(true); publicationContainer.setMargin(true); popupBody.addComponent(publicationContainer); publicationContainer.setColumns(columnNum); publicationContainer.setRows(publicationList.size()); this.addLayoutClickListener(PublicationsInformationWindow.this); int row = 0; int col = 0; for (Object[] obj : publicationList) { VerticalLayout publicationLayout = initPublicationLayout(obj); String btnName = "<font size=1 >" + obj[0].toString() + "</font><br/>" + obj[1].toString() + "<br/><font size=1 >" + obj[2].toString() + "</font><br/><font size=1 >#Proteins: " + obj[5].toString() /*+ "/" + obj[5].toString() + */ + " #Peptides: " + obj[7].toString() /*+ "/" + obj[7].toString() +*/ + "</font>"; PopupInfoBtn publicationBtn = new PopupInfoBtn(publicationLayout, btnName, obj[1].toString()); publicationContainer.addComponent(publicationBtn, col++, row); publicationContainer.setComponentAlignment(publicationBtn, Alignment.TOP_CENTER); if (col >= columnNum) { row++; col = 0; } } height = Math.min((++row * 85) + 200, height); popupWindow.setHeight((height) + "px"); }
From source file:probe.com.view.body.welcomelayout.StudiesInformationWindow.java
public StudiesInformationWindow(Set<QuantDatasetObject> dsObjects, Map<String, String> diseaseHashedColorMap) { int height = Page.getCurrent().getBrowserWindowHeight() - 100; int width = Page.getCurrent().getBrowserWindowWidth() - 100; VerticalLayout popupBody = new VerticalLayout(); popupBody.setWidth((width - 20) + "px"); popupBody.setHeightUndefined();// w w w . j a v a2s . co m popupBody.setStyleName(Reindeer.LAYOUT_WHITE); popupBody.setMargin(true); popupBody.setSpacing(true); popupWindow = new Window() { @Override public void close() { popupWindow.setVisible(false); } }; popupWindow.setContent(popupBody); popupWindow.setWindowMode(WindowMode.NORMAL); popupWindow.setWidth((width) + "px"); popupWindow.setHeight((height) + "px"); popupWindow.setVisible(false); popupWindow.setResizable(false); popupWindow.setClosable(false); popupWindow.setStyleName(Reindeer.WINDOW_LIGHT); popupWindow.setModal(true); popupWindow.setDraggable(false); popupWindow.center(); popupWindow.setCaption( "<font color='gray' style='font-weight: bold;!important'> Datasets Information</font>"); UI.getCurrent().addWindow(popupWindow); popupWindow.center(); popupWindow.setCaptionAsHtml(true); popupWindow.setClosable(true); this.addLayoutClickListener(StudiesInformationWindow.this); Map<Integer, DatasetInformationOverviewLayout> datasetInfoLayoutDSIndexMap = new HashMap<Integer, DatasetInformationOverviewLayout>(); for (QuantDatasetObject quantDs : dsObjects) { DatasetInformationOverviewLayout datasetInfoLayout = new DatasetInformationOverviewLayout(width - 40, diseaseHashedColorMap); datasetInfoLayout.updateDatasetForm(quantDs); // datasetInfoLayout.setWidth(width-40+"px"); datasetInfoLayoutDSIndexMap.put(quantDs.getDsKey(), datasetInfoLayout); } StudyPopupLayout studiesPopupLayout = new StudyPopupLayout(datasetInfoLayoutDSIndexMap); popupBody.addComponent(studiesPopupLayout); popupBody.setComponentAlignment(studiesPopupLayout, Alignment.TOP_CENTER); studiesPopupLayout.setInformationData(dsObjects); }
From source file:probe.com.view.core.NotificationComponent1.java
public NotificationComponent1(int x, int y, String text, String uniqueID) { this.uniqueID = uniqueID; popupBody = new VerticalLayout(); popupBody.setWidthUndefined();//from ww w. j a v a 2s . c o m ;//setWidth((200) + "px"); popupBody.setHeightUndefined(); ;//setHeight((200) + "px"); popupBody.setStyleName("notificationbody"); popupBody.addLayoutClickListener(NotificationComponent1.this); popupWindow = new Window() { @Override public void close() { popupWindow.setVisible(false); } }; popupWindow.setStyleName("notificationwindow"); popupWindow.setCaption(null); popupWindow.setContent(popupBody); popupWindow.setWindowMode(WindowMode.NORMAL); popupWindow.setWidthUndefined();//.setWidth((200) + "px"); popupWindow.setHeightUndefined();//setHeight((200) + "px"); popupWindow.setVisible(false); popupWindow.setResizable(false); popupWindow.setClosable(false); popupWindow.setModal(false); popupWindow.setDraggable(false); popupWindow.setModal(false); UI.getCurrent().addWindow(popupWindow); popupWindow.setPositionX(x); popupWindow.setPositionY(y); popupWindow.setCaptionAsHtml(true); popupWindow.setClosable(false); popupBody.setMargin(true); popupBody.setSpacing(true); Label content = new Label("<center>" + text + "</center>"); content.setStyleName("notificationtext"); content.setContentMode(ContentMode.HTML); popupBody.addComponent(content); VerticalLayout footer = new VerticalLayout(); footer.setStyleName("bubbletalkfooter"); footer.setWidth("30px"); footer.setHeight("20px"); popupBody.addComponent(footer); }
From source file:ro.zg.netcell.vaadin.action.user.LoginHandler.java
License:Apache License
@Override public void handle(ActionContext actionContext) throws Exception { Window w = new Window(); w.setModal(true);/*from w w w. j a v a2 s .c o m*/ OpenGroupsApplication app = actionContext.getApp(); if (app.getAppConfigManager().isInstancePrivate()) { w.setClosable(false); } OpenGroupsMainWindow mainWindow = actionContext.getWindow(); UserAction ua = actionContext.getUserAction(); w.setWidth("600px"); w.setHeight("300px"); w.center(); w.setCaption(getMessage(ua.getActionName() + ".window.caption")); mainWindow.addWindow(w); ComponentContainer loginView = getLoginView(actionContext); w.setContent(loginView); }
From source file:ro.zg.netcell.vaadin.action.user.RegisterUserHandler.java
License:Apache License
@Override public void handle(ActionContext actionContext) throws Exception { Window w = new Window(); w.setModal(true);/*from www.j a v a 2 s . c o m*/ OpenGroupsApplication app = actionContext.getApp(); OpenGroupsMainWindow mainWindow = actionContext.getWindow(); UserAction ua = actionContext.getUserAction(); w.setWidth("400px"); w.setHeight("300px"); w.center(); w.setCaption(getMessage(ua.getActionName() + ".window.caption")); mainWindow.addWindow(w); VerticalLayout layout = new VerticalLayout(); layout.setSizeFull(); Form form = getRegisterForm(actionContext.getUserAction(), app, actionContext.getWindow(), actionContext.getEntity(), actionContext); w.setContent(layout); layout.addComponent(form); form.setWidth("60%"); // form.setHeight("30%"); layout.setComponentAlignment(form, Alignment.MIDDLE_CENTER); }
From source file:ro.zg.netcell.vaadin.action.user.RequestPasswordResetHandler.java
License:Apache License
@Override public void handle(ActionContext actionContext) throws Exception { Window w = new Window(); w.setModal(true);// www .j a v a 2s . c om OpenGroupsApplication app = actionContext.getApp(); OpenGroupsMainWindow mainWindow = actionContext.getWindow(); UserAction ua = actionContext.getUserAction(); w.setWidth("400px"); w.setHeight("300px"); w.center(); w.setCaption(getMessage(ua.getActionName() + ".window.caption")); mainWindow.addWindow(w); VerticalLayout layout = new VerticalLayout(); layout.setSizeFull(); Form form = getForm(actionContext.getUserAction(), app, actionContext); w.setContent(layout); layout.addComponent(form); form.setWidth("60%"); // form.setHeight("30%"); layout.setComponentAlignment(form, Alignment.MIDDLE_CENTER); }
From source file:ro.zg.netcell.vaadin.action.user.ResetPasswordHandler.java
License:Apache License
@Override public void handle(ActionContext actionContext) throws Exception { Window w = new Window(); w.setModal(true);/*from ww w .j a v a2s. c om*/ OpenGroupsApplication app = actionContext.getApp(); OpenGroupsMainWindow mainWindow = actionContext.getWindow(); UserAction ua = actionContext.getUserAction(); w.setWidth("400px"); w.setHeight("300px"); w.center(); w.setCaption(getMessage(ua.getActionName() + ".window.caption")); mainWindow.addWindow(w); VerticalLayout layout = new VerticalLayout(); layout.setSizeFull(); Form form = getForm(actionContext.getUserAction(), app, actionContext.getParams(), actionContext); w.setContent(layout); layout.addComponent(form); form.setWidth("60%"); // form.setHeight("30%"); layout.setComponentAlignment(form, Alignment.MIDDLE_CENTER); /* hide the content of the main window */ mainWindow.setContentVisible(false); }