Class DecoratedCurve

  extended by vmm.core.Exhibit
      extended by vmm.planecurve.PlaneCurve
          extended by vmm.planecurve.parametric.PlaneCurveParametric
              extended by vmm.planecurve.parametric.DecoratedCurve
All Implemented Interfaces:
java.util.EventListener, javax.swing.event.ChangeListener, Decorateable, Parameterizable
Direct Known Subclasses:
Astroid, Circle, Cissoid, Conchoid, Convex, Deltoid, Epizykloide, Lemniskate, SineCurve, Tractrix, Zykloide

public abstract class DecoratedCurve
extends PlaneCurveParametric

Nested Class Summary
static class DecoratedCurve.MMOView
          A trivial subclass of PlaneCurveParametricView that is needed to get the desired color effects during the create animation.
Nested classes/interfaces inherited from class vmm.planecurve.parametric.PlaneCurveParametric
Field Summary
protected  int strokeSize
protected  java.awt.Color wantedColor
Fields inherited from class vmm.planecurve.parametric.PlaneCurveParametric
tmax, tmin, tResolution, tVals
Fields inherited from class vmm.planecurve.PlaneCurve
movingSquare, points, randomSquare
Fields inherited from class vmm.core.Exhibit
decorations, exhibitNeedsRedraw, isMorphing, morphingView, parameters, previousTransform
Constructor Summary
Method Summary
 void doDraw(java.awt.Graphics2D g, View view, Transform transform)
          Draw the curve in a specified View.
protected abstract  void drawNeededStuff(java.awt.Graphics2D g, View view, Transform limits, double t)
 Animation getCreateAnimation(View view)
          Returns an animation that shows the curve being drawn bit-by-bit.
 View getDefaultView()
          Overridden to return a view of type MMOView.
 int getStrokeSize()
 java.awt.Color getWantedColor()
 void setStrokeSize(int size)
 void setWantedColor(java.awt.Color color)
Methods inherited from class vmm.planecurve.parametric.PlaneCurveParametric
getActionsForView, getT, getTResolution, makePoints, myCircle, x2ndDerivativeValue, xDerivativeValue, xValue, y2ndDerivativeValue, yDerivativeValue, yValue
Methods inherited from class vmm.planecurve.PlaneCurve
computeDrawData, fillRandomSquare, getPoint, getPointCount, initializeMovingSquare, moveSquare
Methods inherited from class vmm.core.Exhibit
addChangeListener, addDecoration, addExtraXML, addParameter, addView, clearDecorations, computeDrawDataHook, doDrawHook, fireExhibitChangeEvent, forceRedraw, getAdditionalAnimationsForView, getAlternativeViews, getBuildAnimation, getDecorations, getDefaultBackground, getDefaultForeground, getDefaultTransform, getDefaultWindow, getFramesForMorphing, getMorphingAnimation, getName, getParameterByName, getParameters, getSettingsCommandsForView, getTitle, getUseFilmstripForMorphing, getViews, parameterChanged, readExtraXML, removeChangeListener, removeDecoration, removeParameter, removeView, render, setDefaultBackground, setDefaultForeground, setDefaultWindow, setDefaultWindow, setFramesForMorphing, setName, setUseFilmstripForMorphing, stateChanged
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


protected java.awt.Color wantedColor


protected int strokeSize
Constructor Detail


public DecoratedCurve()
Method Detail


public void setWantedColor(java.awt.Color color)


public java.awt.Color getWantedColor()


public void setStrokeSize(int size)


public int getStrokeSize()


protected abstract void drawNeededStuff(java.awt.Graphics2D g,
                                        View view,
                                        Transform limits,
                                        double t)


public Animation getCreateAnimation(View view)
Description copied from class: PlaneCurveParametric
Returns an animation that shows the curve being drawn bit-by-bit.

getCreateAnimation in class PlaneCurveParametric
view - The View where the creation animation will be shown. If this is null or if it is not an instance of PlaneCurveParametric.PlaneCurveParametricView, then the return value is null.
A creation animation for the given View of this Exhibit. The return value can be null to indicate that no creation animation is to be run.


public void doDraw(java.awt.Graphics2D g,
                   View view,
                   Transform transform)
Draw the curve in a specified View. If the View belongs to the class PlaneCurveParametric.PlaneCurveParametricView, then only a fraction of the curve might be drawn, as specified in the View; this feature is used in the creation animation for the curve. If the View belongs to the subclass DecoratedCurve.MMOView of PlaneCurveParametricView (which is the default), then the curve can be in some other color besides the default (this happens during the create animation, when the curve is being constructed).

doDraw in class PlaneCurveParametric
g - The graphics context where the Exhibit is being drawn. It has already been cleared to the background color (assuming that drawing is being done in the usual way, as defined in the top-level View class).
view - The View that is drawing the Exhibit; this object contains other information that might be of use, such as the Display, if any, associated with the View.
transform - Contains information about the rectangular area in the xy-plane that is being drawn and about the rectangle of pixels in the graphics context where it is drawn. Note that at least for the top-level View class, transform.getX() and transform.getY() can be assumed to be zero.
See Also:
Exhibit.render(Graphics2D, View, Transform, ArrayList), Exhibit.computeDrawData(View, boolean, Transform, Transform)


public View getDefaultView()
Overridden to return a view of type MMOView.

getDefaultView in class PlaneCurveParametric