The Physiologist's Friend Simulation API

ch.unizh.ini.friend.stimulus
Class ConcreteStimulus

java.lang.Object
  extended by ch.unizh.ini.friend.stimulus.AbstractStimulus
      extended by ch.unizh.ini.friend.stimulus.ConcreteStimulus
All Implemented Interfaces:
Updateable, Stimulus, Cloneable
Direct Known Subclasses:
BarStimulus, ColorStimulusImpl, GratingStimulus, SpotStimulus

public class ConcreteStimulus
extends AbstractStimulus
implements Cloneable

Provides a generic implementation of a stimulus. This stimulus has a set of shapes, a set of transforms, a foreground and background brightness. It is an entire stimulus. Specific subclasses of this class correspond to specific stimuli shapes.

The excitation of a Photoreceptor can be computed using the Photoreceptor.excitation() method.

If the stimulus transform is modified, use update() to update the cached stimulus shape???

Version:
$Revision: 1.13 $
Author:
Christof Marti/Tobi Delbruck
See Also:
BarStimulus, EdgeStimulus, GratingStimulus

Field Summary
 
Fields inherited from class ch.unizh.ini.friend.stimulus.AbstractStimulus
backgroundExcitationDensity, BRIGHTNESS_CHANGE_RATIO, foregroundExcitationDensity, newBackgroundExcitationDensity, newForegroundExcitationDensity, newShape, shapes, transforms
 
Fields inherited from interface ch.unizh.ini.friend.stimulus.Stimulus
BACKGROUND_BRIGHTNESS, BRIGHTEN_BACKGROUND, BRIGHTEN_FOREGROUND, DARKEN_BACKGROUND, DARKEN_FOREGROUND, FOREGROUND_BRIGHTNESS, RESIZE_RATIO, ROTATE_BY
 
Constructor Summary
ConcreteStimulus()
          creates a new instance of ConcreteStimulus with a null list of shapes.
ConcreteStimulus(ShapeList shapes)
          Creates a new instance with the given shapes.
ConcreteStimulus(Transformable shape)
          create a ConcreteStimulus with a single Transformable shape.
 
Method Summary
 Object clone()
          clones the foreground density, background density, and the transformed ShapeList
 void update()
          Updates the actual state to the newly computed - AKA double-buffering.
 
Methods inherited from class ch.unizh.ini.friend.stimulus.AbstractStimulus
addShape, brightenBackground, brightenForeground, clearShapes, compute, darkenBackground, darkenForeground, expand, fatten, flipContrast, getBackgroundExcitationDensity, getForegroundExcitationDensity, getShapes, getTransformedShapes, getTransforms, isVisible, lengthen, removeShape, rotate, rotateCCW, rotateCW, setBackgroundExcitationDensity, setForegroundExcitationDensity, setShapes, setTransforms, setVisible, shorten, shrink, thin, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ConcreteStimulus

public ConcreteStimulus()
creates a new instance of ConcreteStimulus with a null list of shapes.


ConcreteStimulus

public ConcreteStimulus(ShapeList shapes)
Creates a new instance with the given shapes.

Parameters:
shapes - A list of Transformable shapes.
See Also:
ConcreteStimulus

ConcreteStimulus

public ConcreteStimulus(Transformable shape)
create a ConcreteStimulus with a single Transformable shape. This constuctor constructs the ShapeList from the shape.

Parameters:
shape - some Transformable shape, constructed from e.g. ConvexPolygon.getRectangleInstance(float, float, float, float).
Method Detail

update

public void update()
Updates the actual state to the newly computed - AKA double-buffering.

Specified by:
update in interface Updateable
Overrides:
update in class AbstractStimulus

clone

public Object clone()
clones the foreground density, background density, and the transformed ShapeList

Overrides:
clone in class Object

http://www.ini.unizh.ch/~tobi/friend