Examples of JCanvas


Examples of diva.canvas.JCanvas

        GraphicsPane pane = new GraphicsPane();
        _layer = pane.getForegroundLayer();
        _overlayLayer = new OverlayLayer();

        _canvas = new JCanvas(pane);

        _container.add("Center", _canvas);
        _canvas.setMinimumSize(new Dimension(horizontalDimension,
                verticalDimension));
        _canvas.setMaximumSize(new Dimension(horizontalDimension,
View Full Code Here

Examples of diva.canvas.JCanvas

    /** Zoom in or out to magnify by the specified factor, from the current
     *  magnification.
     *  @param factor The magnification factor (relative to 1.0).
     */
    public void zoom(double factor) {
        JCanvas canvas = getJGraph().getGraphPane().getCanvas();
        AffineTransform current = canvas.getCanvasPane().getTransformContext()
                .getTransform();

        // Save the center, so we remember what we were looking at.
        Point2D center = getCenter();
        current.scale(factor, factor);
        canvas.getCanvasPane().setTransform(current);

        // Reset the center.
        setCenter(center);

        if (_graphPanner != null) {
View Full Code Here

Examples of diva.canvas.JCanvas

        }

        Rectangle2D viewSize = getVisibleRectangle();
        AffineTransform newTransform = CanvasUtilities.computeFitTransform(
                bounds, viewSize);
        JCanvas canvas = pane.getCanvas();
        canvas.getCanvasPane().setTransform(newTransform);

        if (_graphPanner != null) {
            _graphPanner.repaint();
        }
    }
View Full Code Here

Examples of diva.canvas.JCanvas

    }

    /** Set zoom to the nominal.
     */
    public void zoomReset() {
        JCanvas canvas = getJGraph().getGraphPane().getCanvas();
        AffineTransform current = canvas.getCanvasPane().getTransformContext()
                .getTransform();
        current.setToIdentity();
        canvas.getCanvasPane().setTransform(current);

        if (_graphPanner != null) {
            _graphPanner.repaint();
        }
    }
View Full Code Here

Examples of diva.canvas.JCanvas

            }

            size.recordSize(_getRightComponent());

            // Also record zoom and pan state.
            JCanvas canvas = getJGraph().getGraphPane().getCanvas();
            AffineTransform current = canvas.getCanvasPane()
                    .getTransformContext().getTransform();

            // We assume the scaling in the X and Y directions are the same.
            double scale = current.getScaleX();
            Parameter zoom = (Parameter) getModel().getAttribute(
View Full Code Here

Examples of diva.canvas.JCanvas

    /** Set zoom to the nominal.  This overrides the base class to set
     *  a zoom factor and center more appropriate for editing icons.
     */
    public void zoomReset() {
        JCanvas canvas = getJGraph().getGraphPane().getCanvas();
        AffineTransform current = canvas.getCanvasPane().getTransformContext()
                .getTransform();
        current.setToScale(_ZOOM_SCALE, _ZOOM_SCALE);
        canvas.getCanvasPane().setTransform(current);
        setCenter(new Point2D.Double(0.0, 0.0));

        if (_graphPanner != null) {
            _graphPanner.repaint();
        }
View Full Code Here

Examples of diva.canvas.JCanvas

                            _PADDING, size.getWidth() - 2 * _PADDING, size
                                    .getHeight()
                                    - 2 * _PADDING);
                    AffineTransform newTransform = CanvasUtilities
                            .computeFitTransform(bounds, viewSize);
                    JCanvas canvas = graphPane.getCanvas();
                    canvas.getCanvasPane().setTransform(newTransform);
                }
            }
        };
        SwingUtilities.invokeLater(defer);
    }
View Full Code Here

Examples of diva.canvas.JCanvas

    Interactor defaultInteractor;

    /** Create a JCanvas and put it into a window
     */
    public LabelTutorial() {
        canvas = new JCanvas();
        graphicsPane = (GraphicsPane) canvas.getCanvasPane();

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

Examples of diva.canvas.JCanvas

    private GraphicsPane graphicsPane;

    /** Create a JCanvas and put it into a window.
     */
    public VectorFigureTutorial() {
        canvas = new JCanvas();
        graphicsPane = (GraphicsPane) canvas.getCanvasPane();
        createFigures();

        new BasicFrame("Vector figure tutorial", canvas);
    }
View Full Code Here

Examples of diva.canvas.JCanvas

    private GraphicsPane graphicsPane;

    /** Create a JCanvas and put it into a window.
     */
    public FigureTutorial() {
        canvas = new JCanvas();
        graphicsPane = (GraphicsPane) canvas.getCanvasPane();
        createFigures();

        new BasicFrame("Figure tutorial", canvas);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.