Package edu.uci.ics.jung.visualization.transform

Examples of edu.uci.ics.jung.visualization.transform.LensTransformer


     * @param transformer
     * @param point
     */
    private void setViewCenter(MutableTransformer transformer, Point2D point) {
        if(transformer instanceof LensTransformer) {
            LensTransformer ht =
                (LensTransformer)transformer;
            ht.setViewCenter(point);
        }
    }
View Full Code Here


     * @param transformer
     * @param point
     */
    private void setViewRadius(MutableTransformer transformer, Point2D point) {
        if(transformer instanceof LensTransformer) {
            LensTransformer ht =
                (LensTransformer)transformer;
            double distanceFromCenter = ht.getDistanceFromCenter(point);
            ht.setViewRadius(distanceFromCenter+edgeOffset);
        }
    }
View Full Code Here

     * @param transformer
     * @param point
     */
    private void testViewCenter(MutableTransformer transformer, Point2D point) {
        if(transformer instanceof LensTransformer) {
            LensTransformer ht =
                (LensTransformer)transformer;
            double distanceFromCenter = ht.getDistanceFromCenter(point);
            if(distanceFromCenter < 10) {
                ht.setViewCenter(point);
                dragOnLens = true;
            } else if(Math.abs(distanceFromCenter - ht.getViewRadius()) < 10) {
                edgeOffset = ht.getViewRadius() - distanceFromCenter;
                ht.setViewRadius(distanceFromCenter+edgeOffset);
                dragOnEdge = true;
            }
        }
    }
View Full Code Here

        return (e.getModifiers() & modifiers) != 0;
    }

    private void changeMagnification(MutableTransformer transformer, float delta) {
        if(transformer instanceof LensTransformer) {
            LensTransformer ht = (LensTransformer)transformer;
            float magnification = ht.getMagnification() + delta;
            magnification = Math.max(floor, magnification);
            magnification = Math.min(magnification, ceiling);
            ht.setMagnification(magnification);
        }
    }
View Full Code Here

        float y2 = (float) p2.getY();
       
        float flatness = 0;
        MutableTransformer transformer = rc.getMultiLayerTransformer().getTransformer(Layer.VIEW);
        if(transformer instanceof LensTransformer) {
            LensTransformer ht = (LensTransformer)transformer;
            RectangularShape lensShape = ht.getLensShape();
            if(lensShape.contains(x1,y1) || lensShape.contains(x2,y2)) {
                flatness = .05f;
            }
        }
View Full Code Here

TOP

Related Classes of edu.uci.ics.jung.visualization.transform.LensTransformer

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.