Example usage for com.vaadin.ui VerticalLayout setComponentAlignment

List of usage examples for com.vaadin.ui VerticalLayout setComponentAlignment

Introduction

In this page you can find the example usage for com.vaadin.ui VerticalLayout setComponentAlignment.

Prototype

@Override
    public void setComponentAlignment(Component childComponent, Alignment alignment) 

Source Link

Usage

From source file:probe.com.view.body.QuantCompareDataLayout.java

private VerticalLayout initSelectEnterDatasetDiseaseGroups(int width) {
    VerticalLayout selectDiseaseGroupsMainLayout = new VerticalLayout();
    selectDiseaseGroupsMainLayout.setMargin(new MarginInfo(true, false, false, true));
    selectDiseaseGroupsMainLayout.setSpacing(true);

    Label titleLabel = new Label("1. Select/Enter Dataset Disease Groups");
    titleLabel.setContentMode(ContentMode.HTML);
    titleLabel.setStyleName("normalheader");
    titleLabel.setHeight("20px");
    selectDiseaseGroupsMainLayout.addComponent(titleLabel);
    selectDiseaseGroupsMainLayout.setComponentAlignment(titleLabel, Alignment.TOP_LEFT);

    HorizontalLayout selectionResultsContainer = new HorizontalLayout();
    //        selectionResultsContainer.setStyleName("diseasegroupselectionresult");

    String containerWidth = ((width * 2) + 10) + "px";
    selectionResultsContainer.setWidth(containerWidth);
    selectDiseaseGroupsMainLayout.setWidth(containerWidth);

    selectionResultsContainer.addComponent(selectionResultsLabel);
    selectionResultsLabel.setStyleName(Reindeer.LABEL_SMALL);
    //        selectionResultsLabel.setValue("Selection:   Group A / Group B");
    //        miniselectionResultsLabel.setValue("( Group A  / Group B )");

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

        @Override//from  w  w w .j a v  a 2 s.co m
        public void valueChange(Property.ValueChangeEvent event) {
            String value = "Selection:   ";
            if (diseaseGroupsListA.getValue() != null) {
                diseaseGroupsListA.setRequired(false);
                value += diseaseGroupsListA.getValue().toString();
                useRowSorter = diseaseGroupNames.contains(diseaseGroupsListA.getValue().toString().trim());
            }

            if (diseaseGroupsListB.getValue() != null) {
                diseaseGroupsListB.setRequired(false);
                value += " / " + diseaseGroupsListB.getValue().toString();
                useColumnSorter = diseaseGroupNames.contains(diseaseGroupsListB.getValue().toString().trim());
                //                    reset();
            }
            selectionResultsLabel.setValue(value);
            miniselectionResultsLabel.setValue(value);

            if ((diseaseGroupsListA.getValue() != null) && (diseaseGroupsListB.getValue() != null)) {

                if (diseaseGroupsListA.getValue().toString().trim()
                        .equalsIgnoreCase(diseaseGroupsListB.getValue().toString().trim())) {
                    useRowSorter = useColumnSorter = false;
                }
            }
        }
    };

    HorizontalLayout diseaseGroupsListsContainer = new HorizontalLayout();
    selectDiseaseGroupsMainLayout.addComponent(diseaseGroupsListsContainer);
    diseaseGroupsListsContainer.setWidth(containerWidth);

    diseaseGroupsListA.setStyleName("diseasegrouplist");
    diseaseGroupsListA.setNullSelectionAllowed(false);
    diseaseGroupsListA.setImmediate(true);
    diseaseGroupsListA.setNewItemsAllowed(true);
    diseaseGroupsListA.setWidth(width, Unit.PIXELS);
    diseaseGroupsListA.setInputPrompt("Select or enter new disease group name");
    diseaseGroupsListA.setRequiredError("Select or enter new disease group name");

    diseaseGroupsListB.setStyleName("diseasegrouplist");
    diseaseGroupsListB.setNullSelectionAllowed(false);
    diseaseGroupsListB.setRequiredError("Select or enter new disease group name");

    diseaseGroupsListB.setImmediate(true);
    diseaseGroupsListB.setNewItemsAllowed(true);
    diseaseGroupsListB.setWidth(width, Unit.PIXELS);
    diseaseGroupsListB.setInputPrompt("Select or enter new disease group name");

    selectDiseaseGroupsMainLayout.addComponent(selectionResultsContainer);

    diseaseGroupsListsContainer.addComponent(diseaseGroupsListA);
    diseaseGroupsListsContainer.addComponent(diseaseGroupsListB);
    diseaseGroupsListsContainer.setComponentAlignment(diseaseGroupsListB, Alignment.TOP_RIGHT);

    this.resetLists();

    diseaseGroupsListA.addValueChangeListener(diseaseGroupsListListener);
    diseaseGroupsListB.addValueChangeListener(diseaseGroupsListListener);
    diseaseGroupsListA.setNewItemHandler(new AbstractSelect.NewItemHandler() {

        @Override
        public void addNewItem(String newItemCaption) {
            diseaseGroupsListA.addItem(newItemCaption);
            diseaseGroupsListA.select(newItemCaption);
        }
    });

    diseaseGroupsListB.setNewItemHandler(new AbstractSelect.NewItemHandler() {

        @Override
        public void addNewItem(String newItemCaption) {
            diseaseGroupsListB.addItem(newItemCaption);
            diseaseGroupsListB.select(newItemCaption);
        }
    });

    return selectDiseaseGroupsMainLayout;//new HideOnClickLayout("Select/Enter Dataset Disease Groups", proteinsDataCapturingMainLayout, miniSelectDiseaseGroupsLayout, Alignment.TOP_LEFT, null, null);

}

