当前位置: 首页>>代码示例>>Java>>正文


Java Curve.rectCrossingsForPath方法代码示例

本文整理汇总了Java中sun.awt.geom.Curve.rectCrossingsForPath方法的典型用法代码示例。如果您正苦于以下问题:Java Curve.rectCrossingsForPath方法的具体用法?Java Curve.rectCrossingsForPath怎么用?Java Curve.rectCrossingsForPath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sun.awt.geom.Curve的用法示例。


在下文中一共展示了Curve.rectCrossingsForPath方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: contains

import sun.awt.geom.Curve; //导入方法依赖的package包/类
/**
 * Tests if the specified rectangular area is entirely inside the
 * closed boundary of the specified {@link PathIterator}.
 * <p>
 * This method provides a basic facility for implementors of
 * the {@link Shape} interface to implement support for the
 * {@link Shape#contains(double, double, double, double)} method.
 * <p>
 * This method object may conservatively return false in
 * cases where the specified rectangular area intersects a
 * segment of the path, but that segment does not represent a
 * boundary between the interior and exterior of the path.
 * Such segments could lie entirely within the interior of the
 * path if they are part of a path with a {@link #WIND_NON_ZERO}
 * winding rule or if the segments are retraced in the reverse
 * direction such that the two sets of segments cancel each
 * other out without any exterior area falling between them.
 * To determine whether segments represent true boundaries of
 * the interior of the path would require extensive calculations
 * involving all of the segments of the path and the winding
 * rule and are thus beyond the scope of this implementation.
 *
 * @param pi the specified {@code PathIterator}
 * @param x the specified X coordinate
 * @param y the specified Y coordinate
 * @param w the width of the specified rectangular area
 * @param h the height of the specified rectangular area
 * @return {@code true} if the specified {@code PathIterator} contains
 *         the specified rectangular area; {@code false} otherwise.
 * @since 1.6
 */
