Package diva.canvas.interactor

Examples of diva.canvas.interactor.BoundsManipulator$Resizer


        // Create a controller to do the work.
        controller = new BasicController(graphicsPane);
        defaultInteractor = controller.getSelectionInteractor();

        // Create a manipulator to give resize handles on figures
        BoundsManipulator figureManipulator = new BoundsManipulator();
        controller.setSelectionManipulator(figureManipulator);

        // Create the window
        BasicFrame frame = new BasicFrame("Icons 'R' us", canvas);
        frame.setSize(600, 400);
View Full Code Here


        // For each figure, create a selection interactor with
        // a drag interactor attached to it. Set a different
        // manipulator for each.
        s = new SelectionInteractor(model);
        s.setPrototypeDecorator(new BoundsManipulator());
        d = new DragInteractor();
        s.addInteractor(d);
        d.setSelectiveEnabled(true);
        d.setMouseFilter(new MouseFilter(1, 0, 0));
        selectionDragger.addSelectionInteractor(s);
View Full Code Here

        // Tell the selection dragger to select connectors too
        controller.getSelectionDragger().addSelectionInteractor(ci);

        // Create a manipulator to give resize handles on figures
        BoundsManipulator figureManipulator = new BoundsManipulator();
        controller.setSelectionManipulator(figureManipulator);

        // Make resizing reroute the connectors too
        DragInteractor j = figureManipulator.getHandleInteractor();
        j.addLayerListener(new LayerAdapter() {
            public void mouseDragged(LayerEvent e) {
                connectorA.reroute();
                connectorB.reroute();
                connectorC.reroute();
View Full Code Here

     for grab-handles.  This is typically called on the prototype
     *  to yield a decorator that gets displayed while the object
     *  is selected.
     */
    public FigureDecorator newInstance(Figure f) {
        BoundsManipulator m = new AttributeBoundsManipulator(_container);
        m.setGrabHandleFactory(this.getGrabHandleFactory());
        m.setHandleInteractor(this.getHandleInteractor());
        m.setDragInteractor(getDragInteractor());

        // FIXME: There is a bug in Diva where mouseReleased()
        // is called on the prototype that is used to create this
        // new instance, not on the new instance.  So we make
        // a record of the new instance to get access to it in
View Full Code Here

            // Translate the grab-handle, resizing the geometry
            GrabHandle g = (GrabHandle) e.getFigureSource();
            g.translate(snapped[0], snapped[1]);

            // Transform the child.
            BoundsManipulator parent = (BoundsManipulator) g.getParent();
            BoundsGeometry geometry = parent.getGeometry();

            parent.getChild().transform(
                    CanvasUtilities.computeTransform(parent.getChild()
                            .getBounds(), geometry.getBounds()));
        }
View Full Code Here

        // Create a controller to do the work.
        BasicController controller = new BasicController(graphicsPane);
        SelectionInteractor defaultInteractor = controller
                .getSelectionInteractor();
        BoundsManipulator manip = new BoundsManipulator();
        defaultInteractor.setPrototypeDecorator(manip);

        // Create a simple Vector Figure that draws a cross
        VectorFigure one = new VectorFigure();
        one.add(new Line2D.Double(0.0, 0.0, 100.0, 100.0));
View Full Code Here

        // Create a controller to do the work.
        BasicController controller = new BasicController(graphicsPane);
        SelectionInteractor defaultInteractor = controller
                .getSelectionInteractor();
        BoundsManipulator manip = new BoundsManipulator();
        defaultInteractor.setPrototypeDecorator(manip);

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

    /**
     * Make an Interactor for figures that may be selected, resized and moved.
     */
    private void _makeSelectionInteractor() {
        BoundsManipulator boundsManipulator = new BoundsManipulator();
        boundsManipulator.getHandleInteractor().addLayerListener(new LayerAdapter() {

            public void mouseReleased(LayerEvent e) {
                Figure fig = e.getFigureSource();
                if (fig instanceof CanvasFigure) {
                    ((CanvasFigure) fig).fireCanvasFigureEvent(CanvasFigure.RESIZED);
View Full Code Here

TOP

Related Classes of diva.canvas.interactor.BoundsManipulator$Resizer

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.