Example usage for com.vaadin.ui Alignment TOP_LEFT

List of usage examples for com.vaadin.ui Alignment TOP_LEFT

Introduction

In this page you can find the example usage for com.vaadin.ui Alignment TOP_LEFT.

Prototype

Alignment TOP_LEFT

To view the source code for com.vaadin.ui Alignment TOP_LEFT.

Click Source Link

Usage

From source file:probe.com.view.body.quantdatasetsoverview.diseasegroupsfilters.popupreordergroups.SortableLayoutContainer.java

public SortableLayoutContainer(int w, int subH, final String strTitle, Set<String> labels,
        Map<String, String> diseaseStyleMap) {
    this.diseaseStyleMap = diseaseStyleMap;

    this.setStyleName(Reindeer.LAYOUT_WHITE);
    this.setSpacing(true);
    this.strTitle = strTitle;
    this.groupSelectionMap = new HashMap<String, Boolean>();
    this.selectionSet = new LinkedHashSet<String>();
    //        this.fullSelectionSet = new LinkedHashSet<String>();
    HorizontalLayout headerLayoutI = new HorizontalLayout();
    Label titileI = new Label(strTitle);
    titileI.setStyleName("custLabel");
    headerLayoutI.addComponent(titileI);
    this.addComponent(headerLayoutI);
    int containerWidth = ((w) / 2) - 20;

    this.setWidth(containerWidth + "px");
    int height = subH - 15;
    headerLayoutI.setWidth(containerWidth + "px");

    clearBtn = new Button("Clear");
    clearBtn.setStyleName(Reindeer.BUTTON_LINK);
    clearBtn.setWidth("40px");
    clearBtn.setHeight("18px");
    clearBtn.setEnabled(false);/*  w  ww  . ja  v  a  2 s.c  o m*/
    headerLayoutI.addComponent(clearBtn);
    headerLayoutI.setComponentAlignment(clearBtn, Alignment.TOP_RIGHT);
    clearBtn.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            //                autoClear = true;
            singleSelected = false;
            diseaseGroupSelectOption.setValue(null);

        }
    });

    Panel bodyPanel = new Panel();
    HorizontalLayout bodyLayout = new HorizontalLayout();
    bodyLayout.setStyleName(Reindeer.LAYOUT_WHITE);
    bodyPanel.setContent(bodyLayout);
    this.addComponent(bodyPanel);
    bodyPanel.setHeight(subH + "px");
    bodyPanel.setWidth((containerWidth) + "px");

    counterLayoutContainer = new VerticalLayout();
    bodyLayout.addComponent(counterLayoutContainer);
    counterLayoutContainer.setHeight(height + "px");
    counterLayoutContainer.setWidth("30px");
    counterLayoutContainer.setStyleName(Reindeer.LAYOUT_WHITE);

    counterLayout = new VerticalLayout();
    counterLayoutContainer.addComponent(counterLayout);
    counterLayout.setWidth("30px");
    counterLayout.setSpacing(false);
    counterLayout.setStyleName("countcontainer");

    int sortableItremWidth = containerWidth - 26 - 6 - 15;
    sortableDiseaseGroupLayout = new SortableLayout();
    bodyLayout.addComponent(sortableDiseaseGroupLayout);
    sortableDiseaseGroupLayout.setWidth(sortableItremWidth + "px");

    sortableDiseaseGroupLayout.setData(strTitle);
    sortableDiseaseGroupLayout.addStyleName("no-horizontal-drag-hints");

    checkboxLayout = new VerticalLayout();
    bodyLayout.addComponent(checkboxLayout);

    checkboxLayout.setSpacing(false);
    checkboxLayout.setEnabled(false);
    checkboxLayout.setHeight(height + "px");
    checkboxLayout.setStyleName("countcontainer");
    checkboxLayout.setMargin(new MarginInfo(false, false, false, false));

    diseaseGroupSelectOption = new OptionGroup();
    checkboxLayout.addComponent(diseaseGroupSelectOption);
    checkboxLayout.setComponentAlignment(diseaseGroupSelectOption, Alignment.TOP_LEFT);
    //        diseaseGroupSelectOption.setWidth("20px");
    diseaseGroupSelectOption.setNullSelectionAllowed(true); // user can not 'unselect'
    diseaseGroupSelectOption.setMultiSelect(true);
    diseaseGroupSelectOption.addStyleName("sortablelayoutselect");
    diseaseGroupSelectOption.addValueChangeListener(new Property.ValueChangeListener() {

        @Override
        public void valueChange(Property.ValueChangeEvent event) {
            if (autoClear) {
                autoClear = false;
                return;
            }
            for (String key : groupSelectionMap.keySet()) {
                groupSelectionMap.put(key, Boolean.FALSE);
            }
            getSelectionSet().clear();
            singleSelected = false;
            int counter = 0;
            for (Object key : ((Set) diseaseGroupSelectOption.getValue())) {
                if (((Integer) key) >= groupsIds.size()) {
                    continue;
                }
                groupSelectionMap.put(groupsIds.get((Integer) key), Boolean.TRUE);
                singleSelected = true;
                counter++;
                getSelectionSet().add(groupsIds.get((Integer) key));
            }
            if (counter == groupsIds.size()) {
                singleSelected = false;
            }

        }

    });

    itemWidth = sortableItremWidth - 10;
    initLists(labels);
}

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

