Example usage for com.vaadin.ui HorizontalLayout setHeight

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

Introduction

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

Prototype

@Override
    public void setHeight(String height) 

Source Link

Usage

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

/**
 *
 * @param width//from  w ww . ja v  a  2s.c om
 * @param height
 */
public PeptidesOverviewPanel(int width, int height) {
    this.setWidth(width + "px");
    this.setHeight(height + "px");
    this.setStyleName(Reindeer.LAYOUT_BLUE);
    this.setMargin(true);

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

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

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

}

From source file:probe.com.view.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  ww .  jav  a2s  . com*/
    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:roart.client.MyVaadinUI.java

@Override
protected void init(VaadinRequest request) {
    final VerticalLayout layout = new VerticalLayout();
    VerticalLayout searchTab = null, controlPanelTab = null;

    com.vaadin.server.Page.getCurrent().setTitle("Aether disk search engine by Roar Throns");

    layout.setMargin(true);/*from  w w  w. j av a2  s.  c om*/
    setContent(layout);

    getSession().setAttribute("addr", request.getRemoteAddr());
    getSession().setAttribute(Constants.USER, Constants.NONE);
    initVars();

    HorizontalLayout topLine = new HorizontalLayout();
    Label topTitle = new Label("Aether disk search engine");
    topTitle.setWidth("90%");
    topLine.addComponent(topTitle);
    topLine.setHeight("10%");
    topLine.setWidth("100%");
    boolean doauthenticate = (boolean) getSession().getAttribute("authenticate");
    statLabel = new Label("", ContentMode.PREFORMATTED);
    statLabel.setWidth("50%");
    topLine.addComponent(statLabel);
    if (doauthenticate) {
        Button login = getLoginButton();
        Button logout = getLogoutButton();
        topLine.addComponent(login);
        topLine.addComponent(logout);
        getSession().setAttribute("login", login);
        getSession().setAttribute("logout", logout);
    }
    layout.addComponent(topLine);

    tabsheet = new TabSheet();
    tabsheet.setHeight("80%");
    layout.addComponent(tabsheet);
    // Create the first tab
    searchTab = getSearchTab();
    getSession().setAttribute("search", searchTab);
    // This tab gets its caption from the component caption
    controlPanelTab = getControlPanelTab();
    getSession().setAttribute("controlpanel", controlPanelTab);

    tabsheet.addTab(searchTab);
    // This tab gets its caption from the component caption
    tabsheet.addTab(controlPanelTab);
    //tabsheet.addTab(statTab);

    /*
    tabsheet.addTab(miscTab);
    tabsheet.addTab(comicsTab);
    tabsheet.addTab(trainingTab);
    */

    HorizontalLayout bottomLine = new HorizontalLayout();
    bottomLine.setHeight("10%");
    bottomLine.setWidth("90%");
    Label nodeLabel = new Label("Node " + ControlService.nodename);
    bottomLine.addComponent(nodeLabel);
    Label dbLabel = new Label("Db type " + roart.util.Prop.getProp().getProperty(ConfigConstants.DB));
    //dbLabel.setWidth("30%");
    bottomLine.addComponent(dbLabel);
    Label idxLabel = new Label("Index type " + roart.util.Prop.getProp().getProperty(ConfigConstants.INDEX));
    //idxLabel.setWidth("30%");
    bottomLine.addComponent(idxLabel);
    Label licenseLabel = new Label("Affero GPL");
    //licenseLabel.setWidth("30%");
    bottomLine.addComponent(licenseLabel);
    //bottomLine.setComponentAlignment(licenseLabel, Alignment.BOTTOM_RIGHT);
    layout.addComponent(bottomLine);
    setVisibilities();
}

From source file:roart.client.MyVaadinUI.java

