aboutsummaryrefslogtreecommitdiffstats
path: root/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/jogl/classes/jogamp/graph/geom/plane/Path2D.java')
-rw-r--r--src/jogl/classes/jogamp/graph/geom/plane/Path2D.java47
1 files changed, 26 insertions, 21 deletions
diff --git a/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java b/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
index 945eeceeb..33b80d6b8 100644
--- a/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
+++ b/src/jogl/classes/jogamp/graph/geom/plane/Path2D.java
@@ -33,12 +33,12 @@ public final class Path2D implements Cloneable {
static final String invalidWindingRuleValue = "Invalid winding rule value";
static final String iteratorOutOfBounds = "Iterator out of bounds";
-
+
/**
* The buffers size
*/
private static final int BUFFER_SIZE = 10;
-
+
/**
* The buffers capacity
*/
@@ -48,24 +48,24 @@ public final class Path2D implements Cloneable {
* The point's types buffer
*/
byte[] types;
-
+
/**
* The points buffer
*/
float[] points;
-
+
/**
* The point's type buffer size
*/
int typeSize;
-
+
/**
* The points buffer size
*/
int pointSize;
-
+
/**
- * The path rule
+ * The path rule
*/
int rule;
@@ -80,7 +80,7 @@ public final class Path2D implements Cloneable {
0}; // CLOSE
/*
- * GeneralPath path iterator
+ * GeneralPath path iterator
*/
class Iterator implements PathIterator {
@@ -88,17 +88,17 @@ public final class Path2D implements Cloneable {
* The current cursor position in types buffer
*/
int typeIndex;
-
+
/**
* The current cursor position in points buffer
*/
int pointIndex;
-
+
/**
* The source GeneralPath object
*/
Path2D p;
-
+
/**
* The path iterator transformation
*/
@@ -122,18 +122,22 @@ public final class Path2D implements Cloneable {
this.t = at;
}
+ @Override
public int getWindingRule() {
return p.getWindingRule();
}
+ @Override
public boolean isDone() {
return typeIndex >= p.typeSize;
}
+ @Override
public void next() {
typeIndex++;
}
+ @Override
public int currentSegment(float[] coords) {
if (isDone()) {
throw new NoSuchElementException(iteratorOutOfBounds);
@@ -183,7 +187,7 @@ public final class Path2D implements Cloneable {
}
/**
- * Checks points and types buffer size to add pointCount points. If necessary realloc buffers to enlarge size.
+ * Checks points and types buffer size to add pointCount points. If necessary realloc buffers to enlarge size.
* @param pointCount - the point count to be added in buffer
*/
void checkBuf(int pointCount, boolean checkMove) {
@@ -244,18 +248,19 @@ public final class Path2D implements Cloneable {
final public int size() {
return typeSize;
}
-
+
final public boolean isClosed() {
return typeSize > 0 && types[typeSize - 1] == PathIterator.SEG_CLOSE ;
}
-
+
public void closePath() {
if (!isClosed()) {
checkBuf(0, true);
types[typeSize++] = PathIterator.SEG_CLOSE;
}
}
-
+
+ @Override
public String toString() {
return "[size "+size()+", closed "+isClosed()+"]";
}
@@ -295,7 +300,7 @@ public final class Path2D implements Cloneable {
closePath();
break;
default:
- throw new IllegalArgumentException("Unhandled Segment Type: "+segmentType);
+ throw new IllegalArgumentException("Unhandled Segment Type: "+segmentType);
}
path.next();
connect = false;
@@ -366,9 +371,9 @@ public final class Path2D implements Cloneable {
}
/**
- * Checks cross count according to path rule to define is it point inside shape or not.
+ * Checks cross count according to path rule to define is it point inside shape or not.
* @param cross - the point cross count
- * @return true if point is inside path, or false otherwise
+ * @return true if point is inside path, or false otherwise
*/
boolean isInside(int cross) {
if (rule == WIND_NON_ZERO) {
@@ -396,7 +401,7 @@ public final class Path2D implements Cloneable {
}
public boolean contains(AABBox r) {
- return contains(r.getMinX(), r.getMinY(), r.getWidth(), r.getHeight());
+ return contains(r.getMinX(), r.getMinY(), r.getWidth(), r.getHeight());
}
public boolean intersects(AABBox r) {
@@ -404,9 +409,9 @@ public final class Path2D implements Cloneable {
}
public PathIterator iterator() {
- return new Iterator(this);
+ return new Iterator(this);
}
-
+
public PathIterator iterator(AffineTransform t) {
return new Iterator(this, t);
}