From source file:probe.com.view.body.QuantCompareDataLayout.java

private VerticalLayout initProteinsDataCapture(int width) {
    VerticalLayout proteinsDataCapturingMainLayout = new VerticalLayout();
    proteinsDataCapturingMainLayout.setSpacing(true);
    proteinsDataCapturingMainLayout.setMargin(true);
    String containerWidth = ((width * 2) + 10) + "px";
    proteinsDataCapturingMainLayout.setWidth(containerWidth);
    proteinsDataCapturingMainLayout.setSpacing(true);

    Label titleLabel = new Label("2. Insert UniProt Proteins Accessions");
    titleLabel.setContentMode(ContentMode.HTML);
    titleLabel.setStyleName("normalheader");
    titleLabel.setHeight("20px");
    proteinsDataCapturingMainLayout.addComponent(titleLabel);
    proteinsDataCapturingMainLayout.setComponentAlignment(titleLabel, Alignment.TOP_LEFT);

    GridLayout insertProteinsLayout = new GridLayout(3, 3);
    proteinsDataCapturingMainLayout.addComponent(insertProteinsLayout);
    insertProteinsLayout.setSpacing(true);
    insertProteinsLayout.setMargin(new MarginInfo(false, false, false, false));
    insertProteinsLayout.setWidth(containerWidth);

    HorizontalLayout hlo1 = new HorizontalLayout();
    hlo1.setWidth("100%");
    hlo1.setMargin(new MarginInfo(false, true, false, false));
    Label highLabel = new Label("<font color='#cc0000'>&nbsp;High</font>");
    highLabel.setWidth("40px");
    highLabel.setContentMode(ContentMode.HTML);
    hlo1.addComponent(highLabel);//from   w w  w  . j a va 2  s  .c om

    HorizontalLayout hlo2 = new HorizontalLayout();
    hlo2.setWidth("100%");
    hlo2.setMargin(new MarginInfo(false, true, false, false));
    Label stableLabel = new Label("<font color='#018df4'>&nbsp;Stable</font>");
    stableLabel.setWidth("50px");
    stableLabel.setContentMode(ContentMode.HTML);
    hlo2.addComponent(stableLabel);

    HorizontalLayout hlo3 = new HorizontalLayout();
    hlo3.setWidth("100%");
    hlo3.setMargin(new MarginInfo(false, true, false, false));
    Label lowLabel = new Label("<font color='#009900'>&nbsp;Low</font>");
    lowLabel.setWidth("40px");
    lowLabel.setContentMode(ContentMode.HTML);
    hlo3.addComponent(lowLabel);
    insertProteinsLayout.addComponent(hlo1, 0, 0);
    insertProteinsLayout.setComponentAlignment(hlo1, Alignment.MIDDLE_CENTER);
    insertProteinsLayout.addComponent(hlo2, 1, 0);
    insertProteinsLayout.setComponentAlignment(hlo2, Alignment.MIDDLE_CENTER);
    insertProteinsLayout.addComponent(hlo3, 2, 0);
    insertProteinsLayout.setComponentAlignment(hlo3, Alignment.MIDDLE_CENTER);

    highTextArea.setWidth("100%");
    highTextArea.setHeight("200px");
    insertProteinsLayout.addComponent(highTextArea, 0, 1);
    insertProteinsLayout.setComponentAlignment(highTextArea, Alignment.MIDDLE_CENTER);

    stableTextArea.setWidth("100%");
    stableTextArea.setHeight("200px");
    insertProteinsLayout.addComponent(stableTextArea, 1, 1);
    insertProteinsLayout.setComponentAlignment(stableTextArea, Alignment.MIDDLE_CENTER);

    lowTextArea.setWidth("100%");
    lowTextArea.setHeight("200px");
    insertProteinsLayout.addComponent(lowTextArea, 2, 1);
    insertProteinsLayout.setComponentAlignment(lowTextArea, Alignment.MIDDLE_CENTER);

    VerticalLayout clear1 = new VerticalLayout();
    hlo1.addComponent(clear1);
    clear1.setDescription("Clear field");
    clear1.setStyleName("clearfieldbtn");
    clear1.setWidth("20px");
    clear1.setHeight("20px");
    //        insertProteinsLayout.addComponent(clear1, 0, 2);
    hlo1.setComponentAlignment(clear1, Alignment.MIDDLE_RIGHT);
    clear1.addLayoutClickListener(new LayoutEvents.LayoutClickListener() {

        @Override
        public void layoutClick(LayoutEvents.LayoutClickEvent event) {
            highTextArea.clear();
        }
    });

    VerticalLayout clear2 = new VerticalLayout();
    hlo2.addComponent(clear2);
    clear2.setDescription("Clear field");
    clear2.setStyleName("clearfieldbtn");
    clear2.setWidth("20px");
    clear2.setHeight("20px");

    clear2.addLayoutClickListener(new LayoutEvents.LayoutClickListener() {

        @Override
        public void layoutClick(LayoutEvents.LayoutClickEvent event) {
            stableTextArea.clear();
        }
    });

    hlo2.setComponentAlignment(clear2, Alignment.MIDDLE_RIGHT);
    VerticalLayout clear3 = new VerticalLayout();
    hlo3.addComponent(clear3);
    clear3.setDescription("Clear field");
    clear3.setStyleName("clearfieldbtn");
    clear3.setWidth("20px");
    clear3.setHeight("20px");

    clear3.addLayoutClickListener(new LayoutEvents.LayoutClickListener() {

        @Override
        public void layoutClick(LayoutEvents.LayoutClickEvent event) {
            lowTextArea.clear();
        }
    });
    hlo3.setComponentAlignment(clear3, Alignment.MIDDLE_RIGHT);
    Label errorLabel = new Label();
    proteinsDataCapturingMainLayout.addComponent(errorLabel);
    HorizontalLayout btnsLayout = new HorizontalLayout();
    btnsLayout.setSpacing(true);
    btnsLayout.setMargin(new MarginInfo(true, false, false, false));

    proteinsDataCapturingMainLayout.addComponent(btnsLayout);
    proteinsDataCapturingMainLayout.setComponentAlignment(btnsLayout, Alignment.MIDDLE_RIGHT);

    Button sampleBtn = new Button("Sample");
    sampleBtn.setStyleName(Reindeer.BUTTON_SMALL);
    btnsLayout.addComponent(sampleBtn);
    sampleBtn.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            reset();
            highTextArea.setValue(highAcc);
            lowTextArea.setValue(lowAcc);
            stableTextArea.setValue(stableAcc);
            diseaseGroupsListA.select("Group A");
            diseaseGroupsListB.select("Group B");
            compareBtn.focus();
        }
    });

    Button resetBtn = new Button("Reset");
    resetBtn.setStyleName(Reindeer.BUTTON_SMALL);
    btnsLayout.addComponent(resetBtn);
    resetBtn.setId("resetBtn");
    resetBtn.addClickListener(this);

    compareBtn = new Button("Compare");
    compareBtn.setStyleName(Reindeer.BUTTON_SMALL);
    btnsLayout.addComponent(compareBtn);
    compareBtn.setId("compareBtn");
    compareBtn.addClickListener(this);

    //        highTextArea.setValue(highAcc);
    //        lowTextArea.setValue(lowAcc);
    //        stableTextArea.setValue(stableAcc);

    return proteinsDataCapturingMainLayout;
}

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