private void initPopupBody(int w) {
    HorizontalLayout mainContainer = new HorizontalLayout();
    mainContainer.setStyleName(Reindeer.LAYOUT_WHITE);
    mainContainer.setSpacing(true);/*w w w  .  ja v a  2s .  c o  m*/
    mainContainer.setWidth(w + "px");

    mainContainer.setHeightUndefined();
    mainContainer.setMargin(new MarginInfo(true, false, false, false));

    mainContainer.addComponent(sortableDiseaseGroupI);
    mainContainer.setComponentAlignment(sortableDiseaseGroupI, Alignment.TOP_LEFT);

    mainContainer.addComponent(sortableDiseaseGroupII);
    mainContainer.setComponentAlignment(sortableDiseaseGroupII, Alignment.TOP_RIGHT);

    Property.ValueChangeListener selectionChangeListenet = new Property.ValueChangeListener() {

        @Override
        public void valueChange(Property.ValueChangeEvent event) {

            if (sortableDiseaseGroupI.isSingleSelected()) {
                sortableDiseaseGroupII.setEnableSelection(true);
            } else {
                sortableDiseaseGroupII.selectAndHideUnselected(null, false);
                //                    sortableDiseaseGroupII.setEnableSelection(false);
                return;
            }

            Set<String> updatedGroupIISet = filterPatGroup2List(sortableDiseaseGroupI.getSelectionSet());
            sortableDiseaseGroupII.selectAndHideUnselected(updatedGroupIISet, false);

        }
    };
    sortableDiseaseGroupI.addSelectionValueChangeListener(selectionChangeListenet);

    popupBodyLayout.addComponent(mainContainer);
    popupBodyLayout.setComponentAlignment(mainContainer, Alignment.TOP_LEFT);

    HorizontalLayout bottomLayout = new HorizontalLayout();
    bottomLayout.setWidth("100%");
    bottomLayout.setMargin(new MarginInfo(true, false, false, false));

    popupBodyLayout.addComponent(bottomLayout);
    int width = w - 200;
    ToggleBtn sortSelectToggleBtn = new ToggleBtn("Sort Groups ", "Select Groups ", "Sort  drag & drop",
            "*Select to filter datasets", width);
    bottomLayout.addComponent(sortSelectToggleBtn);//commentLabel
    bottomLayout.setComponentAlignment(sortSelectToggleBtn, Alignment.MIDDLE_LEFT);//commentLabel
    bottomLayout.setExpandRatio(sortSelectToggleBtn, w);
    HorizontalLayout btnLayout = new HorizontalLayout();
    btnLayout.setSpacing(true);
    LayoutEvents.LayoutClickListener toggleListener = new LayoutEvents.LayoutClickListener() {

        @Override
        public void layoutClick(LayoutEvents.LayoutClickEvent event) {
            if (event.getComponent().getStyleName().equalsIgnoreCase("toggleleft")) {
                sortableDiseaseGroupI.setLayoutMode("sort");
                sortableDiseaseGroupII.setEnabled(true);
                sortableDiseaseGroupII.setLayoutMode("sort");

            } else {
                sortableDiseaseGroupI.setLayoutMode("select");
                sortableDiseaseGroupII.setEnableSelection(false);
                sortableDiseaseGroupII.setLayoutMode("select");
                if (sortableDiseaseGroupI.isSingleSelected()) {
                    sortableDiseaseGroupII.setEnableSelection(true);
                }

            }

        }
    };
    sortSelectToggleBtn.addLayoutClickListener(toggleListener);

    btnLayout.setWidthUndefined();
    bottomLayout.addComponent(btnLayout);
    bottomLayout.setComponentAlignment(btnLayout, Alignment.TOP_RIGHT);
    bottomLayout.setExpandRatio(btnLayout, 250);
    Button applyFilters = new Button("Apply");
    applyFilters.setDescription("Apply the updates");
    applyFilters.setPrimaryStyleName("resetbtn");
    applyFilters.setWidth("50px");
    applyFilters.setHeight("24px");

    btnLayout.addComponent(applyFilters);
    applyFilters.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            rowHeaders = sortableDiseaseGroupI.getSortedSet();
            colHeaders = sortableDiseaseGroupII.getSortedSet();
            updateSelectionManager(studiesIndexes);
            popupWindow.close();
        }
    });

    Button cancelFiltersBtn = new Button("Cancel");
    cancelFiltersBtn.setPrimaryStyleName("resetbtn");
    btnLayout.addComponent(cancelFiltersBtn);
    cancelFiltersBtn.setWidth("50px");
    cancelFiltersBtn.setHeight("24px");

    cancelFiltersBtn.setDescription("Reset all applied filters");
    cancelFiltersBtn.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            popupWindow.close();
        }
    });
    Button resetFiltersBtn = new Button("Reset");
    resetFiltersBtn.setPrimaryStyleName("resetbtn");
    btnLayout.addComponent(resetFiltersBtn);
    resetFiltersBtn.setWidth("50px");
    resetFiltersBtn.setHeight("24px");

    resetFiltersBtn.setDescription("Reset all groups");
    resetFiltersBtn.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            Quant_Central_Manager.resetFiltersListener();
            rowHeaders = Quant_Central_Manager.getSelectedHeatMapRows();
            colHeaders = Quant_Central_Manager.getSelectedHeatMapColumns();
            sortableDiseaseGroupI.initLists(rowHeaders);
            sortableDiseaseGroupII.initLists(colHeaders);

        }
    });

}

