Examples of AbsoluteLayout


Examples of com.vaadin.ui.AbsoluteLayout

     * for value and units; assert getters agree.
     */
    public void testSetPosition() {
        final Float SIZE = Float.valueOf(12);

        AbsoluteLayout layout = new AbsoluteLayout();
        Button b = new Button();
        layout.addComponent(b);

        layout.getPosition(b).setTopValue(SIZE);
        layout.getPosition(b).setRightValue(SIZE);
        layout.getPosition(b).setBottomValue(SIZE);
        layout.getPosition(b).setLeftValue(SIZE);

        layout.getPosition(b).setTopUnits(Sizeable.Unit.CM);
        layout.getPosition(b).setRightUnits(Sizeable.Unit.EX);
        layout.getPosition(b).setBottomUnits(Sizeable.Unit.INCH);
        layout.getPosition(b).setLeftUnits(Sizeable.Unit.MM);

        assertEquals(SIZE, layout.getPosition(b).getTopValue());
        assertEquals(SIZE, layout.getPosition(b).getRightValue());
        assertEquals(SIZE, layout.getPosition(b).getBottomValue());
        assertEquals(SIZE, layout.getPosition(b).getLeftValue());

        assertEquals(Sizeable.Unit.CM, layout.getPosition(b).getTopUnits());
        assertEquals(Sizeable.Unit.EX, layout.getPosition(b).getRightUnits());
        assertEquals(Sizeable.Unit.INCH, layout.getPosition(b).getBottomUnits());
        assertEquals(Sizeable.Unit.MM, layout.getPosition(b).getLeftUnits());

    }
View Full Code Here

Examples of com.vaadin.ui.AbsoluteLayout

     * Add component, then set all position attributes with combined setters for
     * value and units; assert getters agree.
     */
    public void testSetPosition2() {
        final Float SIZE = Float.valueOf(12);
        AbsoluteLayout layout = new AbsoluteLayout();
        Button b = new Button();
        layout.addComponent(b);

        layout.getPosition(b).setTop(SIZE, Sizeable.Unit.CM);
        layout.getPosition(b).setRight(SIZE, Sizeable.Unit.EX);
        layout.getPosition(b).setBottom(SIZE, Sizeable.Unit.INCH);
        layout.getPosition(b).setLeft(SIZE, Sizeable.Unit.MM);

        assertEquals(SIZE, layout.getPosition(b).getTopValue());
        assertEquals(SIZE, layout.getPosition(b).getRightValue());
        assertEquals(SIZE, layout.getPosition(b).getBottomValue());
        assertEquals(SIZE, layout.getPosition(b).getLeftValue());

        assertEquals(Sizeable.Unit.CM, layout.getPosition(b).getTopUnits());
        assertEquals(Sizeable.Unit.EX, layout.getPosition(b).getRightUnits());
        assertEquals(Sizeable.Unit.INCH, layout.getPosition(b).getBottomUnits());
        assertEquals(Sizeable.Unit.MM, layout.getPosition(b).getLeftUnits());

    }
View Full Code Here

Examples of com.vaadin.ui.AbsoluteLayout

    /**
     * Add component, set all attributes using CSS, unset some using method
     * calls, assert getters agree.
     */
    public void testUnsetPosition() {
        AbsoluteLayout layout = new AbsoluteLayout();
        Button b = new Button();
        layout.addComponent(b, CSS);

        layout.getPosition(b).setTopValue(null);
        layout.getPosition(b).setRightValue(null);
        layout.getPosition(b).setBottomValue(null);
        layout.getPosition(b).setLeftValue(null);

        layout.getPosition(b).setZIndex(-1);

        assertNull(layout.getPosition(b).getTopValue());
        assertNull(layout.getPosition(b).getBottomValue());
        assertNull(layout.getPosition(b).getLeftValue());
        assertNull(layout.getPosition(b).getRightValue());

        assertEquals("", layout.getPosition(b).getCSSString());

    }
View Full Code Here

