Example usage for com.vaadin.ui Alignment TOP_RIGHT

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

Introduction

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

Prototype

Alignment TOP_RIGHT

To view the source code for com.vaadin.ui Alignment TOP_RIGHT.

Click Source Link

Usage

From source file:com.snowy.PostLoginView.java

@PostConstruct
void init() {/*w  w w. ja  v a2  s .com*/
    //Logger.getLogger(PostLoginView.class.getName()).info(d);
    d = ((MyVaadinUI) UI.getCurrent()).getDataObject();
    //Logger.getLogger(PostLoginView.class.getName()).info(d);
    g = new GameWindow(d);
    c = new ChatWindow(d);
    HorizontalLayout hl = new HorizontalLayout();
    setMargin(true);
    /*this.getUI().addPollListener(new UIEvents.PollListener(){
    @Override
    public void poll(UIEvents.PollEvent event) {
        c.getUsersList().retrieveActiveUsers();
    }
            
    });*/

    this.setSizeFull();
    Button b = new Button("Logout");
    b.addClickListener(e -> {

        d.logout(VaadinSession.getCurrent().getCsrfToken());
        VaadinSession.getCurrent().close();

        Page.getCurrent().setLocation("/");
    });
    Button ccc = new Button("Unpause polling");
    ccc.setEnabled(false);
    Button cc = new Button("Pause polling");
    cc.addClickListener(e -> {
        if (ccc.isEnabled() == false) {
            UI.getCurrent().setPollInterval(1000000000);
            cc.setEnabled(false);
            ccc.setEnabled(true);
        }
    });
    ccc.addClickListener(e -> {
        if (cc.isEnabled() == false) {
            UI.getCurrent().setPollInterval(1000);
            cc.setEnabled(true);
            ccc.setEnabled(false);
        }
    });
    hl.setSizeFull();
    hl.setSpacing(true);
    //whdjwandjawd
    //this.addComponent(cc);
    //this.addComponent(ccc);
    this.addComponent(b);

    //this.setHeightUndefined();
    this.setSpacing(true);
    this.setComponentAlignment(b, Alignment.TOP_RIGHT);
    //this.addComponent(c);
    //this.addComponent(ul);
    hl.addComponent(g);

    hl.addComponent(c);

    //this.addComponent(c);
    hl.setExpandRatio(c, 1);
    hl.setExpandRatio(g, 3);
    g.setSizeFull();
    c.setSizeFull();
    this.addComponent(hl);
    //this.setExpandRatio(g, 2);
    this.setExpandRatio(hl, 1);
}

From source file:com.squadd.UI.EditVersionLayout.java

private void buildLayout() {
    HorizontalLayout knopki = new HorizontalLayout(save, cancel);
    knopki.setSizeUndefined();// w  w  w .  ja va 2 s .  c o  m
    knopki.setSpacing(true);
    HorizontalLayout hor = new HorizontalLayout(knopki);
    hor.setWidth(0.4 * Display.width + "px");
    hor.setComponentAlignment(knopki, Alignment.TOP_RIGHT);
    FormLayout data = new FormLayout(groupName, placeName, date, description);
    HorizontalLayout first = new HorizontalLayout();
    groupPhoto.setWidth(0.2 * Display.width + "px");
    groupPhoto.setHeight(0.2 * Display.width + "px");
    first.addComponent(groupPhoto);
    VerticalLayout lst = new VerticalLayout();
    lst.setSpacing(true);
    lst.addComponents(hor, data);

    HorizontalLayout uploadAndUsers = new HorizontalLayout(uploadPhoto);
    uploadAndUsers.setWidth(0.2 * Display.width + "px");
    uploadPhoto.setSizeUndefined();
    uploadAndUsers.setComponentAlignment(uploadPhoto, Alignment.MIDDLE_CENTER);
    VerticalLayout vert = new VerticalLayout(groupPhoto, uploadAndUsers);
    HorizontalLayout second = new HorizontalLayout(vert);

    HorizontalLayout photoAndInfo = new HorizontalLayout(second, lst);

    addComponent(photoAndInfo);
}

From source file:com.squadd.UI.GroupMainInfoLayout.java