From source file:probe.com.view.body.quantdatasetsoverview.quantproteinscomparisons.DiseaseGroupsComparisonsProteinLayout.java

private void initLabelLayout() {
    this.setWidth("100%");
    this.setHeight("20px");
    this.setStyleName("pointer");
    this.setSpacing(false);
    this.setMargin(false);

    downLabel = new Label();
    downLabel.setWidth("50px");
    downLabel.setHeight("15px");
    downLabel.setContentMode(ContentMode.HTML);
    this.addComponent(downLabel);
    this.setComponentAlignment(downLabel, Alignment.TOP_RIGHT);

    this.trendataLayoutWrapper = new HorizontalLayout();
    trendataLayoutWrapper.setStyleName("emptybackground");//"empty"
    this.addComponent(trendataLayoutWrapper);
    this.setComponentAlignment(trendataLayoutWrapper, Alignment.MIDDLE_CENTER);

    downLayout.setHeight("15px");
    downLayout.setStyleName("greenlayout");
    trendataLayoutWrapper.addComponent(downLayout);
    trendataLayoutWrapper.setComponentAlignment(downLayout, Alignment.MIDDLE_LEFT);

    stableLayoutWrapper = new HorizontalLayout();
    stableLayoutWrapper.setStyleName("empty");
    trendataLayoutWrapper.addComponent(stableLayoutWrapper);
    trendataLayoutWrapper.setComponentAlignment(stableLayoutWrapper, Alignment.MIDDLE_CENTER);

    emptyLayout.setHeight("15px");
    //        trendataLayoutWrapper.setStyleName("empty");//"empty"

    //        stableLayout.setWidth("100%");
    stableLayout.setHeight("15px");
    stableLayout.setStyleName("lightbluelayout");

    noValueProvidedLayout.setHeight("15px");
    noValueProvidedLayout.setStyleName("novaluelayout");//"empty"

    upLayout.setHeight("15px");
    upLayout.setStyleName("redlayout");
    trendataLayoutWrapper.addComponent(upLayout);
    trendataLayoutWrapper.setComponentAlignment(upLayout, Alignment.MIDDLE_RIGHT);
    upLayout.setCaptionAsHtml(true);//from w ww .j  a v a 2  s. c o  m

    upLabel = new Label();
    upLabel.setContentMode(ContentMode.HTML);
    upLabel.setWidth("50px");
    upLabel.setHeight("15px");
    this.addComponent(upLabel);
    this.setComponentAlignment(upLabel, Alignment.TOP_LEFT);

}

From source file:probe.com.view.body.quantdatasetsoverview.quantproteinscomparisons.TrendLegend.java

public TrendLegend(String type) {
    this.setSpacing(true);
    if (type.equalsIgnoreCase("miniscatterpeptidessequence")) {
        String[] labels = new String[] { "Increased", "Equal", "Decreased ", "No Quant. Info." };
        String[] styleName = new String[] { "legendtared100", "legendbluedm", "legendgreenta100",
                "legendgraydm" };
        this.setSpacing(true);
        this.setColumns(4);
        this.setRows(1);
        for (int i = 0; i < styleName.length; i++) {
            HorizontalLayout item = generateItemLabel(labels[i], styleName[i]);
            this.addComponent(item, i, 0);
            this.setComponentAlignment(item, Alignment.MIDDLE_CENTER);

        }//from   w  w  w.  j a va2 s  . c o m

    } else if (type.equalsIgnoreCase("linechart")) {
        String[] labels = new String[] { "Increased   100%", "Increased < 100%", "Equal", "Decreased < 100%",
                "Decreased   100%", "No Quant. Info.", "No Data" };
        String[] styleName = new String[] { "legendtared100", "legendredtaless100", "legendbluedm",
                "legendgreentaless100", "legendgreenta100", "legendgraydm", "legendemptygraydm" };
        this.setSpacing(true);
        this.setColumns(7);
        this.setRows(1);
        this.setMargin(new MarginInfo(false, true, false, false));
        for (int i = 0; i < styleName.length; i++) {
            HorizontalLayout item = generateItemLabel(labels[i], styleName[i]);
            this.addComponent(item, i, 0);
            this.setComponentAlignment(item, Alignment.MIDDLE_CENTER);

        }

    } else if (type.equalsIgnoreCase("bubblechart")) {
        String[] labels = new String[] { "Increased   100%", "Increased < 100%", "Equal", "Decreased < 100%",
                "Decreased   100%", "No Quant. Info." };
        String[] styleName = new String[] { "legendred100", "legendredless100", "legendblue",
                "legendgreenless100", "legendgreen100", "legendgray" };
        this.setSpacing(true);
        this.setColumns(6);
        this.setRows(1);
        this.setMargin(new MarginInfo(false, true, false, false));
        for (int i = 0; i < styleName.length; i++) {
            HorizontalLayout item = generateItemLabel(labels[i], styleName[i]);
            this.addComponent(item, i, 0);
            this.setComponentAlignment(item, Alignment.MIDDLE_CENTER);

        }

    } else if (type.equalsIgnoreCase("table")) {
        String[] labels = new String[] { "Increased", "Equal", "Decreased", "No Quant. Info.",
                "Not Available" };
        String[] styleName = new String[] { "redlayout", "lightbluelayout", "greenlayout", "novaluelayout",
                "empty" };
        this.setSpacing(true);
        this.setColumns(5);
        this.setRows(1);
        this.setMargin(new MarginInfo(false, true, false, false));
        for (int i = 0; i < styleName.length; i++) {
            HorizontalLayout item = generateItemLabel(labels[i], styleName[i]);
            this.addComponent(item, i, 0);
            this.setComponentAlignment(item, Alignment.MIDDLE_CENTER);

        }
    } else if (type.equalsIgnoreCase("ministackedpeptidessequence")) {
        String[] labels = new String[] { "Increased", "Increased-not sign.", "Equal", "Decreased",
                "Decreased-not sign.", "No Quant. Info.", "PTM" };
        String[] styleName = new String[] { "redlayout", "notsigredstackedlayout", "lightbluelayout",
                "greenlayout", "notsiggreenstackedlayout", "novaluelayout", "ptmglycosylation" };
        this.setSpacing(false);
        this.setRows(1);
        this.setColumns(7);
        this.setMargin(new MarginInfo(false, false, false, false));

        int colCounter = 0;
        int rowCounter = 0;
        for (int i = 0; i < styleName.length; i++) {
            HorizontalLayout item = generateItemLabel(labels[i], styleName[i]);
            this.addComponent(item, colCounter++, rowCounter);
            //                if (colCounter == 3) {
            //                    colCounter = 0;
            //                    rowCounter++;
            //                }
            this.setComponentAlignment(item, Alignment.TOP_LEFT);

        }

    } else {
        String[] labels = new String[] { "Increased", "Increased-not sign.", "Equal", "Decreased-not sign.",
                "Decreased", "No Quant. Info.", "PTM" };
        String[] styleName = new String[] { "redlayout", "notsigredstackedlayout", "lightbluelayout",
                "notsiggreenstackedlayout", "greenlayout", "novaluelayout", "ptmglycosylation" };
        this.setSpacing(true);
        this.setRows(1);
        this.setColumns(7);
        this.setMargin(new MarginInfo(false, false, false, false));

        for (int i = 0; i < styleName.length; i++) {
            HorizontalLayout item = generateItemLabel(labels[i], styleName[i]);
            this.addComponent(item, i, 0);
            this.setComponentAlignment(item, Alignment.MIDDLE_CENTER);

        }

    }

}

From source file:probe.com.view.body.quantdatasetsoverview.quantproteinstabsheet.peptidescontainer.PeptidesOverviewPanel.java

/**
 *
 * @param width//  w  w  w  . j  a  v a2  s . co  m
 * @param height
 */
public PeptidesOverviewPanel(int width, int height) {
    this.setWidth(width + "px");
    this.setHeight(height + "px");
    this.setStyleName(Reindeer.LAYOUT_BLUE);
    this.setMargin(true);

    HorizontalLayout topLayout = new HorizontalLayout();
    topLayout.setHeight("20px");
    topLayout.setWidth((width) + "px");
    topLayout.setStyleName(Reindeer.LAYOUT_WHITE);
    topLayout.setMargin(false);
    this.addComponent(topLayout);

    authorLabel = new Label();
    topLayout.addComponent(authorLabel);
    topLayout.setComponentAlignment(authorLabel, Alignment.TOP_LEFT);
    authorLabel.setStyleName("filterShowLabel");

    peptidesChartLayout = new AbsoluteLayout();
    peptidesChartLayout.setWidth(width + "px");
    peptidesChartLayout.setHeight((height - 20) + "px");

}

From source file:probe.com.view.body.quantdatasetsoverview.quantproteinstabsheet.studies.PeptidesComparisonsSequenceLayout.java

/**
 *
 * @param cp// ww  w .j ava2  s .  com
 * @param width
 * @param Quant_Central_Manager
 */
public PeptidesComparisonsSequenceLayout(QuantCentralManager Quant_Central_Manager,
        final DiseaseGroupsComparisonsProteinLayout cp, int width) {
    this.studiesMap = new LinkedHashMap<String, StudyInfoData>();
    this.setColumns(4);
    this.setRows(3);
    this.setWidthUndefined();
    this.setSpacing(true);
    this.setMargin(new MarginInfo(true, false, false, false));
    comparisonTitle = new Label();
    comparisonTitle.setContentMode(ContentMode.HTML);
    comparisonTitle.setStyleName("custChartLabelHeader");
    comparisonTitle.setWidth((width - 55) + "px");
    this.addComponent(comparisonTitle, 1, 0);
    this.setComponentAlignment(comparisonTitle, Alignment.TOP_LEFT);

    closeBtn = new VerticalLayout();
    closeBtn.setWidth("20px");
    closeBtn.setHeight("20px");
    closeBtn.setStyleName("closebtn");
    this.addComponent(closeBtn, 2, 0);
    this.setComponentAlignment(closeBtn, Alignment.TOP_RIGHT);
    //end of toplayout
    //init comparison study layout

    GridLayout proteinSequenceComparisonsContainer = new GridLayout(2,
            cp.getComparison().getDatasetIndexes().length);
    proteinSequenceComparisonsContainer.setWidthUndefined();
    proteinSequenceComparisonsContainer.setHeightUndefined();
    proteinSequenceComparisonsContainer.setStyleName(Reindeer.LAYOUT_WHITE);
    proteinSequenceComparisonsContainer.setSpacing(true);
    proteinSequenceComparisonsContainer.setMargin(new MarginInfo(true, false, false, false));
    this.addComponent(proteinSequenceComparisonsContainer, 1, 1);
    coverageWidth = (width - 100 - 180);

    Map<Integer, Set<QuantPeptide>> dsQuantPepMap = new HashMap<Integer, Set<QuantPeptide>>();
    for (QuantPeptide quantPep : cp.getQuantPeptidesList()) {
        if (!dsQuantPepMap.containsKey(quantPep.getDsKey())) {
            Set<QuantPeptide> subList = new HashSet<QuantPeptide>();
            dsQuantPepMap.put(quantPep.getDsKey(), subList);
        }
        Set<QuantPeptide> subList = dsQuantPepMap.get(quantPep.getDsKey());
        subList.add(quantPep);
        dsQuantPepMap.put(quantPep.getDsKey(), subList);
    }

    int numb = 0;

    int panelWidth = Page.getCurrent().getBrowserWindowWidth() - 100;
    String groupCompTitle = cp.getComparison().getComparisonHeader();
    String updatedHeader = groupCompTitle.split(" / ")[0].split("\n")[0] + " / "
            + groupCompTitle.split(" / ")[1].split("\n")[0];//+ " ( " + groupCompTitle.split(" / ")[1].split("\n")[1] + " )";
    ;
    final StudyInformationPopupComponent studyInformationPopupPanel = new StudyInformationPopupComponent(
            panelWidth, cp.getProtName(), cp.getUrl(), cp.getComparison().getComparisonFullName());
    studyInformationPopupPanel.setVisible(false);

    LayoutEvents.LayoutClickListener studyListener = new LayoutEvents.LayoutClickListener() {

        @Override
        public void layoutClick(LayoutEvents.LayoutClickEvent event) {
            Integer dsId;
            if (event.getComponent() instanceof AbsoluteLayout) {
                dsId = (Integer) ((AbsoluteLayout) event.getComponent()).getData();
            } else {
                dsId = (Integer) ((VerticalLayout) event.getComponent()).getData();
            }
            studyInformationPopupPanel.updateContent(dsToStudyLayoutMap.get(dsId));
        }
    };
    TreeSet<QuantProtein> orderSet = new TreeSet<QuantProtein>(cp.getDsQuantProteinsMap().values());
    for (QuantProtein quantProtein : orderSet) {
        StudyInfoData exportData = new StudyInfoData();
        exportData.setCoverageWidth(coverageWidth);
        Label studyTitle = new Label();//"Study " + (numb + 1));
        studyTitle.setStyleName("peptideslayoutlabel");
        studyTitle.setHeightUndefined();
        studyTitle.setWidth("200px");

        Label iconTitle = new Label("#Patients ("
                + (quantProtein.getPatientsGroupIINumber() + quantProtein.getPatientsGroupINumber()) + ")");
        exportData.setSubTitle(iconTitle.getValue());

        iconTitle.setStyleName("peptideslayoutlabel");
        iconTitle.setHeightUndefined();
        if (quantProtein.getStringPValue().equalsIgnoreCase("Not Significant")
                || quantProtein.getStringFCValue().equalsIgnoreCase("Not regulated")) {
            iconTitle.setStyleName("notregicon");
            exportData.setTrend(0);
        } else if (quantProtein.getStringFCValue().equalsIgnoreCase("Decreased")) {
            iconTitle.setStyleName("downarricon");
            exportData.setTrend(-1);
        } else {
            exportData.setTrend(1);
            iconTitle.setStyleName("uparricon");
        }

        iconTitle.setDescription(cp.getProteinAccssionNumber() + " : #Patients ("
                + (quantProtein.getPatientsGroupIINumber() + quantProtein.getPatientsGroupINumber()) + ")  "
                + quantProtein.getStringFCValue() + " " + quantProtein.getStringPValue() + "");

        VerticalLayout labelContainer = new VerticalLayout();
        labelContainer.addComponent(studyTitle);
        labelContainer.addComponent(iconTitle);

        proteinSequenceComparisonsContainer.addComponent(labelContainer, 0, numb);
        proteinSequenceComparisonsContainer.setComponentAlignment(labelContainer, Alignment.TOP_CENTER);

        Map<Integer, ComparisonDetailsBean> patientGroupsNumToDsIdMap = new HashMap<Integer, ComparisonDetailsBean>();
        ComparisonDetailsBean pGr = new ComparisonDetailsBean();
        patientGroupsNumToDsIdMap
                .put((quantProtein.getPatientsGroupIINumber() + quantProtein.getPatientsGroupINumber()), pGr);
        QuantDatasetObject ds;

        ds = Quant_Central_Manager.getFullQuantDatasetMap().get(quantProtein.getDsKey());

        StudyPopupLayout study = new StudyPopupLayout(panelWidth, quantProtein, ds,
                cp.getProteinAccssionNumber(), cp.getUrl(), cp.getProtName(),
                Quant_Central_Manager.getDiseaseHashedColorMap());
        Set<QuantDatasetObject> qdsSet = new HashSet<QuantDatasetObject>();
        qdsSet.add(ds);
        study.setInformationData(qdsSet, cp);
        dsToStudyLayoutMap.put(ds.getDsKey(), study);

        labelContainer.addLayoutClickListener(studyListener);
        labelContainer.setData(ds.getDsKey());
        studyTitle.setValue("[" + (numb + 1) + "] " + ds.getAuthor());
        exportData.setTitle(ds.getAuthor());

        if (dsQuantPepMap.get(quantProtein.getDsKey()) == null) {
            Label noPeptidesInfoLabel = new Label("No Peptide Information Available ");
            noPeptidesInfoLabel.setHeightUndefined();
            noPeptidesInfoLabel.setStyleName("peptideslayoutlabel");
            VerticalLayout labelValueContainer = new VerticalLayout();
            labelValueContainer.addComponent(noPeptidesInfoLabel);
            labelValueContainer.addLayoutClickListener(studyListener);
            labelValueContainer.setData(ds.getDsKey());

            proteinSequenceComparisonsContainer.addComponent(labelValueContainer, 1, numb);
            proteinSequenceComparisonsContainer.setComponentAlignment(labelValueContainer,
                    Alignment.TOP_CENTER);
            numb++;
            studiesMap.put((numb + 1) + ds.getAuthor(), exportData);
            continue;
        }

        String key = "_-_" + quantProtein.getDsKey() + "_-_" + cp.getProteinAccssionNumber() + "_-_";
        PeptidesInformationOverviewLayout peptideInfoLayout = new PeptidesInformationOverviewLayout(
                cp.getSequence(), dsQuantPepMap.get(quantProtein.getDsKey()), coverageWidth, true,
                studyListener, ds.getDsKey());
        exportData.setPeptidesInfoList(peptideInfoLayout.getStackedPeptides());
        exportData.setLevelsNumber(peptideInfoLayout.getLevel());
        hasPTM = peptideInfoLayout.isHasPTM();
        peptidesInfoLayoutDSIndexMap.put(key, peptideInfoLayout);
        proteinSequenceComparisonsContainer.addComponent(peptideInfoLayout, 1, numb);
        numb++;
        studiesMap.put((numb + 1) + ds.getAuthor(), exportData);

    }

    String rgbColor = Quant_Central_Manager
            .getDiseaseHashedColor(groupCompTitle.split(" / ")[1].split("\n")[1]);
    comparisonTitle.setValue("<font color='" + rgbColor + "' style='font-weight: bold;'>" + updatedHeader
            + " (#Datasets " + numb + "/" + cp.getComparison().getDatasetIndexes().length + ")</font>");
    comparisonTitle.setDescription(cp.getComparison().getComparisonFullName());
    VerticalLayout bottomSpacer = new VerticalLayout();
    bottomSpacer.setWidth((width - 100) + "px");
    bottomSpacer.setHeight("10px");
    bottomSpacer.setStyleName("dottedline");
    this.addComponent(bottomSpacer, 1, 2);

}

From source file:probe.com.view.body.quantdatasetsoverview.quantproteinstabsheet.studies.ProteinStudyComparisonScatterPlotLayout.java

/**
 *
 * @param cp/*from  w w w .  j a  v  a 2 s  . co  m*/
 * @param width
 * @param Quant_Central_Manager
 * @param custTrend
 */
public ProteinStudyComparisonScatterPlotLayout(final QuantCentralManager Quant_Central_Manager,
        final DiseaseGroupsComparisonsProteinLayout cp, int width, int custTrend) {
    this.custTrend = custTrend;
    this.Quant_Central_Manager = Quant_Central_Manager;
    this.setColumns(4);
    this.setRows(2);
    this.width = width;
    this.setSpacing(true);
    this.setMargin(new MarginInfo(true, false, false, false));
    this.comparisonProtein = cp;
    int numb = cp.getSignificantDown() + cp.getStable() + cp.getSignificantUp();
    String groupCompTitle = cp.getComparison().getComparisonHeader();
    String updatedHeader = groupCompTitle.split(" / ")[0].split("\n")[0] + " / "
            + groupCompTitle.split(" / ")[1].split("\n")[0];// + " ( " + groupCompTitle.split(" / ")[1].split("\n")[1] + " )";

    String rgbColor = Quant_Central_Manager
            .getDiseaseHashedColor(groupCompTitle.split(" / ")[1].split("\n")[1]);
    comparisonTitle = new Label("<font color='" + rgbColor + "' style='font-weight: bold;'>" + updatedHeader
            + " (Datasets " + numb + "/" + cp.getComparison().getDatasetIndexes().length + ")</font>");
    comparisonTitle.setContentMode(ContentMode.HTML);
    comparisonTitle.setStyleName("custChartLabelHeader");
    comparisonTitle.setWidth((width - 55) + "px");
    comparisonTitle.setDescription(cp.getComparison().getComparisonFullName());
    this.addComponent(comparisonTitle, 1, 0);
    this.setComponentAlignment(comparisonTitle, Alignment.TOP_LEFT);

    closeBtn = new VerticalLayout();
    closeBtn.setWidth("20px");
    closeBtn.setHeight("20px");
    closeBtn.setStyleName("closebtn");
    this.addComponent(closeBtn, 2, 0);
    this.setComponentAlignment(closeBtn, Alignment.TOP_RIGHT);

    imgWidth = (width - 55);
    ProteinScatterPlotContainer = new AbsoluteLayout();

    this.addComponent(ProteinScatterPlotContainer, 1, 1);
    ProteinScatterPlotContainer.setWidth(imgWidth + "px");
    ProteinScatterPlotContainer.setHeight(150 + "px");

    //        String styleString = "_" + cp.getProteinAccssionNumber() + "_" + cp.getComparison().getComparisonHeader();
    //        teststyle = styleString.replace(" ", "_").replace("+", "_").replace(")", "_").replace("(", "_").toLowerCase().replace(" ", "_").replace("\n", "_").replace(")", "_").replace("(", "_").toLowerCase().replace("+", "_").replace("/", "_").replace(".", "_").replace("'s", "_") + "_scatterplot";
    //        styles.add("." + teststyle + " {  background-image: url(" + defaultScatterPlottImgUrl + " );background-position:center; background-repeat: no-repeat; }");
    //        ProteinScatterPlotContainer.setStyleName(teststyle);
    ProteinScatterPlotContainer.addComponent(defaultChartImage, "left: " + 0 + "px; top: " + 0 + "px;");
    ProteinScatterPlotContainer.addComponent(defaultChartLayout, "left: " + 0 + "px; top: " + 0 + "px;");
    defaultChartLayout.setWidth(imgWidth + "px");
    defaultChartLayout.setHeight(150 + "px");

    defaultChartLayout.addLayoutClickListener(new LayoutEvents.LayoutClickListener() {
        @Override
        public void layoutClick(LayoutEvents.LayoutClickEvent event) {

            if (event.getClickedComponent() instanceof SquaredDot) {
                SquaredDot dot = (SquaredDot) event.getClickedComponent();
                int trend = (Integer) dot.getParam("trend");
                int pGrNumber = (Integer) dot.getParam("pGrNumber");
                int[] dssArr = new int[patientGroupsNumToDsIdMap.get(pGrNumber).getRegulatedList(trend).size()];
                for (int x = 0; x < dssArr.length; x++) {
                    dssArr[x] = patientGroupsNumToDsIdMap.get(pGrNumber).getRegulatedList(trend).get(x);
                }
                Quant_Central_Manager.setStudySelectionListenerLevel(
                        new CSFFilterSelection("Study_Selection", dssArr, "scatter", null));//  
                Set<QuantDatasetObject> dsObjects = new HashSet<QuantDatasetObject>();
                for (int dsId : dssArr) {

                    dsObjects.add(Quant_Central_Manager.getFullQuantDatasetMap().get(dsId));

                }
                studyPopupLayoutManager.updateSelectedProteinInformation(pGrNumber, trend, dsObjects, cp);
            }
        }
    });

}

