returns the starting point of "path" - Java 2D Graphics

Java examples for 2D Graphics:Path

Description

returns the starting point of "path"

Demo Code


//package com.java2s;
import java.awt.geom.PathIterator;
import java.awt.geom.GeneralPath;
import java.awt.geom.Point2D;

public class Main {
    /** returns the starting point of "path" */
    public static Point2D getStartOfPath(GeneralPath path) {
        double seg[] = new double[6];
        PathIterator pi = path.getPathIterator(null);
        int segType = pi.currentSegment(seg);
        return (new Point2D.Double(seg[0], seg[1]));
    }//from   w  ww  . ja  v  a  2 s .  c o m
}

Related Tutorials