Package org.apache.harmony.awt.geom

Examples of org.apache.harmony.awt.geom.IntersectPoint


                                                       intersectPoints.length];
        int resultCoordPos = 0;
        int resultRulesPos = 0;
        boolean isCurrentArea = true;

        IntersectPoint point = intersectPoints[0];
        resultRules[resultRulesPos] = PathIterator.SEG_MOVETO;
        resultOffsets[resultRulesPos++] = resultCoordPos;
       
        do {
          resultCoords[resultCoordPos++] = point.getX();
            resultCoords[resultCoordPos++] = point.getY();
            int curIndex = point.getEndIndex(true);
           
            if (curIndex < 0) {
              isCurrentArea = !isCurrentArea;
            } else if (area.containsExact(coords[2 * curIndex],
                                      coords[2 * curIndex + 1]) > 0) {
              isCurrentArea = false;
            } else {
              isCurrentArea = true;
            }

            IntersectPoint nextPoint = getNextIntersectPoint(intersectPoints,
                                                             point,
                                                             isCurrentArea);
            double[] coords = (isCurrentArea) ? this.coords : area.coords;
            int[] offsets = (isCurrentArea) ? this.offsets : area.offsets;
            int[] rules = (isCurrentArea) ? this.rules : area.rules;
            int offset = point.getRuleIndex(isCurrentArea);
            boolean isCopyUntilZero = false;
           
            if ((point.getRuleIndex(isCurrentArea) >
                    nextPoint.getRuleIndex(isCurrentArea))) {
              int rulesSize = (isCurrentArea) ? this.rulesSize :
                                              area.rulesSize;
              resultCoordPos = includeCoordsAndRules(offset + 1, rulesSize,
                                                 rules, offsets,
                                                 resultRules,
                                                 resultOffsets,
                                                 resultCoords, coords,
                                                 resultRulesPos,
                                                 resultCoordPos,
                                                 point, isCurrentArea,
                                                 false, 0);
              resultRulesPos += rulesSize - offset - 1;
              offset = 1;
              isCopyUntilZero = true;
            }
           
            int length = nextPoint.getRuleIndex(isCurrentArea) - offset + 1;
           
            if (isCopyUntilZero) {
              offset = 0;
            }
           
View Full Code Here


                                                       intersectPoints.length];
        int resultCoordPos = 0;
        int resultRulesPos = 0;
        boolean isCurrentArea = true;

        IntersectPoint point = intersectPoints[0];
        resultRules[resultRulesPos] = PathIterator.SEG_MOVETO;
        resultOffsets[resultRulesPos++] = resultCoordPos;
       
        do {
          resultCoords[resultCoordPos++] = point.getX();
            resultCoords[resultCoordPos++] = point.getY();
            resultRules[resultRulesPos] = PathIterator.SEG_LINETO;
            resultOffsets[resultRulesPos++] = resultCoordPos - 2;
            int curIndex = point.getEndIndex(true);
            if (curIndex < 0) {
              isCurrentArea = !isCurrentArea;
            } else if (area.containsExact(coords[2 * curIndex],
                                      coords[2 * curIndex + 1]) > 0) {
              isCurrentArea = false;
            } else {
              isCurrentArea = true;
            }

            IntersectPoint nextPoint = getNextIntersectPoint(intersectPoints,
                                                         point,
                                                         isCurrentArea);
            double[] coords = (isCurrentArea) ? this.coords : area.coords;
            int offset = 2 * point.getEndIndex(isCurrentArea);
            if ((offset >= 0) &&
                  (nextPoint.getBegIndex(isCurrentArea) <
                    point.getEndIndex(isCurrentArea))) {
                int coordSize = (isCurrentArea) ? this.coordsSize :
                                                area.coordsSize;
                int length = coordSize - offset;
                System.arraycopy(coords, offset,
                             resultCoords, resultCoordPos, length);
               
                for (int i = 0; i < length / 2; i++) {
                  resultRules[resultRulesPos] = PathIterator.SEG_LINETO;
                  resultOffsets[resultRulesPos++] = resultCoordPos;
                  resultCoordPos += 2;
                }
               
                offset = 0;
            }
           
            if (offset >= 0) {
                int length = 2 * nextPoint.getBegIndex(isCurrentArea) - offset + 2;
                System.arraycopy(coords, offset,
                             resultCoords, resultCoordPos, length);
           
                for (int i = 0; i < length / 2; i++) {
                  resultRules[resultRulesPos] = PathIterator.SEG_LINETO;
View Full Code Here

                                                       intersectPoints.length];
        int resultCoordPos = 0;
        int resultRulesPos = 0;
        boolean isCurrentArea = true;

        IntersectPoint point = intersectPoints[0];
        IntersectPoint nextPoint = intersectPoints[0];
        resultRules[resultRulesPos] = PathIterator.SEG_MOVETO;
        resultOffsets[resultRulesPos++] = resultCoordPos;
       
        do {
          resultCoords[resultCoordPos++] = point.getX();
            resultCoords[resultCoordPos++] = point.getY();
            int curIndex = point.getEndIndex(true);
            if ((curIndex < 0) || (area.containsExact(
                coords[2 * curIndex], coords[2 * curIndex + 1]) == 0)) {
              isCurrentArea = !isCurrentArea;
            } else if (area.containsExact(coords[2 * curIndex],
                                      coords[2 * curIndex + 1]) > 0) {
              isCurrentArea = true;
            } else {
              isCurrentArea = false;
            }
           
            nextPoint = getNextIntersectPoint(intersectPoints, point, isCurrentArea);
            double[] coords = (isCurrentArea) ? this.coords : area.coords;
            int[] offsets = (isCurrentArea) ? this.offsets : area.offsets;
            int[] rules = (isCurrentArea) ? this.rules : area.rules;
            int offset = point.getRuleIndex(isCurrentArea);
            boolean isCopyUntilZero = false;
           
            if (point.getRuleIndex(isCurrentArea) >
                    nextPoint.getRuleIndex(isCurrentArea)) {
              int rulesSize = (isCurrentArea) ? this.rulesSize :
                                              area.rulesSize;
              resultCoordPos = includeCoordsAndRules(offset + 1, rulesSize,
                                                 rules, offsets,
                                                 resultRules,
                                                 resultOffsets,
                                                 resultCoords, coords,
                                                 resultRulesPos,
                                                 resultCoordPos, point,
                                                 isCurrentArea, false,
                                                 1);
              resultRulesPos += rulesSize - offset - 1;
              offset = 1;
              isCopyUntilZero = true;
            }
           
            int length = nextPoint.getRuleIndex(isCurrentArea) - offset + 1;
           
            if (isCopyUntilZero) {
              offset = 0;
              isCopyUntilZero = false;
            }
            if ((length == offset) &&
              (nextPoint.getRule(isCurrentArea) != PathIterator.SEG_LINETO) &&
                (nextPoint.getRule(isCurrentArea) != PathIterator.SEG_CLOSE) &&
              (point.getRule(isCurrentArea) != PathIterator.SEG_LINETO) &&
              (point.getRule(isCurrentArea) != PathIterator.SEG_CLOSE)) {
             
              isCopyUntilZero = true;
              length++;
            }
           
             resultCoordPos = includeCoordsAndRules(offset, length, rules,
                                                offsets, resultRules,
                                                resultOffsets, resultCoords,
                                                coords, resultRulesPos,
                                                resultCoordPos, nextPoint,
                                                isCurrentArea, true, 1);
            resultRulesPos = ((length <= offset) || (isCopyUntilZero)) ?
                resultRulesPos + 1 : resultRulesPos + length;

            point = nextPoint;
        } while (point != intersectPoints[0]);
       
        if (resultRules[resultRulesPos - 1] == PathIterator.SEG_LINETO) {
          resultRules[resultRulesPos - 1] = PathIterator.SEG_CLOSE;
        } else {
          resultCoords[resultCoordPos++] = nextPoint.getX();
            resultCoords[resultCoordPos++] = nextPoint.getY();
          resultRules[resultRulesPos++] = PathIterator.SEG_CLOSE;
        }
       
        resultOffsets[resultRulesPos - 1] = resultCoordPos;
    coords = resultCoords;
View Full Code Here

                                                        intersectPoints.length];
        int resultCoordPos = 0;
        int resultRulesPos = 0;
        boolean isCurrentArea = true;

        IntersectPoint point = intersectPoints[0];
        resultRules[resultRulesPos] = PathIterator.SEG_MOVETO;
        resultOffsets[resultRulesPos++] = resultCoordPos;
       
        do {
          resultCoords[resultCoordPos++] = point.getX();
            resultCoords[resultCoordPos++] = point.getY();
            resultRules[resultRulesPos] = PathIterator.SEG_LINETO;
            resultOffsets[resultRulesPos++] = resultCoordPos - 2;
            int curIndex = point.getEndIndex(true);

            if ((curIndex < 0) ||
              (area.containsExact(coords[2 * curIndex],
                                coords[2 * curIndex + 1]) == 0)) {
              isCurrentArea = !isCurrentArea;
            } else if (area.containsExact(coords[2 * curIndex],
                                      coords[2 * curIndex + 1]) > 0) {
              isCurrentArea = true;
            } else {
              isCurrentArea = false;
            }

            IntersectPoint nextPoint = getNextIntersectPoint(intersectPoints,
                                                         point,
                                                         isCurrentArea);
            double[] coords = (isCurrentArea) ? this.coords : area.coords;
            int offset = 2 * point.getEndIndex(isCurrentArea);
            if ((offset >= 0) &&
                (nextPoint.getBegIndex(isCurrentArea) <
                    point.getEndIndex(isCurrentArea))) {
                int coordSize = (isCurrentArea) ? this.coordsSize :
                                                area.coordsSize;
                int length = coordSize - offset;
                System.arraycopy(coords, offset,
                             resultCoords, resultCoordPos, length);
               
                for (int i = 0; i < length / 2; i++) {
                  resultRules[resultRulesPos] = PathIterator.SEG_LINETO;
                  resultOffsets[resultRulesPos++] = resultCoordPos;
                  resultCoordPos += 2;
                }
               
                offset = 0;
            }
           
            if (offset >= 0) {
              int length = 2 * nextPoint.getBegIndex(isCurrentArea) -
                               offset + 2;
              System.arraycopy(coords, offset,
                           resultCoords, resultCoordPos, length);
             
              for (int i = 0; i < length / 2; i++) {
View Full Code Here

                                                       intersectPoints.length];
        int resultCoordPos = 0;
        int resultRulesPos = 0;
        boolean isCurrentArea = true;

        IntersectPoint point = intersectPoints[0];
        resultRules[resultRulesPos] = PathIterator.SEG_MOVETO;
        resultOffsets[resultRulesPos++] = resultCoordPos;
       
        do {
          resultCoords[resultCoordPos++] = point.getX();
            resultCoords[resultCoordPos++] = point.getY();
            int curIndex = offsets[point.getRuleIndex(true)] % coordsSize;
           
            if (area.containsExact(coords[curIndex],
                               coords[curIndex + 1]) == 0) {
              isCurrentArea = !isCurrentArea;
            } else if (area.containsExact(coords[curIndex],
                                      coords[curIndex + 1]) > 0) {
              isCurrentArea = false;
            } else {
              isCurrentArea = true;
            }
 
            IntersectPoint nextPoint = (isCurrentArea) ?
                getNextIntersectPoint(intersectPoints, point,
                                  isCurrentArea):
                getPrevIntersectPoint(intersectPoints, point,
                                  isCurrentArea)
            double[] coords = (isCurrentArea) ? this.coords : area.coords;
            int[] offsets = (isCurrentArea) ? this.offsets : area.offsets;
            int[] rules = (isCurrentArea) ? this.rules : area.rules;
            int offset = (isCurrentArea) ? point.getRuleIndex(isCurrentArea) :
                                       nextPoint.getRuleIndex(isCurrentArea);
            boolean isCopyUntilZero = false;
        
            if (((isCurrentArea) &&
               (point.getRuleIndex(isCurrentArea) >
                nextPoint.getRuleIndex(isCurrentArea))) ||
              ((!isCurrentArea) &&
               (nextPoint.getRuleIndex(isCurrentArea) >
                nextPoint.getRuleIndex(isCurrentArea)))) {
             
              int rulesSize = (isCurrentArea) ? this.rulesSize :
                                              area.rulesSize;
              resultCoordPos = includeCoordsAndRules(offset + 1, rulesSize,
                                                 rules, offsets,
                                                 resultRules,
                                                 resultOffsets,
                                                 resultCoords, coords,
                                                 resultRulesPos,
                                                 resultCoordPos, point,
                                                 isCurrentArea, false,
                                                 2);
              resultRulesPos += rulesSize - offset - 1;
              offset = 1;
              isCopyUntilZero = true;
            }
           
            int length = nextPoint.getRuleIndex(isCurrentArea) - offset + 1;
           
            if (isCopyUntilZero) {
              offset = 0;
              isCopyUntilZero = false;
            }
View Full Code Here

        boolean isCurrentArea = true;
        int countPoints = 0;
        boolean curArea = false;
        boolean addArea = false;

        IntersectPoint point = intersectPoints[0];
        resultRules[resultRulesPos] = PathIterator.SEG_MOVETO;
        resultOffsets[resultRulesPos++] = resultCoordPos;
       
        do {
          resultCoords[resultCoordPos++] = point.getX();
            resultCoords[resultCoordPos++] = point.getY();
            resultRules[resultRulesPos] = PathIterator.SEG_LINETO;
            resultOffsets[resultRulesPos++] = resultCoordPos - 2;
            int curIndex = point.getEndIndex(true);
           
            if ((curIndex < 0) ||
                (area.isVertex(coords[2 * curIndex], coords[2 * curIndex + 1]) &&
                     crossHelper.containsPoint(new double[] {coords[2 * curIndex],
                                           coords[2 * curIndex + 1]}) &&
                (coords[2 * curIndex] != point.getX() ||
                   coords[2 * curIndex + 1] != point.getY()))) {
              isCurrentArea = !isCurrentArea;
            } else if (area.containsExact(coords[2 * curIndex],
                                      coords[2 * curIndex + 1]) > 0) {
              isCurrentArea = false;
            } else {
              isCurrentArea = true;
            }
           
            if (countPoints >= intersectPoints.length) {
                isCurrentArea = !isCurrentArea;
            }
              
            if (isCurrentArea) {
                curArea = true;
            } else {
                addArea = true;
            }

            IntersectPoint nextPoint = (isCurrentArea) ?
                getNextIntersectPoint(intersectPoints, point, isCurrentArea):
                getPrevIntersectPoint(intersectPoints, point, isCurrentArea)
            double[] coords = (isCurrentArea) ? this.coords : area.coords;
           
            int offset = (isCurrentArea) ? 2 * point.getEndIndex(isCurrentArea):
                           2 * nextPoint.getEndIndex(isCurrentArea);
           
            if ((offset > 0) &&
              (((isCurrentArea) &&
                (nextPoint.getBegIndex(isCurrentArea) <
                    point.getEndIndex(isCurrentArea))) ||
                ((!isCurrentArea) &&
                (nextPoint.getEndIndex(isCurrentArea) <
                    nextPoint.getBegIndex(isCurrentArea))))) {
             
                int coordSize = (isCurrentArea) ? this.coordsSize :
                                                area.coordsSize;
                int length = coordSize - offset;
               
                if (isCurrentArea) {
                  System.arraycopy(coords, offset,
                               resultCoords, resultCoordPos, length);
                } else {
                  double[] temp = new double[length];
                  System.arraycopy(coords, offset, temp, 0, length);
                  reverseCopy(temp);
                  System.arraycopy(temp, 0,
                               resultCoords, resultCoordPos, length);
                }
               
                for (int i = 0; i < length / 2; i++) {
                  resultRules[resultRulesPos] = PathIterator.SEG_LINETO;
                  resultOffsets[resultRulesPos++] = resultCoordPos;
                  resultCoordPos += 2;
                }
               
                offset = 0;
            }
           
            if (offset >= 0) {
              int length = (isCurrentArea) ?
                           2 * nextPoint.getBegIndex(isCurrentArea) - offset + 2:
                               2 * point.getBegIndex(isCurrentArea) - offset + 2;
                          
              if (isCurrentArea) {
                System.arraycopy(coords, offset,
                             resultCoords, resultCoordPos, length);
View Full Code Here

      int endIndex = isectPoint.getEndIndex(isCurrentArea);
    if (endIndex < 0) {
      return iPoints[Math.abs(endIndex) - 1];
    }

    IntersectPoint firstIsectPoint = null;
    IntersectPoint nextIsectPoint = null;
    for (IntersectPoint point : iPoints) {
      int begIndex = point.getBegIndex(isCurrentArea);
     
      if (begIndex >= 0) {
        if (firstIsectPoint == null) {
          firstIsectPoint = point;
        } else if (begIndex < firstIsectPoint
            .getBegIndex(isCurrentArea)) {
          firstIsectPoint = point;
        }
      }

      if (endIndex <= begIndex) {
        if (nextIsectPoint == null) {
          nextIsectPoint = point;
        } else if (begIndex <
                   nextIsectPoint.getBegIndex(isCurrentArea)) {
          nextIsectPoint = point;
        }
      }
    }
View Full Code Here

   
    if (begIndex < 0) {
      return iPoints[Math.abs(begIndex) - 1];
    }

    IntersectPoint firstIsectPoint = null;
    IntersectPoint predIsectPoint = null;
    for (IntersectPoint point : iPoints) {
      int endIndex = point.getEndIndex(isCurrentArea);
     
      if (endIndex >= 0) {
        if (firstIsectPoint == null) {
          firstIsectPoint = point;
        } else if (endIndex < firstIsectPoint
            .getEndIndex(isCurrentArea)) {
          firstIsectPoint = point;
        }
      }

      if (endIndex <= begIndex) {
        if (predIsectPoint == null) {
          predIsectPoint = point;
        } else if (endIndex >
                       predIsectPoint.getEndIndex(isCurrentArea)) {
          predIsectPoint = point;
        }
      }
    }
View Full Code Here

                                                       intersectPoints.length];
        int resultCoordPos = 0;
        int resultRulesPos = 0;
        boolean isCurrentArea = true;

        IntersectPoint point = intersectPoints[0];
        resultRules[resultRulesPos] = PathIterator.SEG_MOVETO;
        resultOffsets[resultRulesPos++] = resultCoordPos;
       
        do {
          resultCoords[resultCoordPos++] = point.getX();
            resultCoords[resultCoordPos++] = point.getY();
            int curIndex = point.getEndIndex(true);
           
            if (curIndex < 0) {
              isCurrentArea = !isCurrentArea;
            } else if (area.containsExact(coords[2 * curIndex],
                                      coords[2 * curIndex + 1]) > 0) {
              isCurrentArea = false;
            } else {
              isCurrentArea = true;
            }

            IntersectPoint nextPoint = getNextIntersectPoint(intersectPoints,
                                                             point,
                                                             isCurrentArea);
            double[] coords = (isCurrentArea) ? this.coords : area.coords;
            int[] offsets = (isCurrentArea) ? this.offsets : area.offsets;
            int[] rules = (isCurrentArea) ? this.rules : area.rules;
            int offset = point.getRuleIndex(isCurrentArea);
            boolean isCopyUntilZero = false;
           
            if ((point.getRuleIndex(isCurrentArea) >
                    nextPoint.getRuleIndex(isCurrentArea))) {
              int rulesSize = (isCurrentArea) ? this.rulesSize :
                                              area.rulesSize;
              resultCoordPos = includeCoordsAndRules(offset + 1, rulesSize,
                                                 rules, offsets,
                                                 resultRules,
                                                 resultOffsets,
                                                 resultCoords, coords,
                                                 resultRulesPos,
                                                 resultCoordPos,
                                                 point, isCurrentArea,
                                                 false, 0);
              resultRulesPos += rulesSize - offset - 1;
              offset = 1;
              isCopyUntilZero = true;
            }
           
            int length = nextPoint.getRuleIndex(isCurrentArea) - offset + 1;
           
            if (isCopyUntilZero) {
              offset = 0;
            }
           
View Full Code Here

                                                       intersectPoints.length];
        int resultCoordPos = 0;
        int resultRulesPos = 0;
        boolean isCurrentArea = true;

        IntersectPoint point = intersectPoints[0];
        resultRules[resultRulesPos] = PathIterator.SEG_MOVETO;
        resultOffsets[resultRulesPos++] = resultCoordPos;
       
        do {
          resultCoords[resultCoordPos++] = point.getX();
            resultCoords[resultCoordPos++] = point.getY();
            resultRules[resultRulesPos] = PathIterator.SEG_LINETO;
            resultOffsets[resultRulesPos++] = resultCoordPos - 2;
            int curIndex = point.getEndIndex(true);
            if (curIndex < 0) {
              isCurrentArea = !isCurrentArea;
            } else if (area.containsExact(coords[2 * curIndex],
                                      coords[2 * curIndex + 1]) > 0) {
              isCurrentArea = false;
            } else {
              isCurrentArea = true;
            }

            IntersectPoint nextPoint = getNextIntersectPoint(intersectPoints,
                                                         point,
                                                         isCurrentArea);
            double[] coords = (isCurrentArea) ? this.coords : area.coords;
            int offset = 2 * point.getEndIndex(isCurrentArea);
            if (nextPoint.getBegIndex(isCurrentArea) <
                point.getEndIndex(isCurrentArea)) {
                int coordSize = (isCurrentArea) ? this.coordsSize :
                                                area.coordsSize;
                int length = coordSize - offset;
                System.arraycopy(coords, offset,
                             resultCoords, resultCoordPos, length);
               
                for (int i = 0; i < length / 2; i++) {
                  resultRules[resultRulesPos] = PathIterator.SEG_LINETO;
                  resultOffsets[resultRulesPos++] = resultCoordPos;
                  resultCoordPos += 2;
                }
               
                offset = 0;
            }
           
            int length = 2 * nextPoint.getBegIndex(isCurrentArea) - offset + 2;
            System.arraycopy(coords, offset,
                         resultCoords, resultCoordPos, length);
           
            for (int i = 0; i < length / 2; i++) {
              resultRules[resultRulesPos] = PathIterator.SEG_LINETO;
View Full Code Here

TOP

Related Classes of org.apache.harmony.awt.geom.IntersectPoint

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.