The Design and Implementation of Multimedia Software
An Example with Static Sampled Visual Content

The Code

ImagesApp.prototype   = new MultimediaApp();
ImagesApp.prototype.constructor = ImagesApp;

MultimediaApp.images = ["house.png","snowflake.png"];


/**
 * Default Constructor
 */
function ImagesApp()
{
}


/**
 * Initialize this app
 */
ImagesApp.prototype.init = function()
{
   this.view          = new VisualizationView(this.canvas);
   this.visualization = new Visualization(this.view);
   
   var image = this.imageFactory.createBufferedImage("house.png");
   var house = new SampledContent(image);
   house.setLocation(0,0);
   this.visualization.add(house);
   
   var image = this.imageFactory.createBufferedImage("snowflake.png");
   var snowflake = new SampledContent(image);
   snowflake.setLocation(50,50);
   this.visualization.add(snowflake);
   
   this.visualization.repaint();
}