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:com.parship.roperty.ui.LoginUI.java

License:Apache License

@AutoGenerated
private GridLayout buildLoginLayout() {
    // common part: create layout
    loginLayout = new GridLayout();
    loginLayout.setImmediate(false);/* www .  jav  a  2s. c o m*/
    loginLayout.setWidth("-1px");
    loginLayout.setHeight("100px");
    loginLayout.setMargin(false);
    loginLayout.setSpacing(true);
    loginLayout.setColumns(2);
    loginLayout.setRows(2);

    // userTextField
    userTextField = new TextField();
    userTextField.setCaption("Username");
    userTextField.setImmediate(false);
    userTextField.setWidth("220px");
    userTextField.setHeight("-1px");
    userTextField.setTabIndex(1);
    userTextField.setRequired(true);
    loginLayout.addComponent(userTextField, 0, 0);
    loginLayout.setComponentAlignment(userTextField, new Alignment(33));

    // passTextField
    passTextField = new PasswordField();
    passTextField.setCaption("Password");
    passTextField.setImmediate(false);
    passTextField.setWidth("220px");
    passTextField.setHeight("-1px");
    passTextField.setTabIndex(2);
    passTextField.setRequired(true);
    loginLayout.addComponent(passTextField, 1, 0);
    loginLayout.setComponentAlignment(passTextField, new Alignment(33));

    // buttonLayout
    buttonLayout = buildButtonLayout();
    loginLayout.addComponent(buttonLayout, 1, 1);

    return loginLayout;
}

From source file:com.parship.roperty.ui.LoginUI.java

License:Apache License

@AutoGenerated
private HorizontalLayout buildButtonLayout() {
    // common part: create layout
    buttonLayout = new HorizontalLayout();
    buttonLayout.setImmediate(false);// w w  w  .j  a  v  a2  s .  c  o  m
    buttonLayout.setWidth("100.0%");
    buttonLayout.setHeight("-1px");
    buttonLayout.setMargin(false);

    // keeploggedinLabel
    keeploggedinLabel = new CheckBox();
    keeploggedinLabel.setCaption("Remember me!");
    keeploggedinLabel.setImmediate(false);
    keeploggedinLabel.setWidth("-1px");
    keeploggedinLabel.setHeight("-1px");
    keeploggedinLabel.setTabIndex(3);
    buttonLayout.addComponent(keeploggedinLabel);
    buttonLayout.setComponentAlignment(keeploggedinLabel, new Alignment(33));

    // loginButton
    loginButton = new Button();
    loginButton.setStyleName("v-button");
    loginButton.setCaption("Login");
    loginButton.setImmediate(true);
    loginButton.setWidth("100px");
    loginButton.setHeight("-1px");
    loginButton.setTabIndex(4);
    buttonLayout.addComponent(loginButton);
    buttonLayout.setComponentAlignment(loginButton, new Alignment(6));

    return buttonLayout;
}

From source file:com.salsaw.msalsa.HomePageView.java

License:Apache License

/**
 * The constructor should first build the main layout, set the
 * composition root and then do any custom initialization.
 *
 * The constructor will not be automatically regenerated by the
 * visual editor./*from  w w w  . ja  va2  s .com*/
 * @param navigator 
 */
