Example usage for com.vaadin.ui Alignment Alignment

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

Introduction

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

Prototype

public Alignment(int bitMask) 

Source Link

Usage

From source file:ar.com.zir.cipres.ui.login.LoginForm.java

@AutoGenerated
private VerticalLayout buildMainLayout() {
    // common part: create layout
    mainLayout = new VerticalLayout();
    mainLayout.setImmediate(false);//w  ww  .  j a  v  a 2 s  . co m
    mainLayout.setWidth("100%");
    mainLayout.setHeight("100%");
    mainLayout.setMargin(false);

    // top-level component properties
    setWidth("100.0%");
    setHeight("100.0%");

    // panel_2
    panel_2 = buildPanel_2();
    mainLayout.addComponent(panel_2);
    mainLayout.setComponentAlignment(panel_2, new Alignment(48));

    return mainLayout;
}

From source file:br.com.anteros.mobileserver.app.form.TableForm.java

License:Apache License

private void createGrids() {
    layoutFields = new VerticalLayout();
    layoutFields.setImmediate(false);/*from   w w w.  ja v a  2  s.  c o m*/
    layoutFields.setWidth("100.0%");
    layoutFields.setHeight("100.0%");
    layoutFields.setMargin(false);

    gridFields = new Table();
    gridFields.setWidth("100.0%");
    gridFields.setHeight("100.0%");
    gridFields.setContainerDataSource(getFieldsDataSource());
    gridFields.setColumnHeaders(
            new String[] { "Id", "Nome campo", "Descrio", "Nome campo SQL", "Tipo de Campo", "" });
    gridFields.setSizeFull();
    gridFields.addListener(new Property.ValueChangeListener() {

        public void valueChange(ValueChangeEvent event) {
            enableActions();
        }
    });

    gridFields.setColumnExpandRatio("NAME", 1);
    gridFields.setColumnWidth("ID", 70);
    gridFields.setColumnWidth("NAME", 300);
    gridFields.setColumnWidth("DESCRIPTION", 400);
    gridFields.setColumnWidth("SQL_FIELD_NAME", 200);
    gridFields.setColumnWidth("FIELD_TYPE", 200);
    gridFields.setColumnWidth(MobileServerData.PROPERTY_DATA, 1);
    gridFields.setSelectable(true);
    gridFields.setImmediate(true);

    layoutFields.addComponent(gridFields);
    layoutFields.setExpandRatio(gridFields, 1.0f);

    buttonsFields = new HorizontalLayout();
    buttonsFields.setImmediate(false);
    buttonsFields.setWidth("100.0%");
    buttonsFields.setHeight("30px");
    buttonsFields.setMargin(false);
    buttonsFields.setSpacing(true);

    btnAddField = new Button();
    btnAddField.setCaption("Adicionar");
    btnAddField.setImmediate(false);
    btnAddField.setWidth("-1px");
    btnAddField.setHeight("-1px");
    btnAddField.setIcon(new ThemeResource("icons/16/fieldAdd.png"));
    btnAddField.addListener(this);
    buttonsFields.addComponent(btnAddField);
    buttonsFields.setComponentAlignment(btnAddField, new Alignment(33));

    btnRemoveField = new Button();
    btnRemoveField.setCaption("Remover");
    btnRemoveField.setImmediate(false);
    btnRemoveField.setWidth("-1px");
    btnRemoveField.setHeight("-1px");
    btnRemoveField.setIcon(new ThemeResource("icons/16/fieldRemove.png"));
    btnRemoveField.addListener(this);
    buttonsFields.addComponent(btnRemoveField);
    buttonsFields.setComponentAlignment(btnRemoveField, new Alignment(33));

    btnEditField = new Button();
    btnEditField.setCaption("Editar");
    btnEditField.setImmediate(false);
    btnEditField.setWidth("-1px");
    btnEditField.setHeight("-1px");
    btnEditField.setIcon(new ThemeResource("icons/16/fieldEdit.png"));
    btnEditField.addListener(this);
    buttonsFields.addComponent(btnEditField);
    buttonsFields.setComponentAlignment(btnEditField, new Alignment(33));
    buttonsFields.setExpandRatio(btnEditField, 1);

    layoutParameters = new VerticalLayout();
    layoutParameters.setImmediate(false);
    layoutParameters.setWidth("100.0%");
    layoutParameters.setHeight("100.0%");
    layoutParameters.setMargin(false);

    gridParameters = new Table();
    gridParameters.setWidth("100.0%");
    gridParameters.setHeight("100.0%");
    gridParameters.setContainerDataSource(getParametersDataSource());
    gridParameters.setColumnHeaders(new String[] { "Id", "Nome Parmetro", "Descrio",
            "Tipo Dado Parmetro", "Tipo de Parmetro", "" });
    gridParameters.setSizeFull();
    gridParameters.setSelectable(true);
    gridParameters.setImmediate(true);

    gridParameters.setColumnExpandRatio("NAME", 1);
    gridParameters.setColumnWidth("ID", 70);
    gridParameters.setColumnWidth("NAME", 300);
    gridParameters.setColumnWidth("DESCRIPTION", 400);
    gridParameters.setColumnWidth("PARAMETER_DATA_TYPE", 200);
    gridParameters.setColumnWidth("PARAMETER_TYPE", 200);
    gridParameters.setColumnWidth(MobileServerData.PROPERTY_DATA, 0);
    gridParameters.addListener(new Property.ValueChangeListener() {

        public void valueChange(ValueChangeEvent event) {
            enableActions();
        }
    });
    layoutParameters.addComponent(gridParameters);
    layoutParameters.setExpandRatio(gridParameters, 1.0f);

    buttonsParameters = new HorizontalLayout();
    buttonsParameters.setImmediate(false);
    buttonsParameters.setWidth("100.0%");
    buttonsParameters.setHeight("30px");
    buttonsParameters.setMargin(false);
    buttonsParameters.setSpacing(true);

    btnAddParameter = new Button();
    btnAddParameter.setCaption("Adicionar");
    btnAddParameter.setImmediate(false);
    btnAddParameter.setWidth("-1px");
    btnAddParameter.setHeight("-1px");
    btnAddParameter.setIcon(new ThemeResource("icons/16/parameterAdd.png"));
    btnAddParameter.addListener(this);
    buttonsParameters.addComponent(btnAddParameter);
    buttonsParameters.setComponentAlignment(btnAddParameter, new Alignment(33));

    btnRemoveParameter = new Button();
    btnRemoveParameter.setCaption("Remover");
    btnRemoveParameter.setImmediate(false);
    btnRemoveParameter.setWidth("-1px");
    btnRemoveParameter.setHeight("-1px");
    btnRemoveParameter.setIcon(new ThemeResource("icons/16/parameterRemove.png"));
    btnRemoveParameter.addListener(this);
    buttonsParameters.addComponent(btnRemoveParameter);
    buttonsParameters.setComponentAlignment(btnRemoveParameter, new Alignment(33));

    btnEditParameter = new Button();
    btnEditParameter.setCaption("Editar");
    btnEditParameter.setImmediate(false);
    btnEditParameter.setWidth("-1px");
    btnEditParameter.setHeight("-1px");
    btnEditParameter.setIcon(new ThemeResource("icons/16/parameterEdit.png"));
    btnEditParameter.addListener(this);
    buttonsParameters.addComponent(btnEditParameter);
    buttonsParameters.setComponentAlignment(btnEditParameter, new Alignment(33));
    buttonsParameters.setExpandRatio(btnEditParameter, 1);

}