/**
 *
 * @param Quant_Central_Manager//from w  w  w . j a v  a2 s . c  om
 */
public DiseaseGroupsListFilter(final QuantCentralManager Quant_Central_Manager) {
    this.Quant_Central_Manager = Quant_Central_Manager;
    this.setWidth("450px");
    //        this.Quant_Central_Manager.registerFilterListener(DiseaseGroupsListFilter.this);

    //        this.updatePatientGroups(Quant_Central_Manager.getFilteredDatasetsList());
    //        String[] pgArr = merge(patGr1, patGr2);
    this.patientGroupIFilter = new ListSelectDatasetExplorerFilter(1, "Disease Group I",
            Quant_Central_Manager.getSelectedHeatMapRows());
    initGroupsIFilter();

    this.patientGroupIIFilter = new ListSelectDatasetExplorerFilter(2, "Disease Group II",
            Quant_Central_Manager.getSelectedHeatMapColumns());
    initGroupsIIFilter();
    diseaseGroupsSet = new LinkedHashSet<String>();
    diseaseGroupsSet.addAll(Quant_Central_Manager.getSelectedHeatMapRows());

    this.addComponent(patientGroupIIFilter);

    diseaseGroupsFilterBtn = new Button("Disease Groups");
    diseaseGroupsFilterBtn.setStyleName(Reindeer.BUTTON_LINK);
    diseaseGroupsFilterBtn.addClickListener(DiseaseGroupsListFilter.this);

    VerticalLayout popupBody = new VerticalLayout();

    VerticalLayout filtersConatinerLayout = new VerticalLayout();
    filtersConatinerLayout.setSpacing(true);
    filtersConatinerLayout.setWidth("500px");
    filtersConatinerLayout.setHeightUndefined();

    popupBody.addComponent(filtersConatinerLayout);

    HorizontalLayout btnLayout = new HorizontalLayout();
    popupBody.addComponent(btnLayout);
    btnLayout.setSpacing(true);
    btnLayout.setMargin(new MarginInfo(false, false, true, true));

    Button applyFilters = new Button("Apply");
    applyFilters.setDescription("Apply the selected filters");
    applyFilters.setPrimaryStyleName("resetbtn");
    applyFilters.setWidth("50px");
    applyFilters.setHeight("24px");

    btnLayout.addComponent(applyFilters);
    applyFilters.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            popupWindow.close();
        }
    });

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

    resetFiltersBtn.setDescription("Reset all applied filters");
    resetFiltersBtn.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            Quant_Central_Manager.resetFiltersListener();
        }
    });

    popupWindow = new Window() {
        @Override
        public void close() {
            if (updateManager) {
                updateSelectionManager(studiesIndexes);
            }

            popupWindow.setVisible(false);

        }
    };
    popupWindow.setContent(popupBody);
    popupWindow.setWindowMode(WindowMode.NORMAL);
    popupWindow.setWidth((540) + "px");
    popupWindow.setHeight((500) + "px");
    popupWindow.setVisible(false);
    popupWindow.setResizable(false);
    popupWindow.setClosable(false);
    popupWindow.setStyleName(Reindeer.WINDOW_LIGHT);
    popupWindow.setModal(true);
    popupWindow.setDraggable(false);
    popupWindow.center();
    popupWindow.setCaption(
            "<font color='gray' style='font-weight: bold;!important'>&nbsp;&nbsp;Disease Groups Comparisons</font>");

    UI.getCurrent().addWindow(popupWindow);
    popupWindow.center();

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

    this.setHeightUndefined();
    filtersConatinerLayout.addComponent(DiseaseGroupsListFilter.this);
    filtersConatinerLayout.setComponentAlignment(DiseaseGroupsListFilter.this, Alignment.BOTTOM_CENTER);
    //        Quant_Central_Manager.setSelectedHeatMapRows(selectedRows);
    //        Quant_Central_Manager.setSelectedHeatMapColumns(selectedColumns);

}

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