public HomePageView(SalsaParameters salsaParameters) {
    if (salsaParameters == null) {
        throw new IllegalArgumentException("salsaParameters");
    }

    buildMainLayout();

    // Create form with salsa parameters
    BeanItem<SalsaParameters> salsaParametersBeanItem = new BeanItem<SalsaParameters>(salsaParameters);
    SalsaParametersForm salsaParametersForm = new SalsaParametersForm(salsaParametersBeanItem);

    Button toogleSalsaParametersButton = new Button("Show/Hide M-SALSA Parameters");
    toogleSalsaParametersButton.addClickListener(new Button.ClickListener() {
        /**
        * 
        */
        private static final long serialVersionUID = 1L;

        public void buttonClick(ClickEvent event) {
            salsaParametersForm.setVisible(!salsaParametersForm.isVisible());
        }
    });

    toogleSalsaParametersButton.setWidth("-1px");
    toogleSalsaParametersButton.setHeight("-1px");
    mainLayout.addComponent(toogleSalsaParametersButton);
    mainLayout.setComponentAlignment(toogleSalsaParametersButton, new Alignment(48));

    salsaParametersForm.setWidth("-1px");
    salsaParametersForm.setHeight("-1px");
    mainLayout.addComponent(salsaParametersForm);
    mainLayout.setComponentAlignment(salsaParametersForm, new Alignment(48));

    setCompositionRoot(mainLayout);

    // TODO add user code here      

    // Implement both receiver that saves upload in a file and
    // listener for successful upload
    class AligmentUploader implements Receiver, SucceededListener {
        /**
        * 
        */
        private static final long serialVersionUID = 1L;

        public File file;

        public OutputStream receiveUpload(String filename, String mimeType) {
            // Create upload stream
            FileOutputStream fos = null; // Stream to write to
            try {
                // Load server configuration
                String tmpFolder = ConfigurationManager.getInstance().getServerConfiguration()
                        .getTemporaryFilePath();

                // Open the file for writing.
                file = Paths.get(tmpFolder, filename).toFile();
                fos = new FileOutputStream(file);
            } catch (final java.io.FileNotFoundException e) {
                new Notification("Could not open file<br/>", e.getMessage(), Notification.Type.ERROR_MESSAGE)
                        .show(Page.getCurrent());
                return null;
            }
            return fos; // Return the output stream to write to
        }

        public void uploadSucceeded(SucceededEvent event) {
            try {
                for (IHomePageListener listener : listeners) {
                    listener.buttonClick(file);
                }

            } catch (SALSAException | IOException | InterruptedException e) {
                // TODO Auto-generated catch block
                e.printStackTrace();

                new Notification("ERROR: ", e.getMessage(), Notification.Type.ERROR_MESSAGE)
                        .show(Page.getCurrent());
            }
        }
    }
    ;

    AligmentUploader receiver = new AligmentUploader();

    uploadInput.setReceiver(receiver);
    uploadInput.addSucceededListener(receiver);

}

From source file:com.salsaw.msalsa.HomePageView.java

License:Apache License

@AutoGenerated
private GridLayout buildMainLayout() {
    // common part: create layout
    mainLayout = new GridLayout();
    mainLayout.setImmediate(false);/*from   ww  w.  ja  v a  2  s  .c  om*/
    mainLayout.setWidth("100%");
    mainLayout.setHeight("100%");
    mainLayout.setMargin(false);
    mainLayout.setRows(4);

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

    // title
    title = new Label();
    title.setImmediate(false);
    title.setWidth("-1px");
    title.setHeight("-1px");
    title.setValue("M-SALSA");
    mainLayout.addComponent(title, 0, 0);
    mainLayout.setComponentAlignment(title, new Alignment(48));

    // uploadInput
    uploadInput = new Upload();
    uploadInput.setCaption("Upload and process align input");
    uploadInput.setImmediate(false);
    uploadInput.setWidth("-1px");
    uploadInput.setHeight("-1px");
    mainLayout.addComponent(uploadInput, 0, 1);
    mainLayout.setComponentAlignment(uploadInput, new Alignment(48));

    return mainLayout;
}

From source file:com.thingtrack.konekti.view.layout.workbench.WorkbenchLayout.java

License:Apache License

