Example usage for com.vaadin.ui VerticalLayout setHeight

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

Introduction

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

Prototype

@Override
    public void setHeight(String height) 

Source Link

Usage

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 ava2 s  . c  o 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.SingleStudyFilterLayout.java

/**
 *
 * @param dataset/*from   w ww  .  j  a v  a  2  s  .c o m*/
 * @param datasetIndex
 * @param uniqueAttr
 * @param view
 */
public SingleStudyFilterLayout(QuantDatasetObject dataset, int datasetIndex, boolean[] uniqueAttr,
        boolean view) {

    init();
    this.setMargin(new MarginInfo(false, false, false, false));
    VerticalLayout miniLayout = new VerticalLayout();
    Label miniAttrLabel = new Label();
    if (!dataset.getUniqueValues().equalsIgnoreCase("")) {
        miniAttrLabel.setValue("[ " + dataset.getUniqueValues() + "]");
    }
    miniLayout.addComponent(miniAttrLabel);
    GridLayout studyInfo = new GridLayout();
    studyInfo.setColumns(3);
    studyInfo.setWidth("100%");

    SubTreeHideOnClick layout = new SubTreeHideOnClick("Dataset " + datasetIndex, studyInfo, miniLayout, view);
    this.addComponent(layout);
    this.setComponentAlignment(layout, Alignment.MIDDLE_CENTER);
    for (int i = 0; i < uniqueAttr.length; i++) {

        boolean check = uniqueAttr[i];

        if (check) {
            if (!dataset.getProperty(i).toString().trim().equalsIgnoreCase("Not Available")
                    && !dataset.getProperty(i).toString().trim().equalsIgnoreCase("0")
                    && !dataset.getProperty(i).toString().trim().equalsIgnoreCase("-1")) {
                if (publicationInfoLayoutComponents[i] != null) {
                    studyInfo.addComponent(publicationInfoLayoutComponents[i]);
                    ((InformationField) publicationInfoLayoutComponents[i])
                            .setValue(dataset.getProperty(i).toString(), null);
                }
            }

        }

    }
    Button btn = new Button("Load Dataset");
    btn.setStyleName(Reindeer.BUTTON_SMALL);
    VerticalLayout btnLayout = new VerticalLayout();
    btnLayout.setMargin(true);
    btnLayout.setHeight("30px");
    btnLayout.addComponent(btn);

    int rowNum = studyInfo.getRows();
    if (studyInfo.getComponentCount() % 3 != 0) {
        studyInfo.addComponent(btnLayout, 2, rowNum - 1);
    } else {
        studyInfo.setRows(rowNum + 1);
        studyInfo.addComponent(btnLayout, 2, rowNum);
    }

    studyInfo.setComponentAlignment(btnLayout, Alignment.BOTTOM_LEFT);

}

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

public VerticalLayout generateTipsBtn() {
    VerticalLayout tipsIcon = new VerticalLayout();
    tipsIcon.setWidth("16px");
    tipsIcon.setHeight("16px");
    tipsIcon.setDescription("Show tips");
    tipsIcon.setStyleName("tipbtn");
    tipsIcon.addLayoutClickListener(this);
    return tipsIcon;

}

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

public ToggleBtn(String strBtn1Label, String strBtn2Label, String btn1Comment, String btn2Comment, int width) {

    final Label btn1CommentLabel = new Label(btn1Comment);
    btn1CommentLabel.setStyleName(Reindeer.LABEL_SMALL);
    btn1CommentLabel.setWidth("120px");
    final Label btn2CommentLabel = new Label(btn2Comment);
    btn2CommentLabel.setStyleName(Reindeer.LABEL_SMALL);
    btn2CommentLabel.setVisible(false);/*from  w  w w.  j a va2 s . co  m*/
    btn2CommentLabel.setWidth("120px");

    this.setSpacing(true);
    Label btn1Label = new Label(strBtn1Label);
    btn1Label.setStyleName(Reindeer.LABEL_SMALL);
    Label btn2Label = new Label(strBtn2Label);
    btn2Label.setStyleName(Reindeer.LABEL_SMALL);
    toggleSwichButton = new HorizontalLayout();
    toggleSwichButton.setStyleName("toggleleft");
    toggleSwichButton.setWidth("50px");
    toggleSwichButton.setHeight("15px");
    toggleSwichButton.addLayoutClickListener(new LayoutEvents.LayoutClickListener() {

        @Override
        public void layoutClick(LayoutEvents.LayoutClickEvent event) {
            if (toggleSwichButton.getStyleName().equalsIgnoreCase("toggleleft")) {
                toggleSwichButton.setStyleName("toggleright");
                btn1CommentLabel.setVisible(false);
                btn2CommentLabel.setVisible(true);
            } else {
                toggleSwichButton.setStyleName("toggleleft");
                btn1CommentLabel.setVisible(true);
                btn2CommentLabel.setVisible(false);
            }
        }
    });

    this.addComponent(btn1CommentLabel);//commentLabel
    this.setComponentAlignment(btn1CommentLabel, Alignment.TOP_LEFT);//commentLabel
    this.addComponent(btn2CommentLabel);//commentLabel
    this.setComponentAlignment(btn2CommentLabel, Alignment.TOP_LEFT);//commentLabel
    VerticalLayout spacer = new VerticalLayout();
    width = Math.max((width - 120 - 75 - 75 - 55), 1);
    spacer.setHeight("15px");
    spacer.setWidth(width + "px");
    spacer.setStyleName(Reindeer.LAYOUT_WHITE);
    this.addComponent(spacer);
    this.addComponent(btn1Label);
    this.addComponent(toggleSwichButton);
    this.addComponent(btn2Label);

}

