Package nodebox.graphics

Examples of nodebox.graphics.Point


        LIBRARY = JavaLibrary.ofClass("device", DeviceFunctions.class, "mousePosition", "bufferPoints", "receiveOSC", "sendOSC",
                "audioAnalysis", "audioLogAvg", "audioWave", "beatDetect");
    }

    public static Point mousePosition(NodeContext context) {
        Point p = (Point) context.getData().get("mouse.position");
        if (p != null) {
            return p;
        } else {
            return Point.ZERO;
        }
View Full Code Here


        String comment = this.comment;
        String category = this.category;
        String description = this.description;
        String image = this.image;
        String function = this.function;
        Point position = this.position;
        ImmutableList<Port> inputs = this.inputs;
        String outputType = this.outputType;
        Port.Range outputRange = this.outputRange;
        boolean isNetwork = this.isNetwork;
        ImmutableList<Node> children = this.children;
View Full Code Here

            setVisible(isConnected("shape"));
    }


    public void draw(GraphicsContext ctx) {
        Point pt = (Point) getValue(positionName);
        drawDot(ctx, (float) pt.x, (float) pt.y);
    }
View Full Code Here

    @Override
    public boolean mousePressed(Point pt) {
        px = pt.getX();
        py = pt.getY();
        Point op = (Point) getValue(positionName);
        ox = op.x;
        oy = op.y;

        Rect hitRect = createHitRectangle(ox, oy);
        dragging = hitRect.contains(pt);
View Full Code Here

        double dx = x - px;
        double dy = y - py;
        if (dx == 0 && dy == 0) return false;
        startCombiningEdits("Set Value");
        // TODO: Temporary float fix to get a working compile. Doubles will be removed.
        silentSet(positionName, new Point((float) (ox + dx), (float) (oy + dy)));
        return true;
    }
View Full Code Here

        else
            return Point.ZERO;
    }

    public void draw(GraphicsContext ctx) {
        Point c = getCenter();
        double cx = c.x;
        double cy = c.y;
        ctx.ellipsemode(GraphicsContext.EllipseMode.CENTER);
        ctx.nofill();
        ctx.stroke(HANDLE_COLOR);
View Full Code Here

        }
    }

    @Override
    public boolean mousePressed(Point pt) {
        Point c = getCenter();
        double cx = c.x;
        double cy = c.y;
        // original angle
        oa = (Double) getValue(angleName);
        double[] xy = Geometry.coordinates(cx, cy, handleLength, oa);
View Full Code Here

    }

    @Override
    public boolean mouseDragged(Point pt) {
        if (dragState == DragState.NONE) return false;
        Point c = getCenter();
        double cx = c.x;
        double cy = c.y;
        float a = (float) Geometry.angle(cx, cy, pt.x, pt.y);
        ca = a; // current angle
        handleLength = (float) Geometry.distance(cx, cy, pt.x, pt.y);
View Full Code Here

    public void update() {
        setVisible(isConnected("shape"));
    }

    public void draw(GraphicsContext ctx) {
        Point cp = (Point) getValue(translateName);
        double x = cp.x;
        double y = cp.y;
        ctx.rectmode(GraphicsContext.RectMode.CENTER);
        Path p = new Path();
        p.setFillColor(HANDLE_COLOR);
View Full Code Here

    @Override
    public boolean mousePressed(Point pt) {
        px = pt.getX();
        py = pt.getY();

        Point cp = (Point) getValue(translateName);
        double x = ox = cp.x;
        double y = oy = cp.y;

        Rect centerRect = createHitRectangle(x, y);
        Rect horRect = createHitRectangle(x + handleLength, y);
View Full Code Here

TOP

Related Classes of nodebox.graphics.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.