@AutoGenerated
private HorizontalLayout buildCentralMainLayout() {
    // common part: create layout
    centralMainLayout = new HorizontalLayout();
    centralMainLayout.setImmediate(false);
    centralMainLayout.setWidth("100.0%");
    centralMainLayout.setHeight("100.0%");
    centralMainLayout.setMargin(true);//from w  ww  .  j  ava2s.c om

    // leftPanelWorkbench
    leftPanelWorkbench = new WorkbenchPanel();
    leftPanelWorkbench.setImmediate(false);
    leftPanelWorkbench.setWidth("200px");
    leftPanelWorkbench.setHeight("100.0%");
    centralMainLayout.addComponent(leftPanelWorkbench);

    // centralPanelWorkbench
    centralPanelWorkbench = new WorkbenchPanel();
    centralPanelWorkbench.setImmediate(false);
    centralPanelWorkbench.setWidth("100.0%");
    centralPanelWorkbench.setHeight("100.0%");
    centralMainLayout.addComponent(centralPanelWorkbench);
    centralMainLayout.setExpandRatio(centralPanelWorkbench, 1.0f);
    centralMainLayout.setComponentAlignment(centralPanelWorkbench, new Alignment(48));

    // rightPanelWorkbench
    rightPanelWorkbench = new WorkbenchPanel();
    rightPanelWorkbench.setImmediate(false);
    rightPanelWorkbench.setWidth("200px");
    rightPanelWorkbench.setHeight("100.0%");
    centralMainLayout.addComponent(rightPanelWorkbench);
    centralMainLayout.setComponentAlignment(rightPanelWorkbench, new Alignment(6));

    return centralMainLayout;
}

From source file:com.vaushell.treetasker.application.actionbar.TTWActionBar.java

License:Open Source License

@AutoGenerated
private HorizontalLayout buildButtonsLayout() {
    // common part: create layout
    buttonsLayout = new HorizontalLayout();
    buttonsLayout.setImmediate(false);//from ww w  .  ja v  a  2s . c  o  m
    buttonsLayout.setWidth("1000px");
    buttonsLayout.setHeight("100.0%");
    buttonsLayout.setMargin(false);
    buttonsLayout.setSpacing(true);

    // vBTnewTask
    vBTnewTask = new Button();
    vBTnewTask.setCaption("Insrer une tche");
    vBTnewTask.setIcon(new ThemeResource("icons/newTask.png"));
    vBTnewTask.setImmediate(true);
    vBTnewTask.setDescription("Insrer une tche");
    vBTnewTask.setWidth("-1px");
    vBTnewTask.setHeight("-1px");
    buttonsLayout.addComponent(vBTnewTask);
    buttonsLayout.setComponentAlignment(vBTnewTask, new Alignment(20));

    // vBTaddSubtask
    vBTaddSubtask = new Button();
    vBTaddSubtask.setCaption("Ajouter une sous-tche");
    vBTaddSubtask.setIcon(new ThemeResource("icons/newSubtask.png"));
    vBTaddSubtask.setImmediate(true);
    vBTaddSubtask.setDescription("Ajouter une sous-tche");
    vBTaddSubtask.setWidth("-1px");
    vBTaddSubtask.setHeight("-1px");
    buttonsLayout.addComponent(vBTaddSubtask);
    buttonsLayout.setComponentAlignment(vBTaddSubtask, new Alignment(20));

    // vBTrefresh
    vBTrefresh = new Button();
    vBTrefresh.setCaption("Actualiser");
    vBTrefresh.setIcon(new ThemeResource("icons/refresh.png"));
    vBTrefresh.setImmediate(true);
    vBTrefresh.setDescription("Actualiser la liste des tches");
    vBTrefresh.setWidth("-1px");
    vBTrefresh.setHeight("-1px");
    buttonsLayout.addComponent(vBTrefresh);
    buttonsLayout.setComponentAlignment(vBTrefresh, new Alignment(20));

    // vBTremove
    vBTremove = new Button();
    vBTremove.setCaption("Supprimer");
    vBTremove.setIcon(new ThemeResource("icons/delete.png"));
    vBTremove.setImmediate(true);
    vBTremove.setDescription("Supprimer les tches slectionnes");
    vBTremove.setWidth("-1px");
    vBTremove.setHeight("-1px");
    buttonsLayout.addComponent(vBTremove);
    buttonsLayout.setComponentAlignment(vBTremove, new Alignment(20));

    // vBTcopy
    vBTcopy = new Button();
    vBTcopy.setCaption("Copier");
    vBTcopy.setIcon(new ThemeResource("icons/copy.png"));
    vBTcopy.setImmediate(true);
    vBTcopy.setDescription("Copier les tches slectionnes");
    vBTcopy.setWidth("-1px");
    vBTcopy.setHeight("-1px");
    buttonsLayout.addComponent(vBTcopy);
    buttonsLayout.setComponentAlignment(vBTcopy, new Alignment(20));

    // vBTpaste
    vBTpaste = new Button();
    vBTpaste.setCaption("Coller");
    vBTpaste.setIcon(new ThemeResource("icons/paste.png"));
    vBTpaste.setImmediate(true);
    vBTpaste.setDescription("Coller les tches slectionnes");
    vBTpaste.setWidth("-1px");
    vBTpaste.setHeight("-1px");
    buttonsLayout.addComponent(vBTpaste);
    buttonsLayout.setComponentAlignment(vBTpaste, new Alignment(20));

    // vUPimport
    vUPimport = new Upload();
    vUPimport.setIcon(new ThemeResource("icons/import.png"));
    vUPimport.setImmediate(true);
    vUPimport.setDescription("Importer depuis TaskCoach");
    vUPimport.setWidth("-1px");
    vUPimport.setHeight("-1px");
    buttonsLayout.addComponent(vUPimport);

    // vBTlogout
    vBTlogout = new Button();
    vBTlogout.setCaption("Se dconnecter");
    vBTlogout.setIcon(new ThemeResource("icons/logout.png"));
    vBTlogout.setImmediate(true);
    vBTlogout.setDescription("Se dconnecter");
    vBTlogout.setWidth("-1px");
    vBTlogout.setHeight("-1px");
    buttonsLayout.addComponent(vBTlogout);
    buttonsLayout.setExpandRatio(vBTlogout, 1.0f);
    buttonsLayout.setComponentAlignment(vBTlogout, new Alignment(6));

    return buttonsLayout;
}

