- Timestamp:
- Apr 27, 2004, 8:39:34 PM (22 years ago)
- Location:
- branches/GNU/src/gcc
- Files:
-
- 2 edited
-
. (modified) (1 prop)
-
libjava/java/awt/geom/Ellipse2D.java (modified) (5 diffs, 1 prop)
Legend:
- Unmodified
- Added
- Removed
-
branches/GNU/src/gcc
- Property svn:ignore
-
old new 26 26 configure.vr 27 27 configure.vrs 28 28 29 Makefile 29 dir.info30 30 lost+found 31 31 update.out
-
- Property svn:ignore
-
branches/GNU/src/gcc/libjava/java/awt/geom/Ellipse2D.java
-
Property cvs2svn:cvs-rev
changed from
1.1to1.1.1.2
r1390 r1391 1 /* Copyright (C) 2000, 2002 Free Software Foundation 1 /* Ellipse2D.java -- represents an ellipse in 2-D space 2 Copyright (C) 2000, 2002 Free Software Foundation 2 3 3 4 This file is part of GNU Classpath. … … 39 40 /** 40 41 * @author Tom Tromey <[email protected]> 41 * @date April 16, 2000 42 * @author Eric Blake <[email protected]> 43 * @since 1.2 44 * @status still needs documentation 42 45 */ 43 44 46 public abstract class Ellipse2D extends RectangularShape 45 47 { 46 protected Ellipse2D ()47 { 48 } 49 50 public boolean contains (double x, double y)51 { 52 double rx = getWidth () / 2;53 double ry = getHeight () / 2;54 double tx = (x - getCenterX ()) / rx;55 double ty = (y - getCenterY ()) / ry;48 protected Ellipse2D() 49 { 50 } 51 52 public boolean contains(double x, double y) 53 { 54 double rx = getWidth() / 2; 55 double ry = getHeight() / 2; 56 double tx = (x - getCenterX()) / rx; 57 double ty = (y - getCenterY()) / ry; 56 58 return tx * tx + ty * ty <= 1.0; 57 59 } 58 60 59 public boolean contains (double x, double y, double w, double h)61 public boolean contains(double x, double y, double w, double h) 60 62 { 61 63 double x2 = x + w; 62 64 double y2 = y + h; 63 return (contains (x, y) && contains(x, y2)64 && contains (x2, y) && contains(x2, y2));65 } 66 67 public PathIterator getPathIterator (AffineTransform at)68 { 69 // fixme;70 return n ull;71 } 72 73 public boolean intersects (double x, double y, double w, double h)65 return (contains(x, y2) 66 (x2, y2)); 67 } 68 69 public PathIterator getPathIterator(AffineTransform at) 70 { 71 // 72 return n; 73 } 74 75 public boolean intersects(double x, double y, double w, double h) 74 76 { 75 77 // fixme … … 84 86 public double y; 85 87 86 public Double () 87 { 88 height = width = x = y = 0; 89 } 90 91 public Double (double x, double y, double w, double h) 92 { 93 this.x = x; 94 this.y = y; 95 this.height = h; 96 this.width = w; 97 } 98 99 public Rectangle2D getBounds2D () 100 { 101 return new Rectangle2D.Double (x, y, width, height); 102 } 103 104 public double getHeight () 88 public Double() 89 { 90 } 91 92 public Double(double x, double y, double w, double h) 93 { 94 this.x = x; 95 this.y = y; 96 height = h; 97 width = w; 98 } 99 100 public Rectangle2D getBounds2D() 101 { 102 return new Rectangle2D.Double(x, y, width, height); 103 } 104 105 public double getHeight() 105 106 { 106 107 return height; 107 108 } 108 109 109 public double getWidth ()110 public double getWidth() 110 111 { 111 112 return width; 112 113 } 113 114 114 public double getX ()115 public double getX() 115 116 { 116 117 return x; 117 118 } 118 119 119 public double getY ()120 public double getY() 120 121 { 121 122 return y; 122 123 } 123 124 124 public boolean isEmpty ()125 public boolean isEmpty() 125 126 { 126 127 return height <= 0 || width <= 0; 127 128 } 128 129 129 public void setFrame (double x, double y, double w, double h)130 { 131 this.x = x; 132 this.y = y; 133 this.height = h;134 this.width = w;135 } 136 } 130 public void setFrame(double x, double y, double w, double h) 131 { 132 this.x = x; 133 this.y = y; 134 height = h; 135 width = w; 136 } 137 } 137 138 138 139 public static class Float extends Ellipse2D … … 143 144 public float y; 144 145 145 public Float () 146 { 147 height = width = x = y = 0; 148 } 149 150 public Float (float x, float y, float w, float h) 146 public Float() 147 { 148 } 149 150 public Float(float x, float y, float w, float h) 151 151 { 152 152 this.x = x; … … 156 156 } 157 157 158 public Rectangle2D getBounds2D ()159 { 160 return new Rectangle2D.Float (x, y, width, height);161 } 162 163 public double getHeight ()158 public Rectangle2D getBounds2D() 159 { 160 return new Rectangle2D.Float(x, y, width, height); 161 } 162 163 public double getHeight() 164 164 { 165 165 return height; 166 166 } 167 167 168 public double getWidth ()168 public double getWidth() 169 169 { 170 170 return width; 171 171 } 172 172 173 public double getX ()173 public double getX() 174 174 { 175 175 return x; 176 176 } 177 177 178 public double getY ()178 public double getY() 179 179 { 180 180 return y; 181 181 } 182 182 183 public boolean isEmpty ()183 public boolean isEmpty() 184 184 { 185 185 return height <= 0 || width <= 0; 186 186 } 187 187 188 public void setFrame (float x, float y, float w, float h)189 { 190 this.x = x; 191 this.y = y; 192 this.height = h;193 this.width = w;194 } 195 196 public void setFrame (double x, double y, double w, double h)188 public void setFrame(float x, float y, float w, float h) 189 { 190 this.x = x; 191 this.y = y; 192 height = h; 193 width = w; 194 } 195 196 public void setFrame(double x, double y, double w, double h) 197 197 { 198 198 this.x = (float) x; 199 199 this.y = (float) y; 200 this.height = (float) h;201 this.width = (float) w;202 } 203 } 204 } 200 height = (float) h; 201 width = (float) w; 202 } 203 } 204 } -
Property cvs2svn:cvs-rev
changed from
Note:
See TracChangeset
for help on using the changeset viewer.
