home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VCafe / ddetour.bin / Reserve.class (.txt) < prev    next >
Encoding:
Java Class File  |  1998-03-19  |  9.9 KB  |  320 lines

  1. import java.applet.Applet;
  2. import java.awt.Button;
  3. import java.awt.Color;
  4. import java.awt.Component;
  5. import java.awt.Container;
  6. import java.awt.Cursor;
  7. import java.awt.Font;
  8. import java.awt.Label;
  9. import java.awt.LayoutManager;
  10. import java.awt.Panel;
  11. import java.awt.event.ActionEvent;
  12. import java.awt.event.FocusEvent;
  13. import java.beans.PropertyVetoException;
  14. import java.net.MalformedURLException;
  15. import symantec.itools.awt.util.ToolBarPanel;
  16. import symantec.itools.db.awt.DBTstamp;
  17. import symantec.itools.db.awt.FormattedTextField;
  18. import symantec.itools.db.awt.ImageViewer;
  19. import symantec.itools.db.awt.TextArea;
  20. import symantec.itools.db.awt.TextField;
  21. import symantec.itools.db.beans.jdbc.QueryNavigator;
  22. import symantec.itools.lang.Context;
  23. import symantec.itools.net.RelativeURL;
  24.  
  25. public class Reserve extends Applet {
  26.    QueryNavigator DBA_packagesNavigator;
  27.    QueryNavigator DBA_registrationNavigator;
  28.    Panel dbControlsPanel;
  29.    ToolBarPanel dbButtonsPanel;
  30.    Button DBA_packagesNavigator_next;
  31.    Button DBA_packagesNavigator_previous;
  32.    Label Package_IDLabel;
  33.    Label Package_NameLabel;
  34.    Label Start_DateLabel;
  35.    Label Number_of_DaysLabel;
  36.    Label Price_Per_PersonLabel;
  37.    Label DescriptionLabel;
  38.    FormattedTextField Package_ID;
  39.    TextField Package_Name;
  40.    DBTstamp Start_Date;
  41.    FormattedTextField Number_of_Days;
  42.    TextField Price_Per_Person;
  43.    ImageViewer Image;
  44.    TextArea Description;
  45.    symantec.itools.multimedia.ImageViewer imageViewerPackage;
  46.    ToolBarPanel dbButtonsPanel2;
  47.    Button DBA_registrationNavigator_save;
  48.    Button DBA_registrationNavigator_undoChanges;
  49.    Label Package_IDLabel2;
  50.    Label Customer_First_NameLabel;
  51.    Label Customer_Last_NameLabel;
  52.    Label Customer_EmailLabel;
  53.    Label Customer_PhoneLabel;
  54.    Label Number_in_PartyLabel;
  55.    Label Total_CostLabel;
  56.    FormattedTextField Package_ID2;
  57.    TextField Customer_First_Name;
  58.    TextField Customer_Last_Name;
  59.    TextField Customer_Email;
  60.    FormattedTextField Customer_Phone;
  61.    TextField Number_in_Party;
  62.    TextField Total_Cost;
  63.    symantec.itools.multimedia.ImageViewer imageViewerReg;
  64.  
  65.    public void init() {
  66.       Context.setApplet(this);
  67.       ((Container)this).setLayout((LayoutManager)null);
  68.       ((Component)this).setSize(615, 545);
  69.       ((Component)this).setFont(new Font("Dialog", 0, 12));
  70.       ((Component)this).setForeground(new Color(0));
  71.       ((Component)this).setBackground(new Color(16777215));
  72.       this.DBA_packagesNavigator = new QueryNavigator();
  73.       this.DBA_packagesNavigator.setAutoStart(true);
  74.       this.DBA_packagesNavigator.setClassName("DBA_packagesRecord");
  75.       this.DBA_packagesNavigator.setAliasName("DBA_packages_Applet1_QNAlias");
  76.       this.DBA_registrationNavigator = new QueryNavigator();
  77.       this.DBA_registrationNavigator.setClassName("DBA_registrationRecord");
  78.       this.DBA_registrationNavigator.setAliasName("DBA_registration_Reserve_QNAlias");
  79.       this.dbControlsPanel = new Panel();
  80.       this.dbControlsPanel.setLayout((LayoutManager)null);
  81.       this.dbControlsPanel.setBounds(3, 3, 609, 528);
  82.       ((Container)this).add(this.dbControlsPanel);
  83.       this.dbButtonsPanel = new ToolBarPanel();
  84.       this.dbButtonsPanel.setBounds(105, 303, 136, 30);
  85.       this.dbButtonsPanel.setBackground(new Color(12632256));
  86.       this.dbControlsPanel.add(this.dbButtonsPanel);
  87.       this.DBA_packagesNavigator_next = new Button();
  88.       this.DBA_packagesNavigator_next.setLabel("Next        ");
  89.       this.DBA_packagesNavigator_next.setBounds(0, 0, 62, 23);
  90.       this.DBA_packagesNavigator_next.setBackground(new Color(12632256));
  91.       this.dbButtonsPanel.add(this.DBA_packagesNavigator_next);
  92.       this.DBA_packagesNavigator_previous = new Button();
  93.       this.DBA_packagesNavigator_previous.setLabel("Previous");
  94.       this.DBA_packagesNavigator_previous.setBounds(62, 0, 62, 23);
  95.       this.DBA_packagesNavigator_previous.setBackground(new Color(12632256));
  96.       this.dbButtonsPanel.add(this.DBA_packagesNavigator_previous);
  97.       this.Package_IDLabel = new Label("Package ID");
  98.       this.Package_IDLabel.setBounds(357, 42, 117, 20);
  99.       this.dbControlsPanel.add(this.Package_IDLabel);
  100.       this.Package_NameLabel = new Label("Package Name");
  101.       this.Package_NameLabel.setBounds(6, 42, 117, 20);
  102.       this.dbControlsPanel.add(this.Package_NameLabel);
  103.       this.Start_DateLabel = new Label("Start Date");
  104.       this.Start_DateLabel.setBounds(357, 69, 117, 20);
  105.       this.dbControlsPanel.add(this.Start_DateLabel);
  106.       this.Number_of_DaysLabel = new Label("Number of Days");
  107.       this.Number_of_DaysLabel.setBounds(357, 96, 117, 20);
  108.       this.dbControlsPanel.add(this.Number_of_DaysLabel);
  109.       this.Price_Per_PersonLabel = new Label("Price Per Person");
  110.       this.Price_Per_PersonLabel.setBounds(357, 123, 117, 20);
  111.       this.dbControlsPanel.add(this.Price_Per_PersonLabel);
  112.       this.DescriptionLabel = new Label("Description");
  113.       this.DescriptionLabel.setBounds(357, 150, 128, 20);
  114.       this.dbControlsPanel.add(this.DescriptionLabel);
  115.       this.Package_ID = new FormattedTextField();
  116.       this.Package_ID.setDataBinding("DBA_packages_Applet1_QNAlias@Package_ID");
  117.       this.Package_ID.setEditable(false);
  118.       this.Package_ID.setBounds(474, 42, 99, 20);
  119.       this.Package_ID.setBackground(new Color(12632256));
  120.       this.dbControlsPanel.add(this.Package_ID);
  121.       this.Package_ID.setCursor(new Cursor(2));
  122.       this.Package_Name = new TextField();
  123.       this.Package_Name.setDataBinding("DBA_packages_Applet1_QNAlias@Package_Name");
  124.       this.Package_Name.setEditable(false);
  125.       this.Package_Name.setBounds(132, 42, 200, 20);
  126.       this.Package_Name.setFont(new Font("Dialog", 1, 12));
  127.       this.Package_Name.setBackground(new Color(12632256));
  128.       this.dbControlsPanel.add(this.Package_Name);
  129.       this.Package_Name.setCursor(new Cursor(2));
  130.       this.Start_Date = new DBTstamp();
  131.       this.Start_Date.setDisplayFormat("M+ D%, Y*");
  132.       this.Start_Date.setDataBinding("DBA_packages_Applet1_QNAlias@Start_Date");
  133.       this.Start_Date.setEntryFormat("MDY");
  134.       this.Start_Date.setEditable(false);
  135.       this.Start_Date.setBounds(474, 69, 99, 20);
  136.       this.Start_Date.setBackground(new Color(12632256));
  137.       this.dbControlsPanel.add(this.Start_Date);
  138.       this.Start_Date.setCursor(new Cursor(2));
  139.       this.Number_of_Days = new FormattedTextField();
  140.       this.Number_of_Days.setDataBinding("DBA_packages_Applet1_QNAlias@Number_of_Days");
  141.       this.Number_of_Days.setEditable(false);
  142.       this.Number_of_Days.setBounds(474, 96, 99, 20);
  143.       this.Number_of_Days.setBackground(new Color(12632256));
  144.       this.dbControlsPanel.add(this.Number_of_Days);
  145.       this.Number_of_Days.setCursor(new Cursor(2));
  146.       this.Price_Per_Person = new TextField();
  147.       this.Price_Per_Person.setDataBinding("DBA_packages_Applet1_QNAlias@Price_Per_Person");
  148.       this.Price_Per_Person.setEditable(false);
  149.       this.Price_Per_Person.setBounds(474, 123, 99, 20);
  150.       this.Price_Per_Person.setBackground(new Color(12632256));
  151.       this.dbControlsPanel.add(this.Price_Per_Person);
  152.       this.Price_Per_Person.setCursor(new Cursor(2));
  153.       this.Image = new ImageViewer();
  154.       this.Image.setDataBinding("DBA_packages_Applet1_QNAlias@Image");
  155.       this.Image.setBounds(6, 69, 330, 230);
  156.       this.dbControlsPanel.add(this.Image);
  157.       this.Description = new TextArea();
  158.       this.Description.setDataBinding("DBA_packages_Applet1_QNAlias@Description");
  159.       this.Description.setEditable(false);
  160.       this.Description.setBounds(357, 177, 243, 153);
  161.       this.Description.setBackground(new Color(12632256));
  162.       this.dbControlsPanel.add(this.Description);
  163.       this.Description.setCursor(new Cursor(2));
  164.       this.imageViewerPackage = new symantec.itools.multimedia.ImageViewer();
  165.  
  166.       try {
  167.          this.imageViewerPackage.setImageURL(RelativeURL.getURL("Images/reserv.gif"));
  168.       } catch (MalformedURLException var7) {
  169.       } catch (PropertyVetoException var8) {
  170.       }
  171.  
  172.       try {
  173.          this.imageViewerPackage.setStyle(3);
  174.       } catch (PropertyVetoException var6) {
  175.       }
  176.  
  177.       this.imageViewerPackage.setBounds(0, 0, 500, 36);
  178.       this.dbControlsPanel.add(this.imageViewerPackage);
  179.       this.dbButtonsPanel2 = new ToolBarPanel();
  180.       this.dbButtonsPanel2.setBounds(221, 492, 167, 30);
  181.       this.dbButtonsPanel2.setBackground(new Color(12632256));
  182.       this.dbControlsPanel.add(this.dbButtonsPanel2);
  183.       this.DBA_registrationNavigator_save = new Button();
  184.       this.DBA_registrationNavigator_save.setLabel("Send Registration");
  185.       this.DBA_registrationNavigator_save.setBounds(0, 0, 113, 23);
  186.       this.DBA_registrationNavigator_save.setBackground(new Color(12632256));
  187.       this.dbButtonsPanel2.add(this.DBA_registrationNavigator_save);
  188.       this.DBA_registrationNavigator_undoChanges = new Button();
  189.       this.DBA_registrationNavigator_undoChanges.setLabel("Clear");
  190.       this.DBA_registrationNavigator_undoChanges.setBounds(113, 0, 44, 23);
  191.       this.DBA_registrationNavigator_undoChanges.setBackground(new Color(12632256));
  192.       this.dbButtonsPanel2.add(this.DBA_registrationNavigator_undoChanges);
  193.       this.Package_IDLabel2 = new Label("Package ID");
  194.       this.Package_IDLabel2.setBounds(6, 384, 113, 20);
  195.       this.dbControlsPanel.add(this.Package_IDLabel2);
  196.       this.Customer_First_NameLabel = new Label("First Name");
  197.       this.Customer_First_NameLabel.setBounds(6, 411, 113, 20);
  198.       this.dbControlsPanel.add(this.Customer_First_NameLabel);
  199.       this.Customer_Last_NameLabel = new Label("Last Name");
  200.       this.Customer_Last_NameLabel.setBounds(6, 438, 113, 20);
  201.       this.dbControlsPanel.add(this.Customer_Last_NameLabel);
  202.       this.Customer_EmailLabel = new Label("Email");
  203.       this.Customer_EmailLabel.setBounds(6, 465, 113, 20);
  204.       this.dbControlsPanel.add(this.Customer_EmailLabel);
  205.       this.Customer_PhoneLabel = new Label("Phone");
  206.       this.Customer_PhoneLabel.setBounds(357, 384, 113, 20);
  207.       this.dbControlsPanel.add(this.Customer_PhoneLabel);
  208.       this.Number_in_PartyLabel = new Label("Number in Party");
  209.       this.Number_in_PartyLabel.setBounds(357, 411, 113, 20);
  210.       this.dbControlsPanel.add(this.Number_in_PartyLabel);
  211.       this.Total_CostLabel = new Label("Total Cost");
  212.       this.Total_CostLabel.setBounds(357, 438, 113, 20);
  213.       this.dbControlsPanel.add(this.Total_CostLabel);
  214.       this.Package_ID2 = new FormattedTextField();
  215.       this.Package_ID2.setText("780");
  216.       this.Package_ID2.setDataBinding("DBA_registration_Reserve_QNAlias@Package_ID");
  217.       this.Package_ID2.setEditable(false);
  218.       this.Package_ID2.setBounds(123, 384, 80, 20);
  219.       this.Package_ID2.setBackground(new Color(12632256));
  220.       this.dbControlsPanel.add(this.Package_ID2);
  221.       this.Package_ID2.setCursor(new Cursor(2));
  222.       this.Customer_First_Name = new TextField();
  223.       this.Customer_First_Name.setDataBinding("DBA_registration_Reserve_QNAlias@Customer_First_Name");
  224.       this.Customer_First_Name.setBounds(123, 411, 216, 20);
  225.       this.dbControlsPanel.add(this.Customer_First_Name);
  226.       this.Customer_First_Name.setCursor(new Cursor(2));
  227.       this.Customer_Last_Name = new TextField();
  228.       this.Customer_Last_Name.setDataBinding("DBA_registration_Reserve_QNAlias@Customer_Last_Name");
  229.       this.Customer_Last_Name.setBounds(123, 438, 216, 20);
  230.       this.dbControlsPanel.add(this.Customer_Last_Name);
  231.       this.Customer_Last_Name.setCursor(new Cursor(2));
  232.       this.Customer_Email = new TextField();
  233.       this.Customer_Email.setDataBinding("DBA_registration_Reserve_QNAlias@Customer_Email");
  234.       this.Customer_Email.setBounds(123, 465, 216, 20);
  235.       this.dbControlsPanel.add(this.Customer_Email);
  236.       this.Customer_Email.setCursor(new Cursor(2));
  237.       this.Customer_Phone = new FormattedTextField();
  238.       this.Customer_Phone.setDataBinding("DBA_registration_Reserve_QNAlias@Customer_Phone");
  239.       this.Customer_Phone.setBounds(474, 384, 126, 20);
  240.       this.dbControlsPanel.add(this.Customer_Phone);
  241.       this.Customer_Phone.setCursor(new Cursor(2));
  242.       this.Number_in_Party = new TextField();
  243.       this.Number_in_Party.setText("0");
  244.       this.Number_in_Party.setDataBinding("DBA_registration_Reserve_QNAlias@Number_in_Party");
  245.       this.Number_in_Party.setBounds(474, 411, 54, 20);
  246.       this.dbControlsPanel.add(this.Number_in_Party);
  247.       this.Number_in_Party.setCursor(new Cursor(2));
  248.       this.Total_Cost = new TextField();
  249.       this.Total_Cost.setText("0");
  250.       this.Total_Cost.setDataBinding("DBA_registration_Reserve_QNAlias@Total_Cost");
  251.       this.Total_Cost.setEditable(false);
  252.       this.Total_Cost.setBounds(474, 438, 126, 20);
  253.       this.Total_Cost.setBackground(new Color(12632256));
  254.       this.dbControlsPanel.add(this.Total_Cost);
  255.       this.Total_Cost.setCursor(new Cursor(2));
  256.       this.imageViewerReg = new symantec.itools.multimedia.ImageViewer();
  257.  
  258.       try {
  259.          this.imageViewerReg.setImageURL(RelativeURL.getURL("Images/register.gif"));
  260.       } catch (MalformedURLException var4) {
  261.       } catch (PropertyVetoException var5) {
  262.       }
  263.  
  264.       try {
  265.          this.imageViewerReg.setStyle(3);
  266.       } catch (PropertyVetoException var3) {
  267.       }
  268.  
  269.       this.imageViewerReg.setBounds(0, 348, 500, 27);
  270.       this.dbControlsPanel.add(this.imageViewerReg);
  271.       this.DBA_registrationNavigator.insert();
  272.       Reserve$SymAction lSymAction = new Reserve$SymAction(this);
  273.       this.DBA_packagesNavigator_next.addActionListener(lSymAction);
  274.       this.DBA_packagesNavigator_previous.addActionListener(lSymAction);
  275.       this.DBA_registrationNavigator_save.addActionListener(lSymAction);
  276.       this.DBA_registrationNavigator_undoChanges.addActionListener(lSymAction);
  277.       Reserve$SymFocus aSymFocus = new Reserve$SymFocus(this);
  278.       this.Number_in_Party.addFocusListener(aSymFocus);
  279.    }
  280.  
  281.    void DBAPackagesNavigatorNext_ActionPerformed(ActionEvent event) {
  282.       try {
  283.          this.DBA_packagesNavigator.next();
  284.       } catch (Exception var2) {
  285.       }
  286.  
  287.       this.Package_ID2.setText(this.Package_ID.getText());
  288.       this.Total_Cost.setText(String.valueOf(Float.valueOf(this.Price_Per_Person.getText()) * Float.valueOf(this.Number_in_Party.getText())));
  289.    }
  290.  
  291.    void DBAPackagesNavigatorPrevious_ActionPerformed(ActionEvent event) {
  292.       try {
  293.          this.DBA_packagesNavigator.previous();
  294.       } catch (Exception var2) {
  295.       }
  296.  
  297.       this.Package_ID2.setText(this.Package_ID.getText());
  298.       this.Total_Cost.setText(String.valueOf(Float.valueOf(this.Price_Per_Person.getText()) * Float.valueOf(this.Number_in_Party.getText())));
  299.    }
  300.  
  301.    void DBARegistrationNavigatorSave_ActionPerformed(ActionEvent event) {
  302.       this.DBA_registrationNavigator.save();
  303.       this.DBA_registrationNavigator.insert();
  304.       this.Package_ID2.setText(this.Package_ID.getText());
  305.       this.Number_in_Party.setText("0");
  306.       this.Total_Cost.setText("0");
  307.    }
  308.  
  309.    void DBARegistrationNavigatorUndoChanges_ActionPerformed(ActionEvent event) {
  310.       this.DBA_registrationNavigator.undoChanges();
  311.       this.Package_ID2.setText(this.Package_ID.getText());
  312.       this.Number_in_Party.setText("0");
  313.       this.Total_Cost.setText("0");
  314.    }
  315.  
  316.    void NumberInParty_focusLost(FocusEvent event) {
  317.       this.Total_Cost.setText(String.valueOf(Float.valueOf(this.Price_Per_Person.getText()) * Float.valueOf(this.Number_in_Party.getText())));
  318.    }
  319. }
  320.