From source file:com.vaushell.treetasker.application.actionbar.TTWActionBar.java

License:Open Source License

@AutoGenerated
private VerticalLayout buildContentLayout() {
    // common part: create layout
    contentLayout = new VerticalLayout();
    contentLayout.setStyleName("action-bar");
    contentLayout.setImmediate(false);//  ww  w  .ja  va2s  .  c om
    contentLayout.setWidth("100.0%");
    contentLayout.setHeight("100.0%");
    contentLayout.setMargin(false);

    // buttonsLayout
    buttonsLayout = buildButtonsLayout();
    contentLayout.addComponent(buttonsLayout);
    contentLayout.setComponentAlignment(buttonsLayout, new Alignment(20));

    return contentLayout;
}

From source file:com.vaushell.treetasker.application.content.layout.LoginLayout.java

License:Open Source License

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

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

    // vPBLloginForm
    vPBLloginForm = buildVPBLloginForm();
    mainLayout.addComponent(vPBLloginForm);
    mainLayout.setExpandRatio(vPBLloginForm, 1.0f);
    mainLayout.setComponentAlignment(vPBLloginForm, new Alignment(20));

    return mainLayout;
}

From source file:com.vaushell.treetasker.application.content.layout.LoginLayout.java

License:Open Source License

@AutoGenerated
private GridLayout buildVFormLayout() {
    // common part: create layout
    vFormLayout = new GridLayout();
    vFormLayout.setImmediate(false);/*from  ww w . j  av a  2  s .  c o m*/
    vFormLayout.setWidth("100.0%");
    vFormLayout.setHeight("100.0%");
    vFormLayout.setMargin(true);
    vFormLayout.setSpacing(true);
    vFormLayout.setColumns(2);
    vFormLayout.setRows(4);

    // vLBLuserName
    vLBLuserName = new Label();
    vLBLuserName.setImmediate(false);
    vLBLuserName.setWidth("-1px");
    vLBLuserName.setHeight("-1px");
    vLBLuserName.setValue("E-mail :");
    vFormLayout.addComponent(vLBLuserName, 0, 0);
    vFormLayout.setComponentAlignment(vLBLuserName, new Alignment(33));

    // vTFuserNameValue
    vTFuserNameValue = new TextField();
    vTFuserNameValue.setImmediate(true);
    vTFuserNameValue.setWidth("80.0%");
    vTFuserNameValue.setHeight("-1px");
    vTFuserNameValue.setInputPrompt("E-mail");
    vTFuserNameValue.setSecret(false);
    vFormLayout.addComponent(vTFuserNameValue, 1, 0);
    vFormLayout.setComponentAlignment(vTFuserNameValue, new Alignment(33));

    // vLBLpassword
    vLBLpassword = new Label();
    vLBLpassword.setImmediate(false);
    vLBLpassword.setWidth("-1px");
    vLBLpassword.setHeight("-1px");
    vLBLpassword.setValue("Mot de passe :");
    vFormLayout.addComponent(vLBLpassword, 0, 1);

    // vTFpasswordValue
    vTFpasswordValue = new PasswordField();
    vTFpasswordValue.setImmediate(true);
    vTFpasswordValue.setWidth("80.0%");
    vTFpasswordValue.setHeight("-1px");
    vTFpasswordValue.setInputPrompt("password");
    vFormLayout.addComponent(vTFpasswordValue, 1, 1);
    vFormLayout.setComponentAlignment(vTFpasswordValue, new Alignment(33));

    // vBTregister
    vBTregister = new Button();
    vBTregister.setCaption("S'enregistrer");
    vBTregister.setImmediate(true);
    vBTregister.setWidth("-1px");
    vBTregister.setHeight("26px");
    vFormLayout.addComponent(vBTregister, 1, 2);
    vFormLayout.setComponentAlignment(vBTregister, new Alignment(33));

    // vBTlogin
    vBTlogin = new Button();
    vBTlogin.setCaption("Se connecter");
    vBTlogin.setImmediate(true);
    vBTlogin.setWidth("-1px");
    vBTlogin.setHeight("-1px");
    vFormLayout.addComponent(vBTlogin, 1, 3);
    vFormLayout.setComponentAlignment(vBTlogin, new Alignment(33));

    return vFormLayout;
}