private void buildLayout() {
    HorizontalLayout knopki = new HorizontalLayout(edit);
    knopki.setSizeUndefined();// w w w .  ja v a2 s.c  o  m
    knopki.setSpacing(true);
    HorizontalLayout hor = new HorizontalLayout(knopki);
    hor.setWidth(0.4 * Display.width + "px");
    hor.setComponentAlignment(knopki, Alignment.TOP_RIGHT);
    description.setWidth(0.2 * Display.width + "px");
    FormLayout data = new FormLayout(groupName, placeName, date, description);
    HorizontalLayout first = new HorizontalLayout();
    groupPhoto.setWidth(0.2 * Display.width + "px");
    groupPhoto.setHeight(0.2 * Display.width + "px");
    first.addComponent(groupPhoto);
    HorizontalLayout seventh = new HorizontalLayout();
    seventh.setWidth(0.2 * Display.width + "px");
    seventh.addComponents(uploadPhoto);
    uploadPhoto.setSizeUndefined();
    seventh.setComponentAlignment(uploadPhoto, Alignment.TOP_CENTER);
    VerticalLayout lst = new VerticalLayout();
    lst.setSpacing(true);
    lst.addComponents(hor, data);

    VerticalLayout photoAndUpload = new VerticalLayout(first, seventh);
    HorizontalLayout photoAndInfo = new HorizontalLayout(photoAndUpload, lst);

    VerticalLayout content = new VerticalLayout(photoAndInfo);

    addComponent(content);
}

From source file:com.squadd.UI.LoginUI.java

private void buildLayout(Button first) {
    HorizontalLayout usernameLayout = new HorizontalLayout(username);
    usernameLayout.setSizeFull();//w  w w . j  a va  2  s. c om
    usernameLayout.setComponentAlignment(username, Alignment.TOP_CENTER);
    HorizontalLayout passwordLayout = new HorizontalLayout(password);
    passwordLayout.setSizeFull();
    passwordLayout.setComponentAlignment(password, Alignment.TOP_CENTER);

    actions.setSizeFull();
    actions.setComponentAlignment(first, Alignment.TOP_RIGHT);
    actions.setSpacing(true);

    if (!isModal) {
        addComponent(header);
        for (int i = 0; i < 3; ++i) {
            HorizontalLayout curr = new HorizontalLayout();
            curr.setSizeFull();
            addComponents(curr);
        }
    }

    addComponents(usernameLayout, passwordLayout, actions);
}

From source file:com.squadd.views.RegisterView.java

private void configureActionsLayout(HorizontalLayout layout) {
    layout.setSizeFull();
    layout.setSpacing(true);
    layout.setComponentAlignment(back, Alignment.TOP_RIGHT);
}

From source file:com.wcs.wcslib.vaadin.widget.multifileupload.ui.UploadStateLayout.java

License:Apache License

private void initForm() {
    layout = new VerticalLayout();
    addComponent(layout);//from  ww  w.j  av a  2  s  . co  m

    layout.addComponent(fileName);

    pi.setVisible(false);
    pi.setWidth(100, Unit.PERCENTAGE);
    layout.addComponent(pi);

    textualProgress.setVisible(false);

    cancelLayout = new HorizontalLayout();
    cancelLayout.addStyleName(CANCEL_BUTTON_LAYOUT_STYLE_CLASS);
    cancelLayout.setWidth(100, Unit.PERCENTAGE);
    cancelLayout.addComponent(textualProgress);
    cancelButton = new Button();
    cancelLayout.addComponent(cancelButton);
    cancelLayout.setComponentAlignment(cancelButton, Alignment.TOP_RIGHT);
    layout.addComponent(cancelLayout);
}

From source file:com.wintindustries.pfserver.interfaces.view.dashboard.MainView.java

public void addMenuBar() {
    menuBar = new MenuBar();
    menuBar.setVisible(false);//from   ww  w .  j a v a2 s.  c  om
    this.addComponent(menuBar);
    this.setComponentAlignment(menuBar, Alignment.TOP_RIGHT);
}

From source file:cz.zcu.pia.social.network.frontend.views.ViewHome.java

