001 /* 002 * SoloRecipie.java 003 * 004 * Created on December 18, 2002, 4:29 PM 005 */ 006 007 package spirograph; 008 009 /** 010 * This is an independant (undocked) container for a recipie view. It is inteded 011 * to provide a means by which to visually compare the rules for any number 012 * of recipies, (within the limitations of screen space). 013 * 014 * <p>Copyright © 2002-2003 Franklin W. Olin College of Engineering</p> 015 * 016 * @author Patrick G. Heck, gus.heck@olin.edu 017 */ 018 public class SoloRecipie extends javax.swing.JFrame { 019 020 /** 021 * Creates new form SoloRecipie. This constructor isn't very useful right now, 022 * but it keeps NetBeans happy. In the future setter functions might be applied 023 * to make this useful, but it is not needed right now. 024 * 025 */ 026 public SoloRecipie() { 027 initComponents(); 028 } 029 030 /** 031 * Creates a new <code>SoloRecipie</code>. It also creates a new 032 * {@link RecipieView}, and registers it with the parent controler as an 033 * {@link EtchControlListener}. 034 * 035 * @param r The recipie that is to be displayed 036 * @param parentControler The EtchControl that spawned us. 037 * @param title The title for the new JFrame window 038 */ 039 public SoloRecipie(Recipie r, EtchControl parentControler, String title) { 040 this(); 041 setTitle(title); 042 parentControler.addEtchControlListener(recipieView1); 043 recipieView1.setRecipie(r); 044 r.fireRecipieChanged(); 045 } 046 047 /** This method is called from within the constructor to 048 * initialize the form. 049 * WARNING: Do NOT modify this code. The content of this method is 050 * always regenerated by the Form Editor. 051 */ 052 private void initComponents() {//GEN-BEGIN:initComponents 053 recipieView1 = new spirograph.RecipieView(); 054 055 addWindowListener(new java.awt.event.WindowAdapter() { 056 public void windowClosing(java.awt.event.WindowEvent evt) { 057 exitForm(evt); 058 } 059 }); 060 061 getContentPane().add(recipieView1, java.awt.BorderLayout.CENTER); 062 063 pack(); 064 java.awt.Dimension screenSize = java.awt.Toolkit.getDefaultToolkit().getScreenSize(); 065 setSize(new java.awt.Dimension(400, 320)); 066 setLocation((screenSize.width-400)/2,(screenSize.height-320)/2); 067 }//GEN-END:initComponents 068 069 /** Exit the Application */ 070 private void exitForm(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_exitForm 071 hide(); 072 dispose(); 073 }//GEN-LAST:event_exitForm 074 075 076 // Variables declaration - do not modify//GEN-BEGIN:variables 077 private spirograph.RecipieView recipieView1; 078 // End of variables declaration//GEN-END:variables 079 080 } 081 082 /* 083 * $Log: SoloRecipie.java,v $ 084 * Revision 1.5 2003/01/17 23:19:53 gus 085 * copyright info 086 * 087 * Revision 1.4 2003/01/17 20:49:59 gus 088 * Added javadoc 089 * 090 * Revision 1.3 2003/01/15 18:26:50 gus 091 * accomodate the renamining of editRecipie to setRecipie in RecipieVeiw 092 * 093 * Revision 1.2 2003/01/15 17:36:10 gus 094 * adding log keywords to files that don't have them 095 * 096 */