From source file:br.com.anteros.mobileserver.app.form.UserLoginForm.java

License:Apache License

private VerticalLayout buildVerticalLayout() {
    verticalLayout = new VerticalLayout();
    verticalLayout.setImmediate(false);// ww w.  jav  a  2 s.c om
    verticalLayout.setWidth("390px");
    verticalLayout.setHeight("140px");
    verticalLayout.setMargin(false);

    horizontalLayout = buildHorizontalLayout_1();
    verticalLayout.addComponent(horizontalLayout);
    verticalLayout.setExpandRatio(horizontalLayout, 1.0f);
    verticalLayout.setComponentAlignment(horizontalLayout, new Alignment(48));

    return verticalLayout;
}

From source file:br.com.anteros.mobileserver.app.form.UserLoginForm.java

License:Apache License

private HorizontalLayout buildHorizontalLayout_1() {
    horizontalLayout = new HorizontalLayout();
    horizontalLayout.setImmediate(false);
    horizontalLayout.setWidth("100.0%");
    horizontalLayout.setHeight("100.0%");
    horizontalLayout.setMargin(false);//from  ww  w.j  a  va  2s. c  o m

    image = new Embedded();
    image.setImmediate(false);
    image.setWidth("64px");
    image.setHeight("64px");
    image.setSource(new ThemeResource("img/login.png"));
    image.setType(1);
    image.setMimeType("image/png");
    horizontalLayout.addComponent(image);
    horizontalLayout.setComponentAlignment(image, new Alignment(33));

    absoluteLayout = buildAbsoluteLayout();
    horizontalLayout.addComponent(absoluteLayout);
    horizontalLayout.setExpandRatio(absoluteLayout, 1.0f);

    return horizontalLayout;
}

