Package diva.canvas.interactor

Examples of diva.canvas.interactor.Interactor


     */
    public void createDraggableFigures() {
        FigureLayer layer = graphicsPane.getForegroundLayer();

        // Create the interactor to do the work.
        Interactor dragger = new DragInteractor();
        dragger.setMouseFilter(MouseFilter.defaultFilter);

        // Create a rectangle and make it draggable
        BasicFigure blue = new BasicRectangle(10.0, 10.0, 50.0, 50.0,
                Color.blue);
        layer.add(blue);
View Full Code Here


    public void createBoundedDraggableFigure() {
        FigureLayer layer = graphicsPane.getForegroundLayer();

        // Create the interactor and set it up for a 200x200 rectangle
        Rectangle2D bounds = new Rectangle2D.Double(100.0, 100.0, 200.0, 200.0);
        Interactor boundedDragger = new BoundedDragInteractor(bounds);
        boundedDragger.setMouseFilter(MouseFilter.defaultFilter);

        // Create an outline rectangle that shows the boundaries
        graphicsPane.getOverlayLayer().add(bounds);

        // Create a green rectangle that stays inside the boundary
View Full Code Here

     */
    public void createFigures() {
        FigureLayer layer = graphicsPane.getForegroundLayer();

        // Create an interactor to do the work.
        Interactor dragger = new DragInteractor();

        // Create the figure
        Figure one = new CloudFigure(10.0, 10.0, 80.0, 80.0);
        layer.add(one);
        one.setInteractor(dragger);
View Full Code Here

        switch (id) {
        case MouseEvent.MOUSE_PRESSED:

            // Find what interactor will grab the event.
            for (Iterator i = _interactors.iterator(); i.hasNext();) {
                Interactor interactor = (Interactor) i.next();

                if (interactor.accept(event)) {
                    _currentInteractor = interactor;
                    _currentInteractor.mousePressed(event);
                    break;
                }
            }
View Full Code Here

            return;
        }

        // See whether to handle this event
        // FIXME This is only temporary
        Interactor r = getInteractor();

        if ((r != null) && r instanceof SelectionInteractor) {
            if (((SelectionInteractor) r).getSelectionModel()
                    .containsSelection(this)) {
                return;
View Full Code Here

        JGraph jGraph = parent.getJGraph();
        GraphPane graphPane = jGraph.getGraphPane();
        _controller = graphPane.getGraphController();
        _selectionModel = _controller.getSelectionModel();

        Interactor interactor = _controller.getEdgeController(new Object())
                .getEdgeInteractor();
        _graphModel = (AbstractBasicGraphModel) _controller.getGraphModel();
        _selectionInteractor = (SelectionInteractor) interactor;
        _defaultSelectionRenderer = _selectionInteractor.getSelectionRenderer();
        tempSelectionRenderer = new BasicSelectionRenderer(
View Full Code Here

        super._initializeInteraction(controller);

        if (controller instanceof ExternalIOPortController
                || controller instanceof IOPortController
                || controller instanceof RelationController) {
            Interactor interactor = controller.getNodeInteractor();

            if (interactor instanceof CompositeInteractor) {
                ((CompositeInteractor) interactor).addInteractor(_linkCreator);
            }
        }
View Full Code Here

     */
    protected void _initializeInteraction(NamedObjController controller) {
        super._initializeInteraction(controller);

        if (controller instanceof StateController) {
            Interactor interactor = controller.getNodeInteractor();

            if (interactor instanceof CompositeInteractor) {
                ((CompositeInteractor) interactor).addInteractor(_linkCreator);
            }
        }
View Full Code Here

     * one found. If the event is not consumed, repeat.
     */
    private void dispatchEventUpTree(Figure f, LayerEvent e) {
        // Scan up the tree try to dispatch the event
        while (f != null) {
            Interactor interactor = f.getInteractor();

            if (interactor != null) {
                // Set the figure source
                e.setFigureSource(f);

                if (interactor.accept(e)) {
                    // Send the event to the interactor
                    switch (e.getID()) {
                    case MouseEvent.MOUSE_DRAGGED:
                        interactor.mouseDragged(e);
                        break;

                    case MouseEvent.MOUSE_PRESSED:
                        interactor.mousePressed(e);
                        break;

                    case MouseEvent.MOUSE_RELEASED:
                        interactor.mouseReleased(e);
                        break;

                    case MouseEvent.MOUSE_CLICKED:
                        interactor.mouseClicked(e);
                        break;
                    }
                }
            }

View Full Code Here

     * (Is this the right behavior??)
     */
    private void dispatchMotionEventUpTree(Figure f, LayerEvent e) {
        // Scan up the tree try to dispatch the event
        while (f != null) {
            Interactor interactor = f.getInteractor();

            if ((interactor != null) && interactor.isMotionEnabled()) {
                // Set the figure source
                e.setFigureSource(f);

                if (interactor.accept(e)) {
                    // Send the event to the interactor
                    switch (e.getID()) {
                    case MouseEvent.MOUSE_MOVED:
                        interactor.mouseMoved(e);
                        break;

                    case MouseEvent.MOUSE_EXITED:
                        interactor.mouseExited(e);
                        break;

                    case MouseEvent.MOUSE_ENTERED:
                        interactor.mouseEntered(e);
                        break;
                    }
                }
            }

View Full Code Here

TOP

Related Classes of diva.canvas.interactor.Interactor

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.