Examples of com.vaadin.ui.AbsoluteLayout

        private AbsoluteLayout l;
        private int x;
        private int y;

        private FolderView(Folder f) {
            super(new AbsoluteLayout());
            l = (AbsoluteLayout) getCompositionRoot();
            setSizeFull();
            l.setSizeFull();
            folder = f;
View Full Code Here

Examples of com.vaadin.ui.AbsoluteLayout

        css.setCaption("CssLayout");
        css.addComponent(new Label("Some content"));
        css.setId("layout" + debugIdCounter++);
        addComponent(css);

        AbsoluteLayout abs = new AbsoluteLayout();
        abs.setCaption("Abs layout");
        abs.addComponent(new Label("Some content"));
        abs.setComponentError(new UserError("A error message..."));
        abs.setId("layout" + debugIdCounter++);

        addComponent(abs);

        GridLayout gl = new GridLayout();
        gl.setMargin(true);
View Full Code Here

Examples of com.vaadin.ui.AbsoluteLayout

    private AbsoluteLayout layout;

    public AcceptFromComponent(final Tree tree1) {
        setCaption("Checks the source is tree1 on server");

        layout = new AbsoluteLayout();
        DragAndDropWrapper wrapper = new DragAndDropWrapper(layout);

        setContent(wrapper);

        wrapper.setSizeFull();
View Full Code Here

Examples of com.vaadin.ui.AbsoluteLayout

    private AbsoluteLayout root;
    private AcceptCriterion crit;

    public DragDropPane() {
        super(new AbsoluteLayout());
        root = (AbsoluteLayout) getCompositionRoot();
        setDropHandler(this);
        setDragStartMode(DragStartMode.COMPONENT);
    }
View Full Code Here

Examples of com.vaadin.ui.AbsoluteLayout

        layoutsLayout.addComponent(createClickableAbsoluteLayout());
        layoutsLayout.addComponent(createClickableCSSLayout());
    }

    private Component createClickableAbsoluteLayout() {
        final AbsoluteLayout al = new AbsoluteLayout();
        al.setCaption("AbsoluteLayout");
        al.setStyleName("borders");
        al.setWidth("300px");
        al.setHeight("500px");
        al.addComponent(new TextField("This is its caption",
                "This is a textfield"), "top: 60px; left: 0px; width: 100px;");
        al.addComponent(new TextField("Another textfield caption",
                "This is another textfield"),
                "top: 120px; left: 20px; width: 100px;");

        al.addComponent(new Button("A button with its own click listener",
                new Button.ClickListener() {

                    @Override
                    public void buttonClick(
                            com.vaadin.ui.Button.ClickEvent event) {
                        log("Button " + event.getButton().getCaption()
                                + " was clicked");

                    }
                }));
        al.addLayoutClickListener(new LayoutClickListener() {

            @Override
            public void layoutClick(LayoutClickEvent event) {
                logLayoutClick("AbsoluteLayout", event);
            }
View Full Code Here

Examples of com.vaadin.ui.AbsoluteLayout

    }

    private void testAbsoluteLayout() {
        content.removeAllComponents();

        final AbsoluteLayout a = new AbsoluteLayout();
        a.setWidth("300px");
        a.setHeight("300px");
        a.addComponentAttachListener(new ComponentAttachListener() {
            @Override
            public void componentAttachedToContainer(ComponentAttachEvent event) {
                AbsoluteLayout layout = (AbsoluteLayout) event.getContainer();
                AbsoluteLayout.ComponentPosition position = layout
                        .getPosition(event.getAttachedComponent());

                getMainWindow().showNotification(
                        "Attached to " + position.getCSSString(),
                        Notification.TYPE_ERROR_MESSAGE);
View Full Code Here

Examples of com.vaadin.ui.AbsoluteLayout

public class AbsoluteLayoutClipping extends TestBase {

    @Override
    protected void setup() {
        setTheme("tests-tickets");
        AbsoluteLayout abs = new AbsoluteLayout();
        abs.setStyleName("borders");
        abs.setWidth("100px");
        abs.setHeight("100px");

        Label l = new Label("This should be clipped at 100px");
        l.setSizeUndefined();
        abs.addComponent(l, "top:50px;left:50px");

        Label l2 = new Label("This should not be visible");
        l2.setSizeUndefined();
        abs.addComponent(l2, "top:80px;left:150px");

        Label l3 = new Label("This should be clipped vertically at 100px");
        l3.setWidth("50px");
        abs.addComponent(l3, "top:20px;left:0px");

        addComponent(abs);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.