001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017: package org.apache.harmony.awt.geom;
018:
019: // the class represents the intersect point of two edges
020: public class IntersectPoint {
021: // the edge begin number of first line
022: private int begIndex1;
023: // the edge end number of first line
024: private int endIndex1;
025: // the edge rule of first figure
026: private int rule1;
027: // the index of the first figure rules array
028: private int ruleIndex1;
029: // the parameter value of edge1
030: private double param1;
031: // the edge begin number of second line
032: private int begIndex2;
033: // the edge end number of second line
034: private int endIndex2;
035: // the edge rule of second figure
036: private int rule2;
037: // the index of the second figure rules array
038: private int ruleIndex2;
039: // the absciss coordinate of the point
040: private double x;
041: // the ordinate coordinate of the point
042: private double y;
043: // the parameter value of edge2
044: private double param2;
045:
046: public IntersectPoint(int begIndex1, int endIndex1, int begIndex2,
047: int endIndex2, double x, double y) {
048: this .begIndex1 = begIndex1;
049: this .endIndex1 = endIndex1;
050: this .begIndex2 = begIndex2;
051: this .endIndex2 = endIndex2;
052: this .x = x;
053: this .y = y;
054: }
055:
056: public IntersectPoint(int begIndex1, int endIndex1, int rule1,
057: int ruleIndex1, int begIndex2, int endIndex2, int rule2,
058: int ruleIndex2, double x, double y, double param1,
059: double param2) {
060: this .begIndex1 = begIndex1;
061: this .endIndex1 = endIndex1;
062: this .rule1 = rule1;
063: this .ruleIndex1 = ruleIndex1;
064: this .param1 = param1;
065: this .begIndex2 = begIndex2;
066: this .endIndex2 = endIndex2;
067: this .rule2 = rule2;
068: this .ruleIndex2 = ruleIndex2;
069: this .param2 = param2;
070: this .x = x;
071: this .y = y;
072: }
073:
074: public int getBegIndex(boolean isCurrentArea) {
075: if (isCurrentArea) {
076: return begIndex1;
077: } else {
078: return begIndex2;
079: }
080: }
081:
082: public int getEndIndex(boolean isCurrentArea) {
083: if (isCurrentArea) {
084: return endIndex1;
085: } else {
086: return endIndex2;
087: }
088: }
089:
090: public int getRuleIndex(boolean isCurrentArea) {
091: if (isCurrentArea) {
092: return ruleIndex1;
093: } else {
094: return ruleIndex2;
095: }
096: }
097:
098: public double getParam(boolean isCurrentArea) {
099: if (isCurrentArea) {
100: return param1;
101: } else {
102: return param2;
103: }
104: }
105:
106: public int getRule(boolean isCurrentArea) {
107: if (isCurrentArea) {
108: return rule1;
109: } else {
110: return rule2;
111: }
112: }
113:
114: public double getX() {
115: return x;
116: }
117:
118: public double getY() {
119: return y;
120: }
121:
122: public void setBegIndex1(int begIndex) {
123: this .begIndex1 = begIndex;
124: }
125:
126: public void setEndIndex1(int endIndex) {
127: this .endIndex1 = endIndex;
128: }
129:
130: public void setBegIndex2(int begIndex) {
131: this .begIndex2 = begIndex;
132: }
133:
134: public void setEndIndex2(int endIndex) {
135: this.endIndex2 = endIndex;
136: }
137: }
|