Example usage for com.vaadin.ui Alignment MIDDLE_RIGHT

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

Introduction

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

Prototype

Alignment MIDDLE_RIGHT

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

Click Source Link

Usage

From source file:com.hybridbpm.ui.component.bpm.designer.VariableEditorLayout.java

License:Apache License

public void initUI() {
    removeAllComponents();/*w  ww .j  av a 2  s. c o m*/
    btnAdd.setCaption(("Add variable"));
    btnAdd.setStyleName(ValoTheme.BUTTON_LINK);
    btnAdd.setIcon(FontAwesome.PLUS_CIRCLE);
    setMargin(true);
    setSpacing(true);
    setWidth(100, Sizeable.Unit.PERCENTAGE);
    for (FieldModel fieldModel : processModel.getVariableModels()) {
        FieldForm fieldForm = new FieldForm(FieldForm.CLASS_LIST_TYPE.COMPLEX_DATA);
        fieldForm.setFieldModel(fieldModel);
        addComponent(fieldForm);
    }
    addComponent(btnAdd);
    setComponentAlignment(btnAdd, Alignment.MIDDLE_RIGHT);
}

From source file:com.hybridbpm.ui.component.bpm.TaskLayout.java

License:Apache License

public TaskLayout(String taskId, String processName, String taskName, boolean showHeader) {
    this.taskId = taskId;
    this.processName = processName;
    this.taskName = taskName;
    this.showHeader = showHeader;

    Responsive.makeResponsive(this);
    btnAccept.setIcon(FontAwesome.CHECK);
    btnEscalate.setIcon(FontAwesome.ARROW_UP);
    btnDelegate.setIcon(FontAwesome.ARROW_DOWN);
    btnSchedule.setIcon(FontAwesome.CALENDAR);
    btnSave.setIcon(FontAwesome.SAVE);/*ww  w  . j  a v a2 s .co  m*/
    btnSend.setIcon(FontAwesome.SEND);
    //        btnClose.setIcon(FontAwesome.TIMES);

    btnSend.setStyleName(ValoTheme.BUTTON_PRIMARY);

    btnAccept.addStyleName(ValoTheme.BUTTON_SMALL);
    btnEscalate.addStyleName(ValoTheme.BUTTON_SMALL);
    btnDelegate.addStyleName(ValoTheme.BUTTON_SMALL);
    btnSchedule.addStyleName(ValoTheme.BUTTON_SMALL);
    btnSave.addStyleName(ValoTheme.BUTTON_SMALL);
    btnSend.addStyleName(ValoTheme.BUTTON_SMALL);
    btnClose.addStyleName(ValoTheme.BUTTON_SMALL);

    priorityMenubar.setStyleName(ValoTheme.MENUBAR_SMALL);

    //        buttonBar.setWidth(100, Unit.PERCENTAGE);
    buttonBar.setSpacing(true);
    buttonBar.addStyleName("toolbar");
    //        buttonBar.setExpandRatio(btnAccept, 1f);
    //        buttonBar.setComponentAlignment(priorityMenubar, Alignment.MIDDLE_LEFT);
    buttonBar.setComponentAlignment(btnAccept, Alignment.MIDDLE_RIGHT);
    //        buttonBar.setComponentAlignment(btnEscalate, Alignment.MIDDLE_RIGHT);
    //        buttonBar.setComponentAlignment(btnDelegate, Alignment.MIDDLE_RIGHT);
    buttonBar.setComponentAlignment(btnSchedule, Alignment.MIDDLE_RIGHT);
    buttonBar.setComponentAlignment(btnSave, Alignment.MIDDLE_RIGHT);
    buttonBar.setComponentAlignment(btnSend, Alignment.MIDDLE_RIGHT);
    buttonBar.setComponentAlignment(btnClose, Alignment.MIDDLE_RIGHT);

    tabSheet.setStyleName(ValoTheme.TABSHEET_COMPACT_TABBAR);
    tabSheet.setStyleName(ValoTheme.TABSHEET_FRAMED);
    tabSheet.setSizeFull();

    setSizeFull();
    setSpacing(true);
    if (showHeader) {
        addComponent(taskFormHeader);
    }
    addComponent(buttonBar);
    setComponentAlignment(buttonBar, Alignment.MIDDLE_RIGHT);
    addComponent(tabSheet);
    setExpandRatio(tabSheet, 1f);
    loadForm();
}

From source file:com.hybridbpm.ui.component.bpm.window.FormConfigureWindow.java

License:Apache License

