< prev index next >
src/java.desktop/share/classes/sun/awt/geom/Curve.java
Print this page
*** 1,7 ****
/*
! * Copyright (c) 1998, 2006, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
--- 1,7 ----
/*
! * Copyright (c) 1998, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
*** 59,69 ****
}
}
public static void insertQuad(Vector<Curve> curves,
double x0, double y0,
! double coords[])
{
double y1 = coords[3];
if (y0 > y1) {
Order2.insert(curves, coords,
coords[2], y1,
--- 59,69 ----
}
}
public static void insertQuad(Vector<Curve> curves,
double x0, double y0,
! double[] coords)
{
double y1 = coords[3];
if (y0 > y1) {
Order2.insert(curves, coords,
coords[2], y1,
*** 82,92 ****
}
}
public static void insertCubic(Vector<Curve> curves,
double x0, double y0,
! double coords[])
{
double y1 = coords[5];
if (y0 > y1) {
Order3.insert(curves, coords,
coords[4], y1,
--- 82,92 ----
}
}
public static void insertCubic(Vector<Curve> curves,
double x0, double y0,
! double[] coords)
{
double y1 = coords[5];
if (y0 > y1) {
Order3.insert(curves, coords,
coords[4], y1,
*** 125,135 ****
double px, double py)
{
if (pi.isDone()) {
return 0;
}
! double coords[] = new double[6];
if (pi.currentSegment(coords) != PathIterator.SEG_MOVETO) {
throw new IllegalPathStateException("missing initial moveto "+
"in path definition");
}
pi.next();
--- 125,135 ----
double px, double py)
{
if (pi.isDone()) {
return 0;
}
! double[] coords = new double[6];
if (pi.currentSegment(coords) != PathIterator.SEG_MOVETO) {
throw new IllegalPathStateException("missing initial moveto "+
"in path definition");
}
pi.next();
*** 382,392 ****
return 0;
}
if (pi.isDone()) {
return 0;
}
! double coords[] = new double[6];
if (pi.currentSegment(coords) != PathIterator.SEG_MOVETO) {
throw new IllegalPathStateException("missing initial moveto "+
"in path definition");
}
pi.next();
--- 382,392 ----
return 0;
}
if (pi.isDone()) {
return 0;
}
! double[] coords = new double[6];
if (pi.currentSegment(coords) != PathIterator.SEG_MOVETO) {
throw new IllegalPathStateException("missing initial moveto "+
"in path definition");
}
pi.next();
*** 864,874 ****
}
public abstract Curve getReversedCurve();
public abstract Curve getSubCurve(double ystart, double yend, int dir);
! public int compareTo(Curve that, double yrange[]) {
/*
System.out.println(this+".compareTo("+that+")");
System.out.println("target range = "+yrange[0]+"=>"+yrange[1]);
*/
double y0 = yrange[0];
--- 864,874 ----
}
public abstract Curve getReversedCurve();
public abstract Curve getSubCurve(double ystart, double yend, int dir);
! public int compareTo(Curve that, double[] yrange) {
/*
System.out.println(this+".compareTo("+that+")");
System.out.println("target range = "+yrange[0]+"=>"+yrange[1]);
*/
double y0 = yrange[0];
*** 1028,1038 ****
return orderof(this.XforY(ymid), that.XforY(ymid));
}
public static final double TMIN = 1E-3;
! public boolean findIntersect(Curve that, double yrange[], double ymin,
int slevel, int tlevel,
double s0, double xs0, double ys0,
double s1, double xs1, double ys1,
double t0, double xt0, double yt0,
double t1, double xt1, double yt1)
--- 1028,1038 ----
return orderof(this.XforY(ymid), that.XforY(ymid));
}
public static final double TMIN = 1E-3;
! public boolean findIntersect(Curve that, double[] yrange, double ymin,
int slevel, int tlevel,
double s0, double xs0, double ys0,
double s1, double xs1, double ys1,
double t0, double xt0, double yt0,
double t1, double xt1, double yt1)
*** 1200,1206 ****
public boolean fairlyClose(double v1, double v2) {
return (Math.abs(v1 - v2) <
Math.max(Math.abs(v1), Math.abs(v2)) * 1E-10);
}
! public abstract int getSegment(double coords[]);
}
--- 1200,1206 ----
public boolean fairlyClose(double v1, double v2) {
return (Math.abs(v1 - v2) <
Math.max(Math.abs(v1), Math.abs(v2)) * 1E-10);
}
! public abstract int getSegment(double[] coords);
}
< prev index next >