Package org.apache.isis.viewer.dnd

Examples of org.apache.isis.viewer.dnd.DummyView


        Assert.assertEquals(new Location(ORIGINAL_X + ROOT_VIEW_WIDTH + PADDING, 70), location);
    }

    @Test
    public void adjustWhenOnTopOfExistingField() throws Exception {
        final DummyView anotherView = new DummyView();
        anotherView.setLocation(new Location(ORIGINAL_X + ROOT_VIEW_WIDTH + PADDING, ORIGINAL_Y));
        anotherView.setSize(new Size(50, 50));
        workspace.addView(anotherView);

        newView.setupRequiredSize(new Size(NEW_VIEW_WIDTH, NEW_VIEW_HEIGHT));

        final Location location = strategy.determinePlacement(workspace, existingView, newView);
View Full Code Here


        Assert.assertEquals(new Location(ORIGINAL_X + ROOT_VIEW_WIDTH + PADDING, 0), location);
    }

    @Test
    public void wideComponentsDontCompletelyOverlap() throws Exception {
        final DummyView anotherView = new DummyView();
        anotherView.setLocation(new Location(0, 70 + ROOT_VIEW_HEIGHT + PADDING));
        anotherView.setSize(new Size(WORKSPACE_WIDTH, 100));
        workspace.addView(anotherView);

        newView.setupRequiredSize(new Size(WORKSPACE_WIDTH, NEW_VIEW_HEIGHT));

        final Location location = strategy.determinePlacement(workspace, existingView, newView);
View Full Code Here

        Assert.assertEquals(new Location(0, 70 + ROOT_VIEW_HEIGHT + PADDING + PADDING * 4), location);
    }

    @Test
    public void tallComponentsDontCompletelyOverlap() throws Exception {
        final DummyView anotherView = new DummyView();
        anotherView.setLocation(new Location(ORIGINAL_X + ROOT_VIEW_WIDTH + PADDING, 0));
        anotherView.setSize(new Size(100, WORKSPACE_HEIGHT));
        workspace.addView(anotherView);

        newView.setupRequiredSize(new Size(NEW_VIEW_WIDTH, WORKSPACE_HEIGHT));

        final Location location = strategy.determinePlacement(workspace, existingView, newView);
View Full Code Here

        IsisContextStatic.createRelaxedInstance(sessionFactory);
    }

    @Test
    public void testScrollBar() {
        final DummyView innerView = new DummyView();
        innerView.setupRequiredSize(new Size(100, 200));
        final View view = new ScrollBorder(innerView);

        ViewAreaType type = view.viewAreaType(new Location(20, 190));
        Assert.assertEquals(ViewAreaType.INTERNAL, type);
View Full Code Here

        Assert.assertEquals(ViewAreaType.INTERNAL, type);
    }

    @Test
    public void testSetSizeSetsUpContentAndHeaderSizes() {
        final DummyView contentView = new DummyView();
        contentView.setupRequiredSize(new Size(300, 400));

        final DummyView topHeader = new DummyView();
        topHeader.setupRequiredSize(new Size(0, 20));

        final DummyView leftHeader = new DummyView();
        leftHeader.setupRequiredSize(new Size(30, 0));

        final View scrollBorder = new ScrollBorder(contentView, leftHeader, topHeader);

        scrollBorder.setSize(new Size(100, 200));

        Assert.assertEquals(new Size(300, 400), contentView.getSize());
        Assert.assertEquals(new Size(300, 20), topHeader.getSize());
        Assert.assertEquals(new Size(30, 400), leftHeader.getSize());

    }
View Full Code Here

    }

    @Test
    public void testSetSizeSetsUpContentAndHeaderSizes2() {
        final DummyView contentView = new DummyView();
        contentView.setupRequiredSize(new Size(300, 400));

        final DummyView topHeader = new DummyView();
        topHeader.setupRequiredSize(new Size(0, 20));

        final DummyView leftHeader = new DummyView();
        leftHeader.setupRequiredSize(new Size(30, 0));

        final View scrollBorder = new ScrollBorder(contentView, leftHeader, topHeader);

        scrollBorder.setSize(new Size(100, 200));
View Full Code Here

    @Test
    public void layout() throws Exception {
        IsisContext.setConfiguration(new TestProxyConfiguration());
        TestToolkit.createInstance();

        final DummyView row = new DummyView();
        final DummyView cell1 = new DummyView();
        final DummyView cell2 = new DummyView();
        row.setupSubviews(new View[] { cell1, cell2 });

        final Mockery mockery = new Mockery();
        final TableAxis tableAxis = mockery.mock(TableAxis.class);

        mockery.checking(new Expectations() {
            {
                one(tableAxis).getColumnWidth(0);
                will(returnValue(80));
                one(tableAxis).getColumnWidth(1);
                will(returnValue(80));
            }
        });

        final TableRowLayout layout = new TableRowLayout(tableAxis);

        layout.layout(row, new Size(200, 200));
        mockery.assertIsSatisfied();

        Assert.assertEquals(new Size(80, 10), cell1.getSize());
        Assert.assertEquals(new Size(80, 10), cell2.getSize());

    }
View Full Code Here

                return null;
            }
        };
        view.setSize(new Size(100, 200));

        component1 = new DummyView();
        component1.setupRequiredSize(new Size(100, 20));
    }
View Full Code Here

    }

    @Test
    public void testLayoutGetRedoneAfterNewComponentAdded() throws Exception {
        view.layout();
        view.addView(new DummyView());
        view.layout();
        assertEquals(2, layoutCount);
    }
View Full Code Here

    @Test
    public void testLayoutGetRedoneAfterComponentReplaced() throws Exception {
        view.addView(component1);
        view.layout();
        view.replaceView(component1, new DummyView());
        view.layout();
        assertEquals(2, layoutCount);
    }
View Full Code Here

TOP

Related Classes of org.apache.isis.viewer.dnd.DummyView

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.