List of usage examples for com.vaadin.ui Label setContentMode
public void setContentMode(ContentMode contentMode)
From source file:probe.com.view.body.QuantCompareDataLayout.java
private VerticalLayout initSelectEnterDatasetDiseaseGroups(int width) { VerticalLayout selectDiseaseGroupsMainLayout = new VerticalLayout(); selectDiseaseGroupsMainLayout.setMargin(new MarginInfo(true, false, false, true)); selectDiseaseGroupsMainLayout.setSpacing(true); Label titleLabel = new Label("1. Select/Enter Dataset Disease Groups"); titleLabel.setContentMode(ContentMode.HTML); titleLabel.setStyleName("normalheader"); titleLabel.setHeight("20px"); selectDiseaseGroupsMainLayout.addComponent(titleLabel); selectDiseaseGroupsMainLayout.setComponentAlignment(titleLabel, Alignment.TOP_LEFT); HorizontalLayout selectionResultsContainer = new HorizontalLayout(); // selectionResultsContainer.setStyleName("diseasegroupselectionresult"); String containerWidth = ((width * 2) + 10) + "px"; selectionResultsContainer.setWidth(containerWidth); selectDiseaseGroupsMainLayout.setWidth(containerWidth); selectionResultsContainer.addComponent(selectionResultsLabel); selectionResultsLabel.setStyleName(Reindeer.LABEL_SMALL); // selectionResultsLabel.setValue("Selection: Group A / Group B"); // miniselectionResultsLabel.setValue("( Group A / Group B )"); Property.ValueChangeListener diseaseGroupsListListener = new Property.ValueChangeListener() { @Override//from w w w. j a v a 2s . com public void valueChange(Property.ValueChangeEvent event) { String value = "Selection: "; if (diseaseGroupsListA.getValue() != null) { diseaseGroupsListA.setRequired(false); value += diseaseGroupsListA.getValue().toString(); useRowSorter = diseaseGroupNames.contains(diseaseGroupsListA.getValue().toString().trim()); } if (diseaseGroupsListB.getValue() != null) { diseaseGroupsListB.setRequired(false); value += " / " + diseaseGroupsListB.getValue().toString(); useColumnSorter = diseaseGroupNames.contains(diseaseGroupsListB.getValue().toString().trim()); // reset(); } selectionResultsLabel.setValue(value); miniselectionResultsLabel.setValue(value); if ((diseaseGroupsListA.getValue() != null) && (diseaseGroupsListB.getValue() != null)) { if (diseaseGroupsListA.getValue().toString().trim() .equalsIgnoreCase(diseaseGroupsListB.getValue().toString().trim())) { useRowSorter = useColumnSorter = false; } } } }; HorizontalLayout diseaseGroupsListsContainer = new HorizontalLayout(); selectDiseaseGroupsMainLayout.addComponent(diseaseGroupsListsContainer); diseaseGroupsListsContainer.setWidth(containerWidth); diseaseGroupsListA.setStyleName("diseasegrouplist"); diseaseGroupsListA.setNullSelectionAllowed(false); diseaseGroupsListA.setImmediate(true); diseaseGroupsListA.setNewItemsAllowed(true); diseaseGroupsListA.setWidth(width, Unit.PIXELS); diseaseGroupsListA.setInputPrompt("Select or enter new disease group name"); diseaseGroupsListA.setRequiredError("Select or enter new disease group name"); diseaseGroupsListB.setStyleName("diseasegrouplist"); diseaseGroupsListB.setNullSelectionAllowed(false); diseaseGroupsListB.setRequiredError("Select or enter new disease group name"); diseaseGroupsListB.setImmediate(true); diseaseGroupsListB.setNewItemsAllowed(true); diseaseGroupsListB.setWidth(width, Unit.PIXELS); diseaseGroupsListB.setInputPrompt("Select or enter new disease group name"); selectDiseaseGroupsMainLayout.addComponent(selectionResultsContainer); diseaseGroupsListsContainer.addComponent(diseaseGroupsListA); diseaseGroupsListsContainer.addComponent(diseaseGroupsListB); diseaseGroupsListsContainer.setComponentAlignment(diseaseGroupsListB, Alignment.TOP_RIGHT); this.resetLists(); diseaseGroupsListA.addValueChangeListener(diseaseGroupsListListener); diseaseGroupsListB.addValueChangeListener(diseaseGroupsListListener); diseaseGroupsListA.setNewItemHandler(new AbstractSelect.NewItemHandler() { @Override public void addNewItem(String newItemCaption) { diseaseGroupsListA.addItem(newItemCaption); diseaseGroupsListA.select(newItemCaption); } }); diseaseGroupsListB.setNewItemHandler(new AbstractSelect.NewItemHandler() { @Override public void addNewItem(String newItemCaption) { diseaseGroupsListB.addItem(newItemCaption); diseaseGroupsListB.select(newItemCaption); } }); return selectDiseaseGroupsMainLayout;//new HideOnClickLayout("Select/Enter Dataset Disease Groups", proteinsDataCapturingMainLayout, miniSelectDiseaseGroupsLayout, Alignment.TOP_LEFT, null, null); }
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);//from w ww. j ava 2 s . c om 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;/* www . j ava 2s . 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); 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;/*www. ja v a 2 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.GroupSwichBtn.java
private void updateSelectionList() { table.removeAllComponents();//from w w w. j ava 2s.co m updatedComparisonList.clear(); selectedComparisonList = this.Quant_Central_Manager .getUpdatedSelectedDiseaseGroupsComparisonListProteins(searchQuantificationProtList);// int row = 1; if (selectedComparisonList != null) { table.addComponent(headerI, 0, 0); table.setComponentAlignment(headerI, Alignment.MIDDLE_CENTER); table.addComponent(headerII, 2, 0); table.setComponentAlignment(headerII, Alignment.MIDDLE_CENTER); setWindowHight(selectedComparisonList.size()); for (QuantDiseaseGroupsComparison comparison : selectedComparisonList) { updatedComparisonList.add(comparison); String header = comparison.getComparisonHeader(); String updatedHeaderI = header.split(" / ")[0].split("\n")[0]; String updatedHeaderII = header.split(" / ")[1].split("\n")[0]; String diseaseColor = this.Quant_Central_Manager .getDiseaseHashedColor(header.split(" / ")[1].split("\n")[1]); Label labelI = new Label("<center><font color='" + diseaseColor + "' style='font-weight: bold;!important'>" + updatedHeaderI + "</font></center>"); Label labelII = new Label("<center><font color='" + diseaseColor + "' style='font-weight: bold;!important'>" + updatedHeaderII + "</font></center>"); labelI.setContentMode(ContentMode.HTML); labelII.setContentMode(ContentMode.HTML); labelI.setWidth("100%"); labelII.setWidth("100%"); VerticalLayout switchBtn = swichIconGenerator(); table.addComponent(labelI, 0, row); table.setComponentAlignment(labelI, Alignment.MIDDLE_CENTER); table.addComponent(switchBtn, 1, row); switchBtn.setData(row - 1); table.setComponentAlignment(switchBtn, Alignment.MIDDLE_CENTER); table.addComponent(labelII, 2, row++); table.setComponentAlignment(labelII, Alignment.MIDDLE_CENTER); } table.addComponent(btnWrapper, 2, row); table.setComponentAlignment(btnWrapper, Alignment.MIDDLE_CENTER); } // comparisonList.addValueChangeListener(GroupSwichBtn.this); }
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 ava 2s . c om*/ 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.PopupRecombineDiseaseGroups.java
private HorizontalLayout initDiseaseNamesUpdateContainer(String diseaseCategory) { GridLayout diseaseNamesUpdateContainer = new GridLayout(2, (default_DiseaseCat_DiseaseGroupMap.get(diseaseCategory).size() * 2)); diseaseNamesUpdateContainer.setWidth("100%"); diseaseNamesUpdateContainer.setHeightUndefined(); diseaseNamesUpdateContainer.setSpacing(false); diseaseNamesUpdateContainer.setMargin(new MarginInfo(false, false, false, false)); int widthCalc = 0; int row = 0;//from w w w. j a v a 2s .c om int col = 0; Map<String, ComboBox> diseaseGroupNameToListMap = new LinkedHashMap<String, ComboBox>(); for (String diseaseGroupName : default_DiseaseCat_DiseaseGroupMap.get(diseaseCategory).keySet()) { // if(!diseaseGroupName.contains(diseaseCategory)) // continue; diseaseNamesUpdateContainer.addComponent(generateLabel(diseaseGroupName, diseaseCategory), col, row); ComboBox list = generateLabelList(diseaseCategory); diseaseNamesUpdateContainer.addComponent(list, col + 1, row); diseaseGroupNameToListMap.put(diseaseGroupName, list); col = 0; row++; VerticalLayout spacer1 = new VerticalLayout(); spacer1.setHeight("2px"); spacer1.setWidth("300px"); spacer1.setStyleName(Reindeer.LAYOUT_WHITE); diseaseNamesUpdateContainer.addComponent(spacer1, col, row); VerticalLayout spacer2 = new VerticalLayout(); spacer2.setHeight("2px"); spacer2.setWidth("300px"); spacer2.setStyleName(Reindeer.LAYOUT_WHITE);//"lightgraylayout"); diseaseNamesUpdateContainer.addComponent(spacer2, col + 1, row); col = 0; row++; widthCalc += 26; } diseaseGroupsSelectionListMap.put(diseaseCategory, diseaseGroupNameToListMap); // widthCalc-=26; VerticalLayout diseaseLabelContainer = new VerticalLayout(); Label label = new Label("<center><font color='#ffffff'>" + diseaseCategory + "</font></center>"); label.setContentMode(ContentMode.HTML); diseaseLabelContainer.setHeight(widthCalc + "px"); diseaseLabelContainer.setWidth("20px"); VerticalLayout rotateContainer = new VerticalLayout(); rotateContainer.setWidth(widthCalc + "px"); rotateContainer.setHeight("20px"); diseaseLabelContainer.addComponent(rotateContainer); rotateContainer.setStyleName( "row_" + diseaseStyleMap.get(diseaseCategory.replace(" ", "_").replace("'", "-") + ("_Disease"))); rotateContainer.addComponent(label); HorizontalLayout layout = new HorizontalLayout(); layout.setSpacing(true); layout.addComponent(diseaseLabelContainer); layout.addComponent(diseaseNamesUpdateContainer); return layout; }
From source file:probe.com.view.body.quantdatasetsoverview.quantproteinscomparisons.TrendLegend.java
private HorizontalLayout generateItemLabel(String label, String style) { HorizontalLayout labelLayout = new HorizontalLayout(); labelLayout.setSpacing(true);/*from w w w .j a v a 2 s .co m*/ labelLayout.setHeight("20px"); VerticalLayout icon = new VerticalLayout(); icon.setWidth("10px"); icon.setHeight("10px"); icon.setStyleName(style); labelLayout.addComponent(icon); labelLayout.setComponentAlignment(icon, Alignment.MIDDLE_LEFT); Label l = new Label("<font size='2' face='Verdana'>" + label + "</font>"); l.setContentMode(ContentMode.HTML); labelLayout.addComponent(l); return labelLayout; }
From source file:probe.com.view.body.searching.SearchingFiltersControl.java
private VerticalLayout initFilterLabel(String title) { Label filterLabel = new Label(title); filterLabel.setContentMode(ContentMode.HTML); filterLabel.setStyleName("showFilterLabelHeader"); filterLabel.setDescription("Drop all " + title + " filter"); VerticalLayout layout = new VerticalLayout(); // layout.setId(title); layout.addComponentAsFirst(filterLabel); layout.addLayoutClickListener(listener); return layout; }
From source file:probe.com.view.body.welcomelayout.PublicationsInformationWindow.java
private VerticalLayout initPublicationLayout(Object[] publicationData) { VerticalLayout publicationlayout = new VerticalLayout(); publicationlayout.setWidth("500px"); publicationlayout.setHeightUndefined(); publicationlayout.setSpacing(true);// w w w .ja va 2 s. c o m publicationlayout.setMargin(new MarginInfo(false, false, false, false)); publicationlayout.setStyleName("publicationstyle"); Label pubmedIdLabel = new Label( "<h5>Pubmed Id: <a href='http://www.ncbi.nlm.nih.gov/pubmed/" + publicationData[0].toString() + "' target='_blank' ><font style:'text-decoration:underline !important;'>" + publicationData[0].toString() + "</font></a></h5>"); pubmedIdLabel.setContentMode(ContentMode.HTML); publicationlayout.addComponent(pubmedIdLabel); pubmedIdLabel.setHeight("40px"); Label proteinsNumLabel = new Label("<h5>#Proteins: " + publicationData[5].toString() + "</h5>"); proteinsNumLabel.setDescription("Number of publication proteins " + publicationData[4].toString()); proteinsNumLabel.setContentMode(ContentMode.HTML); publicationlayout.addComponent(proteinsNumLabel); proteinsNumLabel.setHeight("40px"); Label uproteinsNumLabel = new Label( "<h5>#Publication Specific Proteins: " + publicationData[4].toString() + "</h5>"); uproteinsNumLabel .setDescription("Number of publication specific proteins " + publicationData[4].toString()); uproteinsNumLabel.setContentMode(ContentMode.HTML); publicationlayout.addComponent(uproteinsNumLabel); uproteinsNumLabel.setHeight("40px"); Label PeptidesNumLabel = new Label("<h5>#Peptides: " + publicationData[7].toString() + "</h5>"); PeptidesNumLabel.setContentMode(ContentMode.HTML); publicationlayout.addComponent(PeptidesNumLabel); PeptidesNumLabel.setDescription("Number of publication peptides " + publicationData[7].toString()); PeptidesNumLabel.setHeight("40px"); Label uPeptidesNumLabel = new Label( "<h5>#Publication Specific Peptides: " + publicationData[6].toString() + "</h5>"); uPeptidesNumLabel.setContentMode(ContentMode.HTML); publicationlayout.addComponent(uPeptidesNumLabel); uPeptidesNumLabel .setDescription("Number of publication specific peptides " + publicationData[6].toString()); uPeptidesNumLabel.setHeight("40px"); Label titleLabel = new Label( "<textarea rows='5' cols='52' readonly >" + publicationData[3].toString() + "</textarea>"); titleLabel.setContentMode(ContentMode.HTML); publicationlayout.addComponent(titleLabel); titleLabel.setHeight("100px"); return publicationlayout; }