Example usage for com.vaadin.ui Alignment MIDDLE_CENTER

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

Introduction

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

Prototype

Alignment MIDDLE_CENTER

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

Click Source Link

Usage

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

public EmptyView() {

    setSizeFull();//from ww  w . ja va 2s .com

    Label label = new Label("Nothing Selected");
    addComponent(label);
    setComponentAlignment(label, Alignment.MIDDLE_CENTER);
    label.setSizeUndefined();
    label.addStyleName(ValoTheme.LABEL_H1);
    label.addStyleName(ValoTheme.LABEL_LIGHT);
}

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

public FolderView() {
    setSizeFull();
    table = Tables();
    table.setVisible(false);
    this.addComponent(table);
    this.setComponentAlignment(table, Alignment.MIDDLE_CENTER);

}

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

public LoadingView() {
    setSizeFull();//from   w ww.j av  a2  s . c om
    VerticalLayout center = new VerticalLayout();
    this.addComponent(center);
    this.setComponentAlignment(center, Alignment.MIDDLE_CENTER);

    center.setHeight("180px");
    HorizontalLayout info = new HorizontalLayout();

    Label title = new Label("PFServer Dashboard");
    title.setSizeUndefined();
    title.addStyleName(ValoTheme.LABEL_H4);
    title.addStyleName(ValoTheme.LABEL_COLORED);
    // center.addComponent(title);
    // center.setComponentAlignment(title, Alignment.BOTTOM_CENTER);
    Label loading = new Label("Initalizing");
    loading.addStyleName(ValoTheme.LABEL_H1);
    loading.addStyleName(ValoTheme.LABEL_LIGHT);
    info.addComponent(loading);
    info.addComponent(title);
    info.setComponentAlignment(title, Alignment.MIDDLE_RIGHT);

    center.addComponent(info);
    info.setComponentAlignment(loading, Alignment.MIDDLE_LEFT);
    loading.setWidth("160px");

    center.setComponentAlignment(info, Alignment.MIDDLE_CENTER);
    // center.addComponent(loading);
    // center.setComponentAlignment(loading, Alignment.TOP_CENTER);
    ProgressBar indeterminate = new ProgressBar();
    indeterminate.setIndeterminate(true);
    center.addComponent(indeterminate);
    center.setComponentAlignment(indeterminate, Alignment.TOP_CENTER);

}

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

public LoginView() {
    System.out.println("LOAD LLOGIN");
    setSizeFull();/*ww  w.  j  a va2  s . c o m*/
    Component loginForm = buildLoginForm();
    addComponent(loginForm);
    setComponentAlignment(loginForm, Alignment.MIDDLE_CENTER);

    Notification notification = new Notification("Welcome to Dashboard Demo");
    notification.setDescription(
            "<span>This application is not real, it only demonstrates an application built with the <a href=\"https://vaadin.com\">Vaadin framework</a>.</span> <span>No username or password is required, just click the <b>Sign In</b> button to continue.</span>");
    notification.setHtmlContentAllowed(true);
    notification.setStyleName("tray dark small closable login-help");
    notification.setPosition(Position.BOTTOM_CENTER);
    notification.setDelayMsec(20000);
    notification.show(Page.getCurrent());
}

From source file:de.catma.ui.analyzer.querybuilder.ComplexTypeSelectionPanel.java

License:Open Source License

private void initComponents() {

    setSpacing(true);/*from   w  w  w . j a v a  2  s  .  co m*/
    setWidth("100%");
    ComplexTypeOption.UNION.setDisplayString("add more results");
    ComplexTypeOption.EXCLUSION.setDisplayString("exclude hits from previous results");
    ComplexTypeOption.REFINMENT.setDisplayString("refine previous results");

    complexTypeSelect = new OptionGroup("", Arrays.asList(ComplexTypeOption.values()));

    complexTypeSelect.setImmediate(true);

    addComponent(complexTypeSelect);
    setComponentAlignment(complexTypeSelect, Alignment.MIDDLE_CENTER);

}

From source file:de.catma.ui.analyzer.querybuilder.PhrasePanel.java

License:Open Source License

