Introduction

Updated on March 13, 2003

This Kaleidoscope program was developed as a case study of object-oriented design and as a test bed for graphics tools for dealing with shapes and images including Bezier curves. The program creates a picture involving random shapes and images and then runs a kaleidoscope animation in which a pair of mirrors reflects this picture continuously around the graphics window. Many parameters of the animation may be changed while the animation is running and the objects being animated can themselves be continuously mutated in real time.

A screen snapshot from the kaleidoscope program is available below.

The origin of this case study came from my participation in the Killer Examples workshop organized by Carl Alphonce, Zung Nguyen, Stephen Wong, and Phil Ventura at OOPSLA 2002. See:

In particular, another workshop participant, Michael Wick, presented a Kaleidoscope animation suitable for use as a demonstration program early in freshman computer science. This example is available from the above site.

I became interested in the question of whether a more elaborate Kaleidoscope animation would be valuable for a more advanced audience, namely, for upper level students in courses on Object-Oriented Design and/or Software Development. I therefore explored the question of how to build a class and interface structure that would support a very general mechanism for creating and displaying mutatable shapes and images and then transforming these under symmetry transformations. In my opinion, the resulting structures are quite elegant and will indeed serve as an appropriate case study for advanced students.

It is intended that the most general classes in this case study will migrate into the Java Power Tools. This migration should happen in the near future and will be announced here and elsewhere.

Documents

Zip Archive

Java Source

The classes to assist with building shapes

The Java file BaseShape.java

The Java file AutomaticShape.java

The Java file TweakableShape.java

The Java file Path.java

The Java file Tangent.java

The Java file FloatArray.java

The Java file ClosureMode.java

The Java file WindingRule.java

The classes to assist with affine transforms and mutations

The Java file TransformFactory.java

The Java file Mutator.java

The classes to define paintable and mutatable objects

The Java file Paintable.java

The Java file Mutatable.java

The Java file MutatablePaintable.java

The Java file SupportsPropertyChange.java

The Java file AbstractPaintable.java

The Java file AbstractMutatablePaintable.java

The Java file ShapePaintable.java

The Java file ImagePaintable.java

The Java file MutatableWrapper.java

The Java file PaintableSequence.java

The Java file PaintMode.java

The Java file PaintableTools.java

A class to support graphics refresh

The Java file Refresh.java

The classes to build and test the kaleidoscope application and its tools

The Java file PieWedge.java

The Java file RandomPaintable.java

The Java file Kaleidoscope.java

The Java file KaleidoscopeApplication.java

The Java file KaleidoscopeTests.java

Screen Snapshot

Contact Information