home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / TRIAL / JBUILDER / JREFRNCE.Z / MainFrame.java < prev    next >
Encoding:
Java Source  |  1998-05-08  |  23.3 KB  |  695 lines

  1. /*
  2.  * Copyright (c) 1997-1998 Borland International, Inc. All Rights Reserved.
  3.  * 
  4.  * This SOURCE CODE FILE, which has been provided by Borland as part
  5.  * of a Borland product for use ONLY by licensed users of the product,
  6.  * includes CONFIDENTIAL and PROPRIETARY information of Borland.  
  7.  *
  8.  * USE OF THIS SOFTWARE IS GOVERNED BY THE TERMS AND CONDITIONS 
  9.  * OF THE LICENSE STATEMENT AND LIMITED WARRANTY FURNISHED WITH
  10.  * THE PRODUCT.
  11.  *
  12.  * IN PARTICULAR, YOU WILL INDEMNIFY AND HOLD BORLAND, ITS RELATED
  13.  * COMPANIES AND ITS SUPPLIERS, HARMLESS FROM AND AGAINST ANY CLAIMS
  14.  * OR LIABILITIES ARISING OUT OF THE USE, REPRODUCTION, OR DISTRIBUTION
  15.  * OF YOUR PROGRAMS, INCLUDING ANY CLAIMS OR LIABILITIES ARISING OUT OF
  16.  * OR RESULTING FROM THE USE, MODIFICATION, OR DISTRIBUTION OF PROGRAMS
  17.  * OR FILES CREATED FROM, BASED ON, AND/OR DERIVED FROM THIS SOURCE
  18.  * CODE FILE.
  19.  */
  20.  
  21. //Title:        Cliffhanger Adventure Gear
  22. //Version:
  23. //Copyright:    Copyright (c) 1997 Borland International, Inc.
  24. //Author:       Application Methods, Inc.
  25. //Description:  Cliffhanger Adventure Gear order entry system
  26.  
  27. package borland.reference.cliffhanger;
  28.  
  29. import java.awt.*;
  30. import java.awt.event.*;
  31. import borland.jbcl.control.*;
  32. import borland.jbcl.layout.*;
  33. import java.util.*;
  34.  
  35. /**
  36.  * MainFrame is the main window of the Cliffhanger Application.
  37.  * This class implements a button menu to navigate to other
  38.  * functional areas of the application.
  39.  * During instantiation of this class, an attempt to make the database
  40.  * connection is made, and shuts down the application if the connection fails.
  41.  */
  42. public class MainFrame extends DecoratedFrame {
  43.   BorderLayout borderLayout1 = new BorderLayout();
  44.   BevelPanel bevelPanel1 = new BevelPanel();
  45.   MenuBar menuBar1 = new MenuBar();
  46.   Menu menuFile = new Menu();
  47.   MenuItem menuFileExit = new MenuItem();
  48.   Menu menuHelp = new Menu();
  49.   MenuItem menuHelpAbout = new MenuItem();
  50.   StatusBar statusBar = new StatusBar();
  51.   BevelPanel bevelPanel2 = new BevelPanel();
  52.   GridBagLayout gridBagLayout1 = new GridBagLayout();
  53.   ButtonControl btnOrders = new ButtonControl();
  54.   ButtonControl btnCustomers = new ButtonControl();
  55.   ButtonControl btnProducts = new ButtonControl();
  56.   ButtonControl btnCategories = new ButtonControl();
  57.   ButtonControl btnExit = new ButtonControl();
  58.   ImageControl imgLogo = new ImageControl();
  59.   BorderLayout borderLayout2 = new BorderLayout();
  60.   BorderLayout borderLayout3 = new BorderLayout();
  61.   PopupMenu pumOrder = new PopupMenu();
  62.   MenuItem pumNewOrder = new MenuItem();
  63.   MenuItem pumFindOrder = new MenuItem();
  64.   PopupMenu pumCustomer = new PopupMenu();
  65.   PopupMenu pumProduct = new PopupMenu();
  66.   MenuItem pumNewCustomer = new MenuItem();
  67.   MenuItem pumFindCustomer = new MenuItem();
  68.   MenuItem pumNewProduct = new MenuItem();
  69.   MenuItem pumFindProduct = new MenuItem();
  70.   ResourceBundle res = Res.getBundle("borland.reference.cliffhanger.Res");
  71.  
  72.   //Construct the frame
  73.   public MainFrame() {
  74.     try {
  75.       jbInit();
  76.       initData();
  77.     }
  78.     catch (Exception e) {
  79.       borland.jbcl.util.Diagnostic.printStackTrace(e);
  80.     };
  81.   }
  82.  
  83.   //Component initialization
  84.   private void jbInit() throws Exception{
  85.     this.setLayout(borderLayout1);
  86.     this.setTitle(res.getString("MF_Cliffhanger_Title"));
  87.     bevelPanel1.setLayout(borderLayout3);
  88.     menuFile.setLabel(res.getString("MF_File"));
  89.     menuFileExit.setLabel(res.getString("MF_Exit"));
  90.     menuFileExit.addActionListener(new MainFrame_menuFileExit_ActionAdapter(this));
  91.     menuHelp.setLabel(res.getString("MF_Help"));
  92.     menuHelpAbout.setLabel(res.getString("MF_About"));
  93.     statusBar.setBevelOuter(BevelPanel.LOWERED);
  94.     bevelPanel2.setMargins(new Insets(5, 5, 5, 5));
  95.     btnOrders.setAlignment(borland.jbcl.util.Alignment.LEFT | borland.jbcl.util.Alignment.MIDDLE);
  96.     btnOrders.setActionCommand(res.getString("MF_Orders"));
  97.     btnOrders.setImageName(".\\graphics\\orders.gif");
  98.     btnOrders.setLabel(res.getString("MF_Orders"));
  99.     btnOrders.addMouseListener(new MainFrame_btnOrders_mouseAdapter(this));
  100.     btnOrders.addActionListener(new MainFrame_btnOrders_actionAdapter(this));
  101.     btnCustomers.setAlignment(borland.jbcl.util.Alignment.LEFT | borland.jbcl.util.Alignment.MIDDLE);
  102.     btnCustomers.setActionCommand("Customers");
  103.     btnCustomers.setImageName(".\\graphics\\customers.gif");
  104.     btnCustomers.setLabel(res.getString("MF_Customers"));
  105.     btnCustomers.addMouseListener(new MainFrame_btnCustomers_mouseAdapter(this));
  106.     btnCustomers.addActionListener(new MainFrame_btnCustomers_actionAdapter(this));
  107.     btnProducts.setAlignment(borland.jbcl.util.Alignment.LEFT | borland.jbcl.util.Alignment.MIDDLE);
  108.     btnProducts.setActionCommand(res.getString("MF_Products"));
  109.     btnProducts.setImageName(".\\graphics\\Products.gif");
  110.     btnProducts.setLabel(res.getString("MF_Products"));
  111.     btnProducts.addMouseListener(new MainFrame_btnProducts_mouseAdapter(this));
  112.     btnProducts.addActionListener(new MainFrame_btnProducts_actionAdapter(this));
  113.     btnCategories.setAlignment(borland.jbcl.util.Alignment.LEFT | borland.jbcl.util.Alignment.MIDDLE);
  114.     btnCategories.setActionCommand("");
  115.     btnCategories.setImageName(".\\graphics\\categories.gif");
  116.     btnCategories.setLabel(res.getString("MF_Categories"));
  117.     btnCategories.addMouseListener(new MainFrame_btnCategories_mouseAdapter(this));
  118.     btnCategories.addActionListener(new MainFrame_btnCategories_actionAdapter(this));
  119.     btnExit.setAlignment(borland.jbcl.util.Alignment.LEFT | borland.jbcl.util.Alignment.MIDDLE);
  120.     btnExit.setActionCommand("");
  121.     btnExit.setImageName(".\\graphics\\exit.gif");
  122.     btnExit.setLabel(res.getString("MF_Exit"));
  123.     btnExit.addMouseListener(new MainFrame_btnExit_mouseAdapter(this));
  124.     btnExit.addActionListener(new MainFrame_btnExit_actionAdapter(this));
  125.     imgLogo.setAlignment(borland.jbcl.util.Alignment.LEFT | borland.jbcl.util.Alignment.TOP);
  126.     imgLogo.setImageName(".\\Graphics\\logo.gif");
  127.     pumNewOrder.setLabel(res.getString("MF_New_Order"));
  128.     pumNewOrder.addActionListener(new MainFrame_pumNewOrder_ActionAdapter(this));
  129.     pumFindOrder.setLabel(res.getString("MF_Find_Order"));
  130.     pumFindOrder.addActionListener(new MainFrame_pumFindOrder_ActionAdapter(this));
  131.     pumNewCustomer.setLabel(res.getString("MF_New_Customer"));
  132.     pumNewCustomer.addActionListener(new MainFrame_pumNewCustomer_ActionAdapter(this));
  133.     pumFindCustomer.setLabel(res.getString("MF_Find_Customer"));
  134.     pumFindCustomer.addActionListener(new MainFrame_pumFindCustomer_ActionAdapter(this));
  135.     pumNewProduct.setLabel(res.getString("MF_New_Product"));
  136.     pumNewProduct.addActionListener(new MainFrame_pumNewProduct_ActionAdapter(this));
  137.     pumFindProduct.setLabel(res.getString("MF_Find_Product"));
  138.     pumFindProduct.addActionListener(new MainFrame_pumFindProduct_ActionAdapter(this));
  139.     bevelPanel2.setLayout(gridBagLayout1);
  140.     menuHelpAbout.addActionListener(new MainFrame_menuHelpAbout_ActionAdapter(this));
  141.     menuFile.add(menuFileExit);
  142.     menuHelp.add(menuHelpAbout);
  143.     menuBar1.add(menuFile);
  144.     menuBar1.add(menuHelp);
  145.     this.setMenuBar(menuBar1);
  146.     this.add(statusBar, BorderLayout.SOUTH);
  147.     this.add(bevelPanel1, BorderLayout.CENTER);
  148.     bevelPanel1.add(imgLogo, BorderLayout.CENTER);
  149.     this.add(bevelPanel2, BorderLayout.WEST);
  150.     bevelPanel2.add(btnOrders, new GridBagConstraints2(0, 1, 1, 1, 100.0, 100.0
  151.             ,GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 70, 0));
  152.     bevelPanel2.add(btnCustomers, new GridBagConstraints2(0, 2, 1, 1, 100.0, 100.0
  153.             ,GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
  154.     bevelPanel2.add(btnProducts, new GridBagConstraints2(0, 3, 1, 1, 100.0, 100.0
  155.             ,GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
  156.     bevelPanel2.add(btnCategories, new GridBagConstraints2(0, 4, 1, 1, 100.0, 100.0
  157.             ,GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
  158.     bevelPanel2.add(btnExit, new GridBagConstraints2(0, 5, 1, 1, 100.0, 100.0
  159.             ,GridBagConstraints.WEST, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
  160.     pumOrder.add(pumNewOrder);
  161.     pumOrder.add(pumFindOrder);
  162.     pumCustomer.add(pumNewCustomer);
  163.     pumCustomer.add(pumFindCustomer);
  164.     pumProduct.add(pumNewProduct);
  165.     pumProduct.add(pumFindProduct);
  166.  
  167.   }
  168.  
  169.   /**
  170.    * Instantiate a local instance of DataModule1 to
  171.    * Connect to the database which will prompt
  172.    * the user to login.
  173.    * This way, the user will be prompted to login
  174.    * only at startup (when the main form is created).
  175.    */
  176.   private void initData() {
  177.     DataModule1 dm = DataModule1.getDataModule();
  178.     try {
  179.       dm.dbConnect();
  180.     }
  181.     catch (Exception ex) {
  182.       ex.printStackTrace();
  183.       // If the user fails to connect to the database
  184.       // show the error message and exit the program.
  185.       String msg = res.getString("MF_DBConnect_Failed");
  186.       CliffhangerApplication.messageDlg(res.getString("MF_Error"),
  187.                                         msg,
  188.                                         Message.OK);
  189.       System.exit(0);
  190.     }
  191.   }
  192.  
  193.   /**
  194.    * Menu File | Exit action performed event handler
  195.    * Close the applcation.
  196.    */
  197.   public void fileExit_actionPerformed(ActionEvent e) {
  198.     System.exit(0);
  199.   }
  200.  
  201.   /**
  202.    * Menu Help | About action performed event handler.
  203.    * Show the About Box for the application.
  204.    */
  205.   public void helpAbout_actionPerformed(ActionEvent e) {
  206.     MainFrame_AboutBox dlg = new MainFrame_AboutBox(this);
  207.     Dimension dlgSize = dlg.getPreferredSize();
  208.     Dimension frmSize = getSize();
  209.     Point loc = getLocation();
  210.     dlg.setLocation((frmSize.width - dlgSize.width) / 2 + loc.x, (frmSize.height - dlgSize.height) / 2 + loc.y);
  211.     dlg.setModal(true);
  212.     dlg.show();
  213.   }
  214.  
  215.   /**
  216.    * When the Orders button is clicked, show the Orders popup menu.
  217.    */
  218.   void btnOrders_actionPerformed(java.awt.event.ActionEvent e) {
  219.     bevelPanel2.add(pumOrder);
  220.     pumOrder.show(bevelPanel2, btnOrders.getSize().width, btnOrders.getLocation().y);
  221.   }
  222.  
  223.   /**
  224.    * When the Customers button is clicked, show the Customers popup menu.
  225.    */
  226.   void btnCustomers_actionPerformed(java.awt.event.ActionEvent e) {
  227.     bevelPanel2.add(pumCustomer);
  228.     pumCustomer.show(bevelPanel2, btnCustomers.getSize().width, btnCustomers.getLocation().y);
  229.   }
  230.  
  231.   /**
  232.    * When the Products button is clicked, show the Products popup menu.
  233.    */
  234.   void btnProducts_actionPerformed(java.awt.event.ActionEvent e) {
  235.     bevelPanel2.add(pumProduct);
  236.     pumProduct.show(bevelPanel2, btnProducts.getSize().width, btnProducts.getLocation().y);
  237.   }
  238.  
  239.   /**
  240.    * When the Categories button is clicked, show the Categories form.
  241.    * Note: There is no Categories popup menu.
  242.    */
  243.   void btnCategories_actionPerformed(java.awt.event.ActionEvent e) {
  244.     DecoratedFrame frame = CategoryFrame.getCategoryFrame();
  245.     CliffhangerApplication.showCenteredFrame(frame, false);
  246.   }
  247.  
  248.   /**
  249.    * When the Exit button is clicked, close the application.
  250.    */
  251.   void btnExit_actionPerformed(java.awt.event.ActionEvent e) {
  252.     System.exit(0);
  253.   }
  254.  
  255.  
  256.   /**
  257.    * When the New Order menu item is clicked, show the Order Entry form,
  258.    * And insert a new Order record.
  259.    */
  260.   void pumNewOrder_actionPerformed(java.awt.event.ActionEvent e) {
  261.     OrderEntryFrame frame = OrderEntryFrame.getOrderEntryFrame();
  262.     CliffhangerApplication.showCenteredFrame(frame, false);
  263.     frame.newOrder();
  264.   }
  265.  
  266.   /**
  267.    * When the Find Order menu is clicked, show the Find Order form.
  268.    */
  269.   void pumFindOrder_actionPerformed(java.awt.event.ActionEvent e) {
  270.     DecoratedFrame frame = OrderFindFrame.getOrderFindFrame();
  271.     CliffhangerApplication.showCenteredFrame(frame, false);
  272.   }
  273.  
  274.  
  275.   /**
  276.    * When the New Customer menu item is clicked, show the Customer form,
  277.    * And insert a new customer record.
  278.    */
  279.   void pumNewCustomer_actionPerformed(java.awt.event.ActionEvent e) {
  280.     CustomerFrame frame = CustomerFrame.getCustomerFrame();
  281.     CliffhangerApplication.showCenteredFrame(frame, false);
  282.     frame.newCustomer();
  283.    }
  284.  
  285.   /**
  286.    * When the Find Customer menu is clicked, show the Find Customer form.
  287.    */
  288.   void pumFindCustomer_actionPerformed(java.awt.event.ActionEvent e) {
  289.     DecoratedFrame frame = CustomerFindFrame.getCustomerFindFrame();
  290.     CliffhangerApplication.showCenteredFrame(frame, false);
  291.   }
  292.  
  293.  
  294.   /**
  295.    * When the New Product menu item is clicked, show the Product form,
  296.    * And insert a new Product record.
  297.    */
  298.   void pumNewProduct_actionPerformed(java.awt.event.ActionEvent e) {
  299.     ProductFrame frame = ProductFrame.getProductFrame();
  300.     CliffhangerApplication.showCenteredFrame(frame, false);
  301.     frame.newProduct();
  302.   }
  303.  
  304.   /**
  305.    * When the Find Product menu is clicked, show the Find Product form.
  306.    */
  307.   void pumFindProduct_actionPerformed(java.awt.event.ActionEvent e) {
  308.     DecoratedFrame frame = ProductFindFrame.getProductFindFrame();
  309.     CliffhangerApplication.showCenteredFrame(frame, false);
  310.   }
  311.  
  312.   //.....................................................
  313.   /**
  314.    * The following methods are event handlers for
  315.    * showing a hint in the statusBar when the user
  316.    * places the mouse over the buttons on the Main Frame.
  317.    */
  318.   void btnOrders_mouseEntered(MouseEvent e) {
  319.     statusBar.setText(res.getString("MF_Customer_Orders"));
  320.   }
  321.  
  322.   void btnOrders_mouseExited(MouseEvent e) {
  323.     statusBar.setText("");
  324.   }
  325.  
  326.   void btnCustomers_mouseEntered(MouseEvent e) {
  327.     statusBar.setText(res.getString("MF_Customer_Records"));
  328.   }
  329.  
  330.   void btnCustomers_mouseExited(MouseEvent e) {
  331.     statusBar.setText("");
  332.   }
  333.  
  334.   void btnProducts_mouseEntered(MouseEvent e) {
  335.     statusBar.setText(res.getString("MF_Cliffhanger_Products"));
  336.   }
  337.  
  338.   void btnProducts_mouseExited(MouseEvent e) {
  339.     statusBar.setText("");
  340.   }
  341.  
  342.   void btnCategories_mouseEntered(MouseEvent e) {
  343.     statusBar.setText(res.getString("MF_Product_Categories"));
  344.   }
  345.  
  346.   void btnCategories_mouseExited(MouseEvent e) {
  347.     statusBar.setText("");
  348.   }
  349.  
  350.   void btnExit_mouseEntered(MouseEvent e) {
  351.     statusBar.setText(res.getString("MF_Exit_Cliffhanger"));
  352.   }
  353.  
  354.   void btnExit_mouseExited(MouseEvent e) {
  355.     statusBar.setText("");
  356.   }
  357.   //.....................................................
  358.  
  359. }
  360.  
  361. class MainFrame_menuFileExit_ActionAdapter implements ActionListener{
  362.   MainFrame adaptee;
  363.  
  364.   MainFrame_menuFileExit_ActionAdapter(MainFrame adaptee) {
  365.     this.adaptee = adaptee;
  366.   }
  367.  
  368.   public void actionPerformed(ActionEvent e) {
  369.     adaptee.fileExit_actionPerformed(e);
  370.   }
  371. }
  372.  
  373. class MainFrame_menuHelpAbout_ActionAdapter implements ActionListener{
  374.   MainFrame adaptee;
  375.  
  376.   MainFrame_menuHelpAbout_ActionAdapter(MainFrame adaptee) {
  377.     this.adaptee = adaptee;
  378.   }
  379.  
  380.   public void actionPerformed(ActionEvent e) {
  381.     adaptee.helpAbout_actionPerformed(e);
  382.   }
  383. }
  384.  
  385. class MainFrame_btnOrders_actionAdapter implements java.awt.event.ActionListener{
  386.   MainFrame adaptee;
  387.  
  388.   MainFrame_btnOrders_actionAdapter(MainFrame adaptee) {
  389.     this.adaptee = adaptee;
  390.   }
  391.  
  392.   public void actionPerformed(java.awt.event.ActionEvent e) {
  393.     adaptee.btnOrders_actionPerformed(e);
  394.   }
  395. }
  396.  
  397. class MainFrame_btnCustomers_actionAdapter implements java.awt.event.ActionListener{
  398.   MainFrame adaptee;
  399.  
  400.   MainFrame_btnCustomers_actionAdapter(MainFrame adaptee) {
  401.     this.adaptee = adaptee;
  402.   }
  403.  
  404.   public void actionPerformed(java.awt.event.ActionEvent e) {
  405.     adaptee.btnCustomers_actionPerformed(e);
  406.   }
  407. }
  408.  
  409. class MainFrame_btnProducts_actionAdapter implements java.awt.event.ActionListener{
  410.   MainFrame adaptee;
  411.  
  412.   MainFrame_btnProducts_actionAdapter(MainFrame adaptee) {
  413.     this.adaptee = adaptee;
  414.   }
  415.  
  416.   public void actionPerformed(java.awt.event.ActionEvent e) {
  417.     adaptee.btnProducts_actionPerformed(e);
  418.   }
  419. }
  420.  
  421. class MainFrame_btnCategories_actionAdapter implements java.awt.event.ActionListener{
  422.   MainFrame adaptee;
  423.  
  424.   MainFrame_btnCategories_actionAdapter(MainFrame adaptee) {
  425.     this.adaptee = adaptee;
  426.   }
  427.  
  428.   public void actionPerformed(java.awt.event.ActionEvent e) {
  429.     adaptee.btnCategories_actionPerformed(e);
  430.   }
  431. }
  432.  
  433. class MainFrame_btnExit_actionAdapter implements java.awt.event.ActionListener{
  434.   MainFrame adaptee;
  435.  
  436.   MainFrame_btnExit_actionAdapter(MainFrame adaptee) {
  437.     this.adaptee = adaptee;
  438.   }
  439.  
  440.   public void actionPerformed(java.awt.event.ActionEvent e) {
  441.     adaptee.btnExit_actionPerformed(e);
  442.   }
  443. }
  444.  
  445. class MainFrame_pumNewOrder_ActionAdapter implements ActionListener{
  446.   MainFrame adaptee;
  447.  
  448.   MainFrame_pumNewOrder_ActionAdapter(MainFrame adaptee) {
  449.     this.adaptee = adaptee;
  450.   }
  451.  
  452.   public void actionPerformed(java.awt.event.ActionEvent e) {
  453.     adaptee.pumNewOrder_actionPerformed(e);
  454.   }
  455. }
  456.  
  457. class MainFrame_pumFindOrder_ActionAdapter implements ActionListener{
  458.   MainFrame adaptee;
  459.  
  460.   MainFrame_pumFindOrder_ActionAdapter(MainFrame adaptee) {
  461.     this.adaptee = adaptee;
  462.   }
  463.  
  464.   public void actionPerformed(java.awt.event.ActionEvent e) {
  465.     adaptee.pumFindOrder_actionPerformed(e);
  466.   }
  467. }
  468.  
  469. class MainFrame_pumNewCustomer_ActionAdapter implements ActionListener{
  470.   MainFrame adaptee;
  471.  
  472.   MainFrame_pumNewCustomer_ActionAdapter(MainFrame adaptee) {
  473.     this.adaptee = adaptee;
  474.   }
  475.  
  476.   public void actionPerformed(java.awt.event.ActionEvent e) {
  477.     adaptee.pumNewCustomer_actionPerformed(e);
  478.   }
  479. }
  480.  
  481. class MainFrame_pumFindCustomer_ActionAdapter implements ActionListener{
  482.   MainFrame adaptee;
  483.  
  484.   MainFrame_pumFindCustomer_ActionAdapter(MainFrame adaptee) {
  485.     this.adaptee = adaptee;
  486.   }
  487.  
  488.   public void actionPerformed(java.awt.event.ActionEvent e) {
  489.     adaptee.pumFindCustomer_actionPerformed(e);
  490.   }
  491. }
  492.  
  493. class MainFrame_pumNewProduct_ActionAdapter implements ActionListener{
  494.   MainFrame adaptee;
  495.  
  496.   MainFrame_pumNewProduct_ActionAdapter(MainFrame adaptee) {
  497.     this.adaptee = adaptee;
  498.   }
  499.  
  500.   public void actionPerformed(java.awt.event.ActionEvent e) {
  501.     adaptee.pumNewProduct_actionPerformed(e);
  502.   }
  503. }
  504.  
  505. class MainFrame_pumFindProduct_ActionAdapter implements ActionListener{
  506.   MainFrame adaptee;
  507.  
  508.   MainFrame_pumFindProduct_ActionAdapter(MainFrame adaptee) {
  509.     this.adaptee = adaptee;
  510.   }
  511.  
  512.   public void actionPerformed(java.awt.event.ActionEvent e) {
  513.     adaptee.pumFindProduct_actionPerformed(e);
  514.   }
  515. }
  516.  
  517. class MainFrame_btnOrders_mouseAdapter extends java.awt.event.MouseAdapter {
  518.   MainFrame adaptee;
  519.  
  520.   MainFrame_btnOrders_mouseAdapter(MainFrame adaptee) {
  521.     this.adaptee = adaptee;
  522.   }
  523.  
  524.   public void mouseEntered(MouseEvent e) {
  525.     adaptee.btnOrders_mouseEntered(e);
  526.   }
  527.  
  528.   public void mouseExited(MouseEvent e) {
  529.     adaptee.btnOrders_mouseExited(e);
  530.   }
  531. }
  532.  
  533. class MainFrame_btnCustomers_mouseAdapter extends java.awt.event.MouseAdapter {
  534.   MainFrame adaptee;
  535.  
  536.   MainFrame_btnCustomers_mouseAdapter(MainFrame adaptee) {
  537.     this.adaptee = adaptee;
  538.   }
  539.  
  540.   public void mouseEntered(MouseEvent e) {
  541.     adaptee.btnCustomers_mouseEntered(e);
  542.   }
  543.  
  544.   public void mouseExited(MouseEvent e) {
  545.     adaptee.btnCustomers_mouseExited(e);
  546.   }
  547. }
  548.  
  549. class MainFrame_btnProducts_mouseAdapter extends java.awt.event.MouseAdapter {
  550.   MainFrame adaptee;
  551.  
  552.   MainFrame_btnProducts_mouseAdapter(MainFrame adaptee) {
  553.     this.adaptee = adaptee;
  554.   }
  555.  
  556.   public void mouseEntered(MouseEvent e) {
  557.     adaptee.btnProducts_mouseEntered(e);
  558.   }
  559.  
  560.   public void mouseExited(MouseEvent e) {
  561.     adaptee.btnProducts_mouseExited(e);
  562.   }
  563. }
  564.  
  565. class MainFrame_btnCategories_mouseAdapter extends java.awt.event.MouseAdapter {
  566.   MainFrame adaptee;
  567.  
  568.   MainFrame_btnCategories_mouseAdapter(MainFrame adaptee) {
  569.     this.adaptee = adaptee;
  570.   }
  571.  
  572.   public void mouseEntered(MouseEvent e) {
  573.     adaptee.btnCategories_mouseEntered(e);
  574.   }
  575.  
  576.   public void mouseExited(MouseEvent e) {
  577.     adaptee.btnCategories_mouseExited(e);
  578.   }
  579. }
  580.  
  581. class MainFrame_btnExit_mouseAdapter extends java.awt.event.MouseAdapter {
  582.   MainFrame adaptee;
  583.  
  584.   MainFrame_btnExit_mouseAdapter(MainFrame adaptee) {
  585.     this.adaptee = adaptee;
  586.   }
  587.  
  588.   public void mouseEntered(MouseEvent e) {
  589.     adaptee.btnExit_mouseEntered(e);
  590.   }
  591.  
  592.   public void mouseExited(MouseEvent e) {
  593.     adaptee.btnExit_mouseExited(e);
  594.   }
  595. }
  596.  
  597.  
  598.  
  599. /**
  600.  * MainFrame_AboutBox is the About Box dialog for the Cliffhanger Application.
  601.  * This class was originally generated by the Application Wizard.
  602.  */
  603. class MainFrame_AboutBox extends Dialog implements ActionListener{
  604.   Panel panel1 = new Panel();
  605.   BevelPanel bevelPanel1 = new BevelPanel();
  606.   InsetsPanel insetsPanel1 = new InsetsPanel();
  607.   InsetsPanel insetsPanel2 = new InsetsPanel();
  608.   InsetsPanel insetsPanel3 = new InsetsPanel();
  609.   Button button1 = new Button();
  610.   ImageControl imageControl1 = new ImageControl();
  611.   Label label1 = new Label();
  612.   Label label2 = new Label();
  613.   Label label3 = new Label();
  614.   Label label4 = new Label();
  615.   Label label5 = new Label();
  616.   BorderLayout borderLayout1 = new BorderLayout();
  617.   BorderLayout borderLayout2 = new BorderLayout();
  618.   FlowLayout flowLayout1 = new FlowLayout();
  619.   GridLayout gridLayout1 = new GridLayout();
  620.   ResourceBundle res = java.util.ResourceBundle.getBundle("borland.reference.cliffhanger.Res");
  621.  
  622.   String product = res.getString("AB_product");
  623.   String version = res.getString("AB_version");
  624.   String copyright = res.getString("AB_copyright");
  625.   String comments = res.getString("AB_comments");
  626.   String writtenby = res.getString("AB_writtenby");
  627.  
  628.   public MainFrame_AboutBox(Frame parent) {
  629.     super(parent);
  630.     try {
  631.       jbInit();
  632.     }
  633.     catch (Exception e) {
  634.       borland.jbcl.util.Diagnostic.printStackTrace(e);
  635.     };
  636.     pack();
  637.   }
  638.  
  639.   void jbInit() throws Exception{
  640.     this.setTitle(res.getString("MF_About"));
  641.     setResizable(false);
  642.     this.add(panel1, null);
  643.     panel1.setLayout(borderLayout1);
  644.     bevelPanel1.setLayout(borderLayout2);
  645.     insetsPanel2.setLayout(flowLayout1);
  646.     insetsPanel2.add(imageControl1, null);
  647.     insetsPanel2.setInsets(new Insets(10, 10, 10, 10));
  648.     bevelPanel1.add(insetsPanel2, BorderLayout.WEST);
  649.     gridLayout1.setRows(5);
  650.     gridLayout1.setColumns(1);
  651.     label1.setText(product);
  652.     label2.setText(version);
  653.     label3.setText(copyright);
  654.     label4.setText(comments);
  655.     label5.setText(writtenby);
  656.     insetsPanel3.setLayout(gridLayout1);
  657.     insetsPanel3.add(label1, null);
  658.     insetsPanel3.add(label2, null);
  659.     insetsPanel3.add(label3, null);
  660.     insetsPanel3.add(label4, null);
  661.     insetsPanel3.add(label5, null);
  662.     insetsPanel3.setInsets(new Insets(10, 60, 10, 10));
  663.     bevelPanel1.add(insetsPanel3, BorderLayout.CENTER);
  664.     button1.setLabel(res.getString("MF_OK"));
  665.     button1.addActionListener(this);
  666.     insetsPanel1.add(button1, null);
  667.     panel1.add(insetsPanel1, BorderLayout.SOUTH);
  668.     panel1.add(bevelPanel1, BorderLayout.NORTH);
  669.     imageControl1.setAlignment(borland.jbcl.util.Alignment.LEFT | borland.jbcl.util.Alignment.TOP);
  670.     imageControl1.setImageName(".\\Graphics\\logo_sml.gif");
  671.     pack();
  672.   }
  673.  
  674.   public void actionPerformed(ActionEvent e) {
  675.     if (e.getSource() == button1) {
  676.     setVisible(false);
  677.     dispose();
  678.     }
  679.   }
  680. }
  681.  
  682. class InsetsPanel extends Panel {
  683.   protected Insets insets;
  684.  
  685.   public Insets getInsets() {
  686.     return insets == null ? super.getInsets() : insets;
  687.   }
  688.  
  689.   public void setInsets(Insets insets) {
  690.     this.insets = insets;
  691.   }
  692. }
  693.  
  694.  
  695.