Package com.vaadin.ui

Examples of com.vaadin.ui.AbsoluteLayout


        gridlayout = new GridLayout();
        gridlayout.addComponentAttachListener(new MyAttachListener());
        gridlayout.addComponentDetachListener(new MyDetachListener());

        absolutelayout = new AbsoluteLayout();
        absolutelayout.addComponentAttachListener(new MyAttachListener());
        absolutelayout.addComponentDetachListener(new MyDetachListener());

        csslayout = new CssLayout();
        csslayout.addComponentAttachListener(new MyAttachListener());
View Full Code Here


    /**
     * Add component w/o giving positions, assert that everything is unset
     */
    public void testNoPosition() {
        AbsoluteLayout layout = new AbsoluteLayout();
        Button b = new Button();
        layout.addComponent(b);

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

        assertEquals(UNIT_UNSET, layout.getPosition(b).getTopUnits());
        assertEquals(UNIT_UNSET, layout.getPosition(b).getBottomUnits());
        assertEquals(UNIT_UNSET, layout.getPosition(b).getLeftUnits());
        assertEquals(UNIT_UNSET, layout.getPosition(b).getRightUnits());

        assertEquals(-1, layout.getPosition(b).getZIndex());

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

    }
View Full Code Here

    }

    private AbsoluteLayout Ranking() {

        AbsoluteLayout vT = new AbsoluteLayout();
        vT.setHeight(500, Unit.PIXELS);
        vT.setWidth(900, Unit.PIXELS);
        vT.setStyleName(Reindeer.LAYOUT_BLUE);

        final Table table = new Table("Ranking Oficial");

        table.addContainerProperty("Atleta", String.class, null);
        table.addContainerProperty("P", String.class, null);
        table.addContainerProperty("Dez/11", Integer.class, null);
        table.setColumnAlignment("Dez/11", Align.CENTER);
        table.addContainerProperty("Jan/12", Integer.class, null);
        table.setColumnAlignment("Jan/12", Align.CENTER);
        table.addContainerProperty("Abr/12", String.class, null);
        table.addContainerProperty("Total", Integer.class, null);
        table.setColumnAlignment("Total", Align.CENTER);

        table.addItem(new Object[] { "Araujo", "D.1", 8, 8, " ", 16 }, 1);
        table.addItem(new Object[] { "Claudio", "D.2", 2, 10, " ", 12 }, 2);
        table.setPageLength(12);

        vT.addComponent(table, "left: 50px; top: 50px;");
        return vT;

    }
View Full Code Here

    /**
     * Add component, setting all attributes using CSS, assert getter agree
     */
    public void testFullCss() {
        AbsoluteLayout layout = new AbsoluteLayout();
        Button b = new Button();
        layout.addComponent(b, CSS);

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

        assertEquals(Sizeable.Unit.PIXELS, layout.getPosition(b).getTopUnits());
        assertEquals(Sizeable.Unit.PICAS, layout.getPosition(b)
                .getBottomUnits());
        assertEquals(Sizeable.Unit.EM, layout.getPosition(b).getLeftUnits());
        assertEquals(Sizeable.Unit.PERCENTAGE, layout.getPosition(b)
                .getRightUnits());

        assertEquals(7, layout.getPosition(b).getZIndex());

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

    }
View Full Code Here

    /**
     * Add component, setting some attributes using CSS, assert getters agree
     */
    public void testPartialCss() {
        AbsoluteLayout layout = new AbsoluteLayout();
        Button b = new Button();
        layout.addComponent(b, PARTIAL_CSS);

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

        assertEquals(Sizeable.Unit.PIXELS, layout.getPosition(b).getTopUnits());
        assertEquals(UNIT_UNSET, layout.getPosition(b).getBottomUnits());
        assertEquals(Sizeable.Unit.EM, layout.getPosition(b).getLeftUnits());
        assertEquals(UNIT_UNSET, layout.getPosition(b).getRightUnits());

        assertEquals(-1, layout.getPosition(b).getZIndex());

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

    }
View Full Code Here

    /**
     * Add component setting all attributes using CSS, then reset using partial
     * CSS; assert getters agree and the appropriate attributes are unset.
     */
    public void testPartialCssReset() {
        AbsoluteLayout layout = new AbsoluteLayout();
        Button b = new Button();
        layout.addComponent(b, CSS);

        layout.getPosition(b).setCSSString(PARTIAL_CSS);

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

        assertEquals(Sizeable.Unit.PIXELS, layout.getPosition(b).getTopUnits());
        assertEquals(UNIT_UNSET, layout.getPosition(b).getBottomUnits());
        assertEquals(Sizeable.Unit.EM, layout.getPosition(b).getLeftUnits());
        assertEquals(UNIT_UNSET, layout.getPosition(b).getRightUnits());

        assertEquals(-1, layout.getPosition(b).getZIndex());

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

    }
View Full Code Here

     * 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

     * 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

    /**
     * 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

        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

TOP

Related Classes of com.vaadin.ui.AbsoluteLayout

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.