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

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


        }

        int height = displayWidget.getOffsetHeight();
        int width = displayWidget.getOffsetWidth();

        graphDisplay.setLocation(node, new Point(width / 2, height / 2));
    }
View Full Code Here


    private void restoreNodeLocations(Memento state) {
        for (VisualItem visualItem : getVisualItems()) {
            NodeItem item = visualItem.getDisplayObject();
            Memento nodeMemento = state.getChild(visualItem.getId());
            Point location = new Point(
                    (Integer) nodeMemento.getValue(MEMENTO_X),
                    (Integer) nodeMemento.getValue(MEMENTO_Y));

            setLocation(item, location);
        }
View Full Code Here

        Memento state = new Memento();

        for (VisualItem visualItem : getVisualItems()) {
            NodeItem nodeItem = visualItem.getDisplayObject();

            Point location = graphDisplay.getLocation(nodeItem.getNode());

            Memento nodeMemento = new Memento();
            nodeMemento.setValue(MEMENTO_X, location.getX());
            nodeMemento.setValue(MEMENTO_Y, location.getY());

            state.addChild(visualItem.getId(), nodeMemento);
        }
        return state;
    }
View Full Code Here

        @Override
        public void onDrag(NodeDragEvent event) {
            commandManager.execute(new MoveNodeCommand(graphDisplay, event
                    .getNode(),
                    new Point(event.getStartX(), event.getStartY()), new Point(
                            event.getEndX(), event.getEndY())));
        }
View Full Code Here

        callback = spy(new TestViewContentDisplayCallback());
        // TODO split, use separate classes
        visualItemContainer = callback;

        sourceLocation = new Point(10, 15);
        targetLocation = new Point(20, 25);

        arcTypeId = "arcType";
        arcDirected = true;
        arcColor = new Color("#ffffff");
        arcThickness = 1;
View Full Code Here

        assert node != null;
        assert containsNode(node.getId());

        try {
            Location result = _getNodeLocation(getSwfId(), node.getId());
            return new Point((int) result.getX(), (int) result.getY());
        } catch (Exception ex) {
            throw new GraphWidgetException("getLocation(" + node + ") failed",
                    ex);
        }
    }
View Full Code Here

        }

        // TODO extract + refactor layout (have method layout on node)
        Node inputNode = expansionCallback.getDisplay().getNode(
                resource.getUri());
        Point inputLocation = expansionCallback.getDisplay().getLocation(
                inputNode);

        List<Node> nodesToLayout = new ArrayList<Node>();
        for (String uri : added) {
            Node node = expansionCallback.getDisplay().getNode(uri);
View Full Code Here

    public void setUp() {
        MockitoAnnotations.initMocks(this);

        underTest = new DefaultWindowController(callback);

        when(callback.getLocation()).thenReturn(new Point(X, Y));
    }
View Full Code Here

    private PositionManager manager;

    @Test
    public void firstPosition() {
        Point location = manager.getNextLocation(200, 200);

        assertEquals(TEST_PADDING, location.getX());
        assertEquals(TEST_PADDING, location.getY());
    }
View Full Code Here

    @Test
    public void secondLocation() {
        manager.getNextLocation(200, 200);

        Point location = manager.getNextLocation(200, 200);

        assertEquals(TEST_PADDING
                + ((500 - 200 - 2 * TEST_PADDING) / TEST_HORIZONTAL_STEPS),
                location.getX());
        assertEquals(TEST_PADDING
                + ((400 - 200 - 2 * TEST_PADDING) / TEST_VERTICAL_STEPS),
                location.getY());
    }
View Full Code Here

TOP

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

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.