public FormConfigureWindow(Module module) {
    this.module = module;
    formModel = HybridbpmCoreUtil.jsonToObject(module.getModel(), FormModel.class);

    parametersLayout.setFormModel(formModel);
    parametersLayout.initUI(!Module.MODULE_SUBTYPE.TASK_FORM.equals(module.getSubType()));

    toolbar.setSpacing(true);/*from   www  .  ja  v  a  2  s  .c o  m*/
    toolbar.addStyleName("toolbar");

    btnOk.addStyleName(ValoTheme.BUTTON_PRIMARY);
    btnOk.setCaption("OK");
    toolbar.addComponent(btnOk);
    toolbar.setComponentAlignment(btnOk, Alignment.MIDDLE_RIGHT);

    btnClose.setCaption("Close");
    toolbar.addComponent(btnClose);
    toolbar.setComponentAlignment(btnClose, Alignment.MIDDLE_RIGHT);

    cssLayout.addComponent(parametersLayout);
    cssLayout.setSizeFull();
    cssLayout.addStyleName("scrollable");

    layout.setSizeFull();
    layout.setMargin(true);
    layout.addComponent(cssLayout);
    layout.setExpandRatio(cssLayout, 1f);
    layout.addComponent(toolbar);
    layout.setComponentAlignment(toolbar, Alignment.BOTTOM_RIGHT);

    setCaption("Form parameters");
    center();
    setResizable(false);
    //        setClosable(false);
    setModal(true);
    addStyleName("no-vertical-drag-hints");
    addStyleName("no-horizontal-drag-hints");
    setContent(layout);
    setWidth(80, Unit.PERCENTAGE);
    setHeight(80, Unit.PERCENTAGE);
}

From source file:com.hybridbpm.ui.component.bpm.window.ProcessConfigureWindow.java

License:Apache License

public void initUI(ProcessModelLayout processModelLayout) {
    this.processModelLayout = processModelLayout;
    variableEditorLayout.setProcessModel(processModelLayout.getProcessModel());
    variableEditorLayout.initUI();/*from   w w w  . j  av a2s.co m*/
    fileEditorLayout.setProcessModel(processModelLayout.getProcessModel());
    fileEditorLayout.initUI();

    toolbar.setSpacing(true);
    toolbar.addStyleName("toolbar");

    btnOk.addStyleName(ValoTheme.BUTTON_PRIMARY);
    btnOk.setCaption("OK");
    toolbar.addComponent(btnOk);
    toolbar.setComponentAlignment(btnOk, Alignment.MIDDLE_RIGHT);

    btnClose.setCaption("Close");
    toolbar.addComponent(btnClose);
    toolbar.setComponentAlignment(btnClose, Alignment.MIDDLE_RIGHT);

    //        cssLayout.addComponent(variableEditorLayout);
    //        cssLayout.setSizeFull();
    //        cssLayout.addStyleName("scrollable");
    tabSheet.setSizeFull();
    tabSheet.addTab(variableEditorLayout, "Data");
    tabSheet.addTab(fileEditorLayout, "Files");

    layout.setSizeFull();
    layout.setMargin(true);
    layout.addComponent(tabSheet);
    layout.setExpandRatio(tabSheet, 1f);
    layout.addComponent(toolbar);
    layout.setComponentAlignment(toolbar, Alignment.BOTTOM_RIGHT);

    setCaption("Process data");
    center();
    setResizable(false);
    //        setClosable(false);
    setModal(true);
    addStyleName("no-vertical-drag-hints");
    addStyleName("no-horizontal-drag-hints");
    setContent(layout);
    setWidth(80, Unit.PERCENTAGE);
    setHeight(80, Unit.PERCENTAGE);
}

From source file:com.hybridbpm.ui.component.bpm.window.TransitionConfigureWindow.java

License:Apache License

