com.rubecula.darwin.examples.pepperedmoth
Class VisualizationFactory_PepperedMoth

java.lang.Object
  extended by com.rubecula.darwin.examples.pepperedmoth.VisualizationFactory_PepperedMoth
All Implemented Interfaces:
VisualizationFactory

public class VisualizationFactory_PepperedMoth
extends java.lang.Object
implements VisualizationFactory

Lifespan: Transient TODO add property angle for peppered moth to lean (once symbol is no longer circle) Class responsible for creating visualization objects for the PepperedMoth application. TODO consider extending AToString

Author:
Robin Hillyard

Constructor Summary
VisualizationFactory_PepperedMoth(org.apache.commons.math.random.RandomGenerator random)
          Public primary constructor.
 
Method Summary
static java.awt.Color convertToGrayLevel(float greyValue, float max)
           
 int getHeight()
           
 int getWidth()
           
static WingColor getWingColor(Organism organism)
          TODO Consider moving this somewhere else.
 Avatar makeAvatar(Individual individual, java.util.Map<java.lang.String,java.lang.Object> properties)
          XXX properties is unused.
 java.awt.Color makeColor(Individual individual)
          Method to determine a suitable color for visualizing the organism
 java.awt.Point makeLocation(Individual individual)
          Method to determine a suitable location for visualizing the organism
 void setHeight(int height)
          set the height of the space available for visualization.
 void setWidth(int width)
          the width of the space available for visualization.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

VisualizationFactory_PepperedMoth

public VisualizationFactory_PepperedMoth(org.apache.commons.math.random.RandomGenerator random)
Public primary constructor.

Parameters:
random -
Method Detail

convertToGrayLevel

public static java.awt.Color convertToGrayLevel(float greyValue,
                                                float max)
Parameters:
greyValue - the color in range 0=white ... max=black
max - the maximum color value
Returns:
a shade of grey corresponding to the geryValue given. XXX consider moving this method

getWingColor

public static WingColor getWingColor(Organism organism)
TODO Consider moving this somewhere else.

Parameters:
organism -
Returns:
the wing color as a string.

getHeight

public int getHeight()
Specified by:
getHeight in interface VisualizationFactory
Returns:
the height of the space available for visualization. XXX not strictly necessary.
See Also:
VisualizationFactory.getHeight()

getWidth

public int getWidth()
Specified by:
getWidth in interface VisualizationFactory
Returns:
the width of the space available for visualization. XXX not strictly necessary.
See Also:
VisualizationFactory.getWidth()

makeAvatar

public Avatar makeAvatar(Individual individual,
                         java.util.Map<java.lang.String,java.lang.Object> properties)
XXX properties is unused.

Specified by:
makeAvatar in interface VisualizationFactory
Parameters:
individual - the individual to be represented by the Avatar.
properties - the properties of the visualization model
Returns:
the result of invoking AvatarFactory.makeAvatar(Individual, Point, Color)
See Also:
VisualizationFactory.makeAvatar(Individual, java.util.Map)

makeColor

public java.awt.Color makeColor(Individual individual)
Description copied from interface: VisualizationFactory
Method to determine a suitable color for visualizing the organism

Specified by:
makeColor in interface VisualizationFactory
Returns:
the appropriate color
See Also:
VisualizationFactory.makeColor(Individual)

makeLocation

public java.awt.Point makeLocation(Individual individual)
Description copied from interface: VisualizationFactory
Method to determine a suitable location for visualizing the organism

Specified by:
makeLocation in interface VisualizationFactory
Returns:
the appropriate location
See Also:
VisualizationFactory.makeLocation(Individual)

setHeight

public void setHeight(int height)
Description copied from interface: VisualizationFactory
set the height of the space available for visualization.

Specified by:
setHeight in interface VisualizationFactory
See Also:
VisualizationFactory.setHeight(int)

setWidth

public void setWidth(int width)
Description copied from interface: VisualizationFactory
the width of the space available for visualization.

Specified by:
setWidth in interface VisualizationFactory
See Also:
VisualizationFactory.setWidth(int)


Copyright © 2010 Rubecula Software, LLC. All Rights Reserved.