summaryrefslogtreecommitdiff
path: root/CSMath/src/bezier/geom/BezierProperties.java
diff options
context:
space:
mode:
Diffstat (limited to 'CSMath/src/bezier/geom/BezierProperties.java')
-rw-r--r--CSMath/src/bezier/geom/BezierProperties.java74
1 files changed, 46 insertions, 28 deletions
diff --git a/CSMath/src/bezier/geom/BezierProperties.java b/CSMath/src/bezier/geom/BezierProperties.java
index 1b5443d..d73c1f1 100644
--- a/CSMath/src/bezier/geom/BezierProperties.java
+++ b/CSMath/src/bezier/geom/BezierProperties.java
@@ -2,6 +2,12 @@ package bezier.geom;
import java.awt.Color;
+/**
+ * Properties for graphing a bezier curve.
+ *
+ * @author bjculkin
+ *
+ */
public class BezierProperties {
/**
* The number of separate points to graph from the curve.
@@ -14,15 +20,38 @@ public class BezierProperties {
public double scale = 5;
/**
- * The colors for varying parts of the curve.
+ * The color for the curve itself.
*/
- public Color curveColor = Color.BLACK;
- public Color pointColor = Color.RED;
- public Color boxColor = Color.GREEN;
+ public Color curveColor = Color.BLACK;
+ /**
+ * The color for the points in the curve.
+ */
+ public Color pointColor = Color.RED;
+ /**
+ * The color for the bounding box.
+ */
+ public Color boxColor = Color.GREEN;
+ /**
+ * Create a new set of default bezier properties.
+ */
public BezierProperties() {
}
+ /**
+ * Create a new set of bezier properties, with specific values.
+ *
+ * @param parts
+ * The number of points to graph in the curve.
+ * @param scale
+ * The amount to scale the curve by.
+ * @param curveColor
+ * The color for the curve.
+ * @param pointColor
+ * The color for the points in the curve.
+ * @param boxColor
+ * The color for the bounding box of the curve.
+ */
public BezierProperties(int parts, double scale, Color curveColor, Color pointColor, Color boxColor) {
this.parts = parts;
this.scale = scale;
@@ -47,38 +76,27 @@ public class BezierProperties {
@Override
public boolean equals(Object obj) {
- if (this == obj)
- return true;
- if (obj == null)
- return false;
- if (getClass() != obj.getClass())
- return false;
+ if (this == obj) return true;
+ if (obj == null) return false;
+ if (getClass() != obj.getClass()) return false;
BezierProperties other = (BezierProperties) obj;
if (boxColor == null) {
- if (other.boxColor != null)
- return false;
- } else if (!boxColor.equals(other.boxColor))
- return false;
+ if (other.boxColor != null) return false;
+ } else if (!boxColor.equals(other.boxColor)) return false;
if (curveColor == null) {
- if (other.curveColor != null)
- return false;
- } else if (!curveColor.equals(other.curveColor))
- return false;
- if (parts != other.parts)
- return false;
+ if (other.curveColor != null) return false;
+ } else if (!curveColor.equals(other.curveColor)) return false;
+ if (parts != other.parts) return false;
if (pointColor == null) {
- if (other.pointColor != null)
- return false;
- } else if (!pointColor.equals(other.pointColor))
- return false;
- if (Double.doubleToLongBits(scale) != Double.doubleToLongBits(other.scale))
- return false;
+ if (other.pointColor != null) return false;
+ } else if (!pointColor.equals(other.pointColor)) return false;
+ if (Double.doubleToLongBits(scale) != Double.doubleToLongBits(other.scale)) return false;
return true;
}
@Override
public String toString() {
- return "BezierProperties [parts=" + parts + ", scale=" + scale + ", curveColor=" + curveColor + ", pointColor="
- + pointColor + ", boxColor=" + boxColor + "]";
+ return "BezierProperties [parts=" + parts + ", scale=" + scale + ", curveColor=" + curveColor
+ + ", pointColor=" + pointColor + ", boxColor=" + boxColor + "]";
}
} \ No newline at end of file