simulation_MVC_Basic
Class Model

java.lang.Object
  extended by simulation_MVC_Basic.Model

public class Model
extends java.lang.Object

This interface encapsulates the definition of functionality for a data model for a game world. Such data models consist of a collection of ShapeSprites.

Author:
mb

Field Summary
static java.util.logging.Logger logger
           
 
Constructor Summary
Model(java.awt.Dimension worldDimension)
           
 
Method Summary
 void addAnotherSprite()
           
 void addListener(ModelListener listener)
          Add a listener to this model.
 void advanceNextState()
          Updates the data model to reflect whatever actions occur in the duration of one new frame.
 void drawCurrentState(java.awt.Graphics2D graphics)
           
 java.awt.Dimension getWorldDimension()
           
 void notifyModelHasChanged()
           
 void removeSprite()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

public static java.util.logging.Logger logger
Constructor Detail

Model

public Model(java.awt.Dimension worldDimension)
Method Detail

getWorldDimension

public java.awt.Dimension getWorldDimension()

advanceNextState

public void advanceNextState()
Updates the data model to reflect whatever actions occur in the duration of one new frame. Draws the game world on the passed Graphics2D instance.


addListener

public void addListener(ModelListener listener)
Add a listener to this model.

Parameters:
listener -

notifyModelHasChanged

public void notifyModelHasChanged()

drawCurrentState

public void drawCurrentState(java.awt.Graphics2D graphics)

addAnotherSprite

public void addAnotherSprite()

removeSprite

public void removeSprite()