public void initUI(ProcessModelLayout processModelLayout) {
    this.processModelLayout = processModelLayout;
    nameTextField.setCaption(("Name"));
    nameTextField.setWidth(300, Unit.PIXELS);
    nameTextField.setNullRepresentation("");

    expressionTextField.setCaption(("Condition Expression"));
    expressionTextField.setWidth(100, Unit.PERCENTAGE);
    expressionTextField.setHeight(50, Unit.PIXELS);
    expressionTextField.setMode(AceMode.groovy);
    expressionTextField.setTheme(AceTheme.chrome);
    expressionTextField.setShowGutter(false);
    SuggestionExtension extension = new SuggestionExtension(
            new VariableSuggester(this.processModelLayout.getProcessModel()));
    extension.setSuggestOnDot(false);//from  www . j av a 2  s  .  c o  m
    extension.extend(expressionTextField);

    defaultCheckBox.setCaption(("Default Transition"));

    yTextField.setCaption(("Y"));
    yTextField.setWidth(100, Unit.PIXELS);
    yTextField.setNullRepresentation("");
    yTextField.setVisible(false);

    xTextField.setCaption(("Y"));
    xTextField.setWidth(100, Unit.PIXELS);
    xTextField.setNullRepresentation("");
    xTextField.setVisible(false);

    //        configurationLayout.setCaption("Transition properties");
    //        configurationLayout.addStyleName("process-config");
    configurationLayout.setMargin(new MarginInfo(true, true, true, true));
    configurationLayout.setSpacing(true);
    configurationLayout.addComponent(nameTextField, 0, 0, 0, 0);
    configurationLayout.addComponent(defaultCheckBox, 1, 0, 1, 0);
    configurationLayout.setComponentAlignment(defaultCheckBox, Alignment.BOTTOM_RIGHT);
    configurationLayout.addComponent(expressionTextField, 0, 1, 1, 1);
    configurationLayout.addComponent(xTextField, 0, 2, 0, 2);
    configurationLayout.addComponent(yTextField, 1, 2, 1, 2);
    configurationLayout.setColumnExpandRatio(0, 1f);
    configurationLayout.setColumnExpandRatio(1, 1f);
    configurationLayout.setColumnExpandRatio(2, 1f);

    fieldGroup.setBuffered(true); //important
    fieldGroup.bind(xTextField, "x");
    fieldGroup.bind(yTextField, "y");
    fieldGroup.bind(nameTextField, "name");
    fieldGroup.bind(expressionTextField, "expression");
    fieldGroup.bind(defaultCheckBox, "defaultTransition");
    fieldGroup.setItemDataSource(processModelLayout.getActiveElement().getTransitionModel());

    toolbar.setSpacing(true);
    toolbar.setWidth(100, Unit.PERCENTAGE);
    toolbar.addStyleName("toolbar");

    btnShowMore.setCaption(("Show more"));
    btnShowMore.setStyleName(ValoTheme.BUTTON_LINK);
    toolbar.addComponent(btnShowMore);
    toolbar.setComponentAlignment(btnShowMore, Alignment.MIDDLE_LEFT);
    toolbar.setExpandRatio(btnShowMore, 1f);

    btnOk.addStyleName(ValoTheme.BUTTON_PRIMARY);
    btnOk.setCaption(("OK"));
    toolbar.addComponent(btnOk);
    toolbar.setComponentAlignment(btnOk, Alignment.MIDDLE_RIGHT);

    btnClose.setCaption(("Close"));
    toolbar.addComponent(btnClose);
    toolbar.setComponentAlignment(btnClose, Alignment.MIDDLE_RIGHT);

    layout.addStyleName("process-config-layout");
    layout.setSpacing(true);
    layout.setMargin(true);
    layout.addComponent(configurationLayout);
    layout.addComponent(toolbar);
    layout.setComponentAlignment(toolbar, Alignment.MIDDLE_RIGHT);

    setCaption("Transition");
    center();
    setResizable(false);
    //        setClosable(false);
    setModal(true);
    addStyleName("no-vertical-drag-hints");
    addStyleName("no-horizontal-drag-hints");
    addStyleName("process-config-window");
    setContent(layout);
}

From source file:com.hybridbpm.ui.component.chart.color.GaugeBandLayout.java

License:Apache License

