Package com.vaadin.ui

Examples of com.vaadin.ui.Alignment


    private void populateLayout(Layout layout) {
        layout.setSizeFull();
        for (int i = 0; i < 9; i++) {
            Label l = new Label("M");
            Alignment a = alignments[i];
            l.setCaption(a.getHorizontalAlignment() + " "
                    + a.getVerticalAlignment() + " " + a.getBitMask());
            layout.addComponent(l);
            ((AlignmentHandler) layout).setComponentAlignment(l, a);
        }

    }
View Full Code Here


        };

        layout.addComponent(first);
        layout.addComponent(second);

        Alignment alignment = Alignment.BOTTOM_RIGHT;
        layout.setComponentAlignment(first, alignment);
        layout.setComponentAlignment(second, Alignment.MIDDLE_CENTER);

        AbstractComponent replace = new AbstractComponent() {
        };
View Full Code Here

        for (AlignmentInfo horizontal : new AlignmentInfo[] {
                AlignmentInfo.LEFT, AlignmentInfo.CENTER, AlignmentInfo.RIGHT }) {
            for (AlignmentInfo vertical : new AlignmentInfo[] {
                    AlignmentInfo.TOP, AlignmentInfo.MIDDLE,
                    AlignmentInfo.BOTTOM }) {
                Alignment a = new Alignment(horizontal.getBitMask()
                        + vertical.getBitMask());
                alignmentOptions.put(
                        a.getHorizontalAlignment() + " "
                                + a.getVerticalAlignment(), a);

            }

        }
        Command<Form, Alignment> footerComponentAlignmentCommand = new Command<Form, Alignment>() {
View Full Code Here

                @Override
                public void valueChange(ValueChangeEvent event) {
                    Integer h = ((Integer) hAlign.getValue()).intValue();
                    int v = ((Integer) vAlign.getValue()).intValue();

                    updateAlignments(new Alignment(h + v));
                }

            };

            hAlign.setValue(new Integer(Bits.ALIGNMENT_LEFT));
            vAlign.addListener(alignmentChangeListener);
            hAlign.addListener(alignmentChangeListener);
            vAlign.setValue(new Integer(Bits.ALIGNMENT_TOP));

            controls.addComponent(new Label("layout alignment"));
            final NativeSelect lAlign = new NativeSelect();
            controls.addComponent(lAlign);
            lAlign.setNullSelectionAllowed(false);
            lAlign.addItem(new Integer(Bits.ALIGNMENT_LEFT));
            lAlign.setItemCaption(new Integer(Bits.ALIGNMENT_LEFT), "left");
            lAlign.addItem(new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER));
            lAlign.setItemCaption(
                    new Integer(Bits.ALIGNMENT_HORIZONTAL_CENTER), "center");
            lAlign.addItem(new Integer(Bits.ALIGNMENT_RIGHT));
            lAlign.setItemCaption(new Integer(Bits.ALIGNMENT_RIGHT), "right");

            lAlign.addListener(new Property.ValueChangeListener() {
                @Override
                public void valueChange(ValueChangeEvent event) {
                    testPanelLayout.setComponentAlignment(
                            testedLayout,
                            new Alignment(((Integer) lAlign.getValue())
                                    .intValue() + Bits.ALIGNMENT_TOP));
                }
            });
        }
View Full Code Here

                            newLayout = new VerticalLayout();
                        }

                        while (currentLayout.getComponentCount() > 0) {
                            Component child = currentLayout.getComponent(0);
                            Alignment alignment = currentLayout
                                    .getComponentAlignment(child);
                            float expRatio = currentLayout
                                    .getExpandRatio(child);
                            newLayout.addComponent(child);
                            newLayout.setExpandRatio(child, expRatio);
View Full Code Here

                                return;
                            }
                            try {
                                Field field = Alignment.class
                                        .getDeclaredField(value);
                                Alignment alignment = (Alignment) field
                                        .get(null);
                                parent.setComponentAlignment(SampleChild.this,
                                        alignment);
                            } catch (Exception e) {
                                throw new RuntimeException(e);
View Full Code Here

            getBtnRefreshTable().setImmediate(false);
            getBtnRefreshTable().setWidth("-1px");
            getBtnRefreshTable().setHeight("-1px");
            horizontalLayout_1.addComponent(getBtnRefreshTable());
            horizontalLayout_1.setComponentAlignment(getBtnRefreshTable(),
                    new Alignment(33));

            return horizontalLayout_1;
        }
View Full Code Here

   
    // formLayout_2
    formLayout_2 = buildFormLayout_2();
    horizontalLayout_4.addComponent(formLayout_2);
    horizontalLayout_4
        .setComponentAlignment(formLayout_2, new Alignment(6));
   
    return horizontalLayout_4;
  }
View Full Code Here

                  });
   
   
   
    hLay.addComponent(searchBtn);
    hLay.setComponentAlignment(searchBtn, new Alignment(Bits.ALIGNMENT_BOTTOM));
    hLay.setSpacing(true);
   
    addComponent(hLay);
   
        createTaskTable();
View Full Code Here

TOP

Related Classes of com.vaadin.ui.Alignment

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.