From source file:com.anphat.list.ui.DialogAddMapStaffCustomer.java

public void initDialog(boolean isCustInfo) {
    buildInfoLayout(isCustInfo);/* w w w.  j a  va 2s  .co  m*/
    mainLayout.addComponent(infoLayout);
    // searchLayout
    buildSearchLayout(isCustInfo);
    mainLayout.addComponent(searchLayout);
    // btnSearch
    btnSearch = new Button();
    btnSearch.setCaption(BundleUtils.getString("common.button.search"));
    btnSearch.setIcon(new ThemeResource(Constants.ICON.SEARCH));
    btnSearch.setImmediate(true);
    btnSearch.setWidth("-1px");
    btnSearch.setHeight("-1px");
    mainLayout.addComponent(btnSearch);
    mainLayout.setComponentAlignment(btnSearch, new Alignment(48));
    buildMainLayout();
    mainLayout.addComponent(horizontalLayout);
    //Nut luu va huy bo
    GridManyButton gridManyButton = new GridManyButton(
            new String[] { Constants.BUTTON_SAVE, Constants.BUTTON_CANCEL });
    btnSave = gridManyButton.getBtnCommon().get(0);
    btnCancel = gridManyButton.getBtnCommon().get(1);
    mainLayout.addComponent(gridManyButton);

}

From source file:com.anphat.list.ui.DialogAddMapStaffCustomer.java

private void buildMainLayout() {
    // common part: create layout
    horizontalLayout = new HorizontalLayout();
    horizontalLayout.setImmediate(true);
    horizontalLayout.setWidth("100%");
    horizontalLayout.setHeight("-1px");
    horizontalLayout.setMargin(false);//from w  w w  . j a v a 2 s .com

    //        // top-level component properties
    //        setWidth("100.0%");
    //        setHeight("-1px");
    // leftLayout
    buildLeftLayout();
    horizontalLayout.addComponent(leftLayout);
    horizontalLayout.setExpandRatio(leftLayout, 1.0f);

    // centerLayout
    buildCenterLayout();
    horizontalLayout.addComponent(centerLayout);
    horizontalLayout.setComponentAlignment(centerLayout, new Alignment(48));

    // rightLayout
    buildRightLayout();
    horizontalLayout.addComponent(rightLayout);
    horizontalLayout.setExpandRatio(rightLayout, 1.0f);
}

From source file:com.anphat.list.ui.DialogAddMapStaffCustomer.java

private void buildCenterLayout() {
    // common part: create layout
    centerLayout = new VerticalLayout();
    centerLayout.setImmediate(true);/*from  w  ww. jav  a  2 s .  c o  m*/
    centerLayout.setWidth("30px");
    centerLayout.setHeight("-1px");
    centerLayout.setMargin(false);

    // btnAdd
    btnAdd = new Button();
    btnAdd.setIcon(new ThemeResource(Constants.ICON.FORWARD));
    btnAdd.setImmediate(true);
    btnAdd.setWidth("-1px");
    btnAdd.setHeight("-1px");
    centerLayout.addComponent(btnAdd);
    centerLayout.setComponentAlignment(btnAdd, new Alignment(48));

}