public GaugeBandLayout(final BeanFieldGroup<DiagrammePreference> preferences) {
    super(preferences);

    setCaption("Gauge Band Colors");
    setSizeFull();//from  w  ww . j av  a  2s.c o  m
    setSpacing(true);
    setMargin(false);

    addBandButton.setIcon(FontAwesome.PLUS);
    addBandButton.setStyleName(ValoTheme.BUTTON_BORDERLESS);
    addBandButton.addStyleName(ValoTheme.BUTTON_SMALL);

    bandAdditionButtonFrame.setSpacing(true);
    bandAdditionButtonFrame.addComponent(addBandButton);
    bandAdditionButtonFrame.setComponentAlignment(addBandButton, Alignment.MIDDLE_RIGHT);

    addComponent(bandAdditionButtonFrame);

    addBandButton.addClickListener(new Button.ClickListener() {
        @Override
        public void buttonClick(Button.ClickEvent event) {
            addBand();
        }
    });

    colorTable.setHeight("100%");
    colorTable.setWidth("100%");
    colorTable.addStyleName(ValoTheme.TABLE_COMPACT);
    colorTable.addStyleName(ValoTheme.TABLE_SMALL);
    colorTable.addStyleName("color-table");

    colorTable.addContainerProperty(Translate.getMessage("colour"), ColorPicker.class, null);
    colorTable.addContainerProperty(Translate.getMessage("start"), TextField.class, null);
    colorTable.addContainerProperty(Translate.getMessage("end"), TextField.class, null);
    colorTable.addContainerProperty("remove", Button.class, null);

    // COLOR COLUMN
    colorTable.addGeneratedColumn(Translate.getMessage("colour"), new Table.ColumnGenerator() {
        @Override
        public Object generateCell(Table source, Object itemId, Object columnId) {
            final Property<String> colorProp = tableContainer.getItem(itemId).getItemProperty("color");

            int[] col = ColourUtil.decode(colorProp.getValue());
            ColorPicker picker = new ColorPicker();
            picker.addStyleName("diagramme");
            picker.setPosition(Page.getCurrent().getBrowserWindowWidth() / 2 - 246 / 2,
                    Page.getCurrent().getBrowserWindowHeight() / 2 - 507 / 2);
            picker.setColor(new com.vaadin.shared.ui.colorpicker.Color(col[0], col[1], col[2]));

            picker.addColorChangeListener(new ColorChangeListener() {
                @Override
                public void colorChanged(ColorChangeEvent event) {
                    colorProp.setValue(event.getColor().getCSS());
                    updateDiagramme();
                }
            });
            picker.setWidth("25px");

            return picker;
        }
    });

    // BAND START COLUMN
    colorTable.addGeneratedColumn(Translate.getMessage("start"), new Table.ColumnGenerator() {
        @Override
        public Object generateCell(Table source, Object itemId, Object columnId) {
            final Property<Double> startProp = tableContainer.getContainerProperty(itemId, "startValue");

            final ObjectProperty<Double> startValue = new ObjectProperty<Double>(0.0);
            TextField startField = new TextField(startValue);
            //startField.setWidth("60px");
            startField.setSizeFull();
            startField.setNullRepresentation("0");
            startField.addStyleName("tfwb");
            startField.setConvertedValue(startProp.getValue());
            startField.setImmediate(true);

            startValue.addValueChangeListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(Property.ValueChangeEvent event) {
                    startProp.setValue((Double) event.getProperty().getValue());
                    updateDiagramme();
                }
            });

            return startField;
        }
    });

    // BAND END COLUMN
    colorTable.addGeneratedColumn(Translate.getMessage("end"), new Table.ColumnGenerator() {
        @Override
        public Object generateCell(Table source, Object itemId, Object columnId) {
            final Property<Double> endProp = tableContainer.getContainerProperty(itemId, "endValue");

            final ObjectProperty<Double> endValue = new ObjectProperty<Double>(0.0);
            TextField endField = new TextField(endValue);
            //endField.setWidth("60px");
            endField.setSizeFull();
            endField.setNullRepresentation("0");
            endField.addStyleName("tfwb");
            endField.setConvertedValue(endProp.getValue());
            endField.setImmediate(true);

            endValue.addValueChangeListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(Property.ValueChangeEvent valueChangeEvent) {
                    endProp.setValue((Double) valueChangeEvent.getProperty().getValue());
                    updateDiagramme();
                }
            });

            return endField;
        }
    });

    // DELETE BAND COLUMN
    colorTable.addGeneratedColumn("remove", new Table.ColumnGenerator() {

        @Override
        public Object generateCell(Table source, final Object itemId, Object columnId) {

            Button delete = new Button(FontAwesome.TIMES);
            delete.addClickListener(new Button.ClickListener() {
                @Override
                public void buttonClick(Button.ClickEvent event) {
                    removeBand(itemId);
                }
            });
            delete.setWidth("43px");

            return delete;
        }
    });

    colorTable.setColumnWidth(Translate.getMessage("colour"), 33);
    colorTable.setColumnWidth("remove", 48);
    colorTable.setColumnExpandRatio(Translate.getMessage("start"), 0.5f);
    colorTable.setColumnExpandRatio(Translate.getMessage("end"), 0.5f);

    colorTable.setSortEnabled(false);
    colorTable.setPageLength(0);
    colorTable.setEditable(true);
    colorTable.setImmediate(true);

    addComponent(colorTable);
    setExpandRatio(colorTable, 1f);
    setComponentAlignment(colorTable, Alignment.TOP_LEFT);
}

From source file:com.hybridbpm.ui.component.ConfigureWindow.java

License:Apache License

