package secondswing;

/**
 * Title:
 * Description:
 * Copyright:    Copyright (c) 2002
 * Company:
 * @author Burton Rosenberg
 * @version 9 April 2002 [creation date: 9 April 2002]
 */

import java.awt.* ;
import javax.swing.* ;

/* we use a Model-View-Controller pattern, with
 * Controller also handling Model
 */

public class SecondSwingTest {

  static final String FRAME_TITLE = "SecondSwingTest" ;
  static final int FRAME_X = 600 ;
  static final int FRAME_Y = 400 ;

  static final int X_ORG = 80 ;
  static final int Y_ORG = 40 ;
  static final int BAR_HEIGHT = 20 ;
  static final int [] GEOMETRY = { X_ORG, Y_ORG, BAR_HEIGHT } ;

  public static void main(String[] args) {

    // top-level container
    JFrame jf = new JFrame(FRAME_TITLE) ;

    // build Controller and View.
    // View sends Events to Controller;
    // Controller provides model to Viewer.
    MyController mc = new MyController() ;
    MyView mv = new MyView( mc, GEOMETRY ) ;
    mc.setView(mv) ;

    // put View into frame, and show it
    jf.getContentPane().add((JPanel)mv,BorderLayout.CENTER) ;
    jf.setSize(FRAME_X, FRAME_Y) ;
    jf.setVisible(true) ;
  }
}