/**
 * PostConstruct//from   w w w  .ja  va2  s .  c o m
 */
@PostConstruct
@Override
public void postConstruct() {
    super.postConstruct();
    postPaginator = applicationContext.getBean(ComponentPostPaginator.class);

    postsFilter = applicationContext.getBean(ComponentPostsFilter.class, postWrapper, postPaginator);
    //postsFilter.setPostPaginator(postPaginator);
    postPaginator.setFilter(postsFilter);

    addPost = new Button("+");
    if (!securityHelper.isAuthenticated()) {
        addPost.setVisible(false);
    }
    addPost.addClickListener(new Button.ClickListener() {

        @Override
        public void buttonClick(Button.ClickEvent event) {
            addButtonFunction(event);

        }
    });
    addPost.setDescription(msgs.getMessage(BUTTON_DESCRIPTION));
    addPost.setWidth(25, Unit.PIXELS);
    HorizontalLayout addButtonWrapper = new HorizontalLayout();

    addButtonWrapper.setWidth(ComponentPost.POST_WIDTH, Unit.PIXELS);

    addButtonWrapper.addComponent(postsFilter);
    addButtonWrapper.addComponent(addPost);
    addButtonWrapper.setComponentAlignment(addPost, Alignment.TOP_RIGHT);

    addButtonWrapper.setExpandRatio(postsFilter, 10);
    addButtonWrapper.setExpandRatio(addPost, 1);
    this.getContentWrapper().addComponent(addButtonWrapper);
    this.getContentWrapper().addComponent(postWrapper);
    this.getContentWrapper().addComponent(postPaginator);
}

From source file:de.catma.CatmaApplication.java

License:Open Source License

@Override
public void init() {

    Properties properties = loadProperties();
    backgroundService = new BackgroundService(this);

    final Window mainWindow = new Window("CATMA 4.1 - CLA " + VERSION);
    mainWindow.addParameterHandler(this);
    HorizontalLayout mainLayout = new HorizontalLayout();
    mainLayout.setSizeUndefined();//  w  w  w .j a v  a 2s .com
    mainLayout.setMargin(true);
    mainLayout.setSpacing(true);
    mainWindow.addStyleName("catma-mainwindow");

    mainWindow.setContent(mainLayout);
    MenuFactory menuFactory = new MenuFactory();
    try {
        initTempDirectory(properties);
        tagManager = new TagManager();

        repositoryManagerView = new RepositoryManagerView(new RepositoryManager(this, tagManager, properties));

        tagManagerView = new TagManagerView(tagManager);

        taggerManagerView = new TaggerManagerView();

        analyzerManagerView = new AnalyzerManagerView();

        visualizationManagerView = new VisualizationManagerView();

        defaultProgressIndicator = new ProgressIndicator();
        defaultProgressIndicator.setIndeterminate(true);
        defaultProgressIndicator.setEnabled(false);
        defaultProgressIndicator.setPollingInterval(500);
        progressWindow = new ProgressWindow(defaultProgressIndicator);

        menu = menuFactory.createMenu(mainLayout,
                new MenuFactory.MenuEntryDefinition("Repository Manager",
                        new RepositoryManagerWindow(repositoryManagerView)),
                new MenuFactory.MenuEntryDefinition("Tag Manager", new TagManagerWindow(tagManagerView)),
                new MenuFactory.MenuEntryDefinition("Tagger", new TaggerManagerWindow(taggerManagerView)),
                new MenuFactory.MenuEntryDefinition("Analyzer", new AnalyzerManagerWindow(analyzerManagerView)),
                new MenuFactory.MenuEntryDefinition("Visualizer",
                        new VisualizationManagerWindow(visualizationManagerView)));
        Link aboutLink = new Link("About", new ExternalResource("http://www.catma.de"));
        aboutLink.setTargetName("_blank");
        mainLayout.addComponent(aboutLink);
        mainLayout.setComponentAlignment(aboutLink, Alignment.TOP_RIGHT);
        mainLayout.setExpandRatio(aboutLink, 1.0f);

        Link helpLink = new Link("Help", new ExternalResource(getURL() + "manual/"));
        helpLink.setTargetName("_blank");
        mainLayout.addComponent(helpLink);
        mainLayout.setComponentAlignment(helpLink, Alignment.TOP_RIGHT);

        Label helpLabel = new Label();
        helpLabel.setIcon(new ClassResource("ui/resources/icon-help.gif", this));
        helpLabel.setWidth("20px");
        helpLabel.setDescription(
                "<h3>Hints</h3>" + "<p>Watch out for these little question mark icons while navigating "
                        + "through CATMA. They provide useful hints for managing the first "
                        + "steps within a CATMA component.</p>" + "<h4>Login</h4>"
                        + "Once you're logged in, you will see the Repository Manager, "
                        + "which will explain the first steps to you. "
                        + "Just hover your mouse over the question mark icons!");
        VerticalLayout helpWrapper = new VerticalLayout();
        helpWrapper.addComponent(helpLabel);
        helpWrapper.setComponentAlignment(helpLabel, Alignment.TOP_RIGHT);

        Animator helpAnimator = new Animator(helpWrapper);

        helpAnimator.setFadedOut(true);

        mainLayout.addComponent(helpAnimator);
        mainLayout.setComponentAlignment(helpAnimator, Alignment.TOP_RIGHT);
        helpAnimator.fadeIn(2000, 300);

        MenuBar loginLogoutMenu = new MenuBar();
        LoginLogoutCommand loginLogoutCommand = new LoginLogoutCommand(menu, repositoryManagerView, this);
        MenuItem loginLogoutitem = loginLogoutMenu.addItem("Login", loginLogoutCommand);
        loginLogoutCommand.setLoginLogoutItem(loginLogoutitem);

        mainLayout.addComponent(loginLogoutMenu);
        mainLayout.setComponentAlignment(loginLogoutMenu, Alignment.TOP_RIGHT);
        mainLayout.setWidth("100%");
    } catch (Exception e) {
        showAndLogError("The system could not be initialized!", e);
    }

    setMainWindow(mainWindow);

    setTheme("cleatheme");
}

From source file:de.catma.ui.CatmaApplication.java

License:Open Source License

@Override
protected void init(VaadinRequest request) {
    backgroundService = new UIBackgroundService(true);

    storeParameters(request.getParameterMap());

    Page.getCurrent().setTitle("CATMA 5.0 " + MINORVERSION);

    mainLayout = new VerticalLayout();
    mainLayout.setSizeFull();/* w ww.  j a  v  a 2s  .c  o m*/

    menuPanel = new Panel();
    menuPanel.addStyleName("menuPanel");
    mainLayout.addComponent(menuPanel);

    contentPanel = new Panel();
    contentPanel.setHeight("100%");
    contentPanel.addStyleName("contentPanel");

    defaultContentPanelLabel = new Label("Please log in to get started");
    defaultContentPanelLabel.addStyleName("defaultContentPanelLabel");
    contentPanel.setContent(defaultContentPanelLabel);

    mainLayout.addComponent(contentPanel);
    mainLayout.setExpandRatio(contentPanel, 1.0f);

    menuLayout = new HorizontalLayout();
    menuLayout.setMargin(true);
    menuLayout.setSpacing(true);

    logoResource = new ThemeResource("catma-logo.png");
    Link logoImage = new Link(null, new ExternalResource("http://www.catma.de"));
    logoImage.setIcon(logoResource);
    logoImage.setTargetName("_blank");
    menuLayout.addComponent(logoImage);

    MenuFactory menuFactory = new MenuFactory();
    try {

        initTempDirectory();
        tagManager = new TagManager();

        repositoryManagerView = new RepositoryManagerView(
                new RepositoryManager(this, tagManager, RepositoryProperties.INSTANCE.getProperties()));

        tagManagerView = new TagManagerView(tagManager);

        taggerManagerView = new TaggerManagerView();

        analyzerManagerView = new AnalyzerManagerView();

        visualizationManagerView = new VisualizationManagerView();

        menu = menuFactory.createMenu(menuLayout, contentPanel,
                new MenuFactory.MenuEntryDefinition("Repository Manager", repositoryManagerView),
                new MenuFactory.MenuEntryDefinition("Tag Type Manager", tagManagerView),
                new MenuFactory.MenuEntryDefinition("Tagger", taggerManagerView),
                new MenuFactory.MenuEntryDefinition("Analyzer", analyzerManagerView),
                new MenuFactory.MenuEntryDefinition("Visualizer", visualizationManagerView));
        addPropertyChangeListener(CatmaApplicationEvent.userChange, menu.userChangeListener);

        Link latestFeaturesLink = new Link("Latest Features",
                new ExternalResource("http://www.catma.de/latestfeatures"));
        latestFeaturesLink.setTargetName("_blank");
        menuLayout.addComponent(latestFeaturesLink);
        menuLayout.setComponentAlignment(latestFeaturesLink, Alignment.TOP_RIGHT);
        menuLayout.setExpandRatio(latestFeaturesLink, 1.0f);

        Link aboutLink = new Link("About", new ExternalResource("http://www.catma.de"));
        aboutLink.setTargetName("_blank");
        menuLayout.addComponent(aboutLink);
        menuLayout.setComponentAlignment(aboutLink, Alignment.TOP_RIGHT);

        Link termsOfUseLink = new Link("Terms of Use", new ExternalResource("http://www.catma.de/termsofuse"));
        termsOfUseLink.setTargetName("_blank");
        menuLayout.addComponent(termsOfUseLink);
        menuLayout.setComponentAlignment(termsOfUseLink, Alignment.TOP_RIGHT);

        Link manualLink = new Link("Manual", new ExternalResource(request.getContextPath() + "/manual/"));
        manualLink.setTargetName("_blank");
        menuLayout.addComponent(manualLink);
        menuLayout.setComponentAlignment(manualLink, Alignment.TOP_RIGHT);

        Link helpLink = new Link("Helpdesk", new ExternalResource("http://www.catma.de/helpdesk/"));
        helpLink.setTargetName("_blank");
        menuLayout.addComponent(helpLink);
        menuLayout.setComponentAlignment(helpLink, Alignment.TOP_RIGHT);
        helpLink.setVisible(false);

        btHelp = new Button(FontAwesome.QUESTION_CIRCLE);
        btHelp.addStyleName("help-button");
        btHelp.addStyleName("application-help-button");

        menuLayout.addComponent(btHelp);

        btHelp.addClickListener(new ClickListener() {

            public void buttonClick(ClickEvent event) {

                if (uiHelpWindow.getParent() == null) {
                    UI.getCurrent().addWindow(uiHelpWindow);
                } else {
                    UI.getCurrent().removeWindow(uiHelpWindow);
                }

            }
        });

        LoginLogoutCommand loginLogoutCommand = new LoginLogoutCommand(menu, repositoryManagerView);
        Button btloginLogout = new Button("Sign in", event -> loginLogoutCommand.menuSelected(null));
        btloginLogout.setStyleName(BaseTheme.BUTTON_LINK);
        btloginLogout.addStyleName("application-loginlink");

        loginLogoutCommand.setLoginLogoutButton(btloginLogout);

        menuLayout.addComponent(btloginLogout);
        menuLayout.setComponentAlignment(btloginLogout, Alignment.TOP_RIGHT);
        menuLayout.setWidth("100%");

        menuPanel.setContent(menuLayout);

        setContent(mainLayout);

        if (getParameter(Parameter.USER_IDENTIFIER) != null) {
            btloginLogout.click();
        }

        setPollInterval(10000);

        if ((getParameter(Parameter.AUTOLOGIN) != null) && (getUser() == null)) {
            getPage().setLocation(repositoryManagerView.createAuthenticationDialog().createLogInClick(this,
                    RepositoryPropertyKey.CATMA_oauthAuthorizationCodeRequestURL.getValue(),
                    RepositoryPropertyKey.CATMA_oauthAccessTokenRequestURL.getValue(),
                    RepositoryPropertyKey.CATMA_oauthClientId.getValue(),
                    RepositoryPropertyKey.CATMA_oauthClientSecret.getValue(), URLEncoder.encode("/", "UTF-8")));
        }

    } catch (Exception e) {
        showAndLogError("The system could not be initialized!", e);
    }

}