com.rubecula.darwin.visualization
Class Painter_ColoredCircle

java.lang.Object
  extended by com.rubecula.darwin.visualization.Painter_
      extended by com.rubecula.darwin.visualization.Painter_ColoredCircle
All Implemented Interfaces:
Painter

public final class Painter_ColoredCircle
extends Painter_

Lifespan: permanent. Default implementation of Painter. In this implementation, paintPopulation resets the given graphics context to the background, then draws a given title (in red); and paintIndividual draws a circle (diameter 20) of the appropriate color at the appropriate location.

Author:
Robin Hillyard

Field Summary
 
Fields inherited from interface com.rubecula.darwin.visualization.Painter
BACKGROUND_COLOR
 
Constructor Summary
Painter_ColoredCircle(java.lang.String title)
           
 
Method Summary
 void paintBase(java.awt.Graphics g, int width, int height)
          Base method: simply clears the rectangle defined by {0, 0, width, height} to the (previously defined) background color.
 void paintIndividual(java.awt.Graphics g, Avatar avatar)
          Method to paint a representation of an organism.
 
Methods inherited from class com.rubecula.darwin.visualization.Painter_
isIdentify, paintIdentification, paintVisualization, setIdentify
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Painter_ColoredCircle

public Painter_ColoredCircle(java.lang.String title)
Parameters:
title -
Method Detail

paintBase

public void paintBase(java.awt.Graphics g,
                      int width,
                      int height)
Description copied from class: Painter_
Base method: simply clears the rectangle defined by {0, 0, width, height} to the (previously defined) background color. /* (non-Javadoc)

Specified by:
paintBase in interface Painter
Overrides:
paintBase in class Painter_
Parameters:
g - a graphics context, typically a buffered image.
width - the width of the area in which we may draw (0..width are legal for x coordinates).
height - the height of the area in which we may draw (0..height are legal for y coordinates).
See Also:
Painter_.paintBase(java.awt.Graphics, int, int)

paintIndividual

public void paintIndividual(java.awt.Graphics g,
                            Avatar avatar)
Description copied from interface: Painter
Method to paint a representation of an organism. This method is called (indirectly) by Visualizer_.paintComponent(Graphics) method, once for each individual.

Parameters:
g - a graphics context, typically a buffered image.
avatar - the individual from the population model to be painted.
See Also:
Painter.paintIndividual(java.awt.Graphics, com.rubecula.darwin.visualization.Avatar)


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