List of usage examples for com.vaadin.server Page getCurrent
public static Page getCurrent()
From source file:probe.com.view.body.quantdatasetsoverview.diseasegroupsfilters.PopupRecombineDiseaseGroups.java
private void initPopupLayout() { int h = 0;//(default_DiseaseCat_DiseaseGroupMap.size() * 33) + 300; for (Map<String, String> m : default_DiseaseCat_DiseaseGroupMap.values()) { if (h < m.size()) { h = m.size();/*from w w w.ja v a 2s . c o m*/ } } h = (h * 26) + 200; int w = 700; if (Page.getCurrent().getBrowserWindowHeight() - 280 < h) { h = Page.getCurrent().getBrowserWindowHeight() - 280; } if (Page.getCurrent().getBrowserWindowWidth() < w) { w = Page.getCurrent().getBrowserWindowWidth(); } popupWindow.setWidth(w + "px"); popupWindow.setHeight(h + "px"); popupBodyLayout.setWidth((w - 50) + "px"); Set<String> diseaseSet = Quant_Central_Manager.getDiseaseCategorySet(); diseaseTypeSelectionList.setDescription("Select disease category"); for (String disease : diseaseSet) { diseaseTypeSelectionList.addItem(disease); diseaseTypeSelectionList.setItemCaption(disease, (disease)); } HorizontalLayout diseaseCategorySelectLayout = new HorizontalLayout(); diseaseCategorySelectLayout.setWidthUndefined(); diseaseCategorySelectLayout.setHeight("50px"); diseaseCategorySelectLayout.setSpacing(true); diseaseCategorySelectLayout.setMargin(true); popupBodyLayout.addComponent(diseaseCategorySelectLayout); popupBodyLayout.setComponentAlignment(diseaseCategorySelectLayout, Alignment.TOP_LEFT); Label title = new Label("Disease Category"); title.setStyleName(Reindeer.LABEL_SMALL); diseaseCategorySelectLayout.addComponent(title); diseaseCategorySelectLayout.setComponentAlignment(title, Alignment.BOTTOM_CENTER); diseaseTypeSelectionList.setWidth("200px"); diseaseTypeSelectionList.setNullSelectionAllowed(false); diseaseTypeSelectionList.setValue("All"); diseaseTypeSelectionList.setImmediate(true); diseaseCategorySelectLayout.addComponent(diseaseTypeSelectionList); diseaseCategorySelectLayout.setComponentAlignment(diseaseTypeSelectionList, Alignment.TOP_LEFT); diseaseTypeSelectionList.setStyleName("diseaseselectionlist"); diseaseTypeSelectionList.addValueChangeListener(new Property.ValueChangeListener() { @Override public void valueChange(Property.ValueChangeEvent event) { boolean showAll = false; String value = event.getProperty().getValue().toString(); if (value.equalsIgnoreCase("All")) { showAll = true; } for (String dName : diseaseGroupsGridLayoutMap.keySet()) { if (dName.equalsIgnoreCase(value) || showAll) { diseaseGroupsGridLayoutMap.get(dName).setVisible(true); } else { diseaseGroupsGridLayoutMap.get(dName).setVisible(false); } } } }); VerticalLayout diseaseGroupsNamesContainer = new VerticalLayout(); diseaseGroupsNamesContainer.setWidth("100%"); diseaseGroupsNamesContainer.setHeightUndefined(); popupBodyLayout.addComponent(diseaseGroupsNamesContainer); diseaseGroupsNamesContainer.setStyleName(Reindeer.LAYOUT_WHITE); GridLayout diseaseNamesHeader = new GridLayout(2, 1); diseaseNamesHeader.setWidth("100%"); diseaseNamesHeader.setHeightUndefined(); diseaseNamesHeader.setSpacing(true); diseaseNamesHeader.setMargin(new MarginInfo(true, false, true, false)); diseaseGroupsNamesContainer.addComponent(diseaseNamesHeader); Label col1Label = new Label("Group Name"); diseaseNamesHeader.addComponent(col1Label, 0, 0); col1Label.setStyleName(Reindeer.LABEL_SMALL); Label col2Label = new Label("Suggested Name"); diseaseNamesHeader.addComponent(col2Label, 1, 0); col2Label.setStyleName(Reindeer.LABEL_SMALL); Panel diseaseGroupsNamesFrame = new Panel(); diseaseGroupsNamesFrame.setWidth("100%"); diseaseGroupsNamesFrame.setHeight((h - 200) + "px"); diseaseGroupsNamesContainer.addComponent(diseaseGroupsNamesFrame); diseaseGroupsNamesFrame.setStyleName(Reindeer.PANEL_LIGHT); VerticalLayout diseaseNamesUpdateContainerLayout = new VerticalLayout(); for (String diseaseCategory : diseaseSet) { if (diseaseCategory.equalsIgnoreCase("All")) { continue; } HorizontalLayout diseaseNamesUpdateContainer = initDiseaseNamesUpdateContainer(diseaseCategory); diseaseNamesUpdateContainerLayout.addComponent(diseaseNamesUpdateContainer); diseaseGroupsGridLayoutMap.put(diseaseCategory, diseaseNamesUpdateContainer); } diseaseGroupsNamesFrame.setContent(diseaseNamesUpdateContainerLayout); HorizontalLayout btnLayout = new HorizontalLayout(); btnLayout.setMargin(true); btnLayout.setSpacing(true); Button resetFiltersBtn = new Button("Reset"); resetFiltersBtn.setPrimaryStyleName("resetbtn"); btnLayout.addComponent(resetFiltersBtn); resetFiltersBtn.setWidth("50px"); resetFiltersBtn.setHeight("24px"); resetFiltersBtn.setDescription("Reset group names to default"); resetFiltersBtn.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { resetToDefault(); } }); Button resetToOriginalBtn = new Button("Publications Names"); resetToOriginalBtn.setPrimaryStyleName("resetbtn"); btnLayout.addComponent(resetToOriginalBtn); resetToOriginalBtn.setWidth("150px"); resetToOriginalBtn.setHeight("24px"); resetToOriginalBtn.setDescription("Reset group names to original publication names"); resetToOriginalBtn.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { resetToPublicationsNames(); } }); Button applyFilters = new Button("Update"); applyFilters.setDescription("Update disease groups with the selected names"); applyFilters.setPrimaryStyleName("resetbtn"); applyFilters.setWidth("50px"); applyFilters.setHeight("24px"); btnLayout.addComponent(applyFilters); applyFilters.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { updateGroups(); } }); popupBodyLayout.addComponent(btnLayout); popupBodyLayout.setComponentAlignment(btnLayout, Alignment.MIDDLE_RIGHT); resetToDefault(); }
From source file:probe.com.view.body.quantdatasetsoverview.diseasegroupsfilters.PopupReorderGroupsLayout.java
private void initPopupLayout(LinkedHashSet<String> rowHeaders, LinkedHashSet<String> colHeaders, Map<Integer, QuantDatasetObject> quantDSArr) { popupBodyLayout.removeAllComponents(); patientsGroupArr = new DiseaseGroup[quantDSArr.size()]; int maxLabelWidth = -1; int i = 0;/*from w w w .java 2 s.c o m*/ for (QuantDatasetObject ds : quantDSArr.values()) { if (ds == null) { continue; } DiseaseGroup pg = new DiseaseGroup(); String pgI = ds.getPatientsGroup1(); pg.setPatientsGroupI(pgI); String label1; if (pgI.equalsIgnoreCase("Not Available") || pgI.equalsIgnoreCase("control")) { pgI = ""; } String subpgI = ds.getPatientsSubGroup1(); pg.setPatientsSubGroupI(subpgI); if (!subpgI.equalsIgnoreCase("") && !subpgI.equalsIgnoreCase("Not Available")) { pgI = subpgI; } label1 = pgI; pg.setPatientsGroupILabel(label1); String pgII = ds.getPatientsGroup2(); pg.setPatientsGroupII(pgII); String label2; if (pgII.equalsIgnoreCase("Not Available") || pgII.equalsIgnoreCase("control")) { pgII = ""; } String subpgII = ds.getPatientsSubGroup2(); pg.setPatientsSubGroupII(subpgII); if (!subpgII.equalsIgnoreCase("") && !subpgII.equalsIgnoreCase("Not Available")) { pgII = subpgII; } label2 = pgII; pg.setPatientsGroupIILabel(label2); if (label1.split("\n")[0].length() > maxLabelWidth) { maxLabelWidth = label1.length(); } if (label2.split("\n")[0].length() > maxLabelWidth) { maxLabelWidth = label2.length(); } patientsGroupArr[i] = pg; pg.setQuantDatasetIndex(i); pg.setOriginalDatasetIndex(ds.getDsKey()); i++; } int h = (Math.max(rowHeaders.size(), colHeaders.size()) * 27) + 150; int w = (maxLabelWidth * 10 * 2) + 72 + 50; if (Page.getCurrent().getBrowserWindowHeight() - 280 < h) { h = Page.getCurrent().getBrowserWindowHeight() - 280; } if (Page.getCurrent().getBrowserWindowWidth() < w) { w = Page.getCurrent().getBrowserWindowWidth(); } popupBodyLayout.setWidth((w - 50) + "px"); popupWindow.setWidth(w + "px"); popupWindow.setHeight(h + "px"); int subH = (h - 150); patientsGroupArr = Quant_Central_Manager.getDiseaseGroupsArray(); this.sortableDiseaseGroupI = new SortableLayoutContainer((w - 50), subH, " Disease Group A", rowHeaders, Quant_Central_Manager.getDiseaseStyleMap()); this.sortableDiseaseGroupII = new SortableLayoutContainer((w - 50), subH, " Disease Group B", colHeaders, Quant_Central_Manager.getDiseaseStyleMap()); this.initPopupBody((w - 50)); }
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)); }// w w w . j a v a 2 s . c o m } } 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.diseasegroupsfilters.StudiesInformationPopupBtn.java
@Override public void selectionChanged(String type) { if (type.equalsIgnoreCase("Comparison_Selection")) { datasetInfoLayoutDSIndexMap.clear(); Set<QuantDatasetObject> dsObjects = new TreeSet<QuantDatasetObject>(); int selectedDsNumber = 0; 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// w w w . j av a2 s . com .updateDatasetForm(Quant_Central_Manager.getFullQuantDatasetMap().get(dsId)); // datasetInfoLayout.setWidth("100%"); datasetInfoLayoutDSIndexMap.put(dsId, datasetInfoLayout); dsObjects.add(Quant_Central_Manager.getFullQuantDatasetMap().get(dsId)); } } } 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); } } studiesPopupLayout.updateDatasetInfoLayoutDSIndexMap(datasetInfoLayoutDSIndexMap); popupWindow.setCaption(" Study Information (" + selectedDsNumber + ")"); studiesPopupLayout.setInformationData(dsObjects); } }
From source file:probe.com.view.body.quantdatasetsoverview.quantproteinstabsheet.peptidescontainer.StudyInformationPopupComponent.java
/** * * @param width// www . j a va2s .c o m * @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.quantdatasetsoverview.quantproteinstabsheet.studies.PeptidesComparisonsSequenceLayout.java
/** * * @param cp//from ww w . j av a 2 s . c o m * @param width * @param Quant_Central_Manager */ public PeptidesComparisonsSequenceLayout(QuantCentralManager Quant_Central_Manager, final DiseaseGroupsComparisonsProteinLayout cp, int width) { this.studiesMap = new LinkedHashMap<String, StudyInfoData>(); this.setColumns(4); this.setRows(3); this.setWidthUndefined(); this.setSpacing(true); this.setMargin(new MarginInfo(true, false, false, false)); comparisonTitle = new Label(); comparisonTitle.setContentMode(ContentMode.HTML); comparisonTitle.setStyleName("custChartLabelHeader"); comparisonTitle.setWidth((width - 55) + "px"); this.addComponent(comparisonTitle, 1, 0); this.setComponentAlignment(comparisonTitle, Alignment.TOP_LEFT); closeBtn = new VerticalLayout(); closeBtn.setWidth("20px"); closeBtn.setHeight("20px"); closeBtn.setStyleName("closebtn"); this.addComponent(closeBtn, 2, 0); this.setComponentAlignment(closeBtn, Alignment.TOP_RIGHT); //end of toplayout //init comparison study layout GridLayout proteinSequenceComparisonsContainer = new GridLayout(2, cp.getComparison().getDatasetIndexes().length); proteinSequenceComparisonsContainer.setWidthUndefined(); proteinSequenceComparisonsContainer.setHeightUndefined(); proteinSequenceComparisonsContainer.setStyleName(Reindeer.LAYOUT_WHITE); proteinSequenceComparisonsContainer.setSpacing(true); proteinSequenceComparisonsContainer.setMargin(new MarginInfo(true, false, false, false)); this.addComponent(proteinSequenceComparisonsContainer, 1, 1); coverageWidth = (width - 100 - 180); Map<Integer, Set<QuantPeptide>> dsQuantPepMap = new HashMap<Integer, Set<QuantPeptide>>(); for (QuantPeptide quantPep : cp.getQuantPeptidesList()) { if (!dsQuantPepMap.containsKey(quantPep.getDsKey())) { Set<QuantPeptide> subList = new HashSet<QuantPeptide>(); dsQuantPepMap.put(quantPep.getDsKey(), subList); } Set<QuantPeptide> subList = dsQuantPepMap.get(quantPep.getDsKey()); subList.add(quantPep); dsQuantPepMap.put(quantPep.getDsKey(), subList); } int numb = 0; int panelWidth = Page.getCurrent().getBrowserWindowWidth() - 100; String groupCompTitle = cp.getComparison().getComparisonHeader(); String updatedHeader = groupCompTitle.split(" / ")[0].split("\n")[0] + " / " + groupCompTitle.split(" / ")[1].split("\n")[0];//+ " ( " + groupCompTitle.split(" / ")[1].split("\n")[1] + " )"; ; final StudyInformationPopupComponent studyInformationPopupPanel = new StudyInformationPopupComponent( panelWidth, cp.getProtName(), cp.getUrl(), cp.getComparison().getComparisonFullName()); studyInformationPopupPanel.setVisible(false); LayoutEvents.LayoutClickListener studyListener = new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { Integer dsId; if (event.getComponent() instanceof AbsoluteLayout) { dsId = (Integer) ((AbsoluteLayout) event.getComponent()).getData(); } else { dsId = (Integer) ((VerticalLayout) event.getComponent()).getData(); } studyInformationPopupPanel.updateContent(dsToStudyLayoutMap.get(dsId)); } }; TreeSet<QuantProtein> orderSet = new TreeSet<QuantProtein>(cp.getDsQuantProteinsMap().values()); for (QuantProtein quantProtein : orderSet) { StudyInfoData exportData = new StudyInfoData(); exportData.setCoverageWidth(coverageWidth); Label studyTitle = new Label();//"Study " + (numb + 1)); studyTitle.setStyleName("peptideslayoutlabel"); studyTitle.setHeightUndefined(); studyTitle.setWidth("200px"); Label iconTitle = new Label("#Patients (" + (quantProtein.getPatientsGroupIINumber() + quantProtein.getPatientsGroupINumber()) + ")"); exportData.setSubTitle(iconTitle.getValue()); iconTitle.setStyleName("peptideslayoutlabel"); iconTitle.setHeightUndefined(); if (quantProtein.getStringPValue().equalsIgnoreCase("Not Significant") || quantProtein.getStringFCValue().equalsIgnoreCase("Not regulated")) { iconTitle.setStyleName("notregicon"); exportData.setTrend(0); } else if (quantProtein.getStringFCValue().equalsIgnoreCase("Decreased")) { iconTitle.setStyleName("downarricon"); exportData.setTrend(-1); } else { exportData.setTrend(1); iconTitle.setStyleName("uparricon"); } iconTitle.setDescription(cp.getProteinAccssionNumber() + " : #Patients (" + (quantProtein.getPatientsGroupIINumber() + quantProtein.getPatientsGroupINumber()) + ") " + quantProtein.getStringFCValue() + " " + quantProtein.getStringPValue() + ""); VerticalLayout labelContainer = new VerticalLayout(); labelContainer.addComponent(studyTitle); labelContainer.addComponent(iconTitle); proteinSequenceComparisonsContainer.addComponent(labelContainer, 0, numb); proteinSequenceComparisonsContainer.setComponentAlignment(labelContainer, Alignment.TOP_CENTER); Map<Integer, ComparisonDetailsBean> patientGroupsNumToDsIdMap = new HashMap<Integer, ComparisonDetailsBean>(); ComparisonDetailsBean pGr = new ComparisonDetailsBean(); patientGroupsNumToDsIdMap .put((quantProtein.getPatientsGroupIINumber() + quantProtein.getPatientsGroupINumber()), pGr); QuantDatasetObject ds; ds = Quant_Central_Manager.getFullQuantDatasetMap().get(quantProtein.getDsKey()); StudyPopupLayout study = new StudyPopupLayout(panelWidth, quantProtein, ds, cp.getProteinAccssionNumber(), cp.getUrl(), cp.getProtName(), Quant_Central_Manager.getDiseaseHashedColorMap()); Set<QuantDatasetObject> qdsSet = new HashSet<QuantDatasetObject>(); qdsSet.add(ds); study.setInformationData(qdsSet, cp); dsToStudyLayoutMap.put(ds.getDsKey(), study); labelContainer.addLayoutClickListener(studyListener); labelContainer.setData(ds.getDsKey()); studyTitle.setValue("[" + (numb + 1) + "] " + ds.getAuthor()); exportData.setTitle(ds.getAuthor()); if (dsQuantPepMap.get(quantProtein.getDsKey()) == null) { Label noPeptidesInfoLabel = new Label("No Peptide Information Available "); noPeptidesInfoLabel.setHeightUndefined(); noPeptidesInfoLabel.setStyleName("peptideslayoutlabel"); VerticalLayout labelValueContainer = new VerticalLayout(); labelValueContainer.addComponent(noPeptidesInfoLabel); labelValueContainer.addLayoutClickListener(studyListener); labelValueContainer.setData(ds.getDsKey()); proteinSequenceComparisonsContainer.addComponent(labelValueContainer, 1, numb); proteinSequenceComparisonsContainer.setComponentAlignment(labelValueContainer, Alignment.TOP_CENTER); numb++; studiesMap.put((numb + 1) + ds.getAuthor(), exportData); continue; } String key = "_-_" + quantProtein.getDsKey() + "_-_" + cp.getProteinAccssionNumber() + "_-_"; PeptidesInformationOverviewLayout peptideInfoLayout = new PeptidesInformationOverviewLayout( cp.getSequence(), dsQuantPepMap.get(quantProtein.getDsKey()), coverageWidth, true, studyListener, ds.getDsKey()); exportData.setPeptidesInfoList(peptideInfoLayout.getStackedPeptides()); exportData.setLevelsNumber(peptideInfoLayout.getLevel()); hasPTM = peptideInfoLayout.isHasPTM(); peptidesInfoLayoutDSIndexMap.put(key, peptideInfoLayout); proteinSequenceComparisonsContainer.addComponent(peptideInfoLayout, 1, numb); numb++; studiesMap.put((numb + 1) + ds.getAuthor(), exportData); } String rgbColor = Quant_Central_Manager .getDiseaseHashedColor(groupCompTitle.split(" / ")[1].split("\n")[1]); comparisonTitle.setValue("<font color='" + rgbColor + "' style='font-weight: bold;'>" + updatedHeader + " (#Datasets " + numb + "/" + cp.getComparison().getDatasetIndexes().length + ")</font>"); comparisonTitle.setDescription(cp.getComparison().getComparisonFullName()); VerticalLayout bottomSpacer = new VerticalLayout(); bottomSpacer.setWidth((width - 100) + "px"); bottomSpacer.setHeight("10px"); bottomSpacer.setStyleName("dottedline"); this.addComponent(bottomSpacer, 1, 2); }
From source file:probe.com.view.body.quantdatasetsoverview.quantproteinstabsheet.studies.PeptidesStackedBarChartsControler.java
/** * * @param width//from ww w.j a v a2 s . co m * @param patientGroupsNumToDsIdMap * @param protAccsession * @param protName * @param url * @param comparisonHeader * @param datasetQuantProteinsMap * @param datasetIdDsObjectProteinsMap */ public PeptidesStackedBarChartsControler(int width, Map<Integer, ComparisonDetailsBean> patientGroupsNumToDsIdMap, String protAccsession, String protName, String url, String comparisonHeader, Map<String, QuantProtein> datasetQuantProteinsMap, Map<String, QuantDatasetObject> datasetIdDsObjectProteinsMap, Map<String, String> diseaseHashedColorMap) { int panelWidth = Page.getCurrent().getBrowserWindowWidth() - 100; studyInformationPopupPanel = new StudyInformationPopupComponent(panelWidth, protName, url, comparisonHeader); studyInformationPopupPanel.setVisible(false); int counter = 0; for (int pateintGrNum : patientGroupsNumToDsIdMap.keySet()) { while (counter < 4) { if (!patientGroupsNumToDsIdMap.get(pateintGrNum).getRegulatedList(counter).isEmpty()) { StudyPopupLayout studyLayout = new StudyPopupLayout(panelWidth, datasetQuantProteinsMap, datasetIdDsObjectProteinsMap, protAccsession, url, protName, diseaseHashedColorMap); studyPopupLayoutDSIndexMap.put("_-_" + pateintGrNum + "_-_" + counter + "_-_", studyLayout); } counter++; } counter = 0; } }
From source file:probe.com.view.body.searching.quant.QuantDataSearchingTabLayout.java
/** * * @param searchQuantificationProtList/* w w w .ja v a 2s .co m*/ * @param CSFPR_Handler */ public QuantDataSearchingTabLayout(List<QuantProtein> searchQuantificationProtList, CSFPRHandler CSFPR_Handler) { QuantProtiensSearchingResultsLayout datasetOverviewTabLayout = new QuantProtiensSearchingResultsLayout( CSFPR_Handler, searchQuantificationProtList); this.setMargin(true); this.setWidth("100%"); int height = Page.getCurrent().getBrowserWindowHeight() - 100; this.setHeight(height + "px"); this.addComponent(datasetOverviewTabLayout); }
From source file:probe.com.view.body.searching.quant.QuantProtiensSearchingResultsLayout.java
/** * * @param CSFPR_Handler/*from ww w. j a va 2s . co m*/ * @param searchQuantificationProtList */ public QuantProtiensSearchingResultsLayout(CSFPRHandler CSFPR_Handler, List<QuantProtein> searchQuantificationProtList) { Quant_Central_Manager = new QuantCentralManager(CSFPR_Handler, searchQuantificationProtList);//,filterUtility.getFullFilterList() this.setMargin(true); this.setSpacing(true); this.setWidth("100%"); this.setHeightUndefined(); DiseaseGroupsFiltersContainer heatmapFilter = new DiseaseGroupsFiltersContainer(Quant_Central_Manager, CSFPR_Handler, searchQuantificationProtList, null); heatmapFilter.setWidth("100%"); heatmapFilter.setMargin(new MarginInfo(false, false, true, false)); String infoText = "Select an experiment in the roll down menu on top to view all proteins identified in the selected experiment. Select a protein to see below all Peptides identified for the protein, and if the experiment was based on SDS-PAGE, the proteins distribution in the gel is displayed under Fractions. To show information about the experiment, press Dataset Information. Use the search box to navigate in the experiment selected.</p><p style='font-family:verdana;color:black;margin-left:20px;margin-right:20px;'>Under Fractions, bar charts show the distribution of the selected protein across the fractions cut from the gel. Three charts show number of peptides, number of spectra and average precursor intensity. The fraction number represents the gel pieces cut from top to bottom. Protein standards <font color='#CDE1FF'>(light blue bars)</font> indicate the molecular weight range of each fraction. <font color='#79AFFF'>Darker blue bars</font> mark between which two standards the protein's theoretical mass suggests the protein should be found."; HideOnClickLayout DatasetFilteringContainer = new HideOnClickLayout("Datasets", heatmapFilter, null, infoText, CSFPR_Handler.getTipsGenerator().generateTipsBtn()); this.addComponent(DatasetFilteringContainer); DatasetFilteringContainer.setVisability(true); quantProteinsComparisonsContainer = new QuantProteinsComparisonsContainer(Quant_Central_Manager, CSFPR_Handler, searchQuantificationProtList); HideOnClickLayout comparisonsTableContainer = new HideOnClickLayout("Proteins", quantProteinsComparisonsContainer, null, Alignment.TOP_LEFT, infoText, null); int pageWidth = Page.getCurrent().getBrowserWindowWidth(); int layoutWidth = (pageWidth - 95); quantProteinsComparisonsContainer.setLayoutWidth(layoutWidth); this.addComponent(comparisonsTableContainer); comparisonsTableContainer.setVisability(true); proteinsLayout = new QuantProteinsTabsheetContainerLayout(Quant_Central_Manager, true, CSFPR_Handler); HideOnClickLayout proteinsLevelLayout = new HideOnClickLayout("Protein Information", proteinsLayout, null, infoText, null); this.addComponent(proteinsLevelLayout); proteinsLevelLayout.setVisability(true); final SizeReporter sizeReporter = new SizeReporter(proteinsLevelLayout); sizeReporter.addResizeListener(new ComponentResizeListener() { private int resizedCounter = 0; @Override public void sizeChanged(ComponentResizeEvent event) { if (resizedCounter == 3) { UI.getCurrent().scrollIntoView(QuantProtiensSearchingResultsLayout.this); sizeReporter.removeResizeListener(this); } resizedCounter++; } }); CSFPR_Handler.getTipsGenerator().showTips(); // heatmapFilter.popupSortAndSelectPanel(); }
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;// ww w . j ava 2 s . c om 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"); }