home *** CD-ROM | disk | FTP | other *** search
Java Source | 1998-05-08 | 22.2 KB | 500 lines |
- /*
- * Copyright (c) 1997-1998 Borland International, Inc. All Rights Reserved.
- *
- * This SOURCE CODE FILE, which has been provided by Borland as part
- * of a Borland product for use ONLY by licensed users of the product,
- * includes CONFIDENTIAL and PROPRIETARY information of Borland.
- *
- * USE OF THIS SOFTWARE IS GOVERNED BY THE TERMS AND CONDITIONS
- * OF THE LICENSE STATEMENT AND LIMITED WARRANTY FURNISHED WITH
- * THE PRODUCT.
- *
- * IN PARTICULAR, YOU WILL INDEMNIFY AND HOLD BORLAND, ITS RELATED
- * COMPANIES AND ITS SUPPLIERS, HARMLESS FROM AND AGAINST ANY CLAIMS
- * OR LIABILITIES ARISING OUT OF THE USE, REPRODUCTION, OR DISTRIBUTION
- * OF YOUR PROGRAMS, INCLUDING ANY CLAIMS OR LIABILITIES ARISING OUT OF
- * OR RESULTING FROM THE USE, MODIFICATION, OR DISTRIBUTION OF PROGRAMS
- * OR FILES CREATED FROM, BASED ON, AND/OR DERIVED FROM THIS SOURCE
- * CODE FILE.
- */
-
- //Title: Cliffhanger Adventure Gear
- //Version:
- //Copyright: Copyright (c) 1997 Borland International, Inc.
- //Author: Application Methods, Inc.
- //Description: Cliffhanger Adventure Gear order entry system
-
- package borland.reference.cliffhanger;
-
- import java.awt.*;
- import java.awt.event.*;
- import borland.jbcl.layout.*;
- import borland.jbcl.control.*;
- import borland.sql.dataset.*;
- import borland.jbcl.dataset.*;
- import java.util.*;
-
- /**
- * CustomerFrame implements the Customer Form that is used to maintain
- * Customer records. This form allows users to view or update
- * existing customers, or enter new customers. A standard navigation control
- * is used to allow for record browsing. A master-detail relationship between
- * customers and orders is used to display a list of orders placed by each
- * customer.
- *
- * <P>
- * This class employs the Singleton pattern to ensure that the class has only
- * one instance. You can access the singleton instance by calling the
- * getCustomerFrame method.
- */
- public class CustomerFrame extends DecoratedFrame {
- private static DataModule1 dm = DataModule1.getDataModule();
-
- private static CustomerFrame myCustomerFrame;
- private QueryDataSet qdsCustomer;
- private QueryDataSet qdsCustOrder;
- BevelPanel pnlCustomerInfo = new BevelPanel();
- BevelPanel pnlOrders = new BevelPanel();
- BevelPanel pnlToolBar = new BevelPanel();
- BevelPanel pnlMain = new BevelPanel();
- BorderLayout borderLayout1 = new BorderLayout();
- BorderLayout borderLayout2 = new BorderLayout();
- GridBagLayout gridBagLayout1 = new GridBagLayout();
- GridBagLayout gridBagLayout2 = new GridBagLayout();
- NavigatorControl navigatorControl1 = new NavigatorControl();
- GridControl gridControl1 = new GridControl();
- FieldControl txtFirstName = new FieldControl();
- FieldControl txtMI = new FieldControl();
- FieldControl txtLastName = new FieldControl();
- FieldControl txtAddr1 = new FieldControl();
- FieldControl txtAddr2 = new FieldControl();
- FieldControl txtCity = new FieldControl();
- FieldControl txtState = new FieldControl();
- FieldControl txtPostalCode = new FieldControl();
- FieldControl txtCountry = new FieldControl();
- FieldControl txtPhone = new FieldControl();
- FieldControl txtFax = new FieldControl();
- FieldControl txtEmail = new FieldControl();
- LabelControl lblCustomerID = new LabelControl();
- LabelControl labelControl1 = new LabelControl();
- LabelControl labelControl2 = new LabelControl();
- LabelControl labelControl3 = new LabelControl();
- LabelControl labelControl4 = new LabelControl();
- LabelControl labelControl5 = new LabelControl();
- LabelControl labelControl6 = new LabelControl();
- LabelControl labelControl7 = new LabelControl();
- LabelControl labelControl8 = new LabelControl();
- LabelControl labelControl9 = new LabelControl();
- LabelControl labelControl10 = new LabelControl();
- LabelControl labelControl11 = new LabelControl();
- LabelControl labelControl12 = new LabelControl();
- LabelControl lblOrders = new LabelControl();
- StatusBar statusBar1 = new StatusBar();
- ButtonControl btnViewOrder = new ButtonControl();
- ButtonControl btnClose = new ButtonControl();
- ButtonControl btnNewOrder = new ButtonControl();
- BevelPanel pnlOrderButtons = new BevelPanel();
- FlowLayout flowLayout1 = new FlowLayout();
- ImageControl imageControl1 = new ImageControl();
- GridBagLayout gridBagLayout3 = new GridBagLayout();
- ResourceBundle res = java.util.ResourceBundle.getBundle("borland.reference.cliffhanger.Res");
-
- /**
- * The constructor is protected. Use the getCustomerFrame method to get an
- * instance of this class.
- */
- protected CustomerFrame() {
- try {
- jbInit(); // initialize frame's controls (JBuilder designer)
- initData(); // initialize dataset and data-aware components.
- }
- catch (Exception e) {
- e.printStackTrace();
- };
- }
-
- /**
- * Method generated and maintained by JBuilder designer to initialize
- * control properties.
- */
- private void jbInit() throws Exception{
- this.setSize(new Dimension(420, 520));
- this.setTitle(res.getString("CF_Customers"));
- this.addWindowListener(new CustomerFrame_this_windowAdapter(this));
- this.setExitOnClose(false);
- this.setLayout(borderLayout2);
- pnlCustomerInfo.setBevelInner(BevelPanel.FLAT);
- pnlCustomerInfo.setBevelOuter(borland.jbcl.control.BevelPanel.FLAT);
- pnlOrders.setBevelInner(BevelPanel.FLAT);
- pnlOrders.setBevelOuter(borland.jbcl.control.BevelPanel.FLAT);
- pnlMain.setBevelInner(BevelPanel.FLAT);
- pnlMain.setBevelOuter(borland.jbcl.control.BevelPanel.FLAT);
- navigatorControl1.setDataSet(dm.getCustomerDataSet());
- gridControl1.setDataSet(dm.getCustOrderDataSet());
- gridControl1.setDefaultColumnWidth(80);
- gridControl1.setFont(new Font("Dialog", 0, 12));
- gridControl1.setSelectRow(true);
- txtFirstName.setColumnName("FIRSTNAME");
- txtFirstName.setDataSet(dm.getCustomerDataSet());
- txtMI.setColumnName("MI");
- txtMI.setDataSet(dm.getCustomerDataSet());
- txtLastName.setColumnName("LASTNAME");
- txtLastName.setDataSet(dm.getCustomerDataSet());
- txtAddr1.setColumnName("ADDR1");
- txtAddr1.setDataSet(dm.getCustomerDataSet());
- txtAddr2.setColumnName("ADDR2");
- txtAddr2.setDataSet(dm.getCustomerDataSet());
- txtCity.setColumnName("CITY");
- txtCity.setDataSet(dm.getCustomerDataSet());
- txtState.setColumnName("STATE");
- txtState.setDataSet(dm.getCustomerDataSet());
- txtPostalCode.setColumnName("POSTALCODE");
- txtPostalCode.setDataSet(dm.getCustomerDataSet());
- txtCountry.setColumnName("COUNTRY");
- txtCountry.setDataSet(dm.getCustomerDataSet());
- txtPhone.setColumnName("PHONE");
- txtPhone.setDataSet(dm.getCustomerDataSet());
- txtFax.setColumnName("FAX");
- txtFax.setDataSet(dm.getCustomerDataSet());
- txtEmail.setColumnName("EMAIL");
- txtEmail.setDataSet(dm.getCustomerDataSet());
- pnlCustomerInfo.setLayout(gridBagLayout1);
- pnlOrders.setLayout(borderLayout1);
- pnlToolBar.setLayout(gridBagLayout3);
- pnlMain.setLayout(gridBagLayout2);
- lblCustomerID.setColumnName("ID");
- lblCustomerID.setDataSet(dm.getCustomerDataSet());
- lblCustomerID.setFont(new Font("Dialog", 1, 12));
- lblCustomerID.setForeground(Color.red);
- labelControl1.setText(res.getString("CF_Name"));
- labelControl2.setText(res.getString("CF_Address_1"));
- labelControl3.setText(res.getString("CF_City_StateProv"));
- labelControl4.setText(res.getString("CF_Phone"));
- labelControl5.setText(res.getString("CF_EMail"));
- labelControl6.setText(res.getString("CF_Fax"));
- labelControl7.setText(res.getString("CF_Address_2"));
- labelControl8.setText(res.getString("CF_Country"));
- labelControl9.setText(res.getString("CF_First"));
- labelControl10.setAlignment(Label.CENTER);
- labelControl10.setText(res.getString("CF_MI"));
- labelControl11.setText(res.getString("CF_Last"));
- labelControl12.setText(res.getString("CF_Postal_Code"));
- statusBar1.setDataSet(dm.getCustomerDataSet());
- statusBar1.setBevelOuter(BevelPanel.LOWERED);
- statusBar1.setFont(new Font("Dialog", 0, 10));
- btnViewOrder.setLabel(res.getString("CF_View_Order"));
- btnViewOrder.addActionListener(new CustomerFrame_btnViewOrder_actionAdapter(this));
- lblOrders.setText(res.getString("CF_Orders_placed_by_this"));
- btnClose.setLabel(res.getString("CF_Close"));
- btnClose.addActionListener(new CustomerFrame_btnClose_actionAdapter(this));
- pnlOrderButtons.setLayout(flowLayout1);
- btnNewOrder.setLabel(res.getString("CF_New_Order"));
- imageControl1.setAlignment(borland.jbcl.util.Alignment.LEFT | borland.jbcl.util.Alignment.TOP);
- imageControl1.setBackground(SystemColor.control);
- imageControl1.setImageName(".\\graphics\\customerBanner.jpg");
- labelControl6.setAlignment(Label.CENTER);
- btnNewOrder.addActionListener(new CustomerFrame_btnNewOrder_actionAdapter(this));
- this.add(pnlToolBar, BorderLayout.NORTH);
- this.add(pnlMain, BorderLayout.CENTER);
- this.add(statusBar1, BorderLayout.SOUTH);
- pnlMain.add(pnlCustomerInfo, new GridBagConstraints2(0, 0, 1, 1, 100.0, 0.0
- ,GridBagConstraints.NORTH, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), 0, 0));
- pnlCustomerInfo.add(txtFirstName, new GridBagConstraints2(6, 1, 2, 1, 1.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 6, 0, 0), 112, 0));
- pnlCustomerInfo.add(txtMI, new GridBagConstraints2(8, 1, 2, 1, 0.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 0), -60, 0));
- pnlCustomerInfo.add(txtLastName, new GridBagConstraints2(10, 1, 3, 1, 1.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 0, 0, 4), 107, 0));
- pnlCustomerInfo.add(txtAddr1, new GridBagConstraints2(6, 2, 6, 1, 1.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(10, 6, 0, 4), 224, 0));
- pnlCustomerInfo.add(txtAddr2, new GridBagConstraints2(6, 3, 6, 1, 1.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 6, 0, 4), 224, 0));
- pnlCustomerInfo.add(txtCity, new GridBagConstraints2(6, 4, 2, 1, 1.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 6, 0, 0), 108, 0));
- pnlCustomerInfo.add(txtState, new GridBagConstraints2(8, 4, 4, 1, 0.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 0, 0, 0), 18, 0));
- pnlCustomerInfo.add(txtPostalCode, new GridBagConstraints2(6, 5, 2, 1, 1.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 6, 0, 0), 108, 0));
- pnlCustomerInfo.add(txtCountry, new GridBagConstraints2(6, 6, 2, 1, 1.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(0, 6, 0, 0), 107, 0));
- pnlCustomerInfo.add(txtPhone, new GridBagConstraints2(6, 7, 2, 1, 1.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(10, 6, 0, 0), 106, 0));
- pnlCustomerInfo.add(txtFax, new GridBagConstraints2(10, 7, 2, 1, 1.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(10, 0, 0, 4), 65, 0));
- pnlCustomerInfo.add(txtEmail, new GridBagConstraints2(6, 9, 6, 1, 1.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(10, 6, 10, 4), 223, 0));
- pnlCustomerInfo.add(labelControl1, new GridBagConstraints2(0, 1, 6, 1, 0.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 6, 0, 0), 27, 0));
- pnlCustomerInfo.add(labelControl2, new GridBagConstraints2(0, 2, 1, 1, 0.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(10, 6, 0, 0), 0, 0));
- pnlCustomerInfo.add(labelControl3, new GridBagConstraints2(0, 4, 1, 1, 0.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 6, 0, 0), 0, 0));
- pnlCustomerInfo.add(labelControl4, new GridBagConstraints2(0, 7, 3, 2, 0.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(10, 6, 0, 0), 0, 0));
- pnlCustomerInfo.add(labelControl5, new GridBagConstraints2(0, 9, 2, 1, 0.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(10, 6, 10, 0), 0, 0));
- pnlCustomerInfo.add(labelControl6, new GridBagConstraints2(8, 7, 1, 1, 0.0, 0.0
- ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(10, 0, 0, 0), 0, 0));
- pnlCustomerInfo.add(labelControl7, new GridBagConstraints2(0, 3, 5, 1, 0.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 6, 0, 0), 0, 0));
- pnlCustomerInfo.add(labelControl8, new GridBagConstraints2(0, 6, 4, 1, 0.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 6, 0, 0), 0, 0));
- pnlCustomerInfo.add(labelControl9, new GridBagConstraints2(6, 0, 1, 1, 0.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(4, 12, 0, 0), 9, 0));
- pnlCustomerInfo.add(labelControl10, new GridBagConstraints2(8, 0, 1, 1, 0.0, 0.0
- ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(4, 0, 0, 0), 0, 0));
- pnlCustomerInfo.add(labelControl11, new GridBagConstraints2(10, 0, 1, 1, 0.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(4, 9, 0, 0), 0, 0));
- pnlCustomerInfo.add(lblCustomerID, new GridBagConstraints2(0, 0, 1, 1, 0.0, 0.0
- ,GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL, new Insets(0, 10, 0, 0), 0, 0));
- pnlCustomerInfo.add(labelControl12, new GridBagConstraints2(0, 5, 4, 1, 0.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 6, 0, 0), 0, 0));
- pnlMain.add(pnlOrders, new GridBagConstraints2(0, 1, 1, 1, 100.0, 100.0
- ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 0, 0, 0), 0, 0));
- pnlOrders.add(gridControl1, BorderLayout.CENTER);
- pnlOrders.add(lblOrders, BorderLayout.NORTH);
- pnlOrders.add(pnlOrderButtons, BorderLayout.SOUTH);
- pnlOrderButtons.add(btnViewOrder, null);
- pnlOrderButtons.add(btnNewOrder, null);
- pnlToolBar.add(navigatorControl1, new GridBagConstraints2(0, 1, 1, 1, 1.0, 0.0
- ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(0, 2, 2, 2), 0, 0));
- pnlToolBar.add(btnClose, new GridBagConstraints2(1, 1, 1, 1, 0.0, 0.0
- ,GridBagConstraints.EAST, GridBagConstraints.NONE, new Insets(0, 60, 2, 2), 0, 7));
- pnlToolBar.add(imageControl1, new GridBagConstraints2(0, 0, 2, 1, 1.0, 1.0
- ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 2, 2, 2), 0, -57));
- }
-
- /**
- * We created this method to separate code to initialize database and
- * data-aware controls, which otherwise would go in the jbInit() method.
- * Note that by doing so, the properties set here are not visible to the
- * property inspector. And setting any properties via the inspector will
- * add code to jbInit() instead of here.
- */
- private void initData() throws Exception {
- qdsCustomer = dm.getCustomerDataSet();
- qdsCustomer.open();
- qdsCustOrder = dm.getCustOrderDataSet();
- }
-
- /**
- * Class method to access the singleton instance of the class.
- */
- public static CustomerFrame getCustomerFrame() {
- if (myCustomerFrame == null)
- myCustomerFrame = new CustomerFrame();
-
- return myCustomerFrame;
- }
-
- /**
- * Method to insert a new customer record.
- * Useful for inserting records from other forms in the application.
- */
- public void newCustomer() {
- try {
- // Open the dataset if not already opened.
- qdsCustomer.open();
- // Insert a new Customer record at the end of the
- // dataset
- qdsCustomer.insertRow(false);
- }
- catch (Exception e) {
- e.printStackTrace();
- }
- }
-
- /**
- * Initialize form controls when the form is activated.
- */
- void this_windowActivated(WindowEvent e) {
- // determine which navigator buttons to enable
-
- // Note that we set the buttons here instead of in
- // windowOpened because when the NavigatorControl rebuilds
- // itself, the Save and Refresh buttons get re-enabled
- int[] enabledFlags = {1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0};
- for (int i = 0; i < enabledFlags.length; i++)
- navigatorControl1.setButtonEnabled(i, enabledFlags[i] == 1);
- }
-
- /**
- * Before closing the window, check for any pending changes,
- * and prompt user if there are changes pending.
- * Note that we need to both check if there is anything to Post,
- * and to check if there is anything to resolve.
- */
- void this_windowClosing(WindowEvent e) {
- try {
- int status = qdsCustomer.getStatus();
- if ( (qdsCustomer.isEditing() || qdsCustomer.isEditingNewRow()) ||
- ((status & (RowStatus.UPDATED|RowStatus.INSERTED|RowStatus.DELETED)) != 0)
- ) {
- int answer = CliffhangerApplication.messageDlg(res.getString("CF_Save_Pending_Changes"),
- res.getString("CF_Save_pending_changes?"),
- Message.YES_NO_CANCEL);
- // Post changes and resolve them back to DB
- if (answer == Message.YES) {
- qdsCustomer.post();
-
- // if there are pending changes to be resolved,
- // save the changes via the Database.saveChanges()
- // method. Then refresh the dataset.
- status = qdsCustomer.getStatus();
- if ( (status & (RowStatus.UPDATED|RowStatus.INSERTED|RowStatus.DELETED)) != 0) {
- qdsCustomer.getDatabase().saveChanges(new DataSet[] {qdsCustomer}, true);
- }
- }
- // If user chooses no, then cancel any inserts or edits
- // and refresh the dataset.
- else if (answer == Message.NO) {
- qdsCustomer.cancel();
- }
- // If user cancels, just return
- else //if (answer == Message.CANCEL)
- return;
- }
-
- // Refresh the dataset to ensure that we have updated data
- qdsCustomer.refresh();
- setVisible(false);
- dispose();
-
- }
- catch (Exception ex) {
- ex.printStackTrace();
- new ExceptionDialog(this, res.getString("CF_Error"), ex, true).show();
- }
- }
-
- /**
- * When View Order button is clicked, show the Order Entry form
- * with the selected order as the current record.
- */
- void btnViewOrder_actionPerformed(ActionEvent e) {
- try {
- // make sure it is a valid order
- int orderID = qdsCustOrder.getInt("ID");
- if (orderID <= 0) {
- CliffhangerApplication.messageDlg(CliffhangerApplication.MESSAGE_TITLE,
- res.getString("CF_No_order_selected"),
- Message.OK);
- return;
- }
-
- // Get the OrderEntryFrame, and locate the selected order
- OrderEntryFrame frame = OrderEntryFrame.getOrderEntryFrame();
- if (frame.locateOrder(orderID)) {
- // Show the frame centered in the screen
- CliffhangerApplication.showCenteredFrame(frame, false);
- }
- else {
- CliffhangerApplication.messageDlg(res.getString("CF_Error"),
- res.getString("CF_Order_not_found"),
- Message.OK);
- }
- }
- catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /**
- * When New Order button is clicked, show the Order Entry form
- * with a new order inserted, default the customer for the order
- * to the current customer record.
- */
- void btnNewOrder_actionPerformed(ActionEvent e) {
- try {
- // post any changes first
- if (qdsCustomer.isEditing() || qdsCustomer.isEditingNewRow()) {
- qdsCustomer.post();
- }
-
- // make sure it is a valid order
- int customerID = qdsCustomer.getInt("ID");
- if (customerID <= 0) {
- CliffhangerApplication.messageDlg(CliffhangerApplication.MESSAGE_TITLE,
- res.getString("CF_No_customer_selected"),
- Message.OK);
- return;
- }
-
- // Get the OrderEntryFrame and show the frame centered in the screen
- OrderEntryFrame frame = OrderEntryFrame.getOrderEntryFrame();
- CliffhangerApplication.showCenteredFrame(frame, false);
-
- // create a new order, passing the customer ID
- // to default the customer of the new order
- // to this current customer.
- frame.newOrder(customerID);
- }
- catch (Exception ex) {
- ex.printStackTrace();
- }
- }
-
- /**
- * When Close button is clicked, call this frame's windowClosing
- * event handler to properly handle all dataset pending updates.
- */
- void btnClose_actionPerformed(ActionEvent e) {
- // close this Window
- this.this_windowClosing(new WindowEvent(this, WindowEvent.WINDOW_CLOSING));
- }
-
- }
-
- class CustomerFrame_this_windowAdapter extends java.awt.event.WindowAdapter {
- CustomerFrame adaptee;
-
- CustomerFrame_this_windowAdapter(CustomerFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void windowClosing(WindowEvent e) {
- adaptee.this_windowClosing(e);
- }
-
- public void windowActivated(WindowEvent e) {
- adaptee.this_windowActivated(e);
- }
-
- }
-
- class CustomerFrame_btnViewOrder_actionAdapter implements java.awt.event.ActionListener{
- CustomerFrame adaptee;
-
- CustomerFrame_btnViewOrder_actionAdapter(CustomerFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void actionPerformed(ActionEvent e) {
- adaptee.btnViewOrder_actionPerformed(e);
- }
- }
-
- class CustomerFrame_btnClose_actionAdapter implements java.awt.event.ActionListener {
- CustomerFrame adaptee;
-
- CustomerFrame_btnClose_actionAdapter(CustomerFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void actionPerformed(ActionEvent e) {
- adaptee.btnClose_actionPerformed(e);
- }
- }
-
- class CustomerFrame_btnNewOrder_actionAdapter implements java.awt.event.ActionListener {
- CustomerFrame adaptee;
-
- CustomerFrame_btnNewOrder_actionAdapter(CustomerFrame adaptee) {
- this.adaptee = adaptee;
- }
-
- public void actionPerformed(ActionEvent e) {
- adaptee.btnNewOrder_actionPerformed(e);
- }
- }
-