public ConfigureWindow(Component dataLayout, String caption) {
    this.dataLayout = dataLayout;
    setCaption(caption);//from w w  w  . j av  a  2s  .  c  om

    errorMessage.setVisible(false);
    errorMessage.setStyleName(ValoTheme.LABEL_FAILURE);

    toolbar.setSpacing(true);
    toolbar.addStyleName("toolbar");

    btnOk.addStyleName(ValoTheme.BUTTON_PRIMARY);
    btnOk.addStyleName(ValoTheme.BUTTON_SMALL);
    btnOk.setCaption("OK");
    toolbar.addComponent(btnOk);
    toolbar.setComponentAlignment(btnOk, Alignment.MIDDLE_RIGHT);

    btnClose.setCaption("Close");
    btnClose.addStyleName(ValoTheme.BUTTON_SMALL);

    toolbar.addComponent(btnClose);
    toolbar.setComponentAlignment(btnClose, Alignment.MIDDLE_RIGHT);

    cssLayout.addComponent(this.dataLayout);
    cssLayout.setSizeFull();
    cssLayout.addStyleName("scrollable");

    layout.setSizeFull();
    layout.setMargin(true);
    layout.addComponent(cssLayout);
    layout.setExpandRatio(cssLayout, 1f);
    layout.addComponent(errorMessage);
    layout.addComponent(toolbar);
    layout.setComponentAlignment(toolbar, Alignment.BOTTOM_RIGHT);

    center();
    setResizable(false);
    //        setClosable(false);
    setModal(true);
    addStyleName("no-vertical-drag-hints");
    addStyleName("no-horizontal-drag-hints");
    setContent(layout);
    setWidth(80, Unit.PERCENTAGE);
    setHeight(80, Unit.PERCENTAGE);
}

From source file:com.hybridbpm.ui.component.development.AbstractEditor.java

License:Apache License

public AbstractEditor() {
    setSizeFull();// w  w  w  . j a va  2  s  .  c  om
    setSpacing(true);
    setMargin(new MarginInfo(true, false, false, false));
    addComponent(buttonBar);
    setComponentAlignment(buttonBar, Alignment.MIDDLE_RIGHT);
    addComponent(horizontalSplitPanel);
    setExpandRatio(horizontalSplitPanel, 1f);

    horizontalSplitPanel.setSizeFull();
    horizontalSplitPanel.setStyleName("transparent");

    buttonBar.setSpacing(true);
    buttonBar.setSpacing(true);

    btnSave.setIcon(FontAwesome.SAVE);
    btnSave.setStyleName(ValoTheme.BUTTON_BORDERLESS);
    btnSave.addStyleName(ValoTheme.BUTTON_SMALL);
    btnSave.addStyleName(ValoTheme.BUTTON_PRIMARY);
}

From source file:com.hybridbpm.ui.component.development.DataEditor.java

License:Apache License

private void prepareModeler() {
    btnAdd.setCaption("Add field");
    btnAdd.setIcon(FontAwesome.PLUS_CIRCLE);
    btnAdd.setStyleName(ValoTheme.BUTTON_LINK);
    btnAdd.addStyleName(ValoTheme.BUTTON_SMALL);

    modelerLayout.setMargin(true);//  w  ww  .  j  a  va  2 s.c  o  m
    modelerLayout.setSpacing(true);
    modelerLayout.setWidth(100, Sizeable.Unit.PERCENTAGE);
    for (FieldModel fieldModel : dataModel.getFields()) {
        FieldForm fieldForm = new FieldForm(FieldForm.CLASS_LIST_TYPE.BOTH);
        fieldForm.setFieldModel(fieldModel);
        modelerLayout.addComponent(fieldForm);
    }
    modelerLayout.addComponent(btnAdd);
    modelerLayout.setComponentAlignment(btnAdd, Alignment.MIDDLE_RIGHT);
}

From source file:com.hybridbpm.ui.component.development.InParametersLayout.java

License:Apache License

public void initUI() {
    removeAllComponents();/*  ww w  .  j  ava  2  s . c o m*/
    btnAdd.setCaption(("Add parameter"));
    btnAdd.setStyleName(ValoTheme.BUTTON_LINK);
    btnAdd.setIcon(FontAwesome.PLUS_CIRCLE);
    setMargin(true);
    setSpacing(true);
    setWidth(100, Sizeable.Unit.PERCENTAGE);
    for (FieldModel fieldModel : connectoModel.getInParameters()) {
        FieldForm fieldForm = new FieldForm(FieldForm.CLASS_LIST_TYPE.BOTH);
        fieldForm.setFieldModel(fieldModel);
        addComponent(fieldForm);
    }
    addComponent(btnAdd);
    setComponentAlignment(btnAdd, Alignment.MIDDLE_RIGHT);
}