package visual.dynamic.described;


import java.awt.*;
import java.awt.geom.*;
import javax.swing.*;

import app.*;
import visual.*;
import visual.dynamic.described.FloatingSprite;
import visual.dynamic.described.Stage;
import visual.statik.sampled.*;

/**
 * A simple example of described dynamic visual content
 * 
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.0
 *
 */
public class   FloatingSpriteApp
       extends AbstractMultimediaApp
{
    /**
     * The entry point
     */
    public void init()
    {
//[skeleton0.

       ContentFactory                  contentFactory;
       FloatingSprite                  sprite;
       int                             height, width;       
       JPanel                          contentPane;       
       Stage                           stage;
       TransformableContent            content;
       VisualizationView               stageView;       
              
       width   = 640;
       height  = 480;       

       // The Stage
       stage        = new Stage(50);
       stage.setBackground(new Color(255, 255, 255)); 
       stageView = stage.getView();
       stageView.setBounds(0,0,width,height);       

       // The Sprite
       contentFactory = new ContentFactory();
       content = contentFactory.createContent(
                    "/visual/dynamic/described/snowflake.gif", 
                    4, false);
       sprite  = new FloatingSprite(content, width, height);
       stage.add(sprite);

              
       // The content pane
       contentPane = (JPanel)rootPaneContainer.getContentPane();
       contentPane.add(stageView);

       // Start the dynamics
       stage.start();
//]skeleton0.
    }


}
