Example usage for com.vaadin.server Page getCurrent

List of usage examples for com.vaadin.server Page getCurrent

Introduction

In this page you can find the example usage for com.vaadin.server Page getCurrent.

Prototype

public static Page getCurrent() 

Source Link

Document

Gets the Page to which the current uI belongs.

Usage

From source file:pl.exsio.frameset.vaadin.ui.support.flexer.GridLayoutColumnFlexerImpl.java

License:Open Source License

@Override
protected int getSize() {
    return Page.getCurrent().getBrowserWindowWidth();
}

From source file:pl.exsio.frameset.vaadin.ui.support.flexer.GridLayoutRowFlexerImpl.java

License:Open Source License

@Override
protected int getSize() {
    return Page.getCurrent().getBrowserWindowHeight();
}

From source file:pl.exsio.plupload.examples.AbstractExample.java

License:Open Source License

private VerticalLayout getCodePane() {

    VerticalLayout layout = new VerticalLayout();
    final CodeMirror code = new CodeMirror();
    this.decorateCodePane(code);
    code.setLanguage(CodeMirrorLanguage.JAVA);
    layout.addComponent(code);/*from  w w  w .  j  a va 2 s.c o  m*/
    layout.setSizeFull();
    code.setTheme(CodeMirrorTheme.ECLIPSE);
    code.setSizeFull();
    // code.setHeight("500px");
    Page.getCurrent().addBrowserWindowResizeListener(new Page.BrowserWindowResizeListener() {

        @Override
        public void browserWindowResized(Page.BrowserWindowResizeEvent event) {
            code.setHeight((event.getHeight() - 120) + "px");
            code.setWidth((event.getWidth() - 550) + "px");
        }
    });
    code.setHeight((Page.getCurrent().getBrowserWindowHeight() - 120) + "px");
    code.setWidth((Page.getCurrent().getBrowserWindowWidth() - 550) + "px");
    return layout;
}

From source file:probe.com.view.body.identificationdatasetsoverview.IdentificationDatasetLayout.java

/**
 *
 * @param CSFPR_Handler/*from   ww  w.j ava2 s.  com*/
 * @param datasetId
 */
public IdentificationDatasetLayout(CSFPRHandler CSFPR_Handler, int datasetId) {
    topLabelMarker = new VerticalLayout();
    this.addComponent(topLabelMarker);
    this.setExpandRatio(topLabelMarker, 0.01f);
    topLabelMarker.setHeight("10px");
    topLabelMarker.setWidth("20px");
    topLabelMarker.setStyleName(Reindeer.LAYOUT_WHITE);

    this.setSizeFull();
    setMargin(true);
    this.CSFPR_Handler = CSFPR_Handler;
    this.setWidth("100%");
    int height = Page.getCurrent().getBrowserWindowHeight() - 100;
    this.setHeight(height + "px");

    container = new VerticalLayout();
    container.setHeightUndefined();
    container.setWidth("100%");
    this.addComponent(container);
    this.setExpandRatio(container, 0.99f);
    this.datasetId = datasetId;
    fractionsLayout = new VerticalLayout();
    peptidesLayout = new VerticalLayout();
    peptidesLayout.setMargin(true);
    buildMainLayout();

}

From source file:probe.com.view.body.quantcompare.QuantCompareDataViewLayout.java

/**
 *
 * @param CSFPR_Handler/*from  w  w  w  . j  a  v a  2  s  .c om*/
 * @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);// w w w. ja va  2s.  co  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.quantdatasetsoverview.diseasegroupsfilters.GroupSwichBtn.java

private void setWindowHight(int itemsNumber) {
    int itemH = (25 * itemsNumber) + 200;
    int itemW = 500;
    int browserW = Page.getCurrent().getBrowserWindowWidth();
    if (Page.getCurrent().getBrowserWindowHeight() * 90 / 100 > itemH) {
        popupWindow.setHeightUndefined();
    } else {/*from   w  w w .  j  a v  a  2s . com*/
        int height = Math.min(Page.getCurrent().getBrowserWindowHeight() * 90 / 100, itemH);
        popupWindow.setHeight((height) + "px");
    }
    int width = Math.min(browserW * 90 / 100, itemW);
    popupBody.setWidth((width) + "px");
    popupWindow.setWidth((width + 20) + "px");

    int x = (browserW / 2) - (width / 2);
    popupWindow.setPositionX(x);

}

From source file:probe.com.view.body.quantdatasetsoverview.diseasegroupsfilters.interactivepiechartfilters.JfreeDivaPieChartFilter.java