From source file:ru.codeinside.gses.webui.manager.DirectoryPanel.java

License:Mozilla Public License

static Component createDirectoryPanel() {
    HorizontalSplitPanel horSplit = new HorizontalSplitPanel();
    horSplit.setSizeFull();/*from w w w. jav  a  2s. com*/
    horSplit.setMargin(true);

    Panel panel00 = new Panel();
    Panel panel01 = new Panel();

    Panel panel10 = new Panel();

    horSplit.setFirstComponent(panel00);

    VerticalLayout vl = new VerticalLayout();
    horSplit.setSecondComponent(vl);

    vl.addComponent(panel01);
    vl.addComponent(panel10);

    vl.setSpacing(true);

    horSplit.setWidth("100%");
    vl.setHeight("100%");

    panel00.setHeight("100%");
    panel00.setWidth("100%");

    panel01.setWidth("100%");
    panel01.setHeight("100%");
    panel10.setHeight("100%");
    horSplit.setSplitPosition(35);
    vl.setExpandRatio(panel01, 0.25f);
    vl.setExpandRatio(panel10, 0.75f);

    final Table dirMapTable = ManagerWorkplace.createDirectoryMapTable();
    final FilterTable directoryTable = ManagerWorkplace.createDirectoryTable();
    dirMapTable.setVisible(false);

    final Form createFieldForm = new Form();
    createFieldForm.setCaption(" ?  ?");

    final TextField keyField = new TextField("");
    keyField.setRequired(true);
    keyField.setMaxLength(254);
    createFieldForm.addField("key", keyField);

    final TextField valField = new TextField("");
    valField.setRequired(true);
    valField.setMaxLength(1022);
    createFieldForm.addField("val", valField);
    createFieldForm.setVisible(false);

    Button addButton = new Button("",
            new AddTupleButtonListener(createFieldForm, directoryTable, keyField, valField, dirMapTable));
    createFieldForm.addField("submit", addButton);

    directoryTable.addListener(new DirectoryTableChangeListener(createFieldForm, directoryTable, dirMapTable));

    ManagerWorkplace.buildContainer(directoryTable, createFieldForm, dirMapTable);
    directoryTable.setColumnHeaders(new String[] { "?", "", "" });

    final Form createDirectory = new Form();
    createDirectory.setCaption(" ?");
    final TextField field = new TextField("?");
    field.setRequired(true);
    field.setMaxLength(255);
    field.setRequiredError("  ?");
    createDirectory.addField("name", field);
    Button createButton = new Button("",
            new CreateDirectoryButtonListener(field, createDirectory, directoryTable));
    createDirectory.addField("submit", createButton);

    Panel loadPanel = new Panel();
    loadPanel.setCaption(" ?");

    UploadDirectory events = new UploadDirectory(directoryTable, dirMapTable);

    Upload c = new Upload("", events);
    c.addListener(events);

    c.setButtonCaption("");
    loadPanel.addComponent(c);

    VerticalLayout verticalLayout = new VerticalLayout();
    verticalLayout.setSizeFull();
    verticalLayout.setSpacing(true);
    verticalLayout.addComponent(loadPanel);
    verticalLayout.addComponent(createDirectory);
    verticalLayout.addComponent(directoryTable);

    panel00.addComponent(verticalLayout);

    panel01.addComponent(createFieldForm);

    dirMapTable.setSizeFull();
    dirMapTable.setPageLength(13);
    panel10.addComponent(dirMapTable);

    return horSplit;
}

From source file:se.natusoft.osgi.aps.apsconfigadminweb.gui.vaadin.components.ConfigEditor.java

License:Open Source License

