Package org.thechiselgroup.choosel.core.client.geometry

Examples of org.thechiselgroup.choosel.core.client.geometry.Rectangle


    private List<Area> getDropTargetAreas() {
        List<Area> areas = new ArrayList<Area>();
        for (ResourceSetAvatarDropController dropController : getAvailableDropControllers()) {
            Widget dropTarget = dropController.getDropTarget();
            Rectangle rectangle = Rectangle.fromWidget(dropTarget);
            WindowPanel window = getWindow(dropTarget);

            areas.add(new Area(rectangle, window, dropController));
        }
        return areas;
View Full Code Here


    private List<Area> getWindowAreas() {
        List<Area> windowAreas = new ArrayList<Area>();
        List<WindowPanel> windows = desktop.getWindows();
        for (WindowPanel window : windows) {
            Rectangle r = Rectangle.fromWidget(window);
            windowAreas.add(new Area(r, window, null));
        }
        return windowAreas;
    }
View Full Code Here

    @Mock
    private WindowPanel window;

    @Test
    public void getVisiblePartsDoesNotReturnSameAreaTwice() {
        Area underTest = new Area(new Rectangle(0, 0, 100, 100), window, null);

        List<Area> windowAreas = new ArrayList<Area>();
        windowAreas.add(new Area(new Rectangle(0, 0, 50, 100), otherWindow1,
                null));
        windowAreas.add(new Area(new Rectangle(0, 0, 50, 100), otherWindow2,
                null));

        when(window.getZIndex()).thenReturn(0);
        when(otherWindow1.getZIndex()).thenReturn(1);
        when(otherWindow2.getZIndex()).thenReturn(2);

        List<Area> result = underTest.getVisibleParts(windowAreas);
        assertEquals(1, result.size());

        Rectangle rectangle = result.get(0).getRectangle();
        assertEquals(50, rectangle.getX());
        assertEquals(50, rectangle.getWidth());
        assertEquals(0, rectangle.getY());
        assertEquals(100, rectangle.getHeight());
    }
View Full Code Here

TOP

Related Classes of org.thechiselgroup.choosel.core.client.geometry.Rectangle

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.