From source file:com.wft.ui.WelcomeLoginApplication.java

License:Apache License

@Override
public void init() {
    window = new Window("Web Foot Tournament");

    subwindow = new Window("Connexion");
    // ...and make it modal
    subwindow.setModal(true);// ww w .  j a v  a  2s.c o  m
    subwindow.setClosable(false);
    subwindow.setResizable(false);
    subwindow.setWidth("50%");
    subwindow.setHeight("50%");

    // Configure the windows layout; by default a VerticalLayout
    verticalLayout = new VerticalLayout();
    subwindow.setContent(verticalLayout);
    verticalLayout.setMargin(true);
    verticalLayout.setSpacing(true);
    verticalLayout.setSizeFull();

    wftLoginForm.setSizeFull();
    verticalLayout.addComponent(wftLoginForm);
    verticalLayout.setComponentAlignment(wftLoginForm,
            new Alignment(Bits.ALIGNMENT_HORIZONTAL_CENTER | Bits.ALIGNMENT_VERTICAL_CENTER));

    Button createUserBtn = new Button();
    createUserBtn.setCaption("Not yet an user ? Create an account !");
    createUserBtn.addListener(new ClickListener() {

        public void buttonClick(ClickEvent event) {
            switchToCreateUserForm();
        }
    });
    verticalLayout.addComponent(createUserBtn);

    window.addWindow(subwindow);

    setMainWindow(window);

}