From source file:com.anphat.list.ui.DialogCreateDepartment.java

@AutoGenerated
private HorizontalLayout buildHorizontalLayoutButton() {
    // common part: create layout
    horizontalLayoutButton = new HorizontalLayout();
    horizontalLayoutButton.setImmediate(true);
    horizontalLayoutButton.setWidth("100.0%");
    horizontalLayoutButton.setHeight("-1px");
    horizontalLayoutButton.setMargin(true);
    horizontalLayoutButton.setSpacing(true);

    // btnSave/*from ww  w . j a va 2  s  . com*/
    btnSave = new Button();
    btnSave.setCaption(BundleUtils.getString("common.button.save"));
    btnSave.setImmediate(true);
    btnSave.setWidth("-1px");
    btnSave.setHeight("-1px");
    btnSave.setIcon(new ThemeResource("img/save_icon.png"));
    horizontalLayoutButton.addComponent(btnSave);
    horizontalLayoutButton.setComponentAlignment(btnSave, new Alignment(34));

    // btnCancel
    btnCancel = new Button();
    btnCancel.setCaption(BundleUtils.getString("common.button.cancel"));
    btnCancel.setImmediate(true);
    btnCancel.setWidth("-1px");
    btnCancel.setHeight("-1px");
    btnCancel.setIcon(new ThemeResource("img/cancel_icon.png"));
    horizontalLayoutButton.addComponent(btnCancel);
    horizontalLayoutButton.setComponentAlignment(btnCancel, new Alignment(33));

    return horizontalLayoutButton;
}

From source file:com.anphat.list.ui.DialogCreateStaff.java

@AutoGenerated
private HorizontalLayout buildHorizontalLayoutButton() {
    // common part: create layout
    horizontalLayoutButton = new HorizontalLayout();
    horizontalLayoutButton.setImmediate(false);
    horizontalLayoutButton.setWidth("100.0%");
    horizontalLayoutButton.setHeight("-1px");
    horizontalLayoutButton.setMargin(true);
    horizontalLayoutButton.setSpacing(true);

    // btnSave/*  w ww. j a  v a2  s  . c o m*/
    btnSave = new Button();
    btnSave.setCaption(BundleUtils.getString("common.button.save"));
    btnSave.setImmediate(true);
    btnSave.setWidth("-1px");
    btnSave.setHeight("-1px");
    btnSave.setIcon(new ThemeResource(Constants.ICON.SAVE));
    horizontalLayoutButton.addComponent(btnSave);
    horizontalLayoutButton.setComponentAlignment(btnSave, new Alignment(34));

    // btnCancel
    btnCancel = new Button();
    btnCancel.setCaption(BundleUtils.getString("common.button.cancel"));
    btnCancel.setImmediate(true);
    btnCancel.setWidth("-1px");
    btnCancel.setHeight("-1px");
    btnCancel.setIcon(new ThemeResource(Constants.ICON.CANCEL));
    horizontalLayoutButton.addComponent(btnCancel);
    horizontalLayoutButton.setComponentAlignment(btnCancel, new Alignment(33));

    return horizontalLayoutButton;
}

From source file:com.example.mmowgli_2_0.RootCards.java

@AutoGenerated
private GridLayout buildMainLayout() {
    // common part: create layout
    mainLayout = new GridLayout();
    mainLayout.setImmediate(false);//from   w w w . j av a 2s  .c o  m
    mainLayout.setWidth("100%");
    mainLayout.setHeight("150px");
    mainLayout.setMargin(false);
    mainLayout.setColumns(2);

    // top-level component properties
    setWidth("100.0%");
    setHeight("150px");

    // verticalLayout_idea1
    verticalLayout_idea1 = buildVerticalLayout_idea1();
    mainLayout.addComponent(verticalLayout_idea1, 0, 0);
    mainLayout.setComponentAlignment(verticalLayout_idea1, new Alignment(48));

    // verticalLayout_idea2
    verticalLayout_idea2 = buildVerticalLayout_idea2();
    mainLayout.addComponent(verticalLayout_idea2, 1, 0);
    mainLayout.setComponentAlignment(verticalLayout_idea2, new Alignment(48));

    return mainLayout;
}