/**
 * Builds the gui of this component./*from  w  w w.j  av  a 2 s . c o  m*/
 * <p/>
 * The code in this method builds the base gui, the static parts that is only created once. It ends by calling
 * loadCurrentNodeData() to do a first time load of the root node of the ConfigNavigator.
 */
private void setupGUI() {
    this.setStyleName(CSS.APS_CONFIGID_LABEL);
    setSizeFull();

    VerticalLayout mainLayout = new VerticalLayout();
    {
        mainLayout.setSpacing(true);
        mainLayout.setMargin(true);
        mainLayout.setStyleName(CSS.APS_CONTENT_PANEL);
        mainLayout.setSizeFull();

        this.editForConfigEnvSelect = new ConfigEnvSelector();
        this.editForConfigEnvSelect.setDataSource(this.configAdminService.getConfigEnvAdmin());
        this.editForConfigEnvSelect.addListener(new ConfigEnvChangeListener() {
            @Override
            public void configEnvironmentChanged(ConfigEnvChangeEvent event) {
                handleChangedConfigEnv(event.getSelectedConfigEnvironment());
            }
        });
        mainLayout.addComponent(this.editForConfigEnvSelect);
        mainLayout.setExpandRatio(this.editForConfigEnvSelect, 1.0f);

        HorizontalLine hr = new HorizontalLine();
        mainLayout.addComponent(hr);
        mainLayout.setExpandRatio(hr, 1.0f);

        HorizontalLayout contentLayout = new HorizontalLayout();
        {
            contentLayout.setSpacing(true);
            contentLayout.setSizeFull();

            ConfigNode configNode = new ConfigNode(this.editedConfigAdmin.getConfigModel());
            if (!configNode.getNodeChildren().isEmpty()) {

                VerticalLayout nodesAndButtonsLayout = new VerticalLayout();
                {
                    nodesAndButtonsLayout.setWidth(null);
                    nodesAndButtonsLayout.setHeight("100%");
                    nodesAndButtonsLayout.setMargin(false);
                    nodesAndButtonsLayout.setSpacing(false);

                    this.nodeSelector = new NodeSelector();
                    this.nodeSelector.setHeight("100%");
                    this.nodeSelector.setWidth(null);
                    this.nodeSelector.setScrollable(true);
                    this.nodeSelector.setDataSource(this.nodeSelectorDataSource);
                    this.nodeSelector.addListener(new NodeSelectionListener() {
                        @Override
                        public void nodeSelected(NodeSelectedEvent event) {
                            selectCurrentNode(event.getSelectedModel(), event.getIndex());
                        }
                    });
                    nodesAndButtonsLayout.addComponent(this.nodeSelector);
                    nodesAndButtonsLayout.setExpandRatio(this.nodeSelector, 92.0f); // This works for iPad screen
                                                                                    // size and upp.
                    HorizontalLayout buttonsLayout = new HorizontalLayout();
                    {
                        buttonsLayout.setMargin(false);
                        buttonsLayout.setSpacing(false);
                        buttonsLayout.setHeight("100%");

                        this.addNodeButton = new Button(" + ");
                        this.addNodeButton.setEnabled(false);
                        this.addNodeButton.addListener(new ClickListener() {
                            @Override
                            public void buttonClick(ClickEvent event) {
                                addNodeInstance();
                            }
                        });
                        buttonsLayout.addComponent(this.addNodeButton);

                        this.removeNodeButton = new Button(" - ");
                        this.removeNodeButton.setEnabled(false);
                        this.removeNodeButton.addListener(new ClickListener() {
                            @Override
                            public void buttonClick(ClickEvent event) {
                                removeNodeInstance();
                            }
                        });
                        buttonsLayout.addComponent(this.removeNodeButton);
                    }
                    nodesAndButtonsLayout.addComponent(buttonsLayout);
                    nodesAndButtonsLayout.setExpandRatio(buttonsLayout, 8.0f);

                }
                contentLayout.addComponent(nodesAndButtonsLayout);
                contentLayout.setExpandRatio(nodesAndButtonsLayout, 1.0f);
            }

            this.configNodeValuesEditor = new ConfigNodeValuesEditor();
            {
                this.configNodeValuesEditor.setScrollable(true);
                this.configNodeValuesEditor.setWidth("100%");
                this.configNodeValuesEditor.setHeight("100%");

                this.configNodeValuesEditor.setDataSource(this.configNodeValueEditorDataSource);
            }
            contentLayout.addComponent(this.configNodeValuesEditor);
            contentLayout.setExpandRatio(this.configNodeValuesEditor, 99.0f);
        }
        mainLayout.addComponent(contentLayout);
        mainLayout.setExpandRatio(contentLayout, 96.0f);

        hr = new HorizontalLine();
        mainLayout.addComponent(hr);
        mainLayout.setExpandRatio(hr, 1.0f);

        HorizontalLayout saveCancelButtonsLayout = new HorizontalLayout();
        {
            saveCancelButtonsLayout.setSpacing(true);

            Button saveButton = new Button("Save");
            saveButton.addListener(new ClickListener() {
                @Override
                public void buttonClick(ClickEvent event) {
                    saveEdit();
                }
            });
            saveCancelButtonsLayout.addComponent(saveButton);

            Button cancelButton = new Button("Cancel");
            cancelButton.addListener(new ClickListener() {
                @Override
                public void buttonClick(ClickEvent event) {
                    cancelEdit();
                }
            });
            saveCancelButtonsLayout.addComponent(cancelButton);
        }
        mainLayout.addComponent(saveCancelButtonsLayout);
        mainLayout.setExpandRatio(saveCancelButtonsLayout, 1.0f);
    }

    setContent(mainLayout);

    refresh();
    if (this.nodeSelector != null) {
        this.nodeSelector.refreshData();
    }
}