public PopupRecombineDiseaseGroups(QuantCentralManager Quant_Central_Manager) {
    //        super(" ");
    this.diseaseStyleMap = Quant_Central_Manager.getDiseaseStyleMap();

    default_DiseaseCat_DiseaseGroupMap = new LinkedHashMap<String, Map<String, String>>(
            Quant_Central_Manager.getDefault_DiseaseCat_DiseaseGroupMap());

    this.setStyleName("merge");
    this.setDescription("Recombine disease groups");
    this.Quant_Central_Manager = Quant_Central_Manager;
    captionAstrMap = new HashMap<String, Integer>();
    this.addLayoutClickListener(PopupRecombineDiseaseGroups.this);
    this.popupBodyLayout = new VerticalLayout();
    VerticalLayout windowLayout = new VerticalLayout();
    popupWindow = new Window() {
        @Override//  w w w. j av  a 2 s .c om
        public void close() {

            popupWindow.setVisible(false);
        }
    };
    popupWindow.setContent(windowLayout);
    windowLayout.addComponent(popupBodyLayout);
    windowLayout.setComponentAlignment(popupBodyLayout, Alignment.MIDDLE_CENTER);

    popupWindow.setVisible(false);
    popupWindow.setResizable(false);
    popupWindow.setClosable(true);
    popupWindow.setStyleName(Reindeer.WINDOW_LIGHT);
    popupWindow.setModal(true);
    popupWindow.setDraggable(false);
    popupWindow.setCaption(
            "<font color='gray' style='font-weight: bold;!important'>&nbsp;&nbsp;Recombine Disease Groups</font>");
    popupWindow.setCaptionAsHtml(true);
    popupBodyLayout.setStyleName(Reindeer.LAYOUT_WHITE);
    popupBodyLayout.setHeightUndefined();//(h - 50) + "px");
    popupWindow.setWindowMode(WindowMode.NORMAL);
    diseaseTypeSelectionList = new NativeSelect();
    this.initPopupLayout();

    UI.getCurrent().addWindow(popupWindow);
    popupWindow.center();

}

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

