Example usage for com.vaadin.ui Alignment TOP_RIGHT

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

Introduction

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

Prototype

Alignment TOP_RIGHT

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

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  w w  .  j  a  v  a  2s  .  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);//from  ww  w .ja v  a  2 s . co  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 w w  .ja v a2s.  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.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 .ja  va2 s  .  c om

    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/*from  www  .  j a  v  a 2 s . c o  m*/
 * @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/* w  w w . ja va2 s.com*/
 * @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.core.InfoPopupBtn.java

public InfoPopupBtn(String infoText) {
    HorizontalLayout topLayout = new HorizontalLayout();
    VerticalLayout mainBody = new VerticalLayout();
    mainBody.setWidth("450px");
    mainBody.addComponent(topLayout);//  w  ww  .  ja  v  a2  s . c o m
    Label infoHeaderLabel = new Label(
            "<h3 style='font-family:verdana;color:black;font-weight:bold;margin-left:20px;margin-right:20px;'>Information</h3>");
    infoHeaderLabel.setContentMode(ContentMode.HTML);
    topLayout.addComponent(infoHeaderLabel);
    topLayout.setWidth("100%");
    Label infoLable = new Label(
            "<div style='text-align:justify;text-justify:inter-word;'><p  style='line-height:60px; font-family:verdana;color:black;margin-left:20px;margin-right:20px;'>"
                    + infoText + "</p></div>");
    infoLable.setContentMode(ContentMode.HTML);
    infoLable.setWidth("450px");
    mainBody.addComponent(infoLable);
    popupBodyLayout.addComponent(mainBody);
    mainBody.setStyleName("popupmainbody");
    VerticalLayout closeBtn = new VerticalLayout();
    closeBtn.setWidth("16px");
    closeBtn.setHeight("16px");
    closeBtn.setStyleName("defaultclosebtn");
    topLayout.addComponent(closeBtn);
    topLayout.setComponentAlignment(closeBtn, Alignment.TOP_RIGHT);
    popupLayout = new PopupView("", popupBodyLayout);
    this.setStyleName("infoicon");
    this.setWidth("16px");
    this.setHeight("16px");
    this.setDescription("Information");
    this.addLayoutClickListener(InfoPopupBtn.this);
    this.addComponent(popupLayout);
    this.popupLayout.setHideOnMouseOut(false);

    closeBtn.addLayoutClickListener(new LayoutEvents.LayoutClickListener() {

        @Override
        public void layoutClick(LayoutEvents.LayoutClickEvent event) {
            popupLayout.setPopupVisible(false);
        }
    });

}

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

private VerticalLayout initPopupLayout(VerticalLayout popupLayout, String header) {
    VerticalLayout popupBodyWrapper = new VerticalLayout();
    popupBodyWrapper.setWidth("100%");
    popupBodyWrapper.setHeight("100%");
    VerticalLayout popupBodyLayout = new VerticalLayout();
    popupBodyLayout.setWidth((popupLayout.getWidth() + 2) + "px");
    popupBodyLayout.setHeightUndefined();
    popupBodyLayout.setStyleName("pupupbody");
    popupBodyLayout.setSpacing(true);/*from   w w  w.  j a  va 2  s .  co m*/
    HorizontalLayout titleLayout = new HorizontalLayout();
    titleLayout.setWidthUndefined();
    titleLayout.setHeight("40px");

    popupBodyLayout.addComponent(titleLayout);
    popupBodyLayout.addLayoutClickListener(this);

    Label label = new Label("<b>" + header + "</b>");
    label.setStyleName("comparisonHeaders");
    label.setContentMode(ContentMode.HTML);
    label.setWidth((popupLayout.getWidth() - 17) + "px");
    titleLayout.addComponent(label);

    VerticalLayout closeBtn = new VerticalLayout();
    closeBtn.setWidth("16px");
    closeBtn.setHeight("16px");
    closeBtn.setStyleName("closepanelbtn");
    closeBtn.addLayoutClickListener(this);
    titleLayout.addComponent(closeBtn);
    titleLayout.setComponentAlignment(closeBtn, Alignment.TOP_RIGHT);

    popupLayout.setMargin(true);
    popupLayout.setSpacing(true);
    popupBodyLayout.addComponent(popupLayout);
    popupBodyWrapper.addComponent(popupBodyLayout);
    popupBodyWrapper.setComponentAlignment(popupBodyLayout, Alignment.MIDDLE_CENTER);

    return popupBodyWrapper;

}

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

/**
 *
 * @param title/*from www. jav  a  2s .c  om*/
 * @param fullBodyLayout
 * @param miniBodyLayout
 * @param view
 */
public SubTreeHideOnClick(String title, Layout fullBodyLayout, VerticalLayout miniBodyLayout, boolean view) {
    //       title= title.toLowerCase();
    this.setMargin(new MarginInfo(false, false, false, false));
    this.setWidth("100%");
    this.fullBodyLayout = fullBodyLayout;
    this.fullBodyLayout.setVisible(false);
    this.miniBodyLayout = miniBodyLayout;

    titleLayout = new HorizontalLayout();
    titleLayout.setHeight("20px");
    titleLayout.setSpacing(true);
    show = new ShowMiniLabel();
    show.setHeight("20px");
    titleLayout.addComponent(show);
    titleLayout.setComponentAlignment(show, Alignment.BOTTOM_LEFT);
    titleLayout.setMargin(true);

    filterstLabel = new Label(title);//"<h4  style='font-family:verdana;font-weight:bold;'><strong aligen='center' style='font-family:verdana;color:#00000;'>Searching Filters</strong></h4>");
    filterstLabel.setContentMode(ContentMode.HTML);

    filterstLabel.setStyleName("treeNodeLabel");
    filterstLabel.setHeight("20px");
    titleLayout.addComponent(filterstLabel);
    titleLayout.setComponentAlignment(filterstLabel, Alignment.TOP_RIGHT);
    titleLayout.addLayoutClickListener(SubTreeHideOnClick.this);
    this.addComponent(titleLayout);
    this.addComponent(this.fullBodyLayout);
    if (miniBodyLayout != null) {
        titleLayout.addComponent(this.miniBodyLayout);
        miniBodyLayout.setStyleName("treeValue");
        miniBodyLayout.addLayoutClickListener(SubTreeHideOnClick.this);
    }
    if (view) {
        this.showLayout();
    }
}

From source file:pt.ist.vaadinframework.ui.ApplicationWindow.java

License:Open Source License

public ApplicationWindow(String theme, Property applicationTitle, Property applicationSubtitle,
        Property copyright) {//  w  w  w . ja v  a2  s. co  m
    setTheme(theme);
    this.applicationTitle = applicationTitle;
    this.applicationSubtitle = applicationSubtitle;
    this.copyright = copyright;
    VerticalLayout main = new VerticalLayout();
    main.setWidth(90, UNITS_PERCENTAGE);
    main.setHeight(98, UNITS_PERCENTAGE);
    main.addStyleName("application-container");

    VerticalLayout header = new VerticalLayout();
    header.setMargin(true, true, false, true);
    header.setSpacing(true);
    main.addComponent(header);
    HorizontalLayout iconAndTitle = new HorizontalLayout();
    iconAndTitle.setSizeFull();
    iconAndTitle.setSpacing(true);
    header.addComponent(iconAndTitle);
    Embedded logo = new Embedded(null, new ThemeResource("../runo/icons/64/globe.png"));
    iconAndTitle.addComponent(logo);
    iconAndTitle.setComponentAlignment(logo, Alignment.MIDDLE_LEFT);

    VerticalLayout titles = new VerticalLayout();
    titles.setSpacing(true);
    iconAndTitle.addComponent(titles);
    iconAndTitle.setExpandRatio(titles, 0.8f);
    Label title = new Label(applicationTitle);
    title.addStyleName("application-title");
    titles.addComponent(title);
    Label subtitle = new Label(applicationSubtitle);
    subtitle.addStyleName("application-subtitle");
    titles.addComponent(subtitle);

    HorizontalLayout controls = new HorizontalLayout();
    controls.setSpacing(true);
    iconAndTitle.addComponent(controls);
    iconAndTitle.setComponentAlignment(controls, Alignment.TOP_RIGHT);
    Label user = new Label("ist148357");
    controls.addComponent(user);
    Link logout = new Link("logout", new ExternalResource("#"));
    controls.addComponent(logout);

    MenuBar menu = new MenuBar();
    menu.addStyleName("application-menu");
    header.addComponent(menu);
    MenuItem hello = menu.addItem("hello", null);
    hello.addItem("sdgjk", new Command() {
        @Override
        public void menuSelected(MenuItem selectedItem) {
            getWindow().showNotification("skjhfgksjdfhglksdjh");
        }
    });
    MenuItem hello1 = menu.addItem("hello", null);
    hello1.addItem("sdgjk", new Command() {
        @Override
        public void menuSelected(MenuItem selectedItem) {
            getWindow().showNotification("skjhfgksjdfhglksdjh");
        }
    });
    MenuItem hello2 = menu.addItem("hello", null);
    hello2.addItem("sdgjk", new Command() {
        @Override
        public void menuSelected(MenuItem selectedItem) {
            getWindow().showNotification("skjhfgksjdfhglksdjh");
        }
    });

    body = new VerticalLayout();
    body.setSizeFull();
    body.setMargin(true);
    body.addStyleName("application-body");
    main.addComponent(body);
    main.setExpandRatio(body, 1f);
    body.addComponent(createDefaultPageBody());

    VerticalLayout footer = new VerticalLayout();
    main.addComponent(footer);
    main.setComponentAlignment(footer, Alignment.MIDDLE_CENTER);
    Label copyrightLabel = new Label(copyright);
    copyrightLabel.setSizeUndefined();
    copyrightLabel.addStyleName("application-footer");
    footer.addComponent(copyrightLabel);
    footer.setComponentAlignment(copyrightLabel, Alignment.MIDDLE_CENTER);

    VerticalLayout outer = (VerticalLayout) getContent();
    outer.setSizeFull();
    outer.addComponent(main);
    outer.setComponentAlignment(main, Alignment.MIDDLE_CENTER);
}