/**
 *
 * @param filterId/*from  w w w .ja va 2s .  c  om*/
 * @param filterIndex
 * @param Local_Filter_Manager
 * @param dsIndexesMap
 * @param filterWidth
 */
public JfreeDivaPieChartFilter(String filterId, int filterIndex, PieChartsSelectionManager Local_Filter_Manager,
        Map<String, List<Integer>> dsIndexesMap, int filterWidth) {
    this.filter_Id = filterId;
    this.Local_Filter_Manager = Local_Filter_Manager;
    this.dsIndexesMap = dsIndexesMap;
    this.inuseDsIndexesMap = dsIndexesMap;

    this.updateLabelsAndValues(null, false);
    for (int z = 0; z < labels.length; z++) {
        defaultKeyColorMap.put(labels[z], defaultColors[z]);
    }
    width = filterWidth;
    height = (Page.getCurrent().getBrowserWindowHeight() - 200) / 3;
    this.setWidth(width + "px");
    this.setHeight(height + "px");
    this.defaultImgURL = initPieChart(width, height);
    teststyle = "pieChartCssfilter_" + filterId;
    styles.add("." + teststyle + " :focus { outline: none !important;}");
    inUseImgURL = defaultImgURL;
    redrawChart();
    this.addLayoutClickListener(JfreeDivaPieChartFilter.this);
    Local_Filter_Manager.registerLocalPieChartFilter(JfreeDivaPieChartFilter.this);
}

From source file:probe.com.view.body.quantdatasetsoverview.diseasegroupsfilters.interactivepiechartfilters.StudiesPieChartFiltersContainerLayout.java

/**
 *
 * @param Quant_Central_Manager/*from w  w w  .jav a  2  s .  c o 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.PopupInteractiveDSFiltersLayout.java

/**
 *
 * @param interactivePieChartFiltersContainerLayout
 *///from ww w  .  j  ava 2 s  .  c  o m
public PopupInteractiveDSFiltersLayout(
        final StudiesPieChartFiltersContainerLayout interactivePieChartFiltersContainerLayout) {
    VerticalLayout datasetExplorerFiltersIcon = new VerticalLayout();
    //        datasetExplorerFiltersIcon.setWidth("45px");
    //        datasetExplorerFiltersIcon.setHeight("24px");
    //        Label btnTitle = new Label("Studies");
    //        datasetExplorerFiltersIcon.addComponent(btnTitle);
    datasetExplorerFiltersIcon.setStyleName("studyexplorer");
    datasetExplorerFiltersIcon.setDescription("Dataset expolorer filter");
    this.addComponent(datasetExplorerFiltersIcon);
    this.setComponentAlignment(datasetExplorerFiltersIcon, Alignment.BOTTOM_LEFT);
    datasetExplorerFiltersIcon.addLayoutClickListener(PopupInteractiveDSFiltersLayout.this);
    this.setHeightUndefined();

    int height = Page.getCurrent().getBrowserWindowHeight() - 100;
    int width = Page.getCurrent().getBrowserWindowWidth() - 100;
    VerticalLayout popupBody = new VerticalLayout();
    popupBody.setWidth((width) + "px");
    popupBody.setHeightUndefined();
    popupBody.setStyleName(Reindeer.LAYOUT_WHITE);

    this.interactivePieChartFiltersContainerLayout = interactivePieChartFiltersContainerLayout;
    popupWindow = new Window() {

        @Override
        public void close() {
            interactivePieChartFiltersContainerLayout.updateSelectionManager(true);
            popupWindow.setVisible(false);

        }

    };
    popupWindow.setContent(popupBody);
    popupWindow.setWindowMode(WindowMode.NORMAL);
    popupWindow.setWidth((width + 40) + "px");
    popupWindow.setHeight((height) + "px");
    popupWindow.setVisible(false);
    popupWindow.setResizable(false);
    popupWindow.setClosable(false);
    popupWindow.setStyleName(Reindeer.WINDOW_LIGHT);
    popupWindow.setModal(true);
    popupWindow.setDraggable(false);
    popupWindow.center();

    popupWindow.setCaption(
            "<font color='gray' style='font-weight: bold;!important'>&nbsp;&nbsp;Dataset Explorer Filters</font>");

    UI.getCurrent().addWindow(popupWindow);
    popupWindow.setPositionX(30);
    popupWindow.setPositionY(40);

    popupWindow.setCaptionAsHtml(true);
    popupWindow.setClosable(true);

    popupBody.setMargin(true);
    popupBody.setSpacing(true);

    popupBody.addComponent(interactivePieChartFiltersContainerLayout);

}