public static boolean contains(PathIterator pi,
                               double x, double y, double w, double h)
{
    if (java.lang.Double.isNaN(x+w) || java.lang.Double.isNaN(y+h)) {
        /* [xy]+[wh] is NaN if any of those values are NaN,
         * or if adding the two together would produce NaN
         * by virtue of adding opposing Infinte values.
         * Since we need to add them below, their sum must
         * not be NaN.
         * We return false because NaN always produces a
         * negative response to tests
         */
        return false;
    }
    if (w <= 0 || h <= 0) {
        return false;
    }
    int mask = (pi.getWindingRule() == WIND_NON_ZERO ? -1 : 2);
    int crossings = Curve.rectCrossingsForPath(pi, x, y, x+w, y+h);
    return (crossings != Curve.RECT_INTERSECTS &&
            (crossings & mask) != 0);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:54,代码来源:Path2D.java

示例2: intersects

import sun.awt.geom.Curve; //导入方法依赖的package包/类
/**
 * Tests if the interior of the specified {@link PathIterator}
 * intersects the interior of a specified set of rectangular
 * coordinates.
 * <p>
 * This method provides a basic facility for implementors of
 * the {@link Shape} interface to implement support for the
 * {@link Shape#intersects(double, double, double, double)} method.
 * <p>
 * This method object may conservatively return true in
 * cases where the specified rectangular area intersects a
 * segment of the path, but that segment does not represent a
 * boundary between the interior and exterior of the path.
 * Such a case may occur if some set of segments of the
 * path are retraced in the reverse direction such that the
 * two sets of segments cancel each other out without any
 * interior area between them.
 * To determine whether segments represent true boundaries of
 * the interior of the path would require extensive calculations
 * involving all of the segments of the path and the winding
 * rule and are thus beyond the scope of this implementation.
 *
 * @param pi the specified {@code PathIterator}
 * @param x the specified X coordinate
 * @param y the specified Y coordinate
 * @param w the width of the specified rectangular coordinates
 * @param h the height of the specified rectangular coordinates
 * @return {@code true} if the specified {@code PathIterator} and
 *         the interior of the specified set of rectangular
 *         coordinates intersect each other; {@code false} otherwise.
 * @since 1.6
 */
public static boolean intersects(PathIterator pi,
                                 double x, double y, double w, double h)
{
    if (java.lang.Double.isNaN(x+w) || java.lang.Double.isNaN(y+h)) {
        /* [xy]+[wh] is NaN if any of those values are NaN,
         * or if adding the two together would produce NaN
         * by virtue of adding opposing Infinte values.
         * Since we need to add them below, their sum must
         * not be NaN.
         * We return false because NaN always produces a
         * negative response to tests
         */
        return false;
    }
    if (w <= 0 || h <= 0) {
        return false;
    }
    int mask = (pi.getWindingRule() == WIND_NON_ZERO ? -1 : 2);
    int crossings = Curve.rectCrossingsForPath(pi, x, y, x+w, y+h);
    return (crossings == Curve.RECT_INTERSECTS ||
            (crossings & mask) != 0);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:55,代码来源:Path2D.java

示例3: contains

import sun.awt.geom.Curve; //导入方法依赖的package包/类
/**
    * Tests if the specified rectangular area is entirely inside the
    * closed boundary of the specified {@link PathIterator}.
    * <p>
    * This method provides a basic facility for implementors of
    * the {@link Shape} interface to implement support for the
    * {@link Shape#contains(double, double, double, double)} method.
    * <p>
    * This method object may conservatively return false in
    * cases where the specified rectangular area intersects a
    * segment of the path, but that segment does not represent a
    * boundary between the interior and exterior of the path.
    * Such segments could lie entirely within the interior of the
    * path if they are part of a path with a {@link #WIND_NON_ZERO}
    * winding rule or if the segments are retraced in the reverse
    * direction such that the two sets of segments cancel each
    * other out without any exterior area falling between them.
    * To determine whether segments represent true boundaries of
    * the interior of the path would require extensive calculations
    * involving all of the segments of the path and the winding
    * rule and are thus beyond the scope of this implementation.
    *
    * @param pi the specified {@code PathIterator}
    * @param x the specified X coordinate
    * @param y the specified Y coordinate
    * @param w the width of the specified rectangular area
    * @param h the height of the specified rectangular area
    * @return {@code true} if the specified {@code PathIterator} contains
    *         the specified rectangluar area; {@code false} otherwise.
    * @since 1.6
    */
   public static boolean contains(PathIterator pi,
                                  double x, double y, double w, double h)
   {
       if (java.lang.Double.isNaN(x+w) || java.lang.Double.isNaN(y+h)) {
           /* [xy]+[wh] is NaN if any of those values are NaN,
            * or if adding the two together would produce NaN
            * by virtue of adding opposing Infinte values.
            * Since we need to add them below, their sum must
            * not be NaN.
            * We return false because NaN always produces a
            * negative response to tests
            */
           return false;
       }
       if (w <= 0 || h <= 0) {
           return false;
       }
       int mask = (pi.getWindingRule() == WIND_NON_ZERO ? -1 : 2);
int crossings = Curve.rectCrossingsForPath(pi, x, y, x+w, y+h);
return (crossings != Curve.RECT_INTERSECTS &&
               (crossings & mask) != 0);
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:54,代码来源:Path2D.java

示例4: intersects

import sun.awt.geom.Curve; //导入方法依赖的package包/类
/**
    * Tests if the interior of the specified {@link PathIterator}
    * intersects the interior of a specified set of rectangular
    * coordinates.
    * <p>
    * This method provides a basic facility for implementors of
    * the {@link Shape} interface to implement support for the
    * {@link Shape#intersects(double, double, double, double)} method.
    * <p>
    * This method object may conservatively return true in
    * cases where the specified rectangular area intersects a
    * segment of the path, but that segment does not represent a
    * boundary between the interior and exterior of the path.
    * Such a case may occur if some set of segments of the
    * path are retraced in the reverse direction such that the
    * two sets of segments cancel each other out without any
    * interior area between them.
    * To determine whether segments represent true boundaries of
    * the interior of the path would require extensive calculations
    * involving all of the segments of the path and the winding
    * rule and are thus beyond the scope of this implementation.
    *
    * @param pi the specified {@code PathIterator}
    * @param x the specified X coordinate
    * @param y the specified Y coordinate
    * @param w the width of the specified rectangular coordinates
    * @param h the height of the specified rectangular coordinates
    * @return {@code true} if the specified {@code PathIterator} and
    *         the interior of the specified set of rectangular
    *         coordinates intersect each other; {@code false} otherwise.
    * @since 1.6
    */
   public static boolean intersects(PathIterator pi,
                                    double x, double y, double w, double h)
   {
       if (java.lang.Double.isNaN(x+w) || java.lang.Double.isNaN(y+h)) {
           /* [xy]+[wh] is NaN if any of those values are NaN,
            * or if adding the two together would produce NaN
            * by virtue of adding opposing Infinte values.
            * Since we need to add them below, their sum must
            * not be NaN.
            * We return false because NaN always produces a
            * negative response to tests
            */
           return false;
       }
       if (w <= 0 || h <= 0) {
           return false;
       }
       int mask = (pi.getWindingRule() == WIND_NON_ZERO ? -1 : 2);
int crossings = Curve.rectCrossingsForPath(pi, x, y, x+w, y+h);
return (crossings == Curve.RECT_INTERSECTS ||
               (crossings & mask) != 0);
   }
 
开发者ID:jgaltidor,项目名称:VarJ,代码行数:55,代码来源:Path2D.java

示例5: contains

import sun.awt.geom.Curve; //导入方法依赖的package包/类
/**
 * Tests if the specified rectangular area is entirely inside the
 * closed boundary of the specified {@link PathIterator}.
 * <p>
 * This method provides a basic facility for implementors of
 * the {@link Shape} interface to implement support for the
 * {@link Shape#contains(double, double, double, double)} method.
 * <p>
 * This method object may conservatively return false in
 * cases where the specified rectangular area intersects a
 * segment of the path, but that segment does not represent a
 * boundary between the interior and exterior of the path.
 * Such segments could lie entirely within the interior of the
 * path if they are part of a path with a {@link #WIND_NON_ZERO}
 * winding rule or if the segments are retraced in the reverse
 * direction such that the two sets of segments cancel each
 * other out without any exterior area falling between them.
 * To determine whether segments represent true boundaries of
 * the interior of the path would require extensive calculations
 * involving all of the segments of the path and the winding
 * rule and are thus beyond the scope of this implementation.
 *
 * @param pi the specified {@code PathIterator}
 * @param x the specified X coordinate
 * @param y the specified Y coordinate
 * @param w the width of the specified rectangular area
 * @param h the height of the specified rectangular area
 * @return {@code true} if the specified {@code PathIterator} contains
 *         the specified rectangluar area; {@code false} otherwise.
 * @since 1.6
 */
public static boolean contains(PathIterator pi,
                               double x, double y, double w, double h)
{
    if (java.lang.Double.isNaN(x+w) || java.lang.Double.isNaN(y+h)) {
        /* [xy]+[wh] is NaN if any of those values are NaN,
         * or if adding the two together would produce NaN
         * by virtue of adding opposing Infinte values.
         * Since we need to add them below, their sum must
         * not be NaN.
         * We return false because NaN always produces a
         * negative response to tests
         */
        return false;
    }
    if (w <= 0 || h <= 0) {
        return false;
    }
    int mask = (pi.getWindingRule() == WIND_NON_ZERO ? -1 : 2);
    int crossings = Curve.rectCrossingsForPath(pi, x, y, x+w, y+h);
    return (crossings != Curve.RECT_INTERSECTS &&
            (crossings & mask) != 0);
}
 
开发者ID:ZhaoX,项目名称:jdk-1.7-annotated,代码行数:54,代码来源:Path2D.java


注:本文中的sun.awt.geom.Curve.rectCrossingsForPath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。