|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object vmm.core.Exhibit vmm.fractals.Mandelbrot
public class Mandelbrot
The Mandelbrot set. The exhibit has an associated decoration that can show an approximation of the outline of the Julia set and the zero-orbit associated with a point (cx,cy). This decoration is not visible by default, but can be made visible in a view of the exhibit. If it is visible, the start point (cx,cy) is marked with a white cross, and the user can drag this cross; in addition to the cross, either the Julia set or the zero-orbit or both can be shown. The coordinates cx, cy are given by the values of two parameters that are associated with the exhibit, so they can also be set directly.
This exhibit differs from others in that the basic data needed to
draw the exhibit is a bitmap. To make this work properly, a nested View class is
defined that works only for Mandelbrot exhibits. The view class overrides the render()
method from the base Mandelbrot.MandelbrotView
class, which means that it is using a completly
different rendering system from other exhibits. Various other changes were made
that are unique to the Mandelbrot exhibit. Since this might be the only exhibit
where the basic data is a bitmap, no attempt was made to make the modifications in
a general way. Note that the View for a Mandelbrot exhibit MUST be of type
Mandelbrot.MandelbrotView.
Nested Class Summary | |
---|---|
class |
Mandelbrot.MandelbrotView
A View class suitable for viewing a Mandelbrot exhibit. |
Field Summary |
---|
Fields inherited from class vmm.core.Exhibit |
---|
decorations, exhibitNeedsRedraw, isMorphing, morphingView, parameters, previousTransform |
Constructor Summary | |
---|---|
Mandelbrot()
|
Method Summary | |
---|---|
ActionList |
getActionsForView(View view)
This method returns a list of ActionItem that can be applied to a View that
contains this Exhibit. |
View |
getDefaultView()
Overridden to return an object belonging to the nested class MandelbrotView. |
void |
parameterChanged(Parameter param,
java.lang.Object oldValue,
java.lang.Object newValue)
This method is overridden so that in addition to redrawing the Exhibit, it also sets the Julia set point, (cx,cy), to match the values of the associated parameters. |
void |
removeView(View view)
Removes a view from the list of views that are displaying this Exhibit. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Mandelbrot()
Method Detail |
---|
public void removeView(View view)
Exhibit
removeView
in class Exhibit
view
- The view that is no longer displaying this exhibit.public void parameterChanged(Parameter param, java.lang.Object oldValue, java.lang.Object newValue)
parameterChanged
in interface Parameterizable
parameterChanged
in class Exhibit
param
- The Parmeter whose value has been set.oldValue
- The previous value of the parameter.newValue
- The new, current value of the parameter. This is not
necessarily guaranteed to be different from the old value (although it
is for parameters definedin the VMM core).Exhibit.forceRedraw()
public ActionList getActionsForView(View view)
Exhibit
ActionItem
that can be applied to a View that
contains this Exhibit. If the view parameter is null, it should return actions
that are appropriate in any View.
View is presumably one that is displaying this Exhibit.
The items in the returned list must implement the ActionItem interface and
generally belong to one of the classes AbstractActionVMM
,
ToggleAction
, ActionRadioGroup
, or
ActionList
. Null items represent separators.
In this top-level Exhibit class, the return value is a list that contains
one object of type AbstractActionVMM
. The action represents the "Create" command, which is meant to run the
"create animation" of the Exhibit.
In general, when overriding this method, subclasses should call "super.getActionsForView()" to obtain a list of actions from the superclass. It can then add additional actions or remove or disable actions that are in the list from the superclass.
getActionsForView
in class Exhibit
public View getDefaultView()
getDefaultView
in class Exhibit
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |