Example usage for com.vaadin.ui Label setStyleName

List of usage examples for com.vaadin.ui Label setStyleName

Introduction

In this page you can find the example usage for com.vaadin.ui Label setStyleName.

Prototype

@Override
    public void setStyleName(String style) 

Source Link

Usage

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. ja  v a2s . co  m*/
    this.searchQuantificationProtList = searchQuantificationProtList;
    Map<String, String> diseaseHashedColorMap = Quant_Central_Manager.getDiseaseHashedColorMap();
    for (String str : diseaseHashedColorMap.keySet()) {
        diseaseColorMap.put(str, Color.decode(diseaseHashedColorMap.get(str)));
    }
    this.width = chartWidth;
    this.height = 600;
    this.CSFPR_Handler = CSFPR_Handler;
    this.setWidth(width + "px");
    this.setHeightUndefined();
    this.Quant_Central_Manager = Quant_Central_Manager;
    this.Quant_Central_Manager.registerStudySelectionListener(ComparisonsSelectionOverviewBubbleChart.this);
    this.setSpacing(true);

    //init toplayout
    topLayout.setHeight(30 + "px");
    topLayout.setSpacing(true);
    topLayout.setMargin(new MarginInfo(false, false, true, false));
    this.addComponent(topLayout);

    Label overviewLabel = new Label("<font style='margin-left :50px;'>Overview</font> ");
    overviewLabel.setContentMode(ContentMode.HTML);
    topLayout.addComponent(overviewLabel);
    overviewLabel.setStyleName("subtitle");
    overviewLabel.setWidth("120px");

    InfoPopupBtn info = new InfoPopupBtn(
            "The bubble chart give an overview for the proteins existed in the selected comparisons.<br/>The diameter of the bubble represents the number of the proteins in the selected comparison and the color represents the trend<br/>");
    info.setWidth("16px");
    info.setHeight("16px");
    topLayout.addComponent(info);

    //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.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();//from ww  w  .  ja v a  2s.co 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();

}

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);/*from   w  ww .j  a v  a 2  s .c om*/
    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.quantproteinstabsheet.peptidescontainer.popupcomponents.PeptideSequenceContainer.java

private void addTerminalLabels(int top, int width) {

    VerticalLayout nTerminalEdge = new VerticalLayout();
    nTerminalEdge.setWidth("19px");
    nTerminalEdge.setHeight("15px");
    nTerminalEdge.setStyleName("terminal");
    Label nLabel = new Label("N");
    nLabel.setWidth("10px");
    nLabel.setStyleName("ntermlayout");
    nTerminalEdge.addComponent(nLabel);//  w w  w  .java2s .c o  m

    this.addComponent(nTerminalEdge, "left: " + (0) + "px; top: " + (top) + "px;");

    VerticalLayout cTerminalEdge = new VerticalLayout();
    cTerminalEdge.setWidth("20px");
    cTerminalEdge.setHeight("15px");
    cTerminalEdge.setStyleName("terminal");
    Label cLabel = new Label("C");
    cLabel.setStyleName("ctermlayout");
    cTerminalEdge.addComponent(cLabel);
    cLabel.setWidth("10px");
    cTerminalEdge.setComponentAlignment(cLabel, Alignment.TOP_RIGHT);
    this.addComponent(cTerminalEdge, "left: " + (width - 21) + "px; top: " + (top) + "px;");

}

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

/**
 *
 * @param cp//  ww w .  java 2s  .c  om
 * @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.searching.SearchingFiltersControl.java

private VerticalLayout initFilterLabel(String title) {

    Label filterLabel = new Label(title);
    filterLabel.setContentMode(ContentMode.HTML);
    filterLabel.setStyleName("showFilterLabelHeader");
    filterLabel.setDescription("Drop all " + title + " filter");

    VerticalLayout layout = new VerticalLayout();
    //        layout.setId(title);
    layout.addComponentAsFirst(filterLabel);
    layout.addLayoutClickListener(listener);

    return layout;

}

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

private void updateMinFilterL1bel() {
    minimumfilterLayout.removeAllComponents();
    minimumfilterLayout.setWidth("100%");
    HorizontalLayout hlo = new HorizontalLayout();
    minimumfilterLayout.addComponent(hlo);
    int index = 0;
    for (ClosableFilterLabel btn : filtersBtnsMap.values()) {

        Label l = new Label("[ " + btn.getFilterValue() + " ] ");
        l.setStyleName("filterNonClosableBtnLabel");
        if (index > 4) {
            hlo = new HorizontalLayout();
            minimumfilterLayout.addComponent(hlo);
            index = 0;//w  w w.  j av  a2s.com

        }

        index++;
        hlo.addComponent(l);
    }

}

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

/**
 *
 * @param filterId/* w  ww  .jav  a 2 s  .  c  o  m*/
 * @param defaultLabel
 * @param pgArr
 */
