001: /*
002: * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved.
003: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
004: *
005: * This code is free software; you can redistribute it and/or modify it
006: * under the terms of the GNU General Public License version 2 only, as
007: * published by the Free Software Foundation. Sun designates this
008: * particular file as subject to the "Classpath" exception as provided
009: * by Sun in the LICENSE file that accompanied this code.
010: *
011: * This code is distributed in the hope that it will be useful, but WITHOUT
012: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
013: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
014: * version 2 for more details (a copy is included in the LICENSE file that
015: * accompanied this code).
016: *
017: * You should have received a copy of the GNU General Public License version
018: * 2 along with this work; if not, write to the Free Software Foundation,
019: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
020: *
021: * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
022: * CA 95054 USA or visit www.sun.com if you need additional information or
023: * have any questions.
024: */
025:
026: package sun.awt.geom;
027:
028: import java.awt.geom.Rectangle2D;
029: import java.awt.geom.PathIterator;
030: import java.util.Vector;
031:
032: final class Order0 extends Curve {
033: private double x;
034: private double y;
035:
036: public Order0(double x, double y) {
037: super (INCREASING);
038: this .x = x;
039: this .y = y;
040: }
041:
042: public int getOrder() {
043: return 0;
044: }
045:
046: public double getXTop() {
047: return x;
048: }
049:
050: public double getYTop() {
051: return y;
052: }
053:
054: public double getXBot() {
055: return x;
056: }
057:
058: public double getYBot() {
059: return y;
060: }
061:
062: public double getXMin() {
063: return x;
064: }
065:
066: public double getXMax() {
067: return x;
068: }
069:
070: public double getX0() {
071: return x;
072: }
073:
074: public double getY0() {
075: return y;
076: }
077:
078: public double getX1() {
079: return x;
080: }
081:
082: public double getY1() {
083: return y;
084: }
085:
086: public double XforY(double y) {
087: return y;
088: }
089:
090: public double TforY(double y) {
091: return 0;
092: }
093:
094: public double XforT(double t) {
095: return x;
096: }
097:
098: public double YforT(double t) {
099: return y;
100: }
101:
102: public double dXforT(double t, int deriv) {
103: return 0;
104: }
105:
106: public double dYforT(double t, int deriv) {
107: return 0;
108: }
109:
110: public double nextVertical(double t0, double t1) {
111: return t1;
112: }
113:
114: public int crossingsFor(double x, double y) {
115: return 0;
116: }
117:
118: public boolean accumulateCrossings(Crossings c) {
119: return (x > c.getXLo() && x < c.getXHi() && y > c.getYLo() && y < c
120: .getYHi());
121: }
122:
123: public void enlarge(Rectangle2D r) {
124: r.add(x, y);
125: }
126:
127: public Curve getSubCurve(double ystart, double yend, int dir) {
128: return this ;
129: }
130:
131: public Curve getReversedCurve() {
132: return this ;
133: }
134:
135: public int getSegment(double coords[]) {
136: coords[0] = x;
137: coords[1] = y;
138: return PathIterator.SEG_MOVETO;
139: }
140: }
|