From source file:uicomponents.BarcodePreviewComponent.java

License:Open Source License

public BarcodePreviewComponent(SampleToBarcodeFieldTranslator translator) {
    this.translator = translator;
    setSpacing(true);//ww  w  . j  a  v  a 2 s .  c o  m
    setMargin(true);

    Resource res = new ThemeResource("img/qrtest.png");
    Image qr = new Image(null, res);
    qr.setHeight("140px");
    qr.setWidth("140px");
    Image qr2 = new Image(null, res);
    qr2.setHeight("140px");
    qr2.setWidth("140px");

    code = new TextField();
    info1 = new TextField();
    info2 = new TextField();

    codedName = new OptionGroup("Put ID on sticker:");
    codedName.addItems(Arrays.asList("QBiC ID", "Lab ID", "Secondary Name"));
    codedName.setImmediate(true);
    codedName.addStyleName(ValoTheme.OPTIONGROUP_HORIZONTAL);
    codedName.select("QBiC ID");

    code.addStyleName(ValoTheme.TEXTFIELD_BORDERLESS);
    code.setWidth("200px");
    code.addStyleName("barcode-large");

    styleInfoField(info1);
    styleInfoField(info2);
    styleInfoField(qbicInfo);

    VerticalLayout box = new VerticalLayout();
    box.setHeight("110px");
    box.addStyleName(ValoTheme.LAYOUT_COMPONENT_GROUP);
    box.addComponent(code);
    box.addComponent(info1);
    box.addComponent(info2);
    box.addComponent(qbicInfo);
    box.setWidth("190px");

    HorizontalLayout test = new HorizontalLayout();
    test.setSizeFull();
    test.addComponent(qr);
    test.addComponent(box);
    test.addComponent(qr2);

    setFieldsReadOnly(true);
    List<String> options = new ArrayList<String>(Arrays.asList("Tissue/Extr. Material", "Secondary Name",
            "QBiC ID", "Lab ID", "MHC Type", "Used Antibody"));
    select1 = new ComboBox("First Info", options);
    select1.setStyleName(Styles.boxTheme);
    select1.setImmediate(true);
    select1.select("Tissue/Extr. Material");
    select2 = new ComboBox("Second Info", options);
    select2.select("Secondary Name");
    select2.setImmediate(true);
    select2.setStyleName(Styles.boxTheme);

    ValueChangeListener vc = new ValueChangeListener() {

        /**
         * 
         */
        private static final long serialVersionUID = -7466519211904860012L;

        @Override
        public void valueChange(ValueChangeEvent event) {
            refresh();
        }
    };
    codedName.addValueChangeListener(vc);
    select1.addValueChangeListener(vc);
    select2.addValueChangeListener(vc);

    HorizontalLayout designBox = new HorizontalLayout();
    designBox.addComponent(select1);
    designBox.addComponent(select2);
    designBox.addStyleName(ValoTheme.LAYOUT_HORIZONTAL_WRAPPING);
    designBox.setSpacing(true);

    VerticalLayout previewBox = new VerticalLayout();
    previewBox.setStyleName(ValoTheme.LAYOUT_CARD);
    previewBox.setCaption("Barcode Example");
    previewBox.addComponent(test);

    addComponent(previewBox);
    addComponent(codedName);
    addComponent(designBox);

    //    overwrite = new CheckBox("Overwrite existing Tube Barcode Files");
    //    addComponent(ProjectwizardUI.questionize(overwrite,
    //        "Overwrites existing files of barcode stickers. This is useful when "
    //            + "the design was changed after creating them.", "Overwrite Sticker Files"));
}