jdk/src/share/classes/java/awt/geom/PathIterator.java
changeset 16734 da1901d79073
parent 12813 c10ab96dcf41
equal deleted inserted replaced
16733:9267ec7004a1 16734:da1901d79073
     1 /*
     1 /*
     2  * Copyright (c) 1997, 2000, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.  Oracle designates this
     7  * published by the Free Software Foundation.  Oracle designates this
    23  * questions.
    23  * questions.
    24  */
    24  */
    25 
    25 
    26 package java.awt.geom;
    26 package java.awt.geom;
    27 
    27 
    28 import javax.tools.annotation.GenerateNativeHeader;
    28 import java.lang.annotation.Native;
    29 
    29 
    30 /**
    30 /**
    31  * The <code>PathIterator</code> interface provides the mechanism
    31  * The <code>PathIterator</code> interface provides the mechanism
    32  * for objects that implement the {@link java.awt.Shape Shape}
    32  * for objects that implement the {@link java.awt.Shape Shape}
    33  * interface to return the geometry of their boundary by allowing
    33  * interface to return the geometry of their boundary by allowing
    57  * @see java.awt.Shape
    57  * @see java.awt.Shape
    58  * @see java.awt.BasicStroke
    58  * @see java.awt.BasicStroke
    59  *
    59  *
    60  * @author Jim Graham
    60  * @author Jim Graham
    61  */
    61  */
    62 /* No native methods here, but the constants are needed in the supporting JNI code */
       
    63 @GenerateNativeHeader
       
    64 public interface PathIterator {
    62 public interface PathIterator {
    65     /**
    63     /**
    66      * The winding rule constant for specifying an even-odd rule
    64      * The winding rule constant for specifying an even-odd rule
    67      * for determining the interior of a path.
    65      * for determining the interior of a path.
    68      * The even-odd rule specifies that a point lies inside the
    66      * The even-odd rule specifies that a point lies inside the
    69      * path if a ray drawn in any direction from that point to
    67      * path if a ray drawn in any direction from that point to
    70      * infinity is crossed by path segments an odd number of times.
    68      * infinity is crossed by path segments an odd number of times.
    71      */
    69      */
    72     public static final int WIND_EVEN_ODD       = 0;
    70     @Native public static final int WIND_EVEN_ODD       = 0;
    73 
    71 
    74     /**
    72     /**
    75      * The winding rule constant for specifying a non-zero rule
    73      * The winding rule constant for specifying a non-zero rule
    76      * for determining the interior of a path.
    74      * for determining the interior of a path.
    77      * The non-zero rule specifies that a point lies inside the
    75      * The non-zero rule specifies that a point lies inside the
    78      * path if a ray drawn in any direction from that point to
    76      * path if a ray drawn in any direction from that point to
    79      * infinity is crossed by path segments a different number
    77      * infinity is crossed by path segments a different number
    80      * of times in the counter-clockwise direction than the
    78      * of times in the counter-clockwise direction than the
    81      * clockwise direction.
    79      * clockwise direction.
    82      */
    80      */
    83     public static final int WIND_NON_ZERO       = 1;
    81     @Native public static final int WIND_NON_ZERO       = 1;
    84 
    82 
    85     /**
    83     /**
    86      * The segment type constant for a point that specifies the
    84      * The segment type constant for a point that specifies the
    87      * starting location for a new subpath.
    85      * starting location for a new subpath.
    88      */
    86      */
    89     public static final int SEG_MOVETO          = 0;
    87     @Native public static final int SEG_MOVETO          = 0;
    90 
    88 
    91     /**
    89     /**
    92      * The segment type constant for a point that specifies the
    90      * The segment type constant for a point that specifies the
    93      * end point of a line to be drawn from the most recently
    91      * end point of a line to be drawn from the most recently
    94      * specified point.
    92      * specified point.
    95      */
    93      */
    96     public static final int SEG_LINETO          = 1;
    94     @Native public static final int SEG_LINETO          = 1;
    97 
    95 
    98     /**
    96     /**
    99      * The segment type constant for the pair of points that specify
    97      * The segment type constant for the pair of points that specify
   100      * a quadratic parametric curve to be drawn from the most recently
    98      * a quadratic parametric curve to be drawn from the most recently
   101      * specified point.
    99      * specified point.
   113      *               = C(n,m) * t^(m) * (1 - t)^(n-m)
   111      *               = C(n,m) * t^(m) * (1 - t)^(n-m)
   114      *        C(n,m) = Combinations of n things, taken m at a time
   112      *        C(n,m) = Combinations of n things, taken m at a time
   115      *               = n! / (m! * (n-m)!)
   113      *               = n! / (m! * (n-m)!)
   116      * </pre>
   114      * </pre>
   117      */
   115      */
   118     public static final int SEG_QUADTO          = 2;
   116     @Native public static final int SEG_QUADTO          = 2;
   119 
   117 
   120     /**
   118     /**
   121      * The segment type constant for the set of 3 points that specify
   119      * The segment type constant for the set of 3 points that specify
   122      * a cubic parametric curve to be drawn from the most recently
   120      * a cubic parametric curve to be drawn from the most recently
   123      * specified point.
   121      * specified point.
   137      *        C(n,m) = Combinations of n things, taken m at a time
   135      *        C(n,m) = Combinations of n things, taken m at a time
   138      *               = n! / (m! * (n-m)!)
   136      *               = n! / (m! * (n-m)!)
   139      * </pre>
   137      * </pre>
   140      * This form of curve is commonly known as a B&eacute;zier curve.
   138      * This form of curve is commonly known as a B&eacute;zier curve.
   141      */
   139      */
   142     public static final int SEG_CUBICTO         = 3;
   140     @Native public static final int SEG_CUBICTO         = 3;
   143 
   141 
   144     /**
   142     /**
   145      * The segment type constant that specifies that
   143      * The segment type constant that specifies that
   146      * the preceding subpath should be closed by appending a line segment
   144      * the preceding subpath should be closed by appending a line segment
   147      * back to the point corresponding to the most recent SEG_MOVETO.
   145      * back to the point corresponding to the most recent SEG_MOVETO.
   148      */
   146      */
   149     public static final int SEG_CLOSE           = 4;
   147     @Native public static final int SEG_CLOSE           = 4;
   150 
   148 
   151     /**
   149     /**
   152      * Returns the winding rule for determining the interior of the
   150      * Returns the winding rule for determining the interior of the
   153      * path.
   151      * path.
   154      * @return the winding rule.
   152      * @return the winding rule.