Documentation of 'kcl.waterloo.marker.ShapeUtils' Java class
ShapeUtils
kcl.waterloo.marker

Class ShapeUtils



  • public class ShapeUtils
    extends java.lang.Object
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method and Description
      static boolean contains(java.awt.Shape s1, java.awt.Shape s2)
      Tests whether shape s2 lays within shape s1.
      static double getArea(java.awt.Shape s)
      Returns a numerical estimate of the area of a shape.
      static java.awt.geom.Point2D.Double getCentroid(java.awt.Shape s)
      Returns a numerical estimate of the centroid (center of mass) of the specified Shape.
      static double[] getFlattenedX(java.awt.Shape s) 
      static double[] getFlattenedX(java.awt.Shape s, double flatness) 
      static GJXYSeries getFlattenedXY(java.awt.Shape s) 
      static GJXYSeries getFlattenedXY(java.awt.Shape s, double flatness) 
      static double[] getFlattenedY(java.awt.Shape s) 
      static double[] getFlattenedY(java.awt.Shape s, double flatness) 
      static java.awt.geom.Path2D getFromX(GJGraphInterface gr, java.awt.Shape p, double y) 
      static java.awt.geom.Path2D getFromY(GJGraphInterface gr, java.awt.Shape p, double x) 
      static java.awt.geom.Path2D getFromZeroX(GJGraphInterface gr, java.awt.Shape p) 
      static java.awt.geom.Path2D getFromZeroY(GJGraphInterface gr, java.awt.Shape p, double x) 
      static java.util.ArrayList<GJPathSegmentInfo> getSegments(java.awt.Shape p) 
      static double[] getStringLocationToArc(double[] xy, double theta, java.lang.String s, java.awt.FontMetrics metrics) 
      static double[] getX(java.awt.Shape s) 
      static GJXYSeries getXY(java.awt.Shape s) 
      static double[] getXYOnArc(java.awt.geom.Ellipse2D arc0, java.awt.geom.Ellipse2D arc1, double theta)
      Given an arc, arc0 and an angle theta, getXYOnArc returns the XY coordinates for the intersection of theta on the second arc, arc1.
      static double[] getY(java.awt.Shape s) 
      static boolean intersects(java.awt.Shape s1, java.awt.Shape s2)
      Tests whether shape s2 lays within shape s1.
      static boolean isClosed(java.awt.Shape s) 
      static double sumdX(java.awt.Shape s) 
      static java.lang.String toString(java.awt.Shape s) 
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • getSegments

        public static java.util.ArrayList<GJPathSegmentInfo> getSegments(java.awt.Shape p)
      • getXY

        public static GJXYSeries getXY(java.awt.Shape s)
      • getX

        public static double[] getX(java.awt.Shape s)
      • getFlattenedXY

        public static GJXYSeries getFlattenedXY(java.awt.Shape s)
      • getFlattenedXY

        public static GJXYSeries getFlattenedXY(java.awt.Shape s,
                                                double flatness)
      • getFlattenedX

        public static double[] getFlattenedX(java.awt.Shape s)
      • getFlattenedX

        public static double[] getFlattenedX(java.awt.Shape s,
                                             double flatness)
      • getY

        public static double[] getY(java.awt.Shape s)
      • getFlattenedY

        public static double[] getFlattenedY(java.awt.Shape s)
      • getFlattenedY

        public static double[] getFlattenedY(java.awt.Shape s,
                                             double flatness)
      • getFromZeroX

        public static java.awt.geom.Path2D getFromZeroX(GJGraphInterface gr,
                                                        java.awt.Shape p)
      • getFromX

        public static java.awt.geom.Path2D getFromX(GJGraphInterface gr,
                                                    java.awt.Shape p,
                                                    double y)
      • getFromZeroY

        public static java.awt.geom.Path2D getFromZeroY(GJGraphInterface gr,
                                                        java.awt.Shape p,
                                                        double x)
      • getFromY

        public static java.awt.geom.Path2D getFromY(GJGraphInterface gr,
                                                    java.awt.Shape p,
                                                    double x)
      • getArea

        public static double getArea(java.awt.Shape s)
        Returns a numerical estimate of the area of a shape.
        Parameters:
        s - a Shape
        Returns:
        the area.
      • getCentroid

        public static java.awt.geom.Point2D.Double getCentroid(java.awt.Shape s)
        Returns a numerical estimate of the centroid (center of mass) of the specified Shape.
        Parameters:
        s - a Shape object
        Returns:
        the estimate as a Point2d.Double instance.
      • contains

        public static boolean contains(java.awt.Shape s1,
                                       java.awt.Shape s2)
        Tests whether shape s2 lays within shape s1.
        Parameters:
        s1 - a Shape
        s2 - a Shape
        Returns:
        true if s2 lies within s1.
      • intersects

        public static boolean intersects(java.awt.Shape s1,
                                         java.awt.Shape s2)
        Tests whether shape s2 lays within shape s1.
        Parameters:
        s1 - a Shape
        s2 - a Shape
        Returns:
        true if s2 lies within s1.
      • sumdX

        public static double sumdX(java.awt.Shape s)
      • isClosed

        public static boolean isClosed(java.awt.Shape s)
      • toString

        public static java.lang.String toString(java.awt.Shape s)
      • getXYOnArc

        public static double[] getXYOnArc(java.awt.geom.Ellipse2D arc0,
                                          java.awt.geom.Ellipse2D arc1,
                                          double theta)
        Given an arc, arc0 and an angle theta, getXYOnArc returns the XY coordinates for the intersection of theta on the second arc, arc1.
        Parameters:
        arc0 -
        arc1 -
        theta -
        Returns:
      • getStringLocationToArc

        public static double[] getStringLocationToArc(double[] xy,
                                                      double theta,
                                                      java.lang.String s,
                                                      java.awt.FontMetrics metrics)

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.