Class PjJuliaSet
- java.lang.Object
-
- jv.object.PsObject
-
- jv.project.PjProject
-
- vgp.iterate.juliaSet.PjJuliaSet
-
- All Implemented Interfaces:
- java.awt.event.ComponentListener, java.io.Serializable, java.lang.Cloneable, java.util.EventListener, PsTimeListenerIf, PsUpdateIf, PvPickListenerIf
public class PjJuliaSet extends PjProject implements java.awt.event.ComponentListener
Demo project for working with pixel images. Project displays a Julia set and a Mandelbrot set where the Julia set is determined by picking a module value in the Mandelbrot image. Picking in a Julia set will display several iterations of the picked point.Zoom into images by marking a rectangle in display using mark-mode.
- See Also:
- Serialized Form
- Author:
- Konrad Polthier
- Version:
- 04.11.06, 3.00 revised (kp) Moved to vgp.iterate.juliaSet and renamed.
01.10.05, 2.10 revised (kp) User interface improved.
10.08.05, 2.00 revised (kp) Functional extensions and efficiency optimization.
26.09.99, 1.00 created (kp)
-
-
Field Summary
-
Fields inherited from class jv.object.PsObject
HAS_BOUNDARY_PANEL, HAS_CONFIG_PANEL, HAS_INFO_PANEL, HAS_LABEL_PANEL, HAS_MATERIAL_PANEL, HAS_TEXTURE_PANEL, HAS_VECTOR_PANEL, INSPECTOR_INFO, INSPECTOR_INFO_EXT, IS_DELETED, IS_FIXED, IS_FOCUSSED, IS_PICKED, IS_SELECTED, IS_USED, NUM_TAGS
-
-
Constructor Summary
Constructors Constructor and Description PjJuliaSet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcomponentHidden(java.awt.event.ComponentEvent comp)Invoked when component has been hidden.voidcomponentMoved(java.awt.event.ComponentEvent comp)Invoked when component has been moved.voidcomponentResized(java.awt.event.ComponentEvent comp)When component has been resized all images must be resized.voidcomponentShown(java.awt.event.ComponentEvent comp)Invoked when component has been shown.voidcomputeColors(int[] pixArr, int[] valArr, int len, int maxVal, int colType)Compute color array from an array of scalar integer values.voidcomputeImageJulia(PvDisplayIf disp, double xMin, double yMin, double xMax, double yMax)Compute a Julia set in the given rectangle in the complex plane and updates the corresponding images.voidcomputeImageMandelbrot(PvDisplayIf disp, double xMin, double yMin, double xMax, double yMax)Compute a Mandelbrot set in the given rectangle in the complex plane and updates the corresponding images.voidcomputeJulia(int[] pixIter, int imageWidth, int imageHeight, int blockSize, double xMin, double yMin, double xMax, double yMax, int maxIter, PuComplex c)Compute a Julia set in the given rectangle in the complex plane.voidcomputeMandelbrot(int[] pixIter, int imageWidth, int imageHeight, int blockSize, double xMin, double yMin, double xMax, double yMax, int maxIter)Compute a Mandelbrot set in the given rectangle in the complex plane.PvDisplayIfgetDispJulia()Get display of Julia set.PvDisplayIfgetDispMandelbrot()Get display of Mandelbrot set which is used to select the complex parameter value c which determines the Julia set.voidinit()Initialize and reset project, stops the running animation if any.voidmarkVertices(PvPickEvent pickEvent)Method is called from display when user drags a rectangular array.voidpickInitial(PvPickEvent pickEvent)Method is called from display when a user picks into the display in initial-pick mode.voidstart()Called when project is launched by viewer on applet start.booleanupdate(java.lang.Object event)Update the class whenever a child has changed.-
Methods inherited from class jv.project.PjProject
addDisplay, addGeometry, addGeometry, dispose, dragDisplay, dragInitial, dragVertex, fitDisplays, getAnimation, getDisplay, getDisplays, getGeometry, getGeometry, getNumGeometries, getParameter, getParameterInfo, getViewer, hasAnimation, hasDisplay, isEnabledAutoFit, pickDisplay, pickVertex, removeDisplay, removeGeometries, removeGeometry, selectDisplay, selectGeometry, setAnimation, setBackColor, setBorderType, setDisplay, setEnabledAutoFit, setGeometry, setParameterInfo, setTime, setViewer, stop, unmarkVertices
-
Methods inherited from class jv.object.PsObject
addInspector, addUpdateListener, assureInspector, clearTag, clone, clone, clone, copy, getFather, getInfoPanel, getInspector, getName, getNumObjects, getSymbol, hasInspector, hasTag, hasUpdateListener, instanceOf, instanceOf, newInspector, newInspector, removeInspector, removeInspector, removeUpdateListener, setName, setParent, setSymbol, setTag, toString, updatePanels
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface jv.anim.PsTimeListenerIf
getName
-
Methods inherited from interface jv.project.PvPickListenerIf
getName
-
-
-
-
Method Detail
-
init
public void init()
Description copied from class:PjProjectInitialize and reset project, stops the running animation if any. Does not reset any registered display nor geometry. They must be reset individually in each subclass.
-
start
public void start()
Called when project is launched by viewer on applet start.- Overrides:
startin classPjProject- See Also:
PvViewerIf.start(),PjProject.isEnabledAutoFit()
-
update
public boolean update(java.lang.Object event)
Update the class whenever a child has changed. Method is usually invoked from the children.- Specified by:
updatein interfacePsUpdateIf- Overrides:
updatein classPsObject- Parameters:
event- carries a lot of information- Returns:
- true if event has been handled, otherwise false
- See Also:
PsObject.setParent(PsUpdateIf),PsObject.getFather(),PsObject.addUpdateListener(PsUpdateIf)
-
componentShown
public void componentShown(java.awt.event.ComponentEvent comp)
Invoked when component has been shown.- Specified by:
componentShownin interfacejava.awt.event.ComponentListener
-
componentHidden
public void componentHidden(java.awt.event.ComponentEvent comp)
Invoked when component has been hidden.- Specified by:
componentHiddenin interfacejava.awt.event.ComponentListener
-
componentMoved
public void componentMoved(java.awt.event.ComponentEvent comp)
Invoked when component has been moved.- Specified by:
componentMovedin interfacejava.awt.event.ComponentListener
-
componentResized
public void componentResized(java.awt.event.ComponentEvent comp)
When component has been resized all images must be resized.- Specified by:
componentResizedin interfacejava.awt.event.ComponentListener
-
getDispJulia
public PvDisplayIf getDispJulia()
Get display of Julia set. The shown Julia set is determined by a complex value c to be picked in the Mandelbrot image. Picking inside the Julia set will show the iterated values of the picked point z under the mapz -> z^2+c.
-
getDispMandelbrot
public PvDisplayIf getDispMandelbrot()
Get display of Mandelbrot set which is used to select the complex parameter value c which determines the Julia set.
-
markVertices
public void markVertices(PvPickEvent pickEvent)
Method is called from display when user drags a rectangular array. The pixel rectangle is converted into a rectangle in the complex plane and used to zoom into the Julia or Mandelbrot set.- Specified by:
markVerticesin interfacePvPickListenerIf- Overrides:
markVerticesin classPjProject- Parameters:
pickEvent- Everything in aPvPickEvent MarkBoxgets marked.
-
pickInitial
public void pickInitial(PvPickEvent pickEvent)
Method is called from display when a user picks into the display in initial-pick mode. This method iterates the picked point using the Julia or Mandelbrot function and displays the iterated points.- Specified by:
pickInitialin interfacePvPickListenerIf- Overrides:
pickInitialin classPjProject- Parameters:
pickEvent- Pick event issued by the display on left mouse pick.- See Also:
PvPickListenerIf
-
computeImageJulia
public void computeImageJulia(PvDisplayIf disp, double xMin, double yMin, double xMax, double yMax)
Compute a Julia set in the given rectangle in the complex plane and updates the corresponding images.Parameters determine a rectangle in the complex plane in which the Julia set is computed.
-
computeImageMandelbrot
public void computeImageMandelbrot(PvDisplayIf disp, double xMin, double yMin, double xMax, double yMax)
Compute a Mandelbrot set in the given rectangle in the complex plane and updates the corresponding images.Parameters determine a rectangle in the complex plane in which the Mandelbrot set is computed.
-
computeJulia
public void computeJulia(int[] pixIter, int imageWidth, int imageHeight, int blockSize, double xMin, double yMin, double xMax, double yMax, int maxIter, PuComplex c)Compute a Julia set in the given rectangle in the complex plane. Method returns a pixel array with given width and height. Adjusting the maximal number of iterations and blockSize allows to speed up the calculation at the cost of accuracy.The algorithm determines for given complex parameter c if the iteration f(z)=z*z+c diverges to infinity which is assumed if
|z|>4.Parameters determine a rectangle in the complex plane in which the Julia set is computed.
- Parameters:
pixIter- pixel image with RGB integers which will be computed.- Version:
- 10.08.05, 1.00 revised (kp) Major revision and optimization.
-
computeMandelbrot
public void computeMandelbrot(int[] pixIter, int imageWidth, int imageHeight, int blockSize, double xMin, double yMin, double xMax, double yMax, int maxIter)Compute a Mandelbrot set in the given rectangle in the complex plane. Method returns a pixel array with given width and height. Adjusting the maximal number of iterations and blockSize allows to speed up the calculation at the cost of accuracy.The algorithm determines for each z0 if the iteration f(z)=z*z+z0 diverges to infinity which is assumed if
|z|>4.Parameters determine a rectangle in the complex plane in which the Mandelbrot set is computed.
- Parameters:
pixIter- pixel image with RGB integers which will be computed.- Version:
- 10.08.05, 1.00 revised (kp) Major revision and optimization.
-
computeColors
public void computeColors(int[] pixArr, int[] valArr, int len, int maxVal, int colType)Compute color array from an array of scalar integer values. Transfer function depends on chosen color type.
-
-
"