From source file:probe.com.view.body.searching.quant.QuantProtiensSearchingResultsLayout.java

/**
 *
 * @param CSFPR_Handler//from w w  w.j  av  a2s. com
 * @param searchQuantificationProtList
 */
public QuantProtiensSearchingResultsLayout(CSFPRHandler CSFPR_Handler,
        List<QuantProtein> searchQuantificationProtList) {

    Quant_Central_Manager = new QuantCentralManager(CSFPR_Handler, searchQuantificationProtList);//,filterUtility.getFullFilterList()
    this.setMargin(true);
    this.setSpacing(true);
    this.setWidth("100%");
    this.setHeightUndefined();

    DiseaseGroupsFiltersContainer heatmapFilter = new DiseaseGroupsFiltersContainer(Quant_Central_Manager,
            CSFPR_Handler, searchQuantificationProtList, null);
    heatmapFilter.setWidth("100%");
    heatmapFilter.setMargin(new MarginInfo(false, false, true, false));
    String infoText = "Select an experiment in the roll down menu on top to view all proteins identified in the selected experiment. Select a protein to see below all Peptides identified for the protein, and if the experiment was based on SDS-PAGE, the proteins distribution in the gel is displayed under Fractions. To show information about the experiment, press Dataset Information.  Use the search box to navigate in the experiment selected.</p><p  style='font-family:verdana;color:black;margin-left:20px;margin-right:20px;'>Under Fractions, bar charts show the distribution of the selected protein across the fractions cut from the gel. Three charts show number of peptides, number of spectra and average precursor intensity. The fraction number represents the gel pieces cut from top to bottom. Protein standards <font color='#CDE1FF'>(light blue bars)</font> indicate the molecular weight range of each fraction. <font color='#79AFFF'>Darker blue bars</font> mark between which two standards the protein's theoretical mass suggests the protein should be found.";

    HideOnClickLayout DatasetFilteringContainer = new HideOnClickLayout("Datasets", heatmapFilter, null,
            infoText, CSFPR_Handler.getTipsGenerator().generateTipsBtn());
    this.addComponent(DatasetFilteringContainer);
    DatasetFilteringContainer.setVisability(true);

    quantProteinsComparisonsContainer = new QuantProteinsComparisonsContainer(Quant_Central_Manager,
            CSFPR_Handler, searchQuantificationProtList);

    HideOnClickLayout comparisonsTableContainer = new HideOnClickLayout("Proteins",
            quantProteinsComparisonsContainer, null, Alignment.TOP_LEFT, infoText, null);
    int pageWidth = Page.getCurrent().getBrowserWindowWidth();
    int layoutWidth = (pageWidth - 95);
    quantProteinsComparisonsContainer.setLayoutWidth(layoutWidth);
    this.addComponent(comparisonsTableContainer);
    comparisonsTableContainer.setVisability(true);

    proteinsLayout = new QuantProteinsTabsheetContainerLayout(Quant_Central_Manager, true, CSFPR_Handler);
    HideOnClickLayout proteinsLevelLayout = new HideOnClickLayout("Protein Information", proteinsLayout, null,
            infoText, null);

    this.addComponent(proteinsLevelLayout);
    proteinsLevelLayout.setVisability(true);

    final SizeReporter sizeReporter = new SizeReporter(proteinsLevelLayout);
    sizeReporter.addResizeListener(new ComponentResizeListener() {
        private int resizedCounter = 0;

        @Override
        public void sizeChanged(ComponentResizeEvent event) {
            if (resizedCounter == 3) {

                UI.getCurrent().scrollIntoView(QuantProtiensSearchingResultsLayout.this);
                sizeReporter.removeResizeListener(this);
            }
            resizedCounter++;
        }
    });
    CSFPR_Handler.getTipsGenerator().showTips();

    //        heatmapFilter.popupSortAndSelectPanel();
}

From source file:probe.com.view.body.searching.SearchingUnitLayout.java

/**
 *
 * @param searchingBtnClickListener/*  ww w.  j  av  a 2 s  .c om*/
 */
public SearchingUnitLayout(Button.ClickListener searchingBtnClickListener) {
    this.setStyleName(Reindeer.LAYOUT_WHITE);
    this.setSpacing(true);
    this.setMargin(new MarginInfo(true, false, false, false));
    this.setWidth("100%");

    VerticalLayout leftPanel = new VerticalLayout();
    this.addComponent(leftPanel);
    VerticalLayout rightPanel = new VerticalLayout();
    this.addComponent(rightPanel);

    filtersController = new SearchingFiltersControl();

    //init left panel 
    searchingAreaFilter = new SearchingAreaFilter(filtersController, defaultText);
    leftPanel.addComponent(searchingAreaFilter);
    searchingAreaFilter.addSearchingClickListener(searchingBtnClickListener);

    //init right panel
    errorLabelI = new Label(
            "<h4 Style='color:red;'>Please Enter Valid Key Word (at least 4 letters for each keyword)</h4>");
    errorLabelI.setContentMode(ContentMode.HTML);
    errorLabelI.setHeight("30px");
    rightPanel.addComponent(errorLabelI);
    rightPanel.setComponentAlignment(errorLabelI, Alignment.TOP_LEFT);
    errorLabelI.setVisible(false);
    errorLabelII = new CustomErrorLabel();
    rightPanel.addComponent(errorLabelII);
    rightPanel.setComponentAlignment(errorLabelII, Alignment.TOP_LEFT);
    errorLabelII.setVisible(false);

}

From source file:probe.com.view.core.ClosableFilterLabel.java

/**
 *
 * @param filterTitle//  w  w  w .  j a v a2s  .  c om
 * @param value
 * @param filterId
 * @param closable
 */
public ClosableFilterLabel(String filterTitle, String value, int filterId, boolean closable) {
    filterValueLabel = new Label();
    if (closable) {

        filterValueLabel.setStyleName("filterClosableBtnLabel");
        //            width = ((value.length() * 7)) + "px";
        //            closeBtn.setWidth("17px");
        //            closeBtn.setHeight("17px");            
        //            closeBtn.setIcon(new ThemeResource("img/remove-icon.jpg"));

    } else {
        space = "";
        filterValueLabel.setStyleName("filterNonClosableBtnLabel");
    }

    //        this.setMargin(new MarginInfo(false, false, false, false));
    //        this.setSpacing(false);
    filterValueLabel.setValue(space + value);
    filterValueLabel.setContentMode(ContentMode.HTML);
    this.setVisible(true);
    //        this.closable = closable;
    this.setStyleName(Reindeer.LAYOUT_WHITE);
    //        this.setHeight("17px");
    //        this.addComponent(filterValueLabel);

    //             this.filterValueLabel = new Label(value);
    this.filterId = filterId;
    this.value = value;
    this.filterTitle = filterTitle;

    this.closeBtn = new Button(value);
    //        String width = ((value.length() * 7)) + "px";

    //        this.setWidth(width);
    closeBtn.setVisible(false);
    this.addComponent(closeBtn);
    this.setComponentAlignment(closeBtn, Alignment.MIDDLE_LEFT);
    this.addComponent(filterValueLabel);
    this.setComponentAlignment(filterValueLabel, Alignment.TOP_LEFT);
    //        this.setExpandRatio(filterValueLabel, 10);
    //        this.setExpandRatio(closeBtn, 0.1f);
    this.addLayoutClickListener(ClosableFilterLabel.this);
}