private Component createSearchPanel() {
    VerticalLayout searchPanel = new VerticalLayout();
    searchPanel.setSpacing(true);//from  w w w  . ja v a2  s  .  c o  m

    wordSequencePanel = new Panel(new HorizontalLayout());
    searchPanel.addComponent(wordSequencePanel);

    WordPanel firstWordPanel = new WordPanel(new ValueChangeListener() {

        public void valueChange(ValueChangeEvent event) {
            showInPreviw();
        }
    });
    addWordPanel(firstWordPanel);

    HorizontalLayout buttonPanel = new HorizontalLayout();

    Label addWordPanelLabel = new Label("If your phrase contains more words you can");
    buttonPanel.addComponent(addWordPanelLabel);
    buttonPanel.setComponentAlignment(addWordPanelLabel, Alignment.MIDDLE_CENTER);

    btAddWordPanel = new Button("add another word!");
    buttonPanel.addComponent(btAddWordPanel);
    searchPanel.addComponent(buttonPanel);

    return searchPanel;
}

From source file:de.catma.ui.analyzer.querybuilder.ResultPanel.java

License:Open Source License

private void initComponents() {
    setSpacing(true);/*from  w ww  .  ja v a 2 s . c o  m*/
    setMargin(true, false, false, false);
    HorizontalLayout buttonPanel = new HorizontalLayout();
    buttonPanel.setSpacing(true);

    btShowInPreview = new Button("Show in preview");
    buttonPanel.addComponent(btShowInPreview);
    Label maxTotalFrequencyLabel = new Label("with a maximum total frequency of");
    buttonPanel.addComponent(maxTotalFrequencyLabel);
    buttonPanel.setComponentAlignment(maxTotalFrequencyLabel, Alignment.MIDDLE_CENTER);

    maxTotalFrequencyField = new TextField();
    maxTotalFrequencyField.setValue("50");
    maxTotalFrequencyField.addValidator(new Validator() {
        public boolean isValid(Object value) {
            try {
                Integer.valueOf((String) value);
                return true;
            } catch (NumberFormatException nfe) {
                return false;
            }
        }

        public void validate(Object value) throws InvalidValueException {
            try {
                Integer.valueOf((String) value);
            } catch (NumberFormatException nfe) {
                throw new InvalidValueException("Value must be an integer number!");
            }

        }
    });
    maxTotalFrequencyField.setInvalidAllowed(false);
    buttonPanel.addComponent(maxTotalFrequencyField);
    addComponent(buttonPanel);

    HorizontalLayout headerPanel = new HorizontalLayout();
    headerPanel.setSpacing(true);
    headerPanel.setWidth("100%");
    addComponent(headerPanel);

    Label yourSearchLabel = new Label("Your search");
    headerPanel.addComponent(yourSearchLabel);
    headerPanel.setExpandRatio(yourSearchLabel, 0.1f);

    queryLabel = new Label("nothing entered yet");
    queryLabel.addStyleName("centered-bold-text");
    headerPanel.addComponent(queryLabel);
    headerPanel.setExpandRatio(queryLabel, 0.2f);

    Label willMatch = new Label("will match for example:");
    headerPanel.addComponent(willMatch);
    headerPanel.setExpandRatio(willMatch, 0.2f);

    pi = new ProgressIndicator();
    pi.setEnabled(false);
    pi.setIndeterminate(true);

    headerPanel.addComponent(pi);
    headerPanel.setComponentAlignment(pi, Alignment.MIDDLE_RIGHT);
    headerPanel.setExpandRatio(pi, 0.5f);

    resultTable = new TreeTable();
    resultTable.setSizeFull();
    resultTable.setSelectable(true);
    HierarchicalContainer container = new HierarchicalContainer();
    container.setItemSorter(new PropertyDependentItemSorter(TreePropertyName.caption,
            new PropertyToTrimmedStringCIComparator()));

    resultTable.setContainerDataSource(container);

    resultTable.addContainerProperty(TreePropertyName.caption, String.class, null);
    resultTable.setColumnHeader(TreePropertyName.caption, "Phrase");
    resultTable.addContainerProperty(TreePropertyName.frequency, Integer.class, null);
    resultTable.setColumnHeader(TreePropertyName.frequency, "Frequency");
    addComponent(resultTable);
}

From source file:de.catma.ui.analyzer.querybuilder.SearchTypeSelectionPanel.java

License:Open Source License

