{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

CCurve - CCurve.java Author Lewis/Loftus Solution to...

This preview shows pages 1–2. Sign up to view the full content.

//******************************************************************** // CCurve.java Author: Lewis/Loftus // // Solution to Programming Project 11.10 // // Encapsulates the C-curve fractal. //******************************************************************** import java.awt.Graphics; public class CCurve extends RecursiveFractal { private final int MAX_ORDER = 15; private final String name = "The C-Curve Fractal"; private final int NUM_COORDINATES = 4; private final int LEFTX = 0, RIGHTX = 1, TOPY = 2, BOTTOMY = 3; int order; public CCurve() { order = 1; } //----------------------------------------------------------------- // Returns the maximum fractal order. //----------------------------------------------------------------- public int getMaxOrder() { return MAX_ORDER; } //----------------------------------------------------------------- // Returns the current fractal order. //----------------------------------------------------------------- public int getOrder() { return order; } //----------------------------------------------------------------- // Sets the fractal order to the value specified. //----------------------------------------------------------------- public void setOrder(int value) { if (value < 1) order = 1; else if (value > MAX_ORDER) order = MAX_ORDER; else order = value; } //----------------------------------------------------------------- // Returns the name of the fractal. //-----------------------------------------------------------------

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}