home *** CD-ROM | disk | FTP | other *** search
- import java.applet.Applet;
- import java.awt.Button;
- import java.awt.Color;
- import java.awt.Component;
- import java.awt.Container;
- import java.awt.Cursor;
- import java.awt.Font;
- import java.awt.Label;
- import java.awt.LayoutManager;
- import java.awt.Panel;
- import java.awt.event.ActionEvent;
- import java.awt.event.FocusEvent;
- import java.beans.PropertyVetoException;
- import java.net.MalformedURLException;
- import symantec.itools.awt.util.ToolBarPanel;
- import symantec.itools.db.awt.DBTstamp;
- import symantec.itools.db.awt.FormattedTextField;
- import symantec.itools.db.awt.ImageViewer;
- import symantec.itools.db.awt.TextArea;
- import symantec.itools.db.awt.TextField;
- import symantec.itools.db.beans.jdbc.QueryNavigator;
- import symantec.itools.lang.Context;
- import symantec.itools.net.RelativeURL;
-
- public class Reserve extends Applet {
- QueryNavigator DBA_packagesNavigator;
- QueryNavigator DBA_registrationNavigator;
- Panel dbControlsPanel;
- ToolBarPanel dbButtonsPanel;
- Button DBA_packagesNavigator_next;
- Button DBA_packagesNavigator_previous;
- Label Package_IDLabel;
- Label Package_NameLabel;
- Label Start_DateLabel;
- Label Number_of_DaysLabel;
- Label Price_Per_PersonLabel;
- Label DescriptionLabel;
- FormattedTextField Package_ID;
- TextField Package_Name;
- DBTstamp Start_Date;
- FormattedTextField Number_of_Days;
- TextField Price_Per_Person;
- ImageViewer Image;
- TextArea Description;
- symantec.itools.multimedia.ImageViewer imageViewerPackage;
- ToolBarPanel dbButtonsPanel2;
- Button DBA_registrationNavigator_save;
- Button DBA_registrationNavigator_undoChanges;
- Label Package_IDLabel2;
- Label Customer_First_NameLabel;
- Label Customer_Last_NameLabel;
- Label Customer_EmailLabel;
- Label Customer_PhoneLabel;
- Label Number_in_PartyLabel;
- Label Total_CostLabel;
- FormattedTextField Package_ID2;
- TextField Customer_First_Name;
- TextField Customer_Last_Name;
- TextField Customer_Email;
- FormattedTextField Customer_Phone;
- TextField Number_in_Party;
- TextField Total_Cost;
- symantec.itools.multimedia.ImageViewer imageViewerReg;
-
- public void init() {
- Context.setApplet(this);
- ((Container)this).setLayout((LayoutManager)null);
- ((Component)this).setSize(615, 545);
- ((Component)this).setFont(new Font("Dialog", 0, 12));
- ((Component)this).setForeground(new Color(0));
- ((Component)this).setBackground(new Color(16777215));
- this.DBA_packagesNavigator = new QueryNavigator();
- this.DBA_packagesNavigator.setAutoStart(true);
- this.DBA_packagesNavigator.setClassName("DBA_packagesRecord");
- this.DBA_packagesNavigator.setAliasName("DBA_packages_Applet1_QNAlias");
- this.DBA_registrationNavigator = new QueryNavigator();
- this.DBA_registrationNavigator.setClassName("DBA_registrationRecord");
- this.DBA_registrationNavigator.setAliasName("DBA_registration_Reserve_QNAlias");
- this.dbControlsPanel = new Panel();
- this.dbControlsPanel.setLayout((LayoutManager)null);
- this.dbControlsPanel.setBounds(3, 3, 609, 528);
- ((Container)this).add(this.dbControlsPanel);
- this.dbButtonsPanel = new ToolBarPanel();
- this.dbButtonsPanel.setBounds(105, 303, 136, 30);
- this.dbButtonsPanel.setBackground(new Color(12632256));
- this.dbControlsPanel.add(this.dbButtonsPanel);
- this.DBA_packagesNavigator_next = new Button();
- this.DBA_packagesNavigator_next.setLabel("Next ");
- this.DBA_packagesNavigator_next.setBounds(0, 0, 62, 23);
- this.DBA_packagesNavigator_next.setBackground(new Color(12632256));
- this.dbButtonsPanel.add(this.DBA_packagesNavigator_next);
- this.DBA_packagesNavigator_previous = new Button();
- this.DBA_packagesNavigator_previous.setLabel("Previous");
- this.DBA_packagesNavigator_previous.setBounds(62, 0, 62, 23);
- this.DBA_packagesNavigator_previous.setBackground(new Color(12632256));
- this.dbButtonsPanel.add(this.DBA_packagesNavigator_previous);
- this.Package_IDLabel = new Label("Package ID");
- this.Package_IDLabel.setBounds(357, 42, 117, 20);
- this.dbControlsPanel.add(this.Package_IDLabel);
- this.Package_NameLabel = new Label("Package Name");
- this.Package_NameLabel.setBounds(6, 42, 117, 20);
- this.dbControlsPanel.add(this.Package_NameLabel);
- this.Start_DateLabel = new Label("Start Date");
- this.Start_DateLabel.setBounds(357, 69, 117, 20);
- this.dbControlsPanel.add(this.Start_DateLabel);
- this.Number_of_DaysLabel = new Label("Number of Days");
- this.Number_of_DaysLabel.setBounds(357, 96, 117, 20);
- this.dbControlsPanel.add(this.Number_of_DaysLabel);
- this.Price_Per_PersonLabel = new Label("Price Per Person");
- this.Price_Per_PersonLabel.setBounds(357, 123, 117, 20);
- this.dbControlsPanel.add(this.Price_Per_PersonLabel);
- this.DescriptionLabel = new Label("Description");
- this.DescriptionLabel.setBounds(357, 150, 128, 20);
- this.dbControlsPanel.add(this.DescriptionLabel);
- this.Package_ID = new FormattedTextField();
- this.Package_ID.setDataBinding("DBA_packages_Applet1_QNAlias@Package_ID");
- this.Package_ID.setEditable(false);
- this.Package_ID.setBounds(474, 42, 99, 20);
- this.Package_ID.setBackground(new Color(12632256));
- this.dbControlsPanel.add(this.Package_ID);
- this.Package_ID.setCursor(new Cursor(2));
- this.Package_Name = new TextField();
- this.Package_Name.setDataBinding("DBA_packages_Applet1_QNAlias@Package_Name");
- this.Package_Name.setEditable(false);
- this.Package_Name.setBounds(132, 42, 200, 20);
- this.Package_Name.setFont(new Font("Dialog", 1, 12));
- this.Package_Name.setBackground(new Color(12632256));
- this.dbControlsPanel.add(this.Package_Name);
- this.Package_Name.setCursor(new Cursor(2));
- this.Start_Date = new DBTstamp();
- this.Start_Date.setDisplayFormat("M+ D%, Y*");
- this.Start_Date.setDataBinding("DBA_packages_Applet1_QNAlias@Start_Date");
- this.Start_Date.setEntryFormat("MDY");
- this.Start_Date.setEditable(false);
- this.Start_Date.setBounds(474, 69, 99, 20);
- this.Start_Date.setBackground(new Color(12632256));
- this.dbControlsPanel.add(this.Start_Date);
- this.Start_Date.setCursor(new Cursor(2));
- this.Number_of_Days = new FormattedTextField();
- this.Number_of_Days.setDataBinding("DBA_packages_Applet1_QNAlias@Number_of_Days");
- this.Number_of_Days.setEditable(false);
- this.Number_of_Days.setBounds(474, 96, 99, 20);
- this.Number_of_Days.setBackground(new Color(12632256));
- this.dbControlsPanel.add(this.Number_of_Days);
- this.Number_of_Days.setCursor(new Cursor(2));
- this.Price_Per_Person = new TextField();
- this.Price_Per_Person.setDataBinding("DBA_packages_Applet1_QNAlias@Price_Per_Person");
- this.Price_Per_Person.setEditable(false);
- this.Price_Per_Person.setBounds(474, 123, 99, 20);
- this.Price_Per_Person.setBackground(new Color(12632256));
- this.dbControlsPanel.add(this.Price_Per_Person);
- this.Price_Per_Person.setCursor(new Cursor(2));
- this.Image = new ImageViewer();
- this.Image.setDataBinding("DBA_packages_Applet1_QNAlias@Image");
- this.Image.setBounds(6, 69, 330, 230);
- this.dbControlsPanel.add(this.Image);
- this.Description = new TextArea();
- this.Description.setDataBinding("DBA_packages_Applet1_QNAlias@Description");
- this.Description.setEditable(false);
- this.Description.setBounds(357, 177, 243, 153);
- this.Description.setBackground(new Color(12632256));
- this.dbControlsPanel.add(this.Description);
- this.Description.setCursor(new Cursor(2));
- this.imageViewerPackage = new symantec.itools.multimedia.ImageViewer();
-
- try {
- this.imageViewerPackage.setImageURL(RelativeURL.getURL("Images/reserv.gif"));
- } catch (MalformedURLException var7) {
- } catch (PropertyVetoException var8) {
- }
-
- try {
- this.imageViewerPackage.setStyle(3);
- } catch (PropertyVetoException var6) {
- }
-
- this.imageViewerPackage.setBounds(0, 0, 500, 36);
- this.dbControlsPanel.add(this.imageViewerPackage);
- this.dbButtonsPanel2 = new ToolBarPanel();
- this.dbButtonsPanel2.setBounds(221, 492, 167, 30);
- this.dbButtonsPanel2.setBackground(new Color(12632256));
- this.dbControlsPanel.add(this.dbButtonsPanel2);
- this.DBA_registrationNavigator_save = new Button();
- this.DBA_registrationNavigator_save.setLabel("Send Registration");
- this.DBA_registrationNavigator_save.setBounds(0, 0, 113, 23);
- this.DBA_registrationNavigator_save.setBackground(new Color(12632256));
- this.dbButtonsPanel2.add(this.DBA_registrationNavigator_save);
- this.DBA_registrationNavigator_undoChanges = new Button();
- this.DBA_registrationNavigator_undoChanges.setLabel("Clear");
- this.DBA_registrationNavigator_undoChanges.setBounds(113, 0, 44, 23);
- this.DBA_registrationNavigator_undoChanges.setBackground(new Color(12632256));
- this.dbButtonsPanel2.add(this.DBA_registrationNavigator_undoChanges);
- this.Package_IDLabel2 = new Label("Package ID");
- this.Package_IDLabel2.setBounds(6, 384, 113, 20);
- this.dbControlsPanel.add(this.Package_IDLabel2);
- this.Customer_First_NameLabel = new Label("First Name");
- this.Customer_First_NameLabel.setBounds(6, 411, 113, 20);
- this.dbControlsPanel.add(this.Customer_First_NameLabel);
- this.Customer_Last_NameLabel = new Label("Last Name");
- this.Customer_Last_NameLabel.setBounds(6, 438, 113, 20);
- this.dbControlsPanel.add(this.Customer_Last_NameLabel);
- this.Customer_EmailLabel = new Label("Email");
- this.Customer_EmailLabel.setBounds(6, 465, 113, 20);
- this.dbControlsPanel.add(this.Customer_EmailLabel);
- this.Customer_PhoneLabel = new Label("Phone");
- this.Customer_PhoneLabel.setBounds(357, 384, 113, 20);
- this.dbControlsPanel.add(this.Customer_PhoneLabel);
- this.Number_in_PartyLabel = new Label("Number in Party");
- this.Number_in_PartyLabel.setBounds(357, 411, 113, 20);
- this.dbControlsPanel.add(this.Number_in_PartyLabel);
- this.Total_CostLabel = new Label("Total Cost");
- this.Total_CostLabel.setBounds(357, 438, 113, 20);
- this.dbControlsPanel.add(this.Total_CostLabel);
- this.Package_ID2 = new FormattedTextField();
- this.Package_ID2.setText("780");
- this.Package_ID2.setDataBinding("DBA_registration_Reserve_QNAlias@Package_ID");
- this.Package_ID2.setEditable(false);
- this.Package_ID2.setBounds(123, 384, 80, 20);
- this.Package_ID2.setBackground(new Color(12632256));
- this.dbControlsPanel.add(this.Package_ID2);
- this.Package_ID2.setCursor(new Cursor(2));
- this.Customer_First_Name = new TextField();
- this.Customer_First_Name.setDataBinding("DBA_registration_Reserve_QNAlias@Customer_First_Name");
- this.Customer_First_Name.setBounds(123, 411, 216, 20);
- this.dbControlsPanel.add(this.Customer_First_Name);
- this.Customer_First_Name.setCursor(new Cursor(2));
- this.Customer_Last_Name = new TextField();
- this.Customer_Last_Name.setDataBinding("DBA_registration_Reserve_QNAlias@Customer_Last_Name");
- this.Customer_Last_Name.setBounds(123, 438, 216, 20);
- this.dbControlsPanel.add(this.Customer_Last_Name);
- this.Customer_Last_Name.setCursor(new Cursor(2));
- this.Customer_Email = new TextField();
- this.Customer_Email.setDataBinding("DBA_registration_Reserve_QNAlias@Customer_Email");
- this.Customer_Email.setBounds(123, 465, 216, 20);
- this.dbControlsPanel.add(this.Customer_Email);
- this.Customer_Email.setCursor(new Cursor(2));
- this.Customer_Phone = new FormattedTextField();
- this.Customer_Phone.setDataBinding("DBA_registration_Reserve_QNAlias@Customer_Phone");
- this.Customer_Phone.setBounds(474, 384, 126, 20);
- this.dbControlsPanel.add(this.Customer_Phone);
- this.Customer_Phone.setCursor(new Cursor(2));
- this.Number_in_Party = new TextField();
- this.Number_in_Party.setText("0");
- this.Number_in_Party.setDataBinding("DBA_registration_Reserve_QNAlias@Number_in_Party");
- this.Number_in_Party.setBounds(474, 411, 54, 20);
- this.dbControlsPanel.add(this.Number_in_Party);
- this.Number_in_Party.setCursor(new Cursor(2));
- this.Total_Cost = new TextField();
- this.Total_Cost.setText("0");
- this.Total_Cost.setDataBinding("DBA_registration_Reserve_QNAlias@Total_Cost");
- this.Total_Cost.setEditable(false);
- this.Total_Cost.setBounds(474, 438, 126, 20);
- this.Total_Cost.setBackground(new Color(12632256));
- this.dbControlsPanel.add(this.Total_Cost);
- this.Total_Cost.setCursor(new Cursor(2));
- this.imageViewerReg = new symantec.itools.multimedia.ImageViewer();
-
- try {
- this.imageViewerReg.setImageURL(RelativeURL.getURL("Images/register.gif"));
- } catch (MalformedURLException var4) {
- } catch (PropertyVetoException var5) {
- }
-
- try {
- this.imageViewerReg.setStyle(3);
- } catch (PropertyVetoException var3) {
- }
-
- this.imageViewerReg.setBounds(0, 348, 500, 27);
- this.dbControlsPanel.add(this.imageViewerReg);
- this.DBA_registrationNavigator.insert();
- Reserve$SymAction lSymAction = new Reserve$SymAction(this);
- this.DBA_packagesNavigator_next.addActionListener(lSymAction);
- this.DBA_packagesNavigator_previous.addActionListener(lSymAction);
- this.DBA_registrationNavigator_save.addActionListener(lSymAction);
- this.DBA_registrationNavigator_undoChanges.addActionListener(lSymAction);
- Reserve$SymFocus aSymFocus = new Reserve$SymFocus(this);
- this.Number_in_Party.addFocusListener(aSymFocus);
- }
-
- void DBAPackagesNavigatorNext_ActionPerformed(ActionEvent event) {
- try {
- this.DBA_packagesNavigator.next();
- } catch (Exception var2) {
- }
-
- this.Package_ID2.setText(this.Package_ID.getText());
- this.Total_Cost.setText(String.valueOf(Float.valueOf(this.Price_Per_Person.getText()) * Float.valueOf(this.Number_in_Party.getText())));
- }
-
- void DBAPackagesNavigatorPrevious_ActionPerformed(ActionEvent event) {
- try {
- this.DBA_packagesNavigator.previous();
- } catch (Exception var2) {
- }
-
- this.Package_ID2.setText(this.Package_ID.getText());
- this.Total_Cost.setText(String.valueOf(Float.valueOf(this.Price_Per_Person.getText()) * Float.valueOf(this.Number_in_Party.getText())));
- }
-
- void DBARegistrationNavigatorSave_ActionPerformed(ActionEvent event) {
- this.DBA_registrationNavigator.save();
- this.DBA_registrationNavigator.insert();
- this.Package_ID2.setText(this.Package_ID.getText());
- this.Number_in_Party.setText("0");
- this.Total_Cost.setText("0");
- }
-
- void DBARegistrationNavigatorUndoChanges_ActionPerformed(ActionEvent event) {
- this.DBA_registrationNavigator.undoChanges();
- this.Package_ID2.setText(this.Package_ID.getText());
- this.Number_in_Party.setText("0");
- this.Total_Cost.setText("0");
- }
-
- void NumberInParty_focusLost(FocusEvent event) {
- this.Total_Cost.setText(String.valueOf(Float.valueOf(this.Price_Per_Person.getText()) * Float.valueOf(this.Number_in_Party.getText())));
- }
- }
-