public ListSelectDatasetExplorerFilter(int filterId, String defaultLabel, Set<String> pgArr) {
    this.setSizeUndefined();
    this.filterId = filterId;

    //        this.exploringFiltersManager = exploringFiltersManager;
    this.setSpacing(true);

    this.defaultLabel = defaultLabel;
    Label captionLabel = new Label(defaultLabel);
    captionLabel.setStyleName("custLabel");

    if (!defaultLabel.equalsIgnoreCase("")) {
        this.addComponent(captionLabel);
    }
    list = new ListSelect();
    list.setWidth("200px");
    list.setHeight("90px");
    list.setNullSelectionAllowed(true);
    list.setMultiSelect(true);
    for (String str : pgArr) {
        if (!str.equalsIgnoreCase("")) {
            list.addItem(str);
        }
    }

    list.setImmediate(true);
    //        
    HorizontalLayout hlo = new HorizontalLayout();
    hlo.setSpacing(true);
    hlo.addComponent(list);
    this.addComponent(hlo);

    clearBtn = new Button("Clear");
    clearBtn.setPrimaryStyleName("resetbtn");
    clearBtn.setWidth("50px");
    clearBtn.setHeight("24px");
    clearBtn.addClickListener(ListSelectDatasetExplorerFilter.this);
    hlo.addComponent(clearBtn);
    //        exploringFiltersManager.registerFilter(ListSelectDatasetExplorerFilter.this);
}

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

/**
 *
 * @param control//ww w. j a  v  a  2  s.c  om
 * @param filterId
 * @param defaultLabel
 * @param datasetNamesList
 */
@SuppressWarnings("LeakingThisInConstructor")
public ListSelectFilter(SearchingFiltersControl_t control, int filterId, String defaultLabel,
        String[] datasetNamesList) {
    this.setSizeUndefined();
    this.filterId = filterId;
    //        this.setStyleName("custLabel");
    this.control = control;
    this.setSpacing(true);
    //        int widthInt = defaultLabel.length() * 7;
    //        String width = "200px";
    //        if (widthInt > 200) {
    //            width = widthInt + "px";
    //        }
    this.defaultLabel = defaultLabel;
    Label captionLabel = new Label(defaultLabel);
    //        captionLabel.setWidth(width);
    captionLabel.setStyleName("custLabel");

    if (!defaultLabel.equalsIgnoreCase("")) {
        this.addComponent(captionLabel);
    }
    list = new ListSelect();
    list.setWidth("200px");
    list.setHeight("90px");
    list.setNullSelectionAllowed(true);
    list.setMultiSelect(true);

    for (String str : datasetNamesList) {
        list.addItem(str);
    }
    list.setImmediate(true);
    list.addValueChangeListener(this);
    HorizontalLayout hlo = new HorizontalLayout();
    hlo.setSpacing(true);
    hlo.addComponent(list);
    //         filterConfirmLabel = new FilterConfirmLabel();       
    //        hlo.addComponent(filterConfirmLabel);
    this.addComponent(hlo);
    clearBtn = new Button("Clear");
    clearBtn.setStyleName(Reindeer.BUTTON_SMALL);
    clearBtn.addClickListener(this);
    hlo.addComponent(clearBtn);
}

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

public NotificationComponent(String text, String uniqueID) {

    this.uniqueID = uniqueID;
    popupBody = new VerticalLayout();
    popupBody.setWidthUndefined();//setWidth((200) + "px");
    popupBody.setHeightUndefined();//setHeight((200) + "px");
    popupBody.setStyleName("notificationbody");
    popupBody.addLayoutClickListener(NotificationComponent.this);
    popup = new PopupView(null, popupBody) {

        @Override//from   ww w.  j  a v  a 2  s.c om
        public void setPopupVisible(boolean visible) {
            super.setPopupVisible(visible); //To change body of generated methods, choose Tools | Templates.
        }

        @Override
        public boolean isPopupVisible() {
            return super.isPopupVisible(); //To change body of generated methods, choose Tools | Templates.
        }

    };
    this.addComponent(popup);

    //        popupWindow = new Window() {
    //
    //            @Override
    //            public void close() {
    //                popupWindow.setVisible(false);
    //            }
    //
    //        };
    //
    //        popupWindow.setStyleName("notificationwindow");
    //        popupWindow.setCaption(null);
    //        popupWindow.setContent(popupBody);
    //        popupWindow.setWindowMode(WindowMode.NORMAL);
    //        popupWindow.setWidthUndefined();//.setWidth((200) + "px");
    //        popupWindow.setHeightUndefined();//setHeight((200) + "px");
    //        popupWindow.setVisible(false);
    //        popupWindow.setResizable(false);
    //        popupWindow.setClosable(false);
    //        popupWindow.setModal(false);
    //        popupWindow.setDraggable(false);
    //        popupWindow.setModal(false);
    //
    //        UI.getCurrent().addWindow(popupWindow);
    //        popupWindow.setPositionX(x);
    //        popupWindow.setPositionY(y);
    //
    //        popupWindow.setCaptionAsHtml(true);
    //        popupWindow.setClosable(false);
    popupBody.setMargin(true);
    popupBody.setSpacing(true);

    Label content = new Label("<center>" + text + "</center>");
    content.setStyleName("notificationtext");
    content.setContentMode(ContentMode.HTML);
    popupBody.addComponent(content);

    VerticalLayout footer = new VerticalLayout();
    footer.setStyleName("bubbletalkfooter");
    footer.setWidth("30px");
    footer.setHeight("20px");
    popupBody.addComponent(footer);
    popup.setHideOnMouseOut(false);
    popup.setStyleName("popupnotification");
    popupBody.addStyleName("slowinvisible");

}