java.lang.Object
com.arranger.jarl.base.BaseJarlObject
com.arranger.jarl.base.BaseTimedJarlObject
com.arranger.jarl.widget.BaseWidget
com.arranger.jarl.widget.BaseSegmentWidget
com.arranger.jarl.widget.filter.BaseFilterWidget
com.arranger.jarl.widget.filter.Fractal
- All Implemented Interfaces:
- java.lang.Cloneable, com.arranger.jarl.base.IJarlObject, com.arranger.jarl.base.ITimedJarlObject, com.arranger.jarl.widget.IWidget, com.arranger.jarl.util.IWidgetConfigSegmentFactory, com.arranger.jarl.widget.IWidgetDef
- public class Fractal
- extends BaseFilterWidget
Fractal creates a mandelbrot fractal. note, this currently will ignore
traits, strokes & filters...
| Nested classes inherited from class com.arranger.jarl.widget.BaseSegmentWidget |
com.arranger.jarl.widget.BaseSegmentWidget.BaseWidgetConfigSegment |
|
Method Summary |
protected void |
_paint(com.arranger.jarl.base.IContext context,
java.awt.Graphics2D graphics2D)
Called from within BaseWidget.paint(com.arranger.jarl.base.IContext, java.awt.Graphics2D)>BaseWidget.paint(com.arranger.jarl.base.IContext, java.awt.Graphics2D) 55 |
protected void |
addJarlObjectInfo(com.arranger.jarl.base.IJarlObjectInfo jarlObjectInfo)
Override this, and for every field that you're using, call BaseJarlObject.populateInfo(com.arranger.jarl.base.IJarlObjectInfo, java.lang.String, java.lang.String, com.arranger.jarl.base.IJarlObjectInfo.IJarlObjectDisplay)>BaseJarlObject.populateInfo(com.arranger.jarl.base.IJarlObjectInfo, java.lang.String, java.lang.String, com.arranger.jarl.base.IJarlObjectInfo.IJarlObjectDisplay) 55
for example:
populateInfo(jarlObjectInfo, "zOrder", "Z-Order", JarlInfoUtil.PRIMITIVE_DISPLAY);
|
com.arranger.jarl.util.WidgetConfigSegment |
createSegment(org.w3c.dom.Element element)
Create a concrete com.arranger.jarl.util.WidgetConfigSegment based on this element |
protected java.awt.Color |
getColorForPoint(double x,
double y,
double delta,
double height,
int maxIterations,
ComplexRect complexRect,
java.awt.Color[] colors)
|
protected void |
initAttributes(com.arranger.jarl.base.IContext context)
Always remember some attrs might not be there |
protected void |
paintFractal(double width,
double height,
int maxIterations,
ComplexRect complexRect,
java.awt.Graphics2D graphics2D,
java.awt.Color[] colors,
com.arranger.jarl.base.IContext context)
|
protected java.awt.Color[] |
prepareColorArray(com.arranger.jarl.base.IContext context)
Get the gradient color map |
protected int |
testPoint(double cR,
double cI,
int maxIterations)
Is the given complex point, (cR, cI), in the Mandelbrot set?
Use the formula: z <= z*z + c, where z is initially equal to c. |
| Methods inherited from class com.arranger.jarl.widget.BaseWidget |
centerShape, clone, cloneCollection, getColor, getFilters, getParent, getStrokes, getTraits, init, initInstance, paint, paintShape, setColor, setParent |
NUM_COLORS
protected static final int NUM_COLORS
- See Also:
- Constant Field Values
m_gradientIndex
protected int m_gradientIndex
m_iterations
protected int m_iterations
m_complexRect
protected ComplexRect m_complexRect
m_startGradientIndex
protected int m_startGradientIndex
m_endGradientIndex
protected int m_endGradientIndex
m_startIterations
protected int m_startIterations
m_endIterations
protected int m_endIterations
m_startComplexRect
protected ComplexRect m_startComplexRect
m_endComplexRect
protected ComplexRect m_endComplexRect
Fractal
public Fractal()
_paint
protected void _paint(com.arranger.jarl.base.IContext context,
java.awt.Graphics2D graphics2D)
- Description copied from class:
com.arranger.jarl.widget.BaseWidget
- Called from within BaseWidget.paint(com.arranger.jarl.base.IContext, java.awt.Graphics2D)>
BaseWidget.paint(com.arranger.jarl.base.IContext, java.awt.Graphics2D) 55
paintFractal
protected void paintFractal(double width,
double height,
int maxIterations,
ComplexRect complexRect,
java.awt.Graphics2D graphics2D,
java.awt.Color[] colors,
com.arranger.jarl.base.IContext context)
getColorForPoint
protected java.awt.Color getColorForPoint(double x,
double y,
double delta,
double height,
int maxIterations,
ComplexRect complexRect,
java.awt.Color[] colors)
testPoint
protected int testPoint(double cR,
double cI,
int maxIterations)
- Is the given complex point, (cR, cI), in the Mandelbrot set?
Use the formula: z <= z*z + c, where z is initially equal to c.
If |z| >= 2, then the point is not in the set.
Return 0 if the point is in the set; else return the number of
iterations it took to decide that the point is not in the set.
prepareColorArray
protected java.awt.Color[] prepareColorArray(com.arranger.jarl.base.IContext context)
- Get the gradient color map
initAttributes
protected void initAttributes(com.arranger.jarl.base.IContext context)
- Description copied from class:
BaseFilterWidget
- Always remember some attrs might not be there
- Overrides:
initAttributes in class BaseFilterWidget
addJarlObjectInfo
protected void addJarlObjectInfo(com.arranger.jarl.base.IJarlObjectInfo jarlObjectInfo)
- Description copied from class:
com.arranger.jarl.base.BaseJarlObject
- Override this, and for every field that you're using, call BaseJarlObject.populateInfo(com.arranger.jarl.base.IJarlObjectInfo, java.lang.String, java.lang.String, com.arranger.jarl.base.IJarlObjectInfo.IJarlObjectDisplay)>
BaseJarlObject.populateInfo(com.arranger.jarl.base.IJarlObjectInfo, java.lang.String, java.lang.String, com.arranger.jarl.base.IJarlObjectInfo.IJarlObjectDisplay) 55
for example:
populateInfo(jarlObjectInfo, "zOrder", "Z-Order", JarlInfoUtil.PRIMITIVE_DISPLAY);
createSegment
public com.arranger.jarl.util.WidgetConfigSegment createSegment(org.w3c.dom.Element element)
- Description copied from class:
com.arranger.jarl.widget.BaseSegmentWidget
- Create a concrete com.arranger.jarl.widget.BaseSegmentWidget.BaseWidgetConfigSegment based on this element