public PopupReorderGroupsLayout(QuantCentralManager Quant_Central_Manager) {

    this.setStyleName("sortandselect");
    this.setDescription("Reorder and select disease groups");
    this.Quant_Central_Manager = Quant_Central_Manager;
    this.addLayoutClickListener(PopupReorderGroupsLayout.this);
    this.popupBodyLayout = new VerticalLayout();
    VerticalLayout windowLayout = new VerticalLayout();
    popupWindow = new Window() {
        @Override//  www .  java  2 s  . c o m
        public void close() {

            popupWindow.setVisible(false);
        }
    };
    popupWindow.setContent(windowLayout);
    windowLayout.addComponent(popupBodyLayout);
    windowLayout.setComponentAlignment(popupBodyLayout, Alignment.MIDDLE_CENTER);

    popupWindow.setVisible(false);
    popupWindow.setResizable(false);
    popupWindow.setClosable(true);
    popupWindow.setStyleName(Reindeer.WINDOW_LIGHT);
    popupWindow.setModal(true);
    popupWindow.setDraggable(false);
    popupWindow.setCaption(
            "<font color='gray' style='font-weight: bold;!important'>&nbsp;&nbsp;Disease Groups</font>");
    popupWindow.setCaptionAsHtml(true);
    popupBodyLayout.setStyleName(Reindeer.LAYOUT_WHITE);
    popupBodyLayout.setHeightUndefined();//(h - 50) + "px");
    popupWindow.setWindowMode(WindowMode.NORMAL);

    UI.getCurrent().addWindow(popupWindow);
    popupWindow.center();

    colHeaders = Quant_Central_Manager.getSelectedHeatMapRows();
    rowHeaders = Quant_Central_Manager.getSelectedHeatMapRows();

    Map<Integer, QuantDatasetObject> quantDSArr = Quant_Central_Manager.getFilteredDatasetsList();

    patientsGroupArr = Quant_Central_Manager.getDiseaseGroupsArray();
    initPopupLayout(rowHeaders, colHeaders, quantDSArr);
    //        this.Quant_Central_Manager.setHeatMapLevelSelection(rowHeaders, colHeaders, patientsGroupArr);
    this.Quant_Central_Manager.registerFilterListener(PopupReorderGroupsLayout.this);

}

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