private VerticalLayout getControlPanelTab() {
    VerticalLayout tab = new VerticalLayout();
    tab.setCaption("Control Panel");
    HorizontalLayout horNewInd = new HorizontalLayout();
    horNewInd.setHeight("20%");
    horNewInd.setWidth("90%");
    Button fsIndexNew = getFsIndexNew();
    horNewInd.addComponent(fsIndexNew);/*from   ww  w. ja  va2  s . c  om*/
    horNewInd.setComponentAlignment(fsIndexNew, Alignment.BOTTOM_LEFT);
    horNewInd.addComponent(getFsIndexNewPath());
    horNewInd.addComponent(getFsIndexNewMd5());
    HorizontalLayout horNew = new HorizontalLayout();
    horNew.setHeight("20%");
    horNew.setWidth("60%");
    Button fsAddNew = getFsAddNew();
    horNew.addComponent(fsAddNew);
    horNew.setComponentAlignment(fsAddNew, Alignment.BOTTOM_LEFT);
    horNew.addComponent(getFsAddNewPath());
    HorizontalLayout horInd = new HorizontalLayout();
    horInd.setHeight("20%");
    horInd.setWidth("90%");
    Button indexNew = getIndexNew();
    horInd.addComponent(indexNew);
    horInd.setComponentAlignment(indexNew, Alignment.BOTTOM_LEFT);
    horInd.addComponent(getIndexNewPath());
    HorizontalLayout horIndSuf = new HorizontalLayout();
    horIndSuf.setHeight("20%");
    horIndSuf.setWidth("90%");
    horIndSuf.addComponent(getIndexSuffix());
    horIndSuf.addComponent(getReindexSuffix());
    HorizontalLayout horReindex = new HorizontalLayout();
    horReindex.setHeight("20%");
    horReindex.setWidth("90%");
    horReindex.addComponent(getReindex());
    horReindex.addComponent(getReindexDateLower());
    horReindex.addComponent(getReindexDateHigher());
    HorizontalLayout horReindex2 = new HorizontalLayout();
    horReindex2.setHeight("20%");
    horReindex2.setWidth("90%");
    horReindex2.addComponent(getReindexLanguage());
    horReindex2.addComponent(getReindexConfiguredLanguage());
    HorizontalLayout horClean = new HorizontalLayout();
    horClean.setHeight("20%");
    horClean.setWidth("60%");
    horClean.addComponent(getConsistent());
    horClean.addComponent(getConsistentCleanup());
    HorizontalLayout horStat = new HorizontalLayout();
    horStat.setHeight("20%");
    horStat.setWidth("90%");
    horStat.addComponent(getNotIndexed());
    horStat.addComponent(getMemoryUsage());
    horStat.addComponent(getOverlapping());
    HorizontalLayout horDb = new HorizontalLayout();
    horDb.setHeight("20%");
    horDb.setWidth("60%");
    horDb.addComponent(getDbItem());
    horDb.addComponent(getDbSearch());

    HorizontalLayout horConfig = new HorizontalLayout();
    horConfig.setHeight("20%");
    horConfig.setWidth("60%");
    horConfig.addComponent(getConfigValue(ControlService.Config.FAILEDLIMIT));
    horConfig.addComponent(getConfigValue(ControlService.Config.INDEXLIMIT));
    horConfig.addComponent(getConfigValue(ControlService.Config.REINDEXLIMIT));
    horConfig.addComponent(getConfigValue(ControlService.Config.TIKATIMEOUT));
    horConfig.addComponent(getConfigValue(ControlService.Config.OTHERTIMEOUT));

    /*
    tab.addComponent(getCleanup());
    tab.addComponent(getCleanup2());
    tab.addComponent(getCleanupfs());
    */

    tab.addComponent(horNewInd);
    tab.addComponent(horNew);
    tab.addComponent(horInd);
    tab.addComponent(horIndSuf);
    tab.addComponent(horReindex);
    tab.addComponent(horReindex2);
    tab.addComponent(horClean);
    tab.addComponent(horStat);
    tab.addComponent(horDb);
    tab.addComponent(horConfig);
    return tab;
}

From source file:ru.codeinside.adm.ui.employee.EmployeeWidget.java

License:Mozilla Public License

public EmployeeWidget(boolean lockedFilterValue, TreeTable table) {
    this.table = table;
    Upload upload = new Upload();
    upload.setImmediate(false);/*from   w w  w. j a v a  2 s  .  com*/
    upload.setButtonCaption("  ");
    upload.setReceiver(this);
    upload.addListener(this);
    /*    Panel panel1 = new Panel();
        Button button = new Button("??? ", new Button.ClickListener() {
          @Override
          public void buttonClick(Button.ClickEvent event) {
            try {
              URL url = new URL(getApplication().getURL(), "/registry/structures");
              loadEmployeeData(url.openStream());
            } catch (MalformedURLException e) {
              getWindow().showNotification(" " + e.getMessage());
            } catch (IOException e) {
              getWindow().showNotification(" " + e.getMessage());
            }
          }
        });
        panel1.addComponent(button);*/
    tableEmployee = new TableAllEmployee(lockedFilterValue);
    tableEmployee.setSizeFull();
    HorizontalLayout hr = new HorizontalLayout();
    hr.setSizeFull();
    hr.setHeight("70px");
    hr.setSpacing(true);
    hr.setMargin(true);
    hr.addComponent(upload);
    addComponent(hr);
    addComponent(tableEmployee);
    tableEmployee.addButtonToLayout(hr);
    setExpandRatio(hr, 0.01f);
    setExpandRatio(tableEmployee, 0.99f);
    setSizeFull();
}

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

License:Mozilla Public License

private Component createProcedurePanel1() {
    HorizontalLayout hl = new HorizontalLayout();
    hl.setSpacing(true);/* w w  w.  j  av  a  2  s.  c  o  m*/
    hl.setWidth("100%");
    hl.setHeight("100%");
    Panel panel00 = new Panel();
    panel00.setHeight("100%");
    panel00.setWidth("100%");
    Panel panel01 = new Panel();
    panel01.setWidth("100%");
    panel01.setHeight("100%");
    Panel panel10 = new Panel();
    panel10.setSizeFull();
    panel10.setScrollable(false);
    hl.addComponent(panel00);
    hl.addComponent(panel01);

    VerticalLayout vl = new VerticalLayout();
    vl.setSizeFull();
    vl.setMargin(true);
    vl.setSpacing(true);
    vl.addComponent(hl);
    vl.addComponent(panel10);

    hl.setExpandRatio(panel00, 0.33f);
    hl.setExpandRatio(panel01, 0.77f);
    vl.setExpandRatio(hl, 0.6f);
    vl.setExpandRatio(panel10, 0.4f);

    procedureForm = new ProcedureForm();
    procedureTable = new ProcedureTable(procedureForm);
    filter = createFilteringForm(procedureTable);
    panel00.addComponent(filter);
    panel01.addComponent(procedureForm);
    panel10.addComponent(procedureTable);
    ap.addItemSetChangeListener(filter);
    ap.addItemSetChangeListener(procedureForm);
    return vl;
}

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 ww  .  java2  s  .  co  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();
    }
}