home *** CD-ROM | disk | FTP | other *** search
/ PC World 1998 October / PCWorld_1998-10_cd.bin / software / prehled / inprise / JSAMPLES.Z / OrderFrame.java < prev    next >
Text File  |  1998-05-08  |  20KB  |  476 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. package borland.samples.intl.gui;
  22.  
  23. import java.awt.*;
  24. import java.awt.event.*;
  25. import java.util.*;
  26. import borland.jbcl.layout.*;
  27. import borland.jbcl.control.*;
  28. import borland.jbcl.view.*;
  29. import borland.jbcl.util.*;
  30.  
  31. import borland.samples.intl.application.*;
  32. import borland.samples.intl.beans.*;
  33. import borland.samples.intl.beans.event.*;
  34. import borland.jbcl.model.*;
  35.  
  36. public class OrderFrame extends DecoratedFrame implements LocaleChangeListener{
  37.   private static OrderFrame orderFrame = null;
  38.   private int captionMargin = 10;
  39.   private boolean viewingOrders = false;
  40.   private boolean batchUpdateMode = false;
  41.  
  42.   GridControl orderLineItemGridControl = new GridControl();
  43.   private static AppDataModule appDataModule = AppDataModule.getDataModule();
  44.  
  45.   GridBagLayout gridBagLayout1 = new GridBagLayout();
  46.   GridBagLayout gridBagLayout2 = new GridBagLayout();
  47.  
  48.   GridLayout gridLayout2 = new GridLayout();
  49.   GridLayout gridLayout4 = new GridLayout();
  50.   GridLayout gridLayout5 = new GridLayout();
  51.  
  52.   BevelPanel headerPanel = new BevelPanel();
  53.   BevelPanel customerDataPanel = new BevelPanel();
  54.   BevelPanel buttonPanel = new BevelPanel();
  55.   BevelPanel exchangeRatePanel = new BevelPanel();
  56.   BevelPanel summaryPanel = new BevelPanel();
  57.   BevelPanel paymentMethodPanel = new BevelPanel();
  58.   
  59.   TabsetPanel customerTabSetPanel = new TabsetPanel();
  60.  
  61.   LabelControl orderNoLabel = new LabelControl();
  62.   LabelControl titleLabel = new LabelControl();
  63.   LabelControl orderDateLabel = new LabelControl();
  64.   LabelControl exchangeRateLabel = new LabelControl();
  65.   LabelControl subtotalLabel = new LabelControl();
  66.   LabelControl shippingLabel = new LabelControl();
  67.   LabelControl taxLabel = new LabelControl();
  68.   LabelControl totalLabel = new LabelControl();
  69.  
  70.   ButtonControl removeItemButton = new ButtonControl();
  71.   ButtonControl cancelOrderButton = new ButtonControl();
  72.   ButtonControl completeOrderButton = new ButtonControl();
  73.  
  74.   FieldControl orderNoField = new FieldControl();
  75.   FieldControl orderDateField = new FieldControl();
  76.   FieldControl exchangeRateField = new FieldControl();
  77.   FieldControl subtotalField = new FieldControl();
  78.   FieldControl localSubtotalField = new FieldControl();
  79.   FieldControl shippingField = new FieldControl();
  80.   FieldControl localShippingField = new FieldControl();
  81.   FieldControl taxField = new FieldControl();
  82.   FieldControl localTaxField = new FieldControl();
  83.   FieldControl totalField = new FieldControl();
  84.   FieldControl localTotalField = new FieldControl();
  85.  
  86.   SoldToPanel soldToPanel = new SoldToPanel();
  87.   ShipToPanel shipToPanel = new ShipToPanel();
  88.  
  89.   LabelControl paymentMethodLabel = new LabelControl();
  90. //  ChoiceControl paymentMethodField = new ChoiceControl();
  91.   FieldControl paymentMethodField = new FieldControl();
  92.   LabelControl creditCardNoLabel = new LabelControl();
  93.   FieldControl creditCardNoField = new FieldControl();
  94.   LabelControl expirationDateLabel = new LabelControl();
  95.   FieldControl expirationDateField = new FieldControl();
  96.  
  97.   ViewOnlyNavigationBar viewOnlyNavigationBar = new ViewOnlyNavigationBar();
  98.  
  99.   ResourceBundle textRes = java.util.ResourceBundle.getBundle("borland.samples.intl.gui.resources.TextRes",
  100.                                                               LocaleChangeManager.getLocale());
  101.   //Construct the frame
  102.   public OrderFrame() {
  103.     try {
  104.       jbInit();
  105.     }
  106.     catch (Exception e) {
  107.       borland.jbcl.util.Diagnostic.printStackTrace(e);
  108.     };
  109.   }
  110.  
  111.   public static OrderFrame getInstance() {
  112.     if (orderFrame == null) {
  113.       orderFrame = new OrderFrame();
  114.     }
  115.     return orderFrame;
  116.   }
  117.  
  118.   public void addNotify() {
  119.     super.addNotify();
  120.     orderFrame.pack();
  121.  
  122.     //Center the window
  123.     Dimension screenSize = Toolkit.getDefaultToolkit().getScreenSize();
  124.     Dimension frameSize = orderFrame.getPreferredSize();
  125.     if (frameSize.height > screenSize.height)
  126.       frameSize.height = screenSize.height;
  127.     if (frameSize.width > screenSize.width)
  128.       frameSize.width = screenSize.width;
  129.     orderFrame.setLocation((screenSize.width - frameSize.width) / 2, (screenSize.height - frameSize.height) / 2);
  130.   }
  131.  
  132.   void jbInit() throws Exception{
  133.     this.setLayout(gridBagLayout1);
  134.     this.setSize(new Dimension(653, 505));  
  135.     this.setTitle(textRes.getString("Order_frame_title"));
  136.  
  137.     orderNoLabel.setText(textRes.getString("order_no"));
  138.     orderNoField.setDataSet(appDataModule.getOrderDataSet());
  139.     orderNoField.setColumnName("order_no");
  140.     orderNoField.setBackground(SystemColor.control);
  141.  
  142.     titleLabel.setText(textRes.getString("Form_title"));
  143.     titleLabel.setAlignment(Label.CENTER);
  144.  
  145.     orderDateLabel.setText(textRes.getString("order_date"));
  146.     orderDateField.setDataSet(appDataModule.getOrderDataSet());
  147.     orderDateField.setColumnName("order_date");
  148.     orderDateField.setBackground(SystemColor.control);
  149.  
  150.     headerPanel.setLayout(gridBagLayout2);
  151.     headerPanel.setBevelInner(BevelPanel.FLAT);
  152.     headerPanel.add(orderNoLabel, new GridBagConstraints2(0, 0, 1, 1, 0.0, 0.0
  153.             ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 5, 0, 0), 0, 0));
  154.     headerPanel.add(orderNoField, new GridBagConstraints2(1, 0, 1, 1, 0.0, 0.0
  155.             ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
  156.     headerPanel.add(titleLabel, new GridBagConstraints2(2, 0, 4, 1, 100.0, 0.0
  157.             ,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
  158.     headerPanel.add(orderDateLabel, new GridBagConstraints2(6, 0, 1, 1, 0.0, 0.0
  159.             ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 0, 0));
  160.     headerPanel.add(orderDateField, new GridBagConstraints2(7, 0, 1, 1, 0.0, 0.0
  161.             ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 0, 0, 5), 0, 0));
  162.     headerPanel.setEnabled(false);
  163.  
  164.     this.add(headerPanel, new GridBagConstraints2(0, 0, 6, 1, 100.0, 0.0
  165.             ,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
  166.  
  167.     customerTabSetPanel.setLabels(new String[] {textRes.getString("Sold_To"), textRes.getString("Ship_To") });
  168.     customerTabSetPanel.add(soldToPanel, textRes.getString("Sold_To"));
  169.     customerTabSetPanel.add(shipToPanel, textRes.getString("Ship_To"));
  170.     customerTabSetPanel.setSelectedIndex(0);
  171.     this.add(customerTabSetPanel, new GridBagConstraints2(0, 1, 6, 4, 100.0, 0.0
  172.             ,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 18));
  173.  
  174.     orderLineItemGridControl.setAutoInsert(false);
  175.     orderLineItemGridControl.setShowPopup(false);
  176.     orderLineItemGridControl.setDataSet(appDataModule.getOrderLineItemDataSet());
  177.     orderLineItemGridControl.setPreferredSize(new Dimension(0, 100));
  178. //    orderLineItemGridControl.setNavigateOnEnter(false);
  179.  
  180.     this.add(orderLineItemGridControl, new GridBagConstraints2(0, 5, 6, 4, 100.0, 100.0
  181.             ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
  182.  
  183.     paymentMethodLabel.setText(textRes.getString("payment_method"));
  184. //    paymentMethodField.setItems(appDataModule.getPaymentMethodDataSet(), "credit_card_name");
  185.     paymentMethodField.setDataSet(appDataModule.getOrderDataSet());
  186.     paymentMethodField.setColumnName("payment_method");
  187.     creditCardNoLabel.setText(textRes.getString("credit_card_no"));
  188.     creditCardNoField.setDataSet(appDataModule.getOrderDataSet());
  189.     creditCardNoField.setColumnName("credit_card_no");
  190.     expirationDateLabel.setText(textRes.getString("card_expiration_date"));
  191.     expirationDateField.setDataSet(appDataModule.getOrderDataSet());
  192.     expirationDateField.setColumnName("card_expiration_date");
  193.  
  194.     exchangeRateLabel.setText(textRes.getString("Exchange_rate"));
  195.     exchangeRateField.setDataSet(appDataModule.getExchangeRateDataSet());
  196.     exchangeRateField.setColumnName("exchange_rate");
  197.  
  198.     gridLayout5.setRows(4);
  199.     gridLayout5.setColumns(2);
  200.     gridLayout5.setHgap(10);
  201.     paymentMethodPanel.setLayout(gridLayout5);
  202.     paymentMethodPanel.add(paymentMethodLabel, null);
  203.     paymentMethodPanel.add(creditCardNoLabel, null);
  204.     paymentMethodPanel.add(paymentMethodField, null);
  205.     paymentMethodPanel.add(creditCardNoField, null);
  206.     paymentMethodPanel.add(expirationDateLabel, null);
  207.     paymentMethodPanel.add(exchangeRateLabel, null);
  208.     paymentMethodPanel.add(expirationDateField, null);
  209.     paymentMethodPanel.add(exchangeRateField, null);
  210.     paymentMethodPanel.setBevelInner(BevelPanel.FLAT);
  211.     paymentMethodPanel.setMargins(new Insets(10, 30, 5, 30));
  212.  
  213.     this.add(paymentMethodPanel, new GridBagConstraints2(0, 9, 2, 4, 60.0, 0.0
  214.             ,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
  215.  
  216.     subtotalLabel.setText(textRes.getString("Subtotal"));
  217.     subtotalField.setDataSet(appDataModule.getOrderLineItemDataSet());
  218.     subtotalField.setColumnName("subtotal");
  219.     subtotalField.setAlignment(Alignment.RIGHT);
  220.     subtotalField.setBackground(SystemColor.control);
  221.     localSubtotalField.setDataSet(appDataModule.getOrderLineItemDataSet());
  222.     localSubtotalField.setColumnName("local_subtotal");
  223.     localSubtotalField.setBackground(SystemColor.control);
  224.     localSubtotalField.setAlignment(Alignment.RIGHT);
  225.  
  226.     shippingLabel.setText(textRes.getString("Shipping_&_Handling"));
  227.     shippingField.setDataSet(appDataModule.getOrderLineItemDataSet());
  228.     shippingField.setColumnName("shipping");
  229.     shippingField.setBackground(SystemColor.control);
  230.     shippingField.setAlignment(Alignment.RIGHT);
  231.     localShippingField.setDataSet(appDataModule.getOrderLineItemDataSet());
  232.     localShippingField.setColumnName("local_shipping");
  233.     localShippingField.setBackground(SystemColor.control);
  234.     localShippingField.setAlignment(Alignment.RIGHT);
  235.  
  236.     taxLabel.setText(textRes.getString("Sales_tax"));
  237.     taxField.setDataSet(appDataModule.getOrderLineItemDataSet());
  238.     taxField.setColumnName("tax");
  239.     taxField.setAlignment(Alignment.RIGHT);
  240.     taxField.setBackground(SystemColor.control);
  241.     localTaxField.setDataSet(appDataModule.getOrderLineItemDataSet());
  242.     localTaxField.setColumnName("local_tax");
  243.     localTaxField.setAlignment(Alignment.RIGHT);
  244.     localTaxField.setBackground(SystemColor.control);
  245.  
  246.     totalLabel.setText(textRes.getString("Total"));
  247.     totalField.setDataSet(appDataModule.getOrderLineItemDataSet());
  248.     totalField.setColumnName("total");
  249.     totalField.setAlignment(Alignment.RIGHT);
  250.     totalField.setBackground(SystemColor.control);
  251.     localTotalField.setDataSet(appDataModule.getOrderLineItemDataSet());
  252.     localTotalField.setColumnName("local_total");
  253.     localTotalField.setAlignment(Alignment.RIGHT);
  254.     localTotalField.setBackground(SystemColor.control);
  255.  
  256.     gridLayout4.setRows(4);
  257.     gridLayout4.setColumns(3);
  258.     summaryPanel.setLayout(gridLayout4);
  259.     summaryPanel.add(subtotalLabel, null);
  260.     summaryPanel.add(subtotalField, null);
  261.     summaryPanel.add(localSubtotalField, null);
  262.     summaryPanel.add(shippingLabel, null);
  263.     summaryPanel.add(shippingField, null);
  264.     summaryPanel.add(localShippingField, null);
  265.     summaryPanel.add(taxLabel, null);
  266.     summaryPanel.add(taxField, null);
  267.     summaryPanel.add(localTaxField, null);
  268.     summaryPanel.add(totalLabel, null);
  269.     summaryPanel.add(totalField, null);
  270.     summaryPanel.add(localTotalField, null);
  271.     summaryPanel.setBevelInner(BevelPanel.FLAT);
  272.     summaryPanel.setEnabled(false);
  273.  
  274.     this.add(summaryPanel, new GridBagConstraints2(2, 9, 4, 4, 40.0, 0.0
  275.             ,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
  276.  
  277.     gridLayout2.setRows(1);
  278.     gridLayout2.setColumns(3);
  279.     gridLayout2.setHgap(10);
  280.     buttonPanel.setLayout(gridLayout2);
  281.     removeItemButton.setLabel(textRes.getString("Remove_Item"));
  282.     removeItemButton.addActionListener(new OrderFrame_removeItemButton_actionAdapter(this));
  283.     buttonPanel.add(removeItemButton, null);
  284.     cancelOrderButton.setLabel(textRes.getString("Cancel_Order"));
  285.     cancelOrderButton.addActionListener(new OrderFrame_cancelOrderButton_actionAdapter(this));
  286.     buttonPanel.add(cancelOrderButton, null);
  287.     completeOrderButton.setLabel(textRes.getString("Submit_Order"));
  288.     completeOrderButton.addActionListener(new OrderFrame_completeOrderButton_actionAdapter(this));
  289.     buttonPanel.add(completeOrderButton, null);
  290.     buttonPanel.setMargins(new Insets(10, 10, 10, 10));
  291.     this.add(buttonPanel, new GridBagConstraints2(0, 13, 6, 1, 100.0, 0.0
  292.             ,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
  293.  
  294.     viewOnlyNavigationBar.setVisible(false);
  295.     viewOnlyNavigationBar.setDataSet(appDataModule.getOrderDataSet());
  296.     this.add(viewOnlyNavigationBar, new GridBagConstraints2(0, 14, 6, 1, 100.0, 0.0
  297.             ,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
  298.  
  299.     LocaleChangeManager.getLocaleChangeManager().addLocaleChangeListener(this);
  300.   }
  301.  
  302.   public void setViewingOrders(boolean viewingOrders) {
  303.     this.viewingOrders = viewingOrders;
  304.     soldToPanel.setEnabled(!viewingOrders);
  305.     shipToPanel.setEnabled(!viewingOrders);
  306.     orderLineItemGridControl.setReadOnly(viewingOrders);
  307.     paymentMethodPanel.setEnabled(!viewingOrders);
  308.   }
  309.  
  310.   public boolean getViewingOrders() {
  311.     return viewingOrders;
  312.   }
  313.  
  314.   public void setVisible(boolean visible) {
  315.     if (visible) {
  316.       if (viewingOrders) {
  317.         viewOnlyNavigationBar.setVisible(true);
  318.         buttonPanel.setVisible(false);
  319.       } else {
  320.         viewOnlyNavigationBar.setVisible(false);
  321.         buttonPanel.setVisible(true);
  322.       }
  323.     } else {
  324.       if (viewingOrders) {
  325.         WelcomeFrame.getInstance().setAllowProductBrowsing(true);
  326.         appDataModule.browseCustomerOrders(false);
  327.         setViewingOrders(false);
  328.       }
  329.     }
  330.     super.setVisible(visible);
  331.   }
  332.  
  333.   public void setBatchUpdateMode(boolean batchUpdateMode) {
  334.     this.batchUpdateMode = batchUpdateMode;
  335.     orderLineItemGridControl.setBatchMode(batchUpdateMode);
  336.   }
  337.  
  338.   public boolean getBatchUpdateMode() {
  339.     return batchUpdateMode;
  340.   }
  341.  
  342.   protected void processWindowEvent(WindowEvent e) {
  343.     if (e.getID() == WindowEvent.WINDOW_CLOSING) {
  344.       this.setVisible(false);
  345.     }
  346.   }
  347.  
  348.   void removeItemButton_actionPerformed(ActionEvent e) {
  349.     appDataModule.removeCurrentLineItem();
  350.   }
  351.  
  352.  
  353.   void cancelOrderButton_actionPerformed(ActionEvent e) {
  354.     appDataModule.cancelOrder();
  355.     this.setVisible(false);
  356.     WelcomeFrame.getInstance().setAllowOrderViewing(true);
  357.     WelcomeFrame.getInstance().setVisible(true);
  358.   }
  359.  
  360.   void completeOrderButton_actionPerformed(ActionEvent e) {
  361.     try {
  362.       String password = null;
  363.       boolean savePassword = false;
  364.       if (appDataModule.isPasswordNeededToSaveOrder()) {
  365.         String password1 = null;
  366.         String password2 = null;
  367.  
  368.         PasswordDialog passwordDialog = new PasswordDialog(this, textRes.getString("Password"));
  369.         passwordDialog.show();
  370.         password1 = passwordDialog.getPassword();
  371.         if (password1 == null) {
  372.           return;
  373.         }
  374.         passwordDialog = new PasswordDialog(this, textRes.getString("Password_confirmation"));
  375.         passwordDialog.show();
  376.         password2 = passwordDialog.getPassword();
  377.         if (!password1.equals(password2)) {
  378.           Message message = new Message();
  379.           message.setFrame(this);
  380.           message.setLabels(new String [] { textRes.getString("OK") });
  381.           message.setMessage(textRes.getString("Passwords_different"));
  382.           message.setVisible(true);
  383.           return;
  384.         }
  385.         password = password2;
  386.         savePassword = true;
  387.       }
  388.  
  389.       if (appDataModule.saveOrder(password)) {
  390.         this.setVisible(false);
  391.         WelcomeFrame.getInstance().setAllowOrderViewing(true);
  392.         WelcomeFrame.getInstance().requestFocus();
  393.       }
  394.  
  395.     } catch (Exception ex) {
  396.       borland.jbcl.util.Diagnostic.printStackTrace(ex);
  397.     }
  398.   }
  399.  
  400.   public void localeChanged(LocaleChangeEvent e) {
  401.     textRes = java.util.ResourceBundle.getBundle("borland.samples.intl.gui.resources.TextRes", e.getLocale());
  402.  
  403.     setLocale(e.getLocale());
  404.  
  405.     this.setTitle(textRes.getString("Order_frame_title"));
  406.     orderNoLabel.setText(textRes.getString("order_no"));
  407.     orderNoLabel.invalidate();
  408.     titleLabel.setText(textRes.getString("Form_title"));
  409.     titleLabel.invalidate();
  410.     orderDateLabel.setText(textRes.getString("order_date"));
  411.     orderDateLabel.invalidate();
  412.     customerTabSetPanel.setLabels(new String[] {textRes.getString("Sold_To"), textRes.getString("Ship_To") });
  413.     customerTabSetPanel.invalidate();
  414.     paymentMethodLabel.setText(textRes.getString("payment_method"));
  415.     paymentMethodLabel.invalidate();
  416.     creditCardNoLabel.setText(textRes.getString("credit_card_no"));
  417.     creditCardNoLabel.invalidate();
  418.     expirationDateLabel.setText(textRes.getString("card_expiration_date"));
  419.     expirationDateLabel.invalidate();
  420.     exchangeRateLabel.setText(textRes.getString("Exchange_rate"));
  421.     exchangeRateLabel.invalidate();
  422.     subtotalLabel.setText(textRes.getString("Subtotal"));
  423.     subtotalLabel.invalidate();
  424.     shippingLabel.setText(textRes.getString("Shipping_&_Handling"));
  425.     shippingLabel.invalidate();
  426.     taxLabel.setText(textRes.getString("Sales_tax"));
  427.     taxLabel.invalidate();
  428.     totalLabel.setText(textRes.getString("Total"));
  429.     totalLabel.invalidate();
  430.     removeItemButton.setLabel(textRes.getString("Remove_Item"));
  431.     removeItemButton.invalidate();
  432.     cancelOrderButton.setLabel(textRes.getString("Cancel_Order"));
  433.     cancelOrderButton.invalidate();
  434.     completeOrderButton.setLabel(textRes.getString("Submit_Order"));
  435.     completeOrderButton.invalidate();
  436.  
  437.     this.pack();
  438.   }
  439. }
  440.  
  441. class OrderFrame_removeItemButton_actionAdapter implements java.awt.event.ActionListener {
  442.   OrderFrame adaptee;
  443.  
  444.   OrderFrame_removeItemButton_actionAdapter(OrderFrame adaptee) {
  445.     this.adaptee = adaptee;
  446.   }
  447.  
  448.   public void actionPerformed(ActionEvent e) {
  449.     adaptee.removeItemButton_actionPerformed(e);
  450.   }
  451. }
  452.  
  453. class OrderFrame_cancelOrderButton_actionAdapter implements java.awt.event.ActionListener {
  454.   OrderFrame adaptee;
  455.  
  456.   OrderFrame_cancelOrderButton_actionAdapter(OrderFrame adaptee) {
  457.     this.adaptee = adaptee;
  458.   }
  459.  
  460.   public void actionPerformed(ActionEvent e) {
  461.     adaptee.cancelOrderButton_actionPerformed(e);
  462.   }
  463. }
  464.  
  465. class OrderFrame_completeOrderButton_actionAdapter implements java.awt.event.ActionListener {
  466.   OrderFrame adaptee;
  467.  
  468.   OrderFrame_completeOrderButton_actionAdapter(OrderFrame adaptee) {
  469.     this.adaptee = adaptee;
  470.   }
  471.  
  472.   public void actionPerformed(ActionEvent e) {
  473.     adaptee.completeOrderButton_actionPerformed(e);
  474.   }
  475. }
  476.