public final class IteratorController
extends java.lang.Object
IteratorController
class provides functionality for concurrently calculating fractals.
Blocks on the screen are calculated in a random order.
Note that this class cannot be subclassed!
Modifier and Type | Field and Description |
---|---|
static int |
kDefaultNrOfBlocksToUse
The default number of blocks per dimension to use for the parallel calculations.
|
static int |
kMaxNrOfBlocksToUse
The maximum number of blocks per dimension to use for the parallel calculations.
|
Constructor and Description |
---|
IteratorController()
Constructs a
IteratorController object. |
Modifier and Type | Method and Description |
---|---|
ColoringParameters |
getColoringParameters()
Returns the colouring parameters.
|
AFractalIterator |
getFractalIterator()
Returns the fractal iterator.
|
IterationBuffer |
getFractalResultBuffer()
Returns the fractal result buffer.
|
org.sm.smtools.math.FunctionLookupTable |
getIterationsPDF()
Returns the PDF of the iterations.
|
int |
getNrOfBlocksToUse()
Returns the number of blocks to use for each screen dimension.
|
int |
getNrOfThreadsToUse()
Returns the number of threads that is used.
|
void |
installGUIControls(javax.swing.JFrame parentFrame,
org.sm.smtools.application.util.JProgressUpdateGlassPane progressUpdateGlassPane,
FractalPanel fractalPanel,
javax.swing.JLabel statusBarCalculationTimeLabel,
org.sm.smtools.application.util.JARResources resources)
Sets the parent frame, the progress update glass pane, the fractal panel,
and the status bar's calculation time label used for the multithreaded rendering.
|
boolean |
isBusy()
Checks whether or not we are in the middle of a calculation.
|
void |
recalc()
Triggers a multithreaded recalculation of the current fractal.
|
void |
setBusy(boolean isBusy)
Sets the busy flag.
|
void |
setEstimatePDF(boolean estimatePDF)
Specifies whether or not the PDF of the iteration count should be estimated.
|
void |
setFractalIteratorFamily(AFractalIterator fractalIterator)
Selects the family of the fractal iterator to be used.
|
void |
setFractalResultBuffer(IterationBuffer fractalResultBuffer)
Manually sets the fractal result buffer.
|
void |
setNrOfBlocksToUse(int nrOfBlocksToUse)
Sets the number of blocks to use for each screen dimension.
|
void |
setNrOfThreadsToUse(int nrOfThreadsToUse)
Sets the number of threads to use by creating a fixed thread pool.
|
public static final int kDefaultNrOfBlocksToUse
public static final int kMaxNrOfBlocksToUse
public IteratorController()
IteratorController
object.public ColoringParameters getColoringParameters()
public AFractalIterator getFractalIterator()
public IterationBuffer getFractalResultBuffer()
public org.sm.smtools.math.FunctionLookupTable getIterationsPDF()
public final int getNrOfBlocksToUse()
public final int getNrOfThreadsToUse()
public void installGUIControls(javax.swing.JFrame parentFrame, org.sm.smtools.application.util.JProgressUpdateGlassPane progressUpdateGlassPane, FractalPanel fractalPanel, javax.swing.JLabel statusBarCalculationTimeLabel, org.sm.smtools.application.util.JARResources resources)
parentFrame
- the parent frame (used for temporarily disabling resizing)progressUpdateGlassPane
- the progress update glass pane used for the multithreaded renderingfractalPanel
- the fractal panel used for the renderingstatusBarCalculationTimeLabel
- the status bar's calculation time labelresources
- a reference to the JAR resourcespublic boolean isBusy()
boolean
indicating whether or not we are in the middle of a calculationpublic void recalc()
public void setBusy(boolean isBusy)
isBusy
- a boolean
associated with the busy flagpublic void setEstimatePDF(boolean estimatePDF)
estimatePDF
- a boolean
specifying whether or not the PDF of the iteration count should be estimatedpublic void setFractalIteratorFamily(AFractalIterator fractalIterator)
fractalIterator
- the fractal iterator family to be usedpublic void setFractalResultBuffer(IterationBuffer fractalResultBuffer)
fractalResultBuffer
- the new fractal result bufferpublic void setNrOfBlocksToUse(int nrOfBlocksToUse)
nrOfBlocksToUse
- the number of blocks to use for each screen dimensionpublic void setNrOfThreadsToUse(int nrOfThreadsToUse)
Note that this number is bound by the number of available processor cores in the system.
nrOfThreadsToUse
- the number of threads to use for the fixed thread pool