private void initComponents(QueryTree queryTree, QueryOptions queryOptions,
        TagsetDefinitionDictionary tagsetDefinitionDictionary) {

    setSpacing(true);/*from w ww  .  ja v a 2  s. c  om*/
    setWidth("100%");
    List<Component> nextSteps = new ArrayList<Component>();
    phrasePanel = new PhrasePanel(toggleButtonStateListener, queryTree, queryOptions,
            tagsetDefinitionDictionary);
    nextSteps.add(phrasePanel);

    nextSteps.add(
            new SimilPanel(toggleButtonStateListener, queryTree, queryOptions, tagsetDefinitionDictionary));

    nextSteps.add(new TagPanel(toggleButtonStateListener, queryTree, queryOptions, tagsetDefinitionDictionary));

    nextSteps.add(
            new CollocPanel(toggleButtonStateListener, queryTree, queryOptions, tagsetDefinitionDictionary));

    nextSteps
            .add(new FreqPanel(toggleButtonStateListener, queryTree, queryOptions, tagsetDefinitionDictionary));

    searchTypeSelect = new OptionGroup("", nextSteps);

    searchTypeSelect.setImmediate(true);
    searchTypeSelect.setValue(phrasePanel);

    addComponent(searchTypeSelect);
    setComponentAlignment(searchTypeSelect, Alignment.MIDDLE_CENTER);
}

From source file:de.catma.ui.analyzer.querybuilder.WordPanel.java

License:Open Source License

private void initComponents() {
    setSpacing(true);/*from   ww w .j  a  v  a 2 s  .c o m*/
    setMargin(true);
    setSizeFull();

    String next = " first ";
    if (withPositionBox) {
        next = " next ";
    }
    Label startsWithLabel = new Label("The" + next + "word starts with");
    addComponent(startsWithLabel, 0, 0);
    startsWithField = new TextField();
    startsWithField.setImmediate(true);
    addComponent(startsWithField, 1, 0);

    Label containsLabel = new Label("The" + next + "word contains");
    addComponent(containsLabel, 0, 1);
    containsField = new TextField();
    containsField.setImmediate(true);
    addComponent(containsField, 1, 1);

    Label endsWithLabel = new Label("The" + next + "word ends with");
    addComponent(endsWithLabel, 0, 2);
    endsWithField = new TextField();
    endsWithField.setImmediate(true);
    addComponent(endsWithField, 1, 2);

    Label exactLabel = new Label("The" + next + "word is exactly");
    addComponent(exactLabel, 0, 3);
    exactField = new TextField();
    exactField.setImmediate(true);
    addComponent(exactField, 1, 3);

    if (withPositionBox) {
        List<PositionItem> options = new ArrayList<PositionItem>();
        for (int i = 1; i <= 10; i++) {
            options.add(new PositionItem(i, i + " word" + (i == 1 ? "" : "s") + " after the previous word"));
        }
        Label positionLabel = new Label("The position of this word is");
        addComponent(positionLabel, 0, 4);

        positionBox = new ComboBox("", options);
        positionBox.setImmediate(true);
        addComponent(positionBox, 1, 4);
        positionBox.setNullSelectionAllowed(false);
        positionBox.setNewItemsAllowed(false);
        positionBox.setValue(options.get(0));

        btRemove = new Button("Remove");
        addComponent(btRemove, 0, 5, 1, 5);
        setComponentAlignment(btRemove, Alignment.MIDDLE_CENTER);
    }
}

From source file:de.catma.ui.repository.wizard.UploadPanel.java

License:Open Source License

private void initComponents() {
    setSpacing(true);/*from   www .j a v  a  2s.  c o  m*/
    upload = new Upload();
    upload.setButtonCaption("Upload local file");
    upload.setImmediate(true);
    addComponent(upload);

    pi = new ProgressIndicator();
    pi.setVisible(false);
    addComponent(pi);
    setComponentAlignment(pi, Alignment.MIDDLE_CENTER);

    btCancelUpload = new Button("Cancel");
    addComponent(btCancelUpload);
    btCancelUpload.setVisible(false);

    fileLabel = new Label();
    fileLabel.setVisible(false);
    addComponent(fileLabel);
    setComponentAlignment(fileLabel, Alignment.MIDDLE_CENTER);

}