List of usage examples for com.vaadin.ui VerticalLayout setDescription
public void setDescription(String description)
From source file:de.kaiserpfalzEdv.vaadin.about.AboutViewImpl.java
License:Apache License
private VerticalLayout createVerticalLayout(final String caption, final String description, Resource icon) { VerticalLayout result = new VerticalLayout(); result.setSizeFull();/*from w w w. ja va2 s . c om*/ result.setSpacing(true); result.setResponsive(true); if (caption != null) result.setCaption(presenter.translate(caption)); if (description != null) result.setDescription(presenter.translate(description)); if (icon != null) result.setIcon(icon); return result; }
From source file:probe.com.view.body.identificationdatasetsoverview.IdentificationDatasetLayout.java
@Override public void valueChange(Property.ValueChangeEvent event) { if (protTableLayout.getProteinTableComponent().getValue() != null) { proteinskey = (Integer) protTableLayout.getProteinTableComponent().getValue(); } else {//w ww. ja va2s . c o m return; } fractionsLayout.removeAllComponents(); peptidesLayout.removeAllComponents(); if (proteinLabel != null) { proteinLabel.rePaintLable("black"); } protTableLayout.setLastSelectedIndex(proteinskey); final Item item = protTableLayout.getProteinTableComponent().getItem(proteinskey); proteinLabel = (CustomExternalLink) item.getItemProperty("Accession").getValue(); proteinLabel.rePaintLable("white"); final String desc = (String) item.getItemProperty("Description").getValue(); final String accession = item.getItemProperty("Accession").getValue().toString(); final String otherAccession = (String) item.getItemProperty("Other Protein(s)").getValue(); ExporterBtnsGenerator dataExporter = new ExporterBtnsGenerator(CSFPR_Handler); VerticalLayout allPeptidesProteinsExportLayout = dataExporter.exportAllAvailablePeptidesForProtein( accession, otherAccession, desc, true, "Export Peptides from All Datasets for ( " + accession + " )"); allPeptidesProteinsExportLayout .setDescription("Export CSF-PR peptides for ( " + accession + " ) from all datasets"); VerticalLayout datasetProteinsExportLayout = dataExporter.exportDatasetProteins(datasetId, true, "Export all proteins from selected dataset"); datasetProteinsExportLayout.setDescription( "Export all proteins from ( " + CSFPR_Handler.getDataset(datasetId).getName() + " ) dataset"); protTableLayout.setExpBtnProtAllPepTable(allPeptidesProteinsExportLayout, datasetProteinsExportLayout); if (proteinskey >= 0) { Map<Integer, IdentificationPeptideBean> peptideProteintList = CSFPR_Handler .getIdentificationProteinPeptidesList(datasetId, accession, otherAccession); if (!peptideProteintList.isEmpty()) { int validPep = CSFPR_Handler.countValidatedPeptidesNumber(peptideProteintList); if (peptideTableLayout != null) { peptidesLayout.removeComponent(peptideTableLayout); } peptideTableLayout = new IdentificationPeptidesTableLayout(validPep, peptideProteintList.size(), desc, peptideProteintList, accession, CSFPR_Handler.getDataset(datasetId).getName()); peptideTableLayout.setHeight("" + protTableLayout.getHeight()); peptidesLayout.setHeight("" + protTableLayout.getHeight()); peptidesLayout.addComponent(peptideTableLayout); VerticalLayout proteinPeptidesExportLayout = dataExporter.exportPeptidesForProtein(datasetId, accession, otherAccession, desc, peptideProteintList, true, "Export peptides from selected dataset for ( " + accession + " )"); proteinPeptidesExportLayout.setDescription("Export peptides from ( " + CSFPR_Handler.getDataset(datasetId).getName() + " ) dataset for ( " + accession + " )"); peptideTableLayout.setExportingBtnForIdentificationPeptidesTable(proteinPeptidesExportLayout); } List<StandardIdentificationFractionPlotProteinBean> standerdProtList = CSFPR_Handler .getStandardIdentificationFractionProteinsList(datasetId); int fractionsNumber = CSFPR_Handler.getDataset(datasetId).getFractionsNumber(); if (fractionsNumber == 0 || datasetId == 0 || standerdProtList == null || standerdProtList.isEmpty()) { fractionsLayout.removeAllComponents(); if (protTableLayout.getProteinTableComponent() != null) { protTableLayout.getProteinTableComponent().setHeight("267.5px"); protTableLayout.setProtTableHeight("267.5px"); } if (peptideTableLayout.getPepTable() != null) { peptideTableLayout.getPepTable().setHeight("267.5px"); peptideTableLayout.setPeptideTableHeight("267.5px"); } } else { fractionsLayout.removeAllComponents(); Map<Integer, IdentificationProteinBean> fractionsList = CSFPR_Handler .getIdentificationProteinsGelFractionsList(datasetId, accession, otherAccession); if (fractionsList != null && !fractionsList.isEmpty()) { double mw = 0.0; try { mw = Double.valueOf(item.getItemProperty("MW").toString()); } catch (NumberFormatException e) { String str = item.getItemProperty("MW").toString(); String[] strArr = str.split(","); if (strArr.length > 1) { str = strArr[0] + "." + strArr[1]; } mw = Double.valueOf(str); } IdentificationGelFractionsLayout gelFractionLayout = new IdentificationGelFractionsLayout( CSFPR_Handler, accession, mw, fractionsList, standerdProtList, CSFPR_Handler.getDataset(datasetId).getName()); gelFractionLayout.setMargin(new MarginInfo(false, false, false, true)); fractionsLayout.addComponent(gelFractionLayout); } } } }
From source file:probe.com.view.body.QuantCompareDataLayout.java
private VerticalLayout initProteinsDataCapture(int width) { VerticalLayout proteinsDataCapturingMainLayout = new VerticalLayout(); proteinsDataCapturingMainLayout.setSpacing(true); proteinsDataCapturingMainLayout.setMargin(true); String containerWidth = ((width * 2) + 10) + "px"; proteinsDataCapturingMainLayout.setWidth(containerWidth); proteinsDataCapturingMainLayout.setSpacing(true); Label titleLabel = new Label("2. Insert UniProt Proteins Accessions"); titleLabel.setContentMode(ContentMode.HTML); titleLabel.setStyleName("normalheader"); titleLabel.setHeight("20px"); proteinsDataCapturingMainLayout.addComponent(titleLabel); proteinsDataCapturingMainLayout.setComponentAlignment(titleLabel, Alignment.TOP_LEFT); GridLayout insertProteinsLayout = new GridLayout(3, 3); proteinsDataCapturingMainLayout.addComponent(insertProteinsLayout); insertProteinsLayout.setSpacing(true); insertProteinsLayout.setMargin(new MarginInfo(false, false, false, false)); insertProteinsLayout.setWidth(containerWidth); HorizontalLayout hlo1 = new HorizontalLayout(); hlo1.setWidth("100%"); hlo1.setMargin(new MarginInfo(false, true, false, false)); Label highLabel = new Label("<font color='#cc0000'> High</font>"); highLabel.setWidth("40px"); highLabel.setContentMode(ContentMode.HTML); hlo1.addComponent(highLabel);// w w w . ja va2 s. co m HorizontalLayout hlo2 = new HorizontalLayout(); hlo2.setWidth("100%"); hlo2.setMargin(new MarginInfo(false, true, false, false)); Label stableLabel = new Label("<font color='#018df4'> Stable</font>"); stableLabel.setWidth("50px"); stableLabel.setContentMode(ContentMode.HTML); hlo2.addComponent(stableLabel); HorizontalLayout hlo3 = new HorizontalLayout(); hlo3.setWidth("100%"); hlo3.setMargin(new MarginInfo(false, true, false, false)); Label lowLabel = new Label("<font color='#009900'> Low</font>"); lowLabel.setWidth("40px"); lowLabel.setContentMode(ContentMode.HTML); hlo3.addComponent(lowLabel); insertProteinsLayout.addComponent(hlo1, 0, 0); insertProteinsLayout.setComponentAlignment(hlo1, Alignment.MIDDLE_CENTER); insertProteinsLayout.addComponent(hlo2, 1, 0); insertProteinsLayout.setComponentAlignment(hlo2, Alignment.MIDDLE_CENTER); insertProteinsLayout.addComponent(hlo3, 2, 0); insertProteinsLayout.setComponentAlignment(hlo3, Alignment.MIDDLE_CENTER); highTextArea.setWidth("100%"); highTextArea.setHeight("200px"); insertProteinsLayout.addComponent(highTextArea, 0, 1); insertProteinsLayout.setComponentAlignment(highTextArea, Alignment.MIDDLE_CENTER); stableTextArea.setWidth("100%"); stableTextArea.setHeight("200px"); insertProteinsLayout.addComponent(stableTextArea, 1, 1); insertProteinsLayout.setComponentAlignment(stableTextArea, Alignment.MIDDLE_CENTER); lowTextArea.setWidth("100%"); lowTextArea.setHeight("200px"); insertProteinsLayout.addComponent(lowTextArea, 2, 1); insertProteinsLayout.setComponentAlignment(lowTextArea, Alignment.MIDDLE_CENTER); VerticalLayout clear1 = new VerticalLayout(); hlo1.addComponent(clear1); clear1.setDescription("Clear field"); clear1.setStyleName("clearfieldbtn"); clear1.setWidth("20px"); clear1.setHeight("20px"); // insertProteinsLayout.addComponent(clear1, 0, 2); hlo1.setComponentAlignment(clear1, Alignment.MIDDLE_RIGHT); clear1.addLayoutClickListener(new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { highTextArea.clear(); } }); VerticalLayout clear2 = new VerticalLayout(); hlo2.addComponent(clear2); clear2.setDescription("Clear field"); clear2.setStyleName("clearfieldbtn"); clear2.setWidth("20px"); clear2.setHeight("20px"); clear2.addLayoutClickListener(new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { stableTextArea.clear(); } }); hlo2.setComponentAlignment(clear2, Alignment.MIDDLE_RIGHT); VerticalLayout clear3 = new VerticalLayout(); hlo3.addComponent(clear3); clear3.setDescription("Clear field"); clear3.setStyleName("clearfieldbtn"); clear3.setWidth("20px"); clear3.setHeight("20px"); clear3.addLayoutClickListener(new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { lowTextArea.clear(); } }); hlo3.setComponentAlignment(clear3, Alignment.MIDDLE_RIGHT); Label errorLabel = new Label(); proteinsDataCapturingMainLayout.addComponent(errorLabel); HorizontalLayout btnsLayout = new HorizontalLayout(); btnsLayout.setSpacing(true); btnsLayout.setMargin(new MarginInfo(true, false, false, false)); proteinsDataCapturingMainLayout.addComponent(btnsLayout); proteinsDataCapturingMainLayout.setComponentAlignment(btnsLayout, Alignment.MIDDLE_RIGHT); Button sampleBtn = new Button("Sample"); sampleBtn.setStyleName(Reindeer.BUTTON_SMALL); btnsLayout.addComponent(sampleBtn); sampleBtn.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { reset(); highTextArea.setValue(highAcc); lowTextArea.setValue(lowAcc); stableTextArea.setValue(stableAcc); diseaseGroupsListA.select("Group A"); diseaseGroupsListB.select("Group B"); compareBtn.focus(); } }); Button resetBtn = new Button("Reset"); resetBtn.setStyleName(Reindeer.BUTTON_SMALL); btnsLayout.addComponent(resetBtn); resetBtn.setId("resetBtn"); resetBtn.addClickListener(this); compareBtn = new Button("Compare"); compareBtn.setStyleName(Reindeer.BUTTON_SMALL); btnsLayout.addComponent(compareBtn); compareBtn.setId("compareBtn"); compareBtn.addClickListener(this); // highTextArea.setValue(highAcc); // lowTextArea.setValue(lowAcc); // stableTextArea.setValue(stableAcc); return proteinsDataCapturingMainLayout; }
From source file:probe.com.view.body.quantdatasetsoverview.diseasegroupsfilters.ComparisonsSelectionOverviewBubbleChart.java
public ComparisonsSelectionOverviewBubbleChart(final QuantCentralManager Quant_Central_Manager, final CSFPRHandler CSFPR_Handler, int chartWidth, int chartHeight, Set<QuantDiseaseGroupsComparison> selectedComparisonList, List<QuantProtein> searchQuantificationProtList) { userDataCounter = 0;/*w w w . j a v a2s.co m*/ this.searchQuantificationProtList = searchQuantificationProtList; Map<String, String> diseaseHashedColorMap = Quant_Central_Manager.getDiseaseHashedColorMap(); for (String str : diseaseHashedColorMap.keySet()) { diseaseColorMap.put(str, Color.decode(diseaseHashedColorMap.get(str))); } this.width = chartWidth; this.height = 600; this.CSFPR_Handler = CSFPR_Handler; this.setWidth(width + "px"); this.setHeightUndefined(); this.Quant_Central_Manager = Quant_Central_Manager; this.Quant_Central_Manager.registerStudySelectionListener(ComparisonsSelectionOverviewBubbleChart.this); this.setSpacing(true); //init toplayout topLayout.setHeight(30 + "px"); topLayout.setSpacing(true); topLayout.setMargin(new MarginInfo(false, false, true, false)); this.addComponent(topLayout); Label overviewLabel = new Label("<font style='margin-left :50px;'>Overview</font> "); overviewLabel.setContentMode(ContentMode.HTML); topLayout.addComponent(overviewLabel); overviewLabel.setStyleName("subtitle"); overviewLabel.setWidth("120px"); InfoPopupBtn info = new InfoPopupBtn( "The bubble chart give an overview for the proteins existed in the selected comparisons.<br/>The diameter of the bubble represents the number of the proteins in the selected comparison and the color represents the trend<br/>"); info.setWidth("16px"); info.setHeight("16px"); topLayout.addComponent(info); this.topLayout.setVisible(false); //end of toplayout //init chartlayout this.chartLayoutContainer.setVisible(false); this.addComponent(chartLayoutContainer); chartLayoutContainer.setWidth(width + "px"); chartLayoutContainer.setHeight(height + "px"); chartLayoutContainer.addComponent(chartImage, "left: " + 0 + "px; top: " + 0 + "px;"); chartLayoutContainer.addComponent(chartLayout, "left: " + 0 + "px; top: " + 0 + "px;"); chartLayout.setWidth(width + "px"); chartLayout.setHeight(height + "px"); chartLayout.addLayoutClickListener(ComparisonsSelectionOverviewBubbleChart.this); //end of chartlayout //init bottomlayout bottomLayout.setWidth("100%"); this.addComponent(bottomLayout); this.setComponentAlignment(bottomLayout, Alignment.BOTTOM_RIGHT); bottomLayout.setVisible(false); HorizontalLayout btnContainerLayout = new HorizontalLayout(); btnContainerLayout.setSpacing(true); // btnContainerLayout.setMargin(new MarginInfo(false, false, false, false)); btnContainerLayout.setWidthUndefined(); btnContainerLayout.setHeightUndefined(); // btnContainerLayout.addStyleName("leftspacer"); bottomLayout.addComponent(btnContainerLayout); bottomLayout.setComponentAlignment(btnContainerLayout, Alignment.TOP_RIGHT); TrendLegend legendLayout = new TrendLegend("bubblechart"); legendLayout.setWidthUndefined(); legendLayout.setHeight("24px"); btnContainerLayout.addComponent(legendLayout); btnContainerLayout.setComponentAlignment(legendLayout, Alignment.TOP_RIGHT); // btnContainerLayout.setExpandRatio(legendLayout, 600); // btnContainerLayout.setExpandRatio(btnContainerLayout, 210); // VerticalLayout stableBtnWrapper = new VerticalLayout(); //// stableBtnWrapper.setWidth("64px"); // HorizontalLayout stableBtn = new HorizontalLayout(); // stableBtnWrapper.addComponent(stableBtn); // stableBtnWrapper.setComponentAlignment(stableBtn, Alignment.TOP_LEFT); // btnContainerLayout.addComponent(stableBtnWrapper); groupSwichBtn = new GroupSwichBtn(Quant_Central_Manager, searchQuantificationProtList); btnContainerLayout.addComponent(groupSwichBtn); final VerticalLayout appliedIcon = new VerticalLayout(); appliedIcon.setStyleName("appliedicon"); appliedIcon.setWidth("24px"); appliedIcon.setHeight("24px"); appliedIcon.setDescription("Hide stable proteins"); btnContainerLayout.addComponent(appliedIcon); // stableBtn.setStyleName("stablebtn"); // stableBtn.setHeight("24px"); // Label stableLabel = new Label("Equal"); // stableLabel.setWidth("44px"); // stableBtn.addComponent(stableLabel); appliedIcon.addLayoutClickListener(new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { if (appliedIcon.getStyleName().equalsIgnoreCase("appliedicon")) { appliedIcon.setStyleName("unappliedicon"); Quant_Central_Manager.updateSignificantOnlySelection(true); appliedIcon.setDescription("Show stable proteins"); } else { appliedIcon.setStyleName("appliedicon"); Quant_Central_Manager.updateSignificantOnlySelection(false); appliedIcon.setDescription("Hide stable proteins"); } } }); exportPdfBtn = new Button(""); exportPdfBtn.setWidth("24px"); exportPdfBtn.setHeight("24px"); exportPdfBtn.setPrimaryStyleName("exportpdfbtn"); exportPdfBtn.setDescription("Export chart image"); StreamResource myResource = createResource(); FileDownloader fileDownloader = new FileDownloader(myResource); fileDownloader.extend(exportPdfBtn); btnContainerLayout.addComponent(exportPdfBtn); VerticalLayout unselectAllBtn = new VerticalLayout(); unselectAllBtn.setStyleName("unselectallbtn"); btnContainerLayout.addComponent(unselectAllBtn); btnContainerLayout.setComponentAlignment(unselectAllBtn, Alignment.TOP_LEFT); unselectAllBtn.setDescription("Clear selection"); unselectAllBtn.addLayoutClickListener(new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { Quant_Central_Manager.setBubbleChartQuantProteinsSelection(new HashSet<String>(), ""); resetChart(); } }); final VerticalLayout selectMultiBtn = new VerticalLayout(); selectMultiBtn.setStyleName("selectmultiselectedbtn"); btnContainerLayout.addComponent(selectMultiBtn); btnContainerLayout.setComponentAlignment(selectMultiBtn, Alignment.TOP_LEFT); selectMultiBtn.setDescription("Multiple selection"); activeMultiSelect = true; selectMultiBtn.addLayoutClickListener(new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { if (selectMultiBtn.getStyleName().equalsIgnoreCase("selectmultiselectedbtn")) { selectMultiBtn.setStyleName("selectmultibtn"); activeMultiSelect = false; } else { selectMultiBtn.setStyleName("selectmultiselectedbtn"); activeMultiSelect = true; } } }); //end of btns layout //init empty layout emptySelectionLayout = new VerticalLayout(); this.addComponent(emptySelectionLayout); emptySelectionLayout.setWidth(100 + "%"); emptySelectionLayout.setHeightUndefined(); VerticalLayout spacer = new VerticalLayout(); spacer.setHeight("100px"); spacer.setWidth("10px"); spacer.setStyleName(Reindeer.LAYOUT_WHITE); emptySelectionLayout.addComponent(spacer); emptySelectionLayout.setComponentAlignment(spacer, Alignment.BOTTOM_RIGHT); Label startLabel = new Label( "<center><h2 style='color:gray;'><b>Select comparison from the table</b></h2></center>"); startLabel.setContentMode(ContentMode.HTML); emptySelectionLayout.addComponent(startLabel); emptySelectionLayout.setComponentAlignment(startLabel, Alignment.MIDDLE_CENTER); Image handleft = new Image(); handleft.setSource(new ThemeResource("img/handleft.png")); emptySelectionLayout.addComponent(handleft); emptySelectionLayout.setComponentAlignment(handleft, Alignment.MIDDLE_CENTER); //init bubble chart }
From source file:probe.com.view.body.quantdatasetsoverview.diseasegroupsfilters.ComparisonsSelectionOverviewBubbleChart.java
public ComparisonsSelectionOverviewBubbleChart(final QuantCentralManager Quant_Central_Manager, final CSFPRHandler CSFPR_Handler, int chartWidth, int chartHeight, Set<QuantDiseaseGroupsComparison> selectedComparisonList, List<QuantProtein> searchQuantificationProtList, QuantDiseaseGroupsComparison userCustomizedComparison) { this.userCustomizedComparison = userCustomizedComparison; userDataCounter = 1;/* ww w . j a va2 s . c om*/ this.searchQuantificationProtList = searchQuantificationProtList; Map<String, String> diseaseHashedColorMap = Quant_Central_Manager.getDiseaseHashedColorMap(); for (String str : diseaseHashedColorMap.keySet()) { diseaseColorMap.put(str, Color.decode(diseaseHashedColorMap.get(str))); } this.width = chartWidth; this.height = 600; this.CSFPR_Handler = CSFPR_Handler; this.setWidth(width + "px"); this.setHeightUndefined(); this.Quant_Central_Manager = Quant_Central_Manager; this.Quant_Central_Manager.registerStudySelectionListener(ComparisonsSelectionOverviewBubbleChart.this); this.setSpacing(true); //init toplayout topLayout.setHeight(30 + "px"); topLayout.setSpacing(true); topLayout.setMargin(new MarginInfo(false, false, true, false)); this.addComponent(topLayout); Label overviewLabel = new Label("<font style='margin-left :50px;'>Overview</font> "); overviewLabel.setContentMode(ContentMode.HTML); topLayout.addComponent(overviewLabel); overviewLabel.setStyleName("subtitle"); overviewLabel.setWidth("120px"); InfoPopupBtn info = new InfoPopupBtn( "The bubble chart give an overview for the proteins existed in the selected comparisons.<br/>The diameter of the bubble represents the number of the proteins in the selected comparison and the color represents the trend<br/>"); info.setWidth("16px"); info.setHeight("16px"); topLayout.addComponent(info); //end of toplayout //init chartlayout this.chartLayoutContainer.setVisible(false); this.addComponent(chartLayoutContainer); this.addComponent(chartLayoutContainer); chartLayoutContainer.setWidth(width + "px"); chartLayoutContainer.setHeight(height + "px"); chartLayoutContainer.addComponent(chartImage, "left: " + 0 + "px; top: " + 0 + "px;"); chartLayoutContainer.addComponent(chartLayout, "left: " + 0 + "px; top: " + 0 + "px;"); chartLayout.setWidth(width + "px"); chartLayout.setHeight(height + "px"); chartLayout.addLayoutClickListener(ComparisonsSelectionOverviewBubbleChart.this); //end of chartlayout //init bottomlayout bottomLayout.setWidth("100%"); this.addComponent(bottomLayout); this.setComponentAlignment(bottomLayout, Alignment.BOTTOM_RIGHT); bottomLayout.setVisible(false); HorizontalLayout btnContainerLayout = new HorizontalLayout(); btnContainerLayout.setSpacing(true); // btnContainerLayout.setMargin(new MarginInfo(false, false, false, false)); btnContainerLayout.setWidthUndefined(); btnContainerLayout.setHeightUndefined(); // btnContainerLayout.addStyleName("leftspacer"); bottomLayout.addComponent(btnContainerLayout); bottomLayout.setComponentAlignment(btnContainerLayout, Alignment.TOP_RIGHT); TrendLegend legendLayout = new TrendLegend("bubblechart"); legendLayout.setWidthUndefined(); legendLayout.setHeight("24px"); btnContainerLayout.addComponent(legendLayout); btnContainerLayout.setComponentAlignment(legendLayout, Alignment.TOP_RIGHT); Quant_Central_Manager.insertNoftfication("Quantitative Datasets", "Remeber you can flip the disease group comparisons using (Swich disease groups button)<img src='VAADIN/themes/dario-theme/img/flip-v-updated.png' height='25px' width='25' alt='Reorder and select' Align='center'/> ", width, width, "flipnotification"); // btnContainerLayout.setExpandRatio(legendLayout, 600); // btnContainerLayout.setExpandRatio(btnContainerLayout, 210); // VerticalLayout stableBtnWrapper = new VerticalLayout(); //// stableBtnWrapper.setWidth("64px"); // HorizontalLayout stableBtn = new HorizontalLayout(); // stableBtnWrapper.addComponent(stableBtn); // stableBtnWrapper.setComponentAlignment(stableBtn, Alignment.TOP_LEFT); // btnContainerLayout.addComponent(stableBtnWrapper); groupSwichBtn = new GroupSwichBtn(Quant_Central_Manager, searchQuantificationProtList); btnContainerLayout.addComponent(groupSwichBtn); final VerticalLayout appliedIcon = new VerticalLayout(); appliedIcon.setStyleName("appliedicon"); appliedIcon.setWidth("24px"); appliedIcon.setHeight("24px"); appliedIcon.setDescription("Hide stable proteins"); btnContainerLayout.addComponent(appliedIcon); // stableBtn.setStyleName("stablebtn"); // stableBtn.setHeight("24px"); // Label stableLabel = new Label("Equal"); // stableLabel.setWidth("44px"); // stableBtn.addComponent(stableLabel); appliedIcon.addLayoutClickListener(new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { if (appliedIcon.getStyleName().equalsIgnoreCase("appliedicon")) { appliedIcon.setStyleName("unappliedicon"); Quant_Central_Manager.updateSignificantOnlySelection(true); appliedIcon.setDescription("Show stable proteins"); } else { appliedIcon.setStyleName("appliedicon"); Quant_Central_Manager.updateSignificantOnlySelection(false); appliedIcon.setDescription("Hide stable proteins"); } } }); exportPdfBtn = new Button(""); exportPdfBtn.setWidth("24px"); exportPdfBtn.setHeight("24px"); exportPdfBtn.setPrimaryStyleName("exportpdfbtn"); exportPdfBtn.setDescription("Export chart image"); StreamResource myResource = createResource(); FileDownloader fileDownloader = new FileDownloader(myResource); fileDownloader.extend(exportPdfBtn); btnContainerLayout.addComponent(exportPdfBtn); VerticalLayout unselectAllBtn = new VerticalLayout(); unselectAllBtn.setStyleName("unselectallbtn"); btnContainerLayout.addComponent(unselectAllBtn); btnContainerLayout.setComponentAlignment(unselectAllBtn, Alignment.TOP_LEFT); unselectAllBtn.setDescription("Clear selection"); unselectAllBtn.addLayoutClickListener(new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { Quant_Central_Manager.setBubbleChartQuantProteinsSelection(new HashSet<String>(), ""); resetChart(); } }); final VerticalLayout selectMultiBtn = new VerticalLayout(); selectMultiBtn.setStyleName("selectmultiselectedbtn"); btnContainerLayout.addComponent(selectMultiBtn); btnContainerLayout.setComponentAlignment(selectMultiBtn, Alignment.TOP_LEFT); selectMultiBtn.setDescription("Multiple selection"); activeMultiSelect = true; selectMultiBtn.addLayoutClickListener(new LayoutEvents.LayoutClickListener() { @Override public void layoutClick(LayoutEvents.LayoutClickEvent event) { if (selectMultiBtn.getStyleName().equalsIgnoreCase("selectmultiselectedbtn")) { selectMultiBtn.setStyleName("selectmultibtn"); activeMultiSelect = false; } else { selectMultiBtn.setStyleName("selectmultiselectedbtn"); activeMultiSelect = true; } } }); //end of btns layout //init empty layout emptySelectionLayout = new VerticalLayout(); this.addComponent(emptySelectionLayout); emptySelectionLayout.setWidth(width + "px"); emptySelectionLayout.setHeightUndefined(); VerticalLayout spacer = new VerticalLayout(); spacer.setHeight("100px"); spacer.setWidth("10px"); spacer.setStyleName(Reindeer.LAYOUT_WHITE); emptySelectionLayout.addComponent(spacer); emptySelectionLayout.setComponentAlignment(spacer, Alignment.BOTTOM_RIGHT); Label startLabel = new Label( "<center><h2 style='color:gray;'><b>Select comparison from the table</b></h2></center>"); startLabel.setContentMode(ContentMode.HTML); emptySelectionLayout.addComponent(startLabel); emptySelectionLayout.setComponentAlignment(startLabel, Alignment.MIDDLE_CENTER); Image handleft = new Image(); handleft.setSource(new ThemeResource("img/handleft.png")); emptySelectionLayout.addComponent(handleft); emptySelectionLayout.setComponentAlignment(handleft, Alignment.MIDDLE_CENTER); }
From source file:probe.com.view.body.quantdatasetsoverview.diseasegroupsfilters.heatmap.HeatMapComponent.java
private VerticalLayout initDiseaseGroupLabel(String dName, int itemsNumb, boolean row) { VerticalLayout diseaseLabelContainer = new VerticalLayout(); Label label = new Label("<center><font color='#ffffff'>" + dName.replace("_", " ").replace("-", "'").replace("Disease", "") + "</font></center>"); label.setContentMode(ContentMode.HTML); if (row) {//from w w w .j a v a 2 s . c o m diseaseLabelContainer.setHeight((itemsNumb * heatmapCellWidth) + "px"); diseaseLabelContainer.setWidth("20px"); VerticalLayout rotateContainer = new VerticalLayout(); rotateContainer.setWidth((itemsNumb * heatmapCellWidth) + "px"); rotateContainer.setHeight("20px"); diseaseLabelContainer.addComponent(rotateContainer); rotateContainer.setStyleName("row_" + diseaseStyleMap.get(dName)); rotateContainer.addComponent(label); } else { diseaseLabelContainer.addComponent(label); diseaseLabelContainer.setWidth((itemsNumb * heatmapCellWidth) + "px"); diseaseLabelContainer.setHeight("20px"); diseaseLabelContainer.setStyleName(diseaseStyleMap.get(dName)); } diseaseLabelContainer.setDescription(dName.replace("_", " ").replace("-", "'")); return diseaseLabelContainer; }
From source file:probe.com.view.body.quantdatasetsoverview.diseasegroupsfilters.PopupInteractiveDSFiltersLayout.java
/** * * @param interactivePieChartFiltersContainerLayout *//*from w ww . j a v a2 s . com*/ public PopupInteractiveDSFiltersLayout( final StudiesPieChartFiltersContainerLayout interactivePieChartFiltersContainerLayout) { VerticalLayout datasetExplorerFiltersIcon = new VerticalLayout(); // datasetExplorerFiltersIcon.setWidth("45px"); // datasetExplorerFiltersIcon.setHeight("24px"); // Label btnTitle = new Label("Studies"); // datasetExplorerFiltersIcon.addComponent(btnTitle); datasetExplorerFiltersIcon.setStyleName("studyexplorer"); datasetExplorerFiltersIcon.setDescription("Dataset expolorer filter"); this.addComponent(datasetExplorerFiltersIcon); this.setComponentAlignment(datasetExplorerFiltersIcon, Alignment.BOTTOM_LEFT); datasetExplorerFiltersIcon.addLayoutClickListener(PopupInteractiveDSFiltersLayout.this); this.setHeightUndefined(); int height = Page.getCurrent().getBrowserWindowHeight() - 100; int width = Page.getCurrent().getBrowserWindowWidth() - 100; VerticalLayout popupBody = new VerticalLayout(); popupBody.setWidth((width) + "px"); popupBody.setHeightUndefined(); popupBody.setStyleName(Reindeer.LAYOUT_WHITE); this.interactivePieChartFiltersContainerLayout = interactivePieChartFiltersContainerLayout; popupWindow = new Window() { @Override public void close() { interactivePieChartFiltersContainerLayout.updateSelectionManager(true); popupWindow.setVisible(false); } }; 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(false); popupWindow.center(); popupWindow.setCaption( "<font color='gray' style='font-weight: bold;!important'> Dataset Explorer Filters</font>"); UI.getCurrent().addWindow(popupWindow); popupWindow.setPositionX(30); popupWindow.setPositionY(40); popupWindow.setCaptionAsHtml(true); popupWindow.setClosable(true); popupBody.setMargin(true); popupBody.setSpacing(true); popupBody.addComponent(interactivePieChartFiltersContainerLayout); }
From source file:probe.com.view.body.quantdatasetsoverview.quantproteinstabsheet.peptidescontainer.popupcomponents.PeptideSequenceContainer.java
private void checkAndMerge() { TreeMap<Integer, StackedBarPeptideComponent> finalUpdatedPeptidesCoverageMap = new TreeMap<Integer, StackedBarPeptideComponent>(); TreeMap<Integer, StackedBarPeptideComponent> orderedCompoMap = new TreeMap<Integer, StackedBarPeptideComponent>(); for (StackedBarPeptideComponent peptideLayout : allPeptidesStackedBarComponentsMap) { if (orderedCompoMap.containsKey(peptideLayout.getX0())) { StackedBarPeptideComponent toReplaceComp = orderedCompoMap.remove(peptideLayout.getX0()); if (toReplaceComp.getWidthArea() <= peptideLayout.getWidthArea()) { orderedCompoMap.put(peptideLayout.getX0(), peptideLayout); } else { orderedCompoMap.put(toReplaceComp.getX0(), toReplaceComp); }// w ww . ja v a 2 s . co m } else { orderedCompoMap.put(peptideLayout.getX0(), peptideLayout); } } if (orderedCompoMap.size() == 1) { StackedBarPeptideComponent peptideI = orderedCompoMap.firstEntry().getValue(); finalUpdatedPeptidesCoverageMap.put(peptideI.getX0(), peptideI); } else { TreeMap<Integer, StackedBarPeptideComponent> refrenceOrderedCompoMap = new TreeMap<Integer, StackedBarPeptideComponent>( orderedCompoMap); while (true) { boolean merge = false; for (int keyI : orderedCompoMap.navigableKeySet()) { StackedBarPeptideComponent peptideI = orderedCompoMap.get(keyI); TreeMap<Integer, StackedBarPeptideComponent> comparableOrderedCompoMap = new TreeMap<Integer, StackedBarPeptideComponent>( refrenceOrderedCompoMap); comparableOrderedCompoMap.remove(keyI); for (int keyII : comparableOrderedCompoMap.navigableKeySet()) { StackedBarPeptideComponent peptideII = comparableOrderedCompoMap.get(keyII); if (((Integer) peptideII.getParam("start")) == ((Integer) peptideI.getParam("end") + 1) || (((Integer) peptideI.getParam("start")) == ((Integer) peptideII.getParam("end") + 1))) { // int x0 = Math.min(peptideI.getX0(), peptideII.getX0()); int widthArea = peptideI.getWidthArea() + peptideII.getWidthArea(); String sequence; if (peptideI.getX0() < peptideII.getX0()) { sequence = peptideI.getParam("sequence").toString() + peptideII.getParam("sequence"); } else { sequence = peptideII.getParam("sequence").toString() + peptideI.getParam("sequence"); } StackedBarPeptideComponent updatedCoverComp = new StackedBarPeptideComponent(x0, widthArea, "", ""); refrenceOrderedCompoMap.remove(keyI); refrenceOrderedCompoMap.remove(keyII); updatedCoverComp.setParam("sequence", sequence); updatedCoverComp.setParam("start", Math.min(((Integer) peptideI.getParam("start")), ((Integer) peptideII.getParam("start")))); updatedCoverComp.setParam("end", Math.max(((Integer) peptideI.getParam("end")), ((Integer) peptideII.getParam("end")))); refrenceOrderedCompoMap.put(x0 + 10000, updatedCoverComp); merge = true; break; } else if (((Integer) peptideII.getParam("start") > (Integer) peptideI.getParam("start")) && ((Integer) peptideII.getParam("end") > (Integer) peptideI.getParam("end")) && ((Integer) peptideII.getParam("start") < (Integer) peptideI.getParam("end"))) { //// int x0 = Math.min(peptideI.getX0(), peptideII.getX0()); int widthArea = 0; String sequence; if (peptideI.getX0() < peptideII.getX0()) { sequence = peptideI.getParam("sequence").toString() + peptideII.getParam("sequence"); widthArea = peptideII.getWidthArea() + (peptideII.getX0() - peptideI.getX0()); } else { sequence = peptideII.getParam("sequence").toString() + peptideI.getParam("sequence"); widthArea = peptideI.getWidthArea() + (peptideI.getX0() - peptideII.getX0()); } StackedBarPeptideComponent updatedCoverComp = new StackedBarPeptideComponent(x0, widthArea, "", ""); refrenceOrderedCompoMap.remove(keyI); refrenceOrderedCompoMap.remove(keyII); updatedCoverComp.setParam("sequence", sequence); updatedCoverComp.setParam("start", Math.min(((Integer) peptideI.getParam("start")), ((Integer) peptideII.getParam("start")))); updatedCoverComp.setParam("end", Math.max(((Integer) peptideI.getParam("end")), ((Integer) peptideII.getParam("end")))); refrenceOrderedCompoMap.put(x0 + 10000, updatedCoverComp); merge = true; break; } else if (((Integer) peptideII.getParam("start") > (Integer) peptideI.getParam("start")) && ((Integer) peptideII.getParam("end") <= (Integer) peptideI.getParam("end"))) { int x0 = Math.min(peptideI.getX0(), peptideII.getX0()); int widthArea = 0; String sequence; if (peptideI.getParam("sequence").toString() .contains(peptideII.getParam("sequence").toString())) { widthArea = peptideI.getWidthArea(); sequence = peptideI.getParam("sequence").toString(); } else { widthArea = peptideII.getWidthArea(); sequence = peptideII.getParam("sequence").toString(); } StackedBarPeptideComponent updatedCoverComp = new StackedBarPeptideComponent(x0, widthArea, "", ""); refrenceOrderedCompoMap.remove(keyI); refrenceOrderedCompoMap.remove(keyII); updatedCoverComp.setParam("sequence", sequence); updatedCoverComp.setParam("start", Math.min(((Integer) peptideI.getParam("start")), ((Integer) peptideII.getParam("start")))); updatedCoverComp.setParam("end", Math.max(((Integer) peptideI.getParam("end")), ((Integer) peptideII.getParam("end")))); refrenceOrderedCompoMap.put(x0 + 10000, updatedCoverComp); merge = true; break; } } } if (merge) { orderedCompoMap.clear(); orderedCompoMap.putAll(refrenceOrderedCompoMap); } else { break; } } finalUpdatedPeptidesCoverageMap.putAll(refrenceOrderedCompoMap); } // LinkedHashMap<Integer, Integer> startEndMap = new LinkedHashMap<Integer, Integer>(); // LinkedHashMap<Integer, StackedBarPeptideComponent> stackedPepSet = new LinkedHashMap<Integer, StackedBarPeptideComponent>(); // LinkedHashMap<Integer, StackedBarPeptideComponent> orderedCompoMap = new LinkedHashMap<Integer, StackedBarPeptideComponent>(); // for (StackedBarPeptideComponent peptideLayout : allPeptidesStackedBarComponentsMap) { // int start = (Integer) peptideLayout.getParam("start"); // int end = (Integer) peptideLayout.getParam("end"); // if (!startEndMap.containsKey(start)) { // int x0 = peptideLayout.getX0(); // int widthArea = peptideLayout.getWidthArea(); // String sequence = peptideLayout.getParam("sequence").toString(); // StackedBarPeptideComponent updatedCoverComp = new StackedBarPeptideComponent(x0, widthArea, "", ""); // updatedCoverComp.setParam("sequence", sequence); // updatedCoverComp.setParam("start", peptideLayout.getParam("start")); // updatedCoverComp.setParam("end", peptideLayout.getParam("end")); // startEndMap.put(start, end); // stackedPepSet.put(start, peptideLayout); // } else { // StackedBarPeptideComponent updatedCoverComp = stackedPepSet.remove(start); // int x0 = peptideLayout.getX0(); // int widthArea ; // String sequence; // if (updatedCoverComp.getParam("sequence").toString().contains(peptideLayout.getParam("sequence").toString())) { // widthArea = updatedCoverComp.getWidthArea(); // sequence = updatedCoverComp.getParam("sequence").toString(); // } else { // widthArea = peptideLayout.getWidthArea(); // sequence = peptideLayout.getParam("sequence").toString(); // } // // StackedBarPeptideComponent updatedCoverCompI = new StackedBarPeptideComponent(x0, widthArea, "", ""); // updatedCoverCompI.setParam("sequence", sequence); // updatedCoverCompI.setParam("start", peptideLayout.getParam("start")); // updatedCoverCompI.setParam("end", Math.max((Integer)peptideLayout.getParam("end"),(Integer)updatedCoverComp.getParam("end"))); // startEndMap.put(start,(Integer) updatedCoverCompI.getParam("end")); // stackedPepSet.put(start, updatedCoverCompI); // // } // // } for (StackedBarPeptideComponent peptideLayout : finalUpdatedPeptidesCoverageMap.values()) { VerticalLayout coverageComp = new VerticalLayout(); coverageComp.setStyleName("vdarkgray"); coverageComp.setHeight("15px"); coverageComp.setWidth(peptideLayout.getWidth(), peptideLayout.getWidthUnits()); coverageComp.setDescription("" + peptideLayout.getParam("start") + "-" + peptideLayout.getParam("sequence") + "-" + peptideLayout.getParam("end")); coveragePeptidesSequencesBar.addComponent(coverageComp, "left: " + (peptideLayout.getX0() - 20) + "px; top: " + (0) + "px;"); } }
From source file:probe.com.view.body.searching.id.IdDataSearchingTabLayout.java
/** * * @param searchIdentificationProtList/*from w w w. jav a2s .com*/ * @param handler */ public IdDataSearchingTabLayout(Map<Integer, IdentificationProteinBean> searchIdentificationProtList, final CSFPRHandler handler) { this.setMargin(true); this.setSpacing(true); idSearchingResultsTableLayout = new VerticalLayout(); idSearchingResultsTableLayout.setHeight("100%"); idFractionLayout = new VerticalLayout(); idPeptidesLayout = new VerticalLayout(); this.addComponent(idSearchingResultsTableLayout); this.addComponent(idFractionLayout); this.addComponent(idPeptidesLayout); final IdentificationSearchResultsTableLayout searcheResultsTableLayout = new IdentificationSearchResultsTableLayout( handler, handler.getIdentificationDatasetDetailsList(), searchIdentificationProtList, false); idSearchingResultsTableLayout.addComponent(searcheResultsTableLayout); final ExporterBtnsGenerator dataExporter = new ExporterBtnsGenerator(handler); Property.ValueChangeListener listener = new Property.ValueChangeListener() { /* *the main listener for search table */ private static final long serialVersionUID = 1L; private CustomExternalLink searchTableAccessionLable; private int key; /** * on select search table value initialize the peptides table and * fractions plots if exist * process * * @param event value change on search table selection */ @Override public synchronized void valueChange(Property.ValueChangeEvent event) { if (searchTableAccessionLable != null) { searchTableAccessionLable.rePaintLable("black"); } if (searcheResultsTableLayout.getSearchTable().getValue() != null) { key = (Integer) searcheResultsTableLayout.getSearchTable().getValue(); } else { return; } final Item item = searcheResultsTableLayout.getSearchTable().getItem(key); searchTableAccessionLable = (CustomExternalLink) item.getItemProperty("Accession").getValue(); searchTableAccessionLable.rePaintLable("white"); idPeptidesLayout.removeAllComponents(); idFractionLayout.removeAllComponents(); String datasetName = item.getItemProperty("Experiment").toString(); String accession = item.getItemProperty("Accession").toString(); String otherAccession = item.getItemProperty("Other Protein(s)").toString(); String desc = item.getItemProperty("Description").toString(); int datasetId = handler.setMainIdentificationDatasetId(datasetName); int fractionNumber = handler.getDataset(datasetId).getFractionsNumber(); if (datasetId != 0 && handler.getDataset(datasetId).getDatasetType() == 1) { VerticalLayout allPeptidesProteinsExportLayout = dataExporter .exportAllAvailablePeptidesForProtein(accession, otherAccession, desc, true, "Export peptides from all datasets for ( " + accession + " )"); allPeptidesProteinsExportLayout .setDescription("Export CSF-PR peptides for ( " + accession + " ) from all datasets"); searcheResultsTableLayout.setExpBtnProtAllPepTable(allPeptidesProteinsExportLayout); if (key >= 0) { Map<Integer, IdentificationPeptideBean> pepProtList = handler .getIdentificationProteinPeptidesList(datasetId, accession, otherAccession); if (!pepProtList.isEmpty()) { int validPep = handler.countValidatedPeptidesNumber(pepProtList); if (idPeptideTableLayout != null) { idPeptidesLayout.removeComponent(idPeptideTableLayout); } idPeptideTableLayout = new IdentificationPeptidesTableLayout(validPep, pepProtList.size(), desc, pepProtList, accession, handler.getDataset(datasetId).getName()); idPeptidesLayout.setMargin(false); idPeptidesLayout.addComponent(idPeptideTableLayout); VerticalLayout proteinPeptidesExportLayout = dataExporter.exportPeptidesForProtein( datasetId, accession, otherAccession, desc, pepProtList, true, "Export Peptides from Selected Dataset for ( " + accession + " )"); proteinPeptidesExportLayout.setDescription( "Export peptides from ( " + handler.getDataset(datasetId).getName() + " ) dataset for ( " + accession + " )"); idPeptideTableLayout .setExportingBtnForIdentificationPeptidesTable(proteinPeptidesExportLayout); } List<StandardIdentificationFractionPlotProteinBean> standerdProtList = handler .getStandardIdentificationFractionProteinsList(datasetId);// if (fractionNumber == 0 || datasetId == 0 || standerdProtList == null || standerdProtList.isEmpty()) { idFractionLayout.removeAllComponents(); if (searcheResultsTableLayout.getSearchTable() != null) { searcheResultsTableLayout.getSearchTable().setHeight("267.5px"); } if (idPeptideTableLayout.getPepTable() != null) { idPeptideTableLayout.getPepTable().setHeight("267.5px"); idPeptideTableLayout.setPeptideTableHeight("267.5px"); } } else { Map<Integer, IdentificationProteinBean> fractionsList = handler .getIdentificationProteinsGelFractionsList(datasetId, accession, otherAccession); if (fractionsList != null && !fractionsList.isEmpty()) { double mw = 0.0; try { mw = Double.valueOf(item.getItemProperty("MW").toString()); } catch (NumberFormatException e) { String str = item.getItemProperty("MW").toString(); String[] strArr = str.split(","); if (strArr.length > 1) { str = strArr[0] + "." + strArr[1]; } mw = Double.valueOf(str); } idFractionLayout.addComponent( new IdentificationGelFractionsLayout(handler, accession, mw, fractionsList, standerdProtList, handler.getDataset(datasetId).getName())); } } } } } }; searcheResultsTableLayout.setListener(listener); searcheResultsTableLayout.getSearchTable().addValueChangeListener(listener); }
From source file:probe.com.view.core.TipGenerator.java
public VerticalLayout generateTipsBtn() { VerticalLayout tipsIcon = new VerticalLayout(); tipsIcon.setWidth("16px"); tipsIcon.setHeight("16px"); tipsIcon.setDescription("Show tips"); tipsIcon.setStyleName("tipbtn"); tipsIcon.addLayoutClickListener(this); return tipsIcon; }