List of usage examples for com.vaadin.ui Alignment TOP_LEFT
Alignment TOP_LEFT
To view the source code for com.vaadin.ui Alignment TOP_LEFT.
Click Source Link
From source file:probe.com.view.body.identificationdatasetsoverview.IdentificationDatasetLayout.java
/** * initialize main proteins tab layout initialize drop down select dataset * list and add main value change listener to it *//*from www .ja va 2 s . co m*/ private void buildMainLayout() { //init dataset Details String infoText = "<p style='font-family:verdana;color:black;margin-left:20px;margin-right:20px;'>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."; IdentificationDatasetInformationLayout datasetInfoLayout = new IdentificationDatasetInformationLayout( CSFPR_Handler, datasetId, null); HideOnClickLayout dsLayout = new HideOnClickLayout(CSFPR_Handler.getDataset(datasetId).getName(), datasetInfoLayout, null, infoText, CSFPR_Handler.getTipsGenerator().generateTipsBtn()); dsLayout.setMargin(new MarginInfo(false, false, false, false)); container.addComponent(dsLayout); //get proteins List proteinsList = CSFPR_Handler.getIdentificationProteinsList(datasetId); protTableLayout = new IdentificationProteinsTableLayout(proteinsList, CSFPR_Handler.getDataset(datasetId).getFractionsNumber(), CSFPR_Handler.getDataset(datasetId).getNumberValidProt(), CSFPR_Handler.getDataset(datasetId).getProteinsNumber()); container.addComponent(protTableLayout); container.setComponentAlignment(protTableLayout, Alignment.TOP_LEFT); protTableLayout.getProteinTableComponent().addValueChangeListener(IdentificationDatasetLayout.this); protTableLayout.setListener(IdentificationDatasetLayout.this); fractionsLayout.setWidth("100%"); container.addComponent(fractionsLayout); peptidesLayout.setWidth("100%"); container.addComponent(peptidesLayout); selectionIndexes = CSFPR_Handler.calculateIdentificationProteinsTableSearchIndexesSet( protTableLayout.getProteinTableComponent().getProtToIndexSearchingMap(), protTableLayout.getProteinTableComponent().getTableSearchMapIndex(), protTableLayout.getSearchField().getValue().toUpperCase().trim()); protTableLayout.getProteinTableComponent() .setCurrentPageFirstItemId(protTableLayout.getProteinTableComponent().getFirstIndex()); protTableLayout.getProteinTableComponent() .select(protTableLayout.getProteinTableComponent().getFirstIndex()); protTableLayout.getProteinTableComponent().commit(); ActionButtonTextField searchButtonTextField = ActionButtonTextField .extend(protTableLayout.getSearchField()); searchButtonTextField.getState().type = ActionButtonType.ACTION_SEARCH; searchButtonTextField.addClickListener(new ActionButtonTextField.ClickListener() { @Override public void buttonClick(ActionButtonTextField.ClickEvent clickEvent) { selectionIndexes = CSFPR_Handler.calculateIdentificationProteinsTableSearchIndexesSet( protTableLayout.getProteinTableComponent().getProtToIndexSearchingMap(), protTableLayout.getProteinTableComponent().getTableSearchMapIndex(), protTableLayout.getSearchField().getValue().toUpperCase().trim()); if (!selectionIndexes.isEmpty()) { if (selectionIndexes.size() > 1) { protTableLayout.getNextSearch().setEnabled(true); protTableLayout.getNextSearch().focus(); } else { protTableLayout.getNextSearch().setEnabled(false); } protIndex = 1; nextIndex = selectionIndexes.firstKey(); protTableLayout.getProtCounter() .setValue("( " + (protIndex++) + " of " + selectionIndexes.size() + " )"); protTableLayout.getProteinTableComponent() .setCurrentPageFirstItemId(selectionIndexes.get(nextIndex)); protTableLayout.getProteinTableComponent().select(selectionIndexes.get(nextIndex)); protTableLayout.getProteinTableComponent().commit(); } else { Notification.show("Not Exist"); protIndex = 1; } } }); protTableLayout.getSearchField().addFocusListener(new FieldEvents.FocusListener() { @Override public void focus(FieldEvents.FocusEvent event) { protTableLayout.getNextSearch().setEnabled(false); protTableLayout.getProtCounter().setValue(""); protIndex = 1; } }); protTableLayout.getNextSearch().addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { nextIndex = selectionIndexes.higherKey(nextIndex); protTableLayout.getProteinTableComponent() .setCurrentPageFirstItemId(selectionIndexes.get(nextIndex)); protTableLayout.getProteinTableComponent().select(selectionIndexes.get(nextIndex)); protTableLayout.getProteinTableComponent().commit(); protTableLayout.getProtCounter() .setValue("( " + (protIndex++) + " of " + selectionIndexes.size() + " )"); if (nextIndex == selectionIndexes.lastKey()) { nextIndex = selectionIndexes.firstKey() - 1; protIndex = 1; } } }); }
From source file:probe.com.view.body.quantcompare.QuantCompareDataViewLayout.java
/** * * @param CSFPR_Handler//from w w w . jav a2 s .com * @param searchQuantificationProtList * @param userCustomizedComparison */ public QuantCompareDataViewLayout(CSFPRHandler CSFPR_Handler, List<QuantProtein> searchQuantificationProtList, QuantDiseaseGroupsComparison userCustomizedComparison) { Quant_Central_Manager = new QuantCentralManager(CSFPR_Handler, searchQuantificationProtList, userCustomizedComparison);//,filterUtility.getFullFilterList() this.setMargin(true); this.setSpacing(true); this.setWidth("100%"); this.setHeightUndefined(); //order based on user groups DiseaseGroupsFiltersContainer heatmapFilter = new DiseaseGroupsFiltersContainer(Quant_Central_Manager, CSFPR_Handler, searchQuantificationProtList, userCustomizedComparison); 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 QuantUserDataProteinsComparisonsContainer(Quant_Central_Manager, CSFPR_Handler, searchQuantificationProtList, userCustomizedComparison); HideOnClickLayout comparisonsTableContainer = new HideOnClickLayout("Proteins", quantProteinsComparisonsContainer, null, Alignment.TOP_LEFT, infoText, null); int pageWidth = Page.getCurrent().getBrowserWindowWidth(); int layoutWidth = (pageWidth - 70); quantProteinsComparisonsContainer.setLayoutWidth(layoutWidth); this.addComponent(comparisonsTableContainer); comparisonsTableContainer.setVisability(true); Map<String, Integer> customizedTrendMap = new HashMap<String, Integer>(); for (String accession : userCustomizedComparison.getComparProtsMap().keySet()) { customizedTrendMap.put(accession.toLowerCase(), userCustomizedComparison.getComparProtsMap().get(accession).getSignificantTrindCategory()); } proteinsLayout = new QuantProteinsTabsheetContainerLayout(Quant_Central_Manager, true, CSFPR_Handler, customizedTrendMap); HideOnClickLayout proteinsLevelLayout = new HideOnClickLayout("Protein Information", proteinsLayout, null, infoText, null); this.addComponent(proteinsLevelLayout); proteinsLevelLayout.setVisability(true); // heatmapFilter.selectAllComparisons(); }
From source file:probe.com.view.body.QuantCompareDataLayout.java
public QuantCompareDataLayout(CSFPRHandler CSFPR_Handler) { this.setWidth("100%"); this.setHeightUndefined(); this.setStyleName(Reindeer.LAYOUT_WHITE); this.setSpacing(true); topLabelMarker = new VerticalLayout(); this.addComponent(topLabelMarker); this.setExpandRatio(topLabelMarker, 0.01f); topLabelMarker.setHeight("10px"); topLabelMarker.setWidth("20px"); topLabelMarker.setStyleName(Reindeer.LAYOUT_WHITE); this.CSFPR_Handler = CSFPR_Handler; Map<String, QuantDatasetInitialInformationObject> quantDatasetInitialInformationObjectMap = CSFPR_Handler .getQuantDatasetInitialInformationObject(); diseaseGroupNames = new TreeSet<String>(); for (String diseaseCategory : quantDatasetInitialInformationObjectMap.keySet()) { QuantDatasetInitialInformationObject quantDatasetInitialInformationObject = quantDatasetInitialInformationObjectMap .get(diseaseCategory);/*from w w w .j a va 2s . c o m*/ for (QuantDatasetObject qdsObject : quantDatasetInitialInformationObject.getQuantDatasetsList() .values()) { diseaseGroupNames.add(qdsObject.getPatientsSubGroup1().split("\n")[0].trim()); diseaseGroupNames.add(qdsObject.getPatientsSubGroup2().split("\n")[0].trim()); } } int width = 400; if (Page.getCurrent().getBrowserWindowWidth() < 800) { width = Page.getCurrent().getBrowserWindowWidth() / 2; } HorizontalLayout userDataLayout = new HorizontalLayout(); userDataLayout.setSpacing(true); HorizontalLayout miniSelectDiseaseGroupsLayout = new HorizontalLayout(); miniSelectDiseaseGroupsLayout.setStyleName("diseasegroupselectionresult"); miniSelectDiseaseGroupsLayout.setSpacing(true); miniSelectDiseaseGroupsLayout.setWidthUndefined(); miniselectionResultsLabel = new Label(); // miniselectionResultsLabel.setWidth("300px"); miniSelectDiseaseGroupsLayout.addComponent(miniselectionResultsLabel); selectionResultsOverview = new Label(); // selectionResultsOverview.setWidth("300px"); miniSelectDiseaseGroupsLayout.addComponent(selectionResultsOverview); selectionResultsOverview.setContentMode(ContentMode.HTML); userDataLayoutContainer = new HideOnClickLayout("User Data", userDataLayout, miniSelectDiseaseGroupsLayout, Alignment.TOP_LEFT, "info data", null); userDataLayoutContainer.setMargin(new MarginInfo(false, false, false, true)); userDataLayoutContainer.setVisability(true); this.addComponent(userDataLayoutContainer); VerticalLayout leftUserDataLayout = new VerticalLayout(); userDataLayout.addComponent(leftUserDataLayout); //select or enter new disease groups layout selectionResultsLabel = new Label("Selection:"); selectDiseaseGroupsContainer = initSelectEnterDatasetDiseaseGroups(width); // selectDiseaseGroupsContainer.setVisability(true); selectDiseaseGroupsContainer.setReadOnly(true); leftUserDataLayout.addComponent(selectDiseaseGroupsContainer); proteinsDataCaptureLayout = initProteinsDataCapture(width); leftUserDataLayout.addComponent(proteinsDataCaptureLayout); ResultsOverviewLayout.setStyleName("compareresults"); ResultsOverviewLayout.setWidth("350px"); ResultsOverviewLayout.setHeightUndefined(); ResultsOverviewLayout.setSpacing(true); ResultsOverviewLayout.setMargin(new MarginInfo(false, false, false, true)); Label resultsTitleLabel = new Label("Results Overview"); resultsTitleLabel.setContentMode(ContentMode.HTML); resultsTitleLabel.setStyleName("normalheader"); resultsTitleLabel.setHeight("20px"); ResultsOverviewLayout.addComponent(resultsTitleLabel); ResultsOverviewLayout.setComponentAlignment(resultsTitleLabel, Alignment.TOP_LEFT); resultContainer = new GridLayout(3, 5); resultContainer.setSpacing(true); resultContainer.setMargin(true); resultContainer.setHideEmptyRowsAndColumns(true); ResultsOverviewLayout.addComponent(resultContainer); ResultsOverviewLayout.setComponentAlignment(resultContainer, Alignment.TOP_LEFT); resultContainer.setWidth("100%"); foundPublicationLabel = new Label(); // resultContainer.addComponent(foundPublicationLabel, 0, 0); foundStudiesLabel = new Label(); // resultContainer.addComponent(foundStudiesLabel, 1, 0); foundProteinsLabel = new Label(); resultContainer.addComponent(foundProteinsLabel, 0, 0); newProteinsDownloadBtn = new Button(); newProteinsDownloadBtn.setCaptionAsHtml(true); newProteinsDownloadBtn.setStyleName(Reindeer.BUTTON_LINK); // ResultsOverviewLayout.addComponent(newProteinsDownloadBtn); newProteinsDownloadBtn.setDescription("Download new proteins (not found in CSF-PR) records"); // ResultsOverviewLayout.addComponent(newProteinsTextArea); newProteinsTextArea.setWidth("302px"); newProteinsTextArea.setHeight("200px"); newProteinsTextArea.setReadOnly(true); newProteinsDownloadBtn.addClickListener(QuantCompareDataLayout.this); newProteinsDownloadBtn.setId("notfounderrorbtn"); userDataLayout.addComponent(ResultsOverviewLayout); this.addComponent(resultsLayout); }
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/* w ww . j a v a 2 s . c o m*/ 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);//w ww. j a va2 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;/*from w w w .jav a 2s.com*/ 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;/*from ww w .j a v a 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); //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
/** * @param heatmapCellWidth// w ww .j ava 2s. c om * @param heatmapHeaderCellWidth * @param diseaseStyleMap */ public HeatMapComponent(int heatmapCellWidth, int heatmapHeaderCellWidth, Map<String, String> diseaseStyleMap) { this.diseaseStyleMap = diseaseStyleMap; this.setMargin(false); this.setSpacing(true); this.setWidth("100%"); this.heatmapCellWidth = heatmapCellWidth; this.heatmapHeaderCellWidth = heatmapHeaderCellWidth; columnContainer = new VerticalLayout(); columnContainer.setWidth("100%"); columnContainer.setSpacing(true); diseaseGroupsColumnsLabels = new HorizontalLayout(); diseaseGroupsColumnsLabels.setWidth("10px"); diseaseGroupsColumnsLabels.setHeight("20px"); diseaseGroupsColumnsLabels.setStyleName(Reindeer.LAYOUT_BLUE); columnContainer.addComponent(diseaseGroupsColumnsLabels); this.columnHeader = new GridLayout(); columnContainer.addComponent(columnHeader); columnContainer.setComponentAlignment(columnHeader, Alignment.TOP_LEFT); this.rowHeader = new GridLayout(); this.heatmapBody = new GridLayout(); heatmapBody.setStyleName("hmbackground"); topLayout = new HorizontalLayout(); topLayout.setHeight((heatmapHeaderCellWidth + 24) + "px"); topLayout.setSpacing(false); spacer = new VerticalLayout(); spacer.setWidth((heatmapHeaderCellWidth + 25) + "px"); spacer.setHeight((heatmapHeaderCellWidth + 24) + "px"); spacer.setStyleName(Reindeer.LAYOUT_WHITE); hideCompBtn = new VerticalLayout(); hideCompBtn.setSpacing(true); hideCompBtn.setWidth((heatmapHeaderCellWidth + 25) + "px"); // hideCompBtn.setHeight((heatmapHeaderCellWidth) + "px"); hideCompBtn.setStyleName("matrixbtn"); icon = new Image(); defaultResource = new ThemeResource("img/logo.png"); icon.setSource(defaultResource); hideCompBtn.setDescription("Expand chart and hide comparisons table"); hideCompBtn.addComponent(icon); hideCompBtn.setComponentAlignment(icon, Alignment.MIDDLE_CENTER); icon.setHeight((heatmapHeaderCellWidth - 20 + 10) + "px"); hideShowBtnLabel = new Label("Expand Chart"); hideShowBtnLabel.setHeight((20) + "px"); hideCompBtn.addComponent(hideShowBtnLabel); hideCompBtn.setComponentAlignment(hideShowBtnLabel, Alignment.BOTTOM_CENTER); spacer.addComponent(hideCompBtn); spacer.setComponentAlignment(hideCompBtn, Alignment.MIDDLE_CENTER); hideCompBtn.setEnabled(false); topLayout.addComponent(spacer); topLayout.setComponentAlignment(spacer, Alignment.BOTTOM_LEFT); topLayout.setSpacing(true); topLayout.addComponent(columnContainer); topLayout.setComponentAlignment(columnContainer, Alignment.TOP_LEFT); this.addComponent(topLayout); bottomLayout = new HorizontalLayout(); diseaseGroupsRowsLabels = new VerticalLayout(); diseaseGroupsRowsLabels.setHeight("10px"); diseaseGroupsRowsLabels.setWidth("20px"); diseaseGroupsRowsLabels.setStyleName(Reindeer.LAYOUT_BLUE); bottomLayout.addComponent(diseaseGroupsRowsLabels); rowHeader.setWidth(heatmapHeaderCellWidth + "px"); rowHeader.setHeight("100%"); bottomLayout.addComponent(rowHeader); bottomLayout.addComponent(heatmapBody); bottomLayout.setSpacing(true); bottomLayout.setComponentAlignment(heatmapBody, Alignment.MIDDLE_LEFT); this.addComponent(bottomLayout); }
From source file:probe.com.view.body.quantdatasetsoverview.diseasegroupsfilters.interactivepiechartfilters.StudiesPieChartFiltersContainerLayout.java
/** * * @param Quant_Central_Manager/*from ww w. j a v a 2 s .co m*/ * @param handler */ public StudiesPieChartFiltersContainerLayout(QuantCentralManager Quant_Central_Manager, final CSFPRHandler handler) { int layoutHeight = Page.getCurrent().getBrowserWindowHeight() - 200; int layoutWidth = Page.getCurrent().getBrowserWindowWidth() - 200; this.setWidth(layoutWidth + "px"); this.setHeight(layoutHeight + "px"); int filterWidth = layoutWidth / 3; this.setSpacing(true); boolean[] activeFilters = Quant_Central_Manager.getActiveFilters(); Map<Integer, QuantDatasetObject> quantDatasetArr = Quant_Central_Manager.getFilteredDatasetsList(); internalSelectionManager = new PieChartsSelectionManager(Quant_Central_Manager); if (quantDatasetArr == null) { return; } this.setRows(4); this.setColumns(4); int colCounter = 0; int rowCounter = 0; this.chartSet.clear(); for (int x = 0; x < activeFilters.length; x++) { String filterId = ""; if (activeFilters[x]) { Map<String, List<Integer>> dsIndexesMap = new HashMap<String, List<Integer>>(); // List<Object> valueSet = new ArrayList<Object>(); switch (x) { case 0: // filterId = "identifiedProteinsNumber"; // for (QuantDatasetObject pb : quantDatasetArr) { // if (pb == null) { // continue; // } // int value = pb.getIdentifiedProteinsNumber(); // valueSet.add(value); // } break; case 1: // filterId = "quantifiedProteinsNumber"; // for (QuantDatasetObject pb : quantDatasetArr) { // if (pb == null) { // continue; // } // int value = pb.getQuantifiedProteinsNumber(); // valueSet.add(value); // // } break; case 2: // filterId = "analyticalMethod"; // for (QuantDatasetObject pb : quantDatasetArr.values()) { // if (pb == null) { // continue; // } // String value = pb.getAnalyticalMethod(); // valueSet.add(value); // // } break; case 3: // filterId = "rawDataUrl"; // for (QuantDatasetObject pb : quantDatasetArr.values()) { // // if (pb == null) { // continue; // } // if (!dsIndexesMap.containsKey(pb.getRawDataUrl())) { // List<Integer> list = new ArrayList<Integer>(); // dsIndexesMap.put(pb.getRawDataUrl(), list); // // } // List<Integer> list = dsIndexesMap.get(pb.getRawDataUrl()); // list.add(pb.getUniqId()); // dsIndexesMap.put(pb.getRawDataUrl(), list); // valueSet.add(pb.getRawDataUrl()); // // } break; case 4: filterId = "year"; for (QuantDatasetObject pb : quantDatasetArr.values()) { if (pb == null) { continue; } if (!dsIndexesMap.containsKey(pb.getYear() + "")) { List<Integer> list = new ArrayList<Integer>(); dsIndexesMap.put(pb.getYear() + "", list); } List<Integer> list = dsIndexesMap.get(pb.getYear() + ""); list.add(pb.getDsKey()); dsIndexesMap.put(pb.getYear() + "", list); int value = pb.getYear(); // valueSet.add(value); } break; case 5: filterId = "typeOfStudy"; for (QuantDatasetObject pb : quantDatasetArr.values()) { if (pb == null) { continue; } if (!dsIndexesMap.containsKey(pb.getTypeOfStudy())) { List<Integer> list = new ArrayList<Integer>(); dsIndexesMap.put(pb.getTypeOfStudy(), list); } if (pb.getTypeOfStudy().trim().equalsIgnoreCase("")) { pb.setTypeOfStudy("Not Available"); } List<Integer> list = dsIndexesMap.get(pb.getTypeOfStudy()); list.add(pb.getDsKey()); dsIndexesMap.put(pb.getTypeOfStudy(), list); String value = pb.getTypeOfStudy(); // valueSet.add(value); } break; case 6: filterId = "sampleType"; for (QuantDatasetObject pb : quantDatasetArr.values()) { if (pb == null) { continue; } if (pb.getSampleType().trim().equalsIgnoreCase("")) { pb.setSampleType("Not Available"); } if (!dsIndexesMap.containsKey(pb.getSampleType())) { List<Integer> list = new ArrayList<Integer>(); dsIndexesMap.put(pb.getSampleType(), list); } List<Integer> list = dsIndexesMap.get(pb.getSampleType()); list.add(pb.getDsKey()); dsIndexesMap.put(pb.getSampleType(), list); String value = pb.getSampleType(); // valueSet.add(value); } break; case 7: filterId = "sampleMatching"; for (QuantDatasetObject pb : quantDatasetArr.values()) { if (pb == null) { continue; } if (pb.getSampleMatching().trim().equalsIgnoreCase("")) { pb.setSampleMatching("Not Available"); } if (!dsIndexesMap.containsKey(pb.getSampleMatching())) { List<Integer> list = new ArrayList<Integer>(); dsIndexesMap.put(pb.getSampleMatching(), list); } List<Integer> list = dsIndexesMap.get(pb.getSampleMatching()); list.add(pb.getDsKey()); dsIndexesMap.put(pb.getSampleMatching(), list); String value = pb.getSampleMatching(); // valueSet.add(value); } break; case 8: filterId = "technology"; for (QuantDatasetObject pb : quantDatasetArr.values()) { if (pb == null) { continue; } String value = pb.getTechnology(); if (value == null || value.equalsIgnoreCase("")) { value = "Not Available"; } if (!dsIndexesMap.containsKey(value)) { List<Integer> list = new ArrayList<Integer>(); dsIndexesMap.put(value, list); } List<Integer> list = dsIndexesMap.get(value); list.add(pb.getDsKey()); dsIndexesMap.put(value, list); // valueSet.add(value); } break; case 9: filterId = "analyticalApproach"; for (QuantDatasetObject pb : quantDatasetArr.values()) { if (pb == null) { continue; } String value = pb.getAnalyticalApproach(); if (value == null || value.trim().equalsIgnoreCase("")) { pb.setAnalyticalApproach("Not Available"); value = "Not Available"; } if (!dsIndexesMap.containsKey(value)) { List<Integer> list = new ArrayList<Integer>(); dsIndexesMap.put(value, list); } List<Integer> list = dsIndexesMap.get(pb.getAnalyticalApproach()); list.add(pb.getDsKey()); dsIndexesMap.put(value, list); // valueSet.add(value); } break; case 10: filterId = "enzyme"; for (QuantDatasetObject pb : quantDatasetArr.values()) { if (pb == null) { continue; } String value = pb.getEnzyme(); if (value == null || value.trim().equalsIgnoreCase("")) { value = "Not Available"; pb.setEnzyme(value); } if (!dsIndexesMap.containsKey(value)) { List<Integer> list = new ArrayList<Integer>(); dsIndexesMap.put(value, list); } List<Integer> list = dsIndexesMap.get(value); list.add(pb.getDsKey()); dsIndexesMap.put(value, list); // valueSet.add(value); } break; case 11: filterId = "shotgunTargeted"; for (QuantDatasetObject pb : quantDatasetArr.values()) { if (pb == null) { continue; } String value = pb.getShotgunTargeted(); if (value == null || value.trim().equalsIgnoreCase("")) { value = "Not Available"; pb.setShotgunTargeted(value); } if (!dsIndexesMap.containsKey(value)) { List<Integer> list = new ArrayList<Integer>(); dsIndexesMap.put(value, list); } List<Integer> list = dsIndexesMap.get(value); list.add(pb.getDsKey()); dsIndexesMap.put(value, list); // valueSet.add(value); } break; case 12: // filterId = "quantificationBasis"; // for (QuantDatasetObject pb : quantDatasetArr.values()) { // if (pb == null) { // continue; // } // String value = pb.getQuantificationBasis(); // if (value == null || value.trim().equalsIgnoreCase("")) { // value = "Not Available"; // pb.setQuantificationBasis(value); // } // if (!dsIndexesMap.containsKey(value)) { // List<Integer> list = new ArrayList<Integer>(); // dsIndexesMap.put(value, list); // // } // List<Integer> list = dsIndexesMap.get(value); // list.add(pb.getDsKey()); // dsIndexesMap.put(value, list); // valueSet.add(value); // } break; case 13: filterId = "quantBasisComment"; for (QuantDatasetObject pb : quantDatasetArr.values()) { if (pb == null) { continue; } String value = pb.getQuantBasisComment(); if (value == null || value.trim().equalsIgnoreCase("")) { value = "Not Available"; pb.setQuantBasisComment(value); } if (!dsIndexesMap.containsKey(value)) { List<Integer> list = new ArrayList<Integer>(); dsIndexesMap.put(value, list); } List<Integer> list = dsIndexesMap.get(value); list.add(pb.getDsKey()); dsIndexesMap.put(value, list); // valueSet.add(value); } break; case 14: // for (QuantDatasetObject pb : QuantDatasetListObject) { // int value = pb.getQuantifiedProteinsNumber(); // valueSet.add(value); // } break; case 15: // for (QuantDatasetObject pb : QuantDatasetListObject) { // int value = pb.getPatientsGroup1Number(); // valueSet.add(value); // } break; case 16: // for (QuantDatasetObject pb : QuantDatasetListObject) { // int value = pb.getPatientsGroup2Number(); // valueSet.add(value); // } break; case 17: // for (QuantDatasetObject pb : QuantDatasetListObject) { // String value = pb.getNormalizationStrategy(); // valueSet.add(value); // } break; } // if (!valueSet.isEmpty()) { //do we need valueSet;; JfreeDivaPieChartFilter iFilter = new JfreeDivaPieChartFilter(filterId, x, internalSelectionManager, dsIndexesMap, filterWidth); chartSet.add(iFilter.getChart()); // fullFilterList.put(filterId, valueSet); this.addComponent(iFilter, colCounter++, rowCounter); this.setComponentAlignment(iFilter, Alignment.MIDDLE_CENTER); if (colCounter == 3) { colCounter = 0; rowCounter++; } } // } } Quant_Central_Manager.setStudiesOverviewPieChart(chartSet); HorizontalLayout btnLayout = new HorizontalLayout(); btnLayout.setHeight("23px"); btnLayout.setWidthUndefined(); btnLayout.setSpacing(true); btnLayout.setStyleName(Reindeer.LAYOUT_WHITE); if (colCounter == 3) { this.addComponent(btnLayout, 2, ++rowCounter); } else { this.addComponent(btnLayout, 2, rowCounter); } this.setComponentAlignment(btnLayout, Alignment.MIDDLE_CENTER); Button applyFilters = new Button("Apply"); applyFilters.setDescription("Apply the selected filters"); applyFilters.setPrimaryStyleName("resetbtn"); applyFilters.setWidth("50px"); applyFilters.setHeight("24px"); btnLayout.addComponent(applyFilters); applyFilters.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { pieChartFiltersBtn.closePupupWindow(); } }); // Button unselectAllBtn = new Button("Unselect All"); // unselectAllBtn.setStyleName(Reindeer.BUTTON_SMALL); // btnLayout.addComponent(unselectAllBtn); // unselectAllBtn.addClickListener(new Button.ClickListener() { // // @Override // public void buttonClick(Button.ClickEvent event) { // // internalSelectionManager.unselectAll(); // // } // }); // Button unselectAllBtn = new Button("Clear"); unselectAllBtn.setPrimaryStyleName("resetbtn"); unselectAllBtn.setWidth("50px"); unselectAllBtn.setHeight("24px"); btnLayout.addComponent(unselectAllBtn); btnLayout.setComponentAlignment(unselectAllBtn, Alignment.TOP_LEFT); unselectAllBtn.setDescription("Clear All Selections"); unselectAllBtn.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { internalSelectionManager.unselectAll(); } }); Button resetFiltersBtn = new Button("Reset"); resetFiltersBtn.setPrimaryStyleName("resetbtn"); resetFiltersBtn.setWidth("50px"); resetFiltersBtn.setHeight("24px"); btnLayout.addComponent(resetFiltersBtn); resetFiltersBtn.setDescription("Reset all applied filters"); resetFiltersBtn.addClickListener(new Button.ClickListener() { @Override public void buttonClick(Button.ClickEvent event) { internalSelectionManager.resetToInitState(); internalSelectionManager.resetCentralSelectionManager(); } }); Button exportChartsBtn = new Button(""); exportChartsBtn.setWidth("24px"); exportChartsBtn.setHeight("24px"); exportChartsBtn.setPrimaryStyleName("exportpdfbtn"); btnLayout.addComponent(exportChartsBtn); exportChartsBtn.setDescription("Export all charts filters as pdf file"); // exportChartsBtn.addClickListener(new Button.ClickListener() { // @Override // public void buttonClick(Button.ClickEvent event) { // String url = handler.exportImgAsPdf(chartSet, "piechart_filters.pdf"); // FileResource res = new FileResource(new File(url)); // Page.getCurrent().open(res, "_blank", true); // } // }); StreamResource myResource = createResource(handler); FileDownloader fileDownloader = new FileDownloader(myResource); fileDownloader.extend(exportChartsBtn); pieChartFiltersBtn = new PopupInteractiveDSFiltersLayout(this); }
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();/* w w w. j av a2 s. 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(); }