net.sf.jame.mandelbrot.extensions.fractal.incolouring
Class AbstractIncolouringPaletteRuntime<T extends AbstractIncolouringPaletteConfig>

java.lang.Object
  extended by net.sf.jame.core.config.RuntimeElement
      extended by net.sf.jame.core.extension.ExtensionRuntime
          extended by net.sf.jame.core.extension.ConfigurableExtensionRuntime<T>
              extended by net.sf.jame.mandelbrot.fractal.incolouring.extension.IncolouringFormulaExtensionRuntime<T>
                  extended by net.sf.jame.mandelbrot.extensions.fractal.incolouring.AbstractIncolouringFormulaRuntime<T>
                      extended by net.sf.jame.mandelbrot.extensions.fractal.incolouring.AbstractIncolouringPaletteRuntime<T>
All Implemented Interfaces:
java.util.EventListener, ValueChangeListener
Direct Known Subclasses:
ModulusRuntime, ModulusRuntime, PhaseRuntime, PhaseRuntime, UniversalRuntime

public abstract class AbstractIncolouringPaletteRuntime<T extends AbstractIncolouringPaletteConfig>
extends AbstractIncolouringFormulaRuntime<T>

Author:
Andrea Medeghini

Field Summary
protected  int[] colorTable
           
protected  RenderingFormulaExtensionRuntime<?> formulaRuntime
           
protected  int maxColors
           
protected  Palette palette
           
 
Constructor Summary
AbstractIncolouringPaletteRuntime()
           
 
Method Summary
 void configReloaded()
          Called when config is changed.
 boolean isChanged()
          Tests and resets the change counter.
 void prepareForRendering(RenderingFormulaExtensionRuntime<?> formulaRuntime, int maxColors)
          Sets the iterations.
 int renderColor(RenderedPoint cp)
           
 int renderColor(RenderedPoint cp, int shift)
           
protected abstract  int renderIndex(RenderedPoint cp)
           
 
Methods inherited from class net.sf.jame.mandelbrot.extensions.fractal.incolouring.AbstractIncolouringFormulaRuntime
dispose, isHorizontalSymetryAllowed, isSolidGuessAllowed, isVerticalSymetryAllowed
 
Methods inherited from class net.sf.jame.core.extension.ConfigurableExtensionRuntime
getConfig, setConfig, valueChanged
 
Methods inherited from class net.sf.jame.core.config.RuntimeElement
changeCount, finalize, fireChanged
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

formulaRuntime

protected RenderingFormulaExtensionRuntime<?> formulaRuntime

colorTable

protected int[] colorTable

palette

protected Palette palette

maxColors

protected int maxColors
Constructor Detail

AbstractIncolouringPaletteRuntime

public AbstractIncolouringPaletteRuntime()
Method Detail

prepareForRendering

public void prepareForRendering(RenderingFormulaExtensionRuntime<?> formulaRuntime,
                                int maxColors)
Description copied from class: IncolouringFormulaExtensionRuntime
Sets the iterations.

Overrides:
prepareForRendering in class AbstractIncolouringFormulaRuntime<T extends AbstractIncolouringPaletteConfig>
maxColors - the number of colours.
See Also:
AbstractIncolouringFormulaRuntime.prepareForRendering(net.sf.jame.mandelbrot.fractal.rendering.extension.RenderingFormulaExtensionRuntime, int)

renderColor

public int renderColor(RenderedPoint cp)
Specified by:
renderColor in class IncolouringFormulaExtensionRuntime<T extends AbstractIncolouringPaletteConfig>
Parameters:
cp -
Returns:
the color.

renderColor

public int renderColor(RenderedPoint cp,
                       int shift)
Specified by:
renderColor in class IncolouringFormulaExtensionRuntime<T extends AbstractIncolouringPaletteConfig>
Parameters:
cp -
shift -
Returns:
the color.

renderIndex

protected abstract int renderIndex(RenderedPoint cp)
Parameters:
cp -
Returns:
the index.

isChanged

public boolean isChanged()
Description copied from class: RuntimeElement
Tests and resets the change counter.

Overrides:
isChanged in class RuntimeElement
Returns:
true if the change counter is greater than 0.
See Also:
RuntimeElement.isChanged()

configReloaded

public void configReloaded()
Description copied from class: ConfigurableExtensionRuntime
Called when config is changed.

Overrides:
configReloaded in class ConfigurableExtensionRuntime<T extends AbstractIncolouringPaletteConfig>
See Also:
ConfigurableExtensionRuntime.configReloaded()