public StudiesInformationPopupBtn(QuantCentralManager Quant_Central_Manager) {
    //        super("Study Information");
    this.Quant_Central_Manager = Quant_Central_Manager;
    this.setStyleName(Reindeer.BUTTON_LINK);
    this.addStyleName("studyinfo");
    this.setDescription("Show dataset information");
    this.addClickListener(StudiesInformationPopupBtn.this);
    int selectedDsNumber = 0;
    Set<QuantDatasetObject> dsObjects = new TreeSet<QuantDatasetObject>();
    if (Quant_Central_Manager.getSelectedDiseaseGroupsComparisonList() != null
            && !Quant_Central_Manager.getSelectedDiseaseGroupsComparisonList().isEmpty()) {
        Set<QuantDiseaseGroupsComparison> compSet = Quant_Central_Manager
                .getSelectedDiseaseGroupsComparisonList();
        for (QuantDiseaseGroupsComparison comp : compSet) {
            selectedDsNumber += comp.getDatasetIndexes().length;
            for (int dsId : comp.getDatasetIndexes()) {
                DatasetInformationOverviewLayout datasetInfoLayout = new DatasetInformationOverviewLayout(
                        (Page.getCurrent().getBrowserWindowWidth() * 90 / 100),
                        Quant_Central_Manager.getDiseaseHashedColorMap());
                datasetInfoLayout.updateDatasetForm(Quant_Central_Manager.getFullQuantDatasetMap().get(dsId));
                //                    datasetInfoLayout.setWidth("100%");
                datasetInfoLayoutDSIndexMap.put(dsId, datasetInfoLayout);
                dsObjects.add(Quant_Central_Manager.getFullQuantDatasetMap().get(dsId));

            }/*from   w ww  .j a v a  2s .  co  m*/
        }

    } else {
        selectedDsNumber = Quant_Central_Manager.getFilteredDatasetsList().size();
        Map<Integer, QuantDatasetObject> fullDsMap = Quant_Central_Manager.getFilteredDatasetsList();
        for (QuantDatasetObject quantDs : fullDsMap.values()) {
            DatasetInformationOverviewLayout datasetInfoLayout = new DatasetInformationOverviewLayout(
                    (Page.getCurrent().getBrowserWindowWidth() * 90 / 100),
                    Quant_Central_Manager.getDiseaseHashedColorMap());
            datasetInfoLayout.updateDatasetForm(quantDs);
            //                datasetInfoLayout.setWidth("100%");
            datasetInfoLayoutDSIndexMap.put(quantDs.getDsKey(), datasetInfoLayout);
            dsObjects.add(quantDs);

        }
    }
    this.studiesPopupLayout = new StudyPopupLayout(datasetInfoLayoutDSIndexMap);
    VerticalLayout popupBody = new VerticalLayout();
    popupBody.setWidth("100%");
    popupBody.addComponent(studiesPopupLayout);
    popupBody.setComponentAlignment(studiesPopupLayout, Alignment.TOP_CENTER);

    popupWindow = new Window() {
        @Override
        public void close() {
            popupWindow.setVisible(false);
        }
    };
    popupWindow.setContent(popupBody);
    popupWindow.setWindowMode(WindowMode.NORMAL);
    popupWindow.setWidth("95%");
    popupWindow.setHeight("95%");
    popupWindow.setVisible(false);
    popupWindow.setResizable(false);
    popupWindow.setClosable(false);
    popupWindow.setStyleName(Reindeer.WINDOW_LIGHT);
    popupWindow.setModal(true);
    popupWindow.setDraggable(false);
    popupWindow.center();

    popupWindow.setCaption(
            "<font color='gray' style='font-weight: bold;!important'>&nbsp;&nbsp;Study Information ("
                    + selectedDsNumber + ")</font>");
    studiesPopupLayout.setInformationData(dsObjects);

    UI.getCurrent().addWindow(popupWindow);
    popupWindow.center();

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

    popupBody.setMargin(true);
    popupBody.setSpacing(true);
    Quant_Central_Manager.registerStudySelectionListener(StudiesInformationPopupBtn.this);

}

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);//from   ww w  . jav  a2  s  .  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.searching.SearchingUnitLayout.java

/**
 *
 * @param searchingBtnClickListener//from www. j  a v a 2s.c  o m
 */
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.body.welcomelayout.PublicationsInformationWindow.java

public PublicationsInformationWindow(List<Object[]> publicationList) {

    int height = Page.getCurrent().getBrowserWindowHeight() - 100;
    int width = Page.getCurrent().getBrowserWindowWidth() - 100;
    int columnNum = width / 250;
    width = columnNum * 250;//from   w w  w  .j  a  va2 s .  c  om
    VerticalLayout popupBodyWrapper = new VerticalLayout();
    popupBodyWrapper.setWidth("100%");
    popupBodyWrapper.setHeight("100%");
    VerticalLayout popupBody = new VerticalLayout();
    popupBody.setWidth((width) + "px");
    popupBody.setHeightUndefined();
    popupBody.setStyleName(Reindeer.LAYOUT_WHITE);
    popupBody.setMargin(true);
    popupBody.setSpacing(true);
    popupBodyWrapper.addComponent(popupBody);
    popupBodyWrapper.setComponentAlignment(popupBody, Alignment.TOP_CENTER);

    popupWindow = new Window() {

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

        }

    };

    popupWindow.setContent(popupBodyWrapper);
    popupWindow.setWindowMode(WindowMode.NORMAL);

    popupWindow.setWidth((width + 22) + "px");

    popupWindow.setVisible(false);
    popupWindow.setResizable(false);
    popupWindow.setClosable(false);
    popupWindow.setStyleName(Reindeer.WINDOW_LIGHT);
    popupWindow.setModal(true);
    popupWindow.setDraggable(false);
    popupWindow.setCaption(
            "<font color='gray' style='font-weight: bold;!important'>&nbsp;&nbsp;Publication Information</font>");

    UI.getCurrent().addWindow(popupWindow);
    popupWindow.center();

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

    GridLayout publicationContainer = new GridLayout();
    publicationContainer.setWidth("100%");
    publicationContainer.setSpacing(true);
    publicationContainer.setMargin(true);
    popupBody.addComponent(publicationContainer);

    publicationContainer.setColumns(columnNum);
    publicationContainer.setRows(publicationList.size());

    this.addLayoutClickListener(PublicationsInformationWindow.this);
    int row = 0;
    int col = 0;

    for (Object[] obj : publicationList) {
        VerticalLayout publicationLayout = initPublicationLayout(obj);
        String btnName = "<font size=1 >" + obj[0].toString() + "</font><br/>" + obj[1].toString()
                + "<br/><font size=1 >" + obj[2].toString() + "</font><br/><font size=1 >#Proteins: "
                + obj[5].toString() /*+ "/" + obj[5].toString() + */ + "   #Peptides: "
                + obj[7].toString() /*+ "/" + obj[7].toString() +*/ + "</font>";

        PopupInfoBtn publicationBtn = new PopupInfoBtn(publicationLayout, btnName, obj[1].toString());
        publicationContainer.addComponent(publicationBtn, col++, row);
        publicationContainer.setComponentAlignment(publicationBtn, Alignment.TOP_CENTER);
        if (col >= columnNum) {
            row++;
            col = 0;

        }
    }
    height = Math.min((++row * 85) + 200, height);
    popupWindow.setHeight((height) + "px");

}