亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? brokerviewimpl.java

?? this is a trade sale system realized by java. It can run some easy functions and has a good design p
?? JAVA
字號:
package trader;
import trader.gui.BrokerGui;
import java.util.*;
import java.io.Serializable;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
public class BrokerViewImpl implements BrokerView, Serializable{
  private transient BrokerGui gui;
  private BrokerModel brokerModel;
  private ArrayList brokerControllers  = new ArrayList(10);
  
  // Important note - For mod05_view exercises you are supplied
  // with the BrokerGui class. You should treat the GUI as a 
  // blackbox. You should focus on the services it provides and
  // not on how it provides the services. For the API (public 
  // methods) of the BrokerGui class, refer to Module 5 of 
  // the student guide. 

  public BrokerViewImpl(BrokerModel model) {
    System.out.println("Creating BrokerViewImpl");
    try {
      //** 1 Assign model to the attribute brokerModel
      brokerModel = model;
      //** 2 Invoke the addChangeListener method with this
      //     instance of BrokerViewImpl as the input parameter
      model.addChangeListener(this);
    } catch (Exception e) {
      System.out.println("BrokerViewImpl constructor " + e);
    }
    // Create and assign a BrokerGui object to gui 
    gui = new BrokerGui();
    // Pass the array selectionPanelListeners containing the
    // event listener objects that handle button clicks on
    // the selection panel of the gui. The array 
    // selectionPanelListeners is declared later in this class.
    // The buttons on the selection panel of the gui are
    // "Customer Details", "Portfolio", "All Customers" and
    // "Stocks".
    gui.addSelectionPanelListeners(selectionPanelListeners);
    // Pass the array custPanelListeners containing the
    // event listener objects that handle button clicks on
    // the customer details panel of the gui. The array 
    // custPanelListeners is declared later in this class.
    // The buttons on the customer details panel of the gui are
    // "Get Customer", "Add Customer", "Update Customer" and
    // "Delete Customer".
    gui.addCustPanelListeners(custPanelListeners);
  }
      
//user gesture listener registration methods
  /* ---------------------------------------------------------------
   * adds requester to the list of objects to be notified of user 
   * gestures entered through a user interface such as a GUI.
   * User getsures for the customer segment are add, delete, update
   * get and getAll customers. There are similar user gestures for 
   * portfolio and stock segments
   */
  public void addUserGestureListener(BrokerController b)
    throws BrokerException {
    System.out.println("BrokerViewImpl.addUserGestureListener " +b);
    //** 1 add b to brokerControllers using the add method   
    brokerControllers.add(b);
  }

//display selection request service methods  
  /* ------------------------------------------------------------
   * shows the display page specified by the broker controller
   */
  public void showDisplay(Object display) throws BrokerException {
    System.out.println("BrokerViewImpl.showDisplay " + display);
    // General hints: Use the instanceof operator to determine
    // the display parameter variable's class type.
    //** 1 If display variable's the class type is Customer then
    //**   1.1 Invoke refreshCustPan method on the gui passing
    //**       display as the invoked methods input parameter.
    //**       Note a cast of display to Customer type may be
    //**       required.
    //**   1.2 Invoke the showCard method on the gui passing the
    //**       string "customer"  as the invoked methods input 
    //**       parameter.
    if (display instanceof Customer) {
      gui.refreshCustPan((Customer) display);
      gui.showCard("customer");
    }
    //** 2 If display variable's the class type is Customer[] then
    //**   2.1 Invoke refreshAllCustPan method on the gui passing
    //**       display as the invoked methods input parameter.
    //**       Note a cast of display to Customer[] type may be
    //**       required.
    //**   2.2 Invoke the showCard method on the gui passing the
    //**       string "allcustomers"  as the invoked methods input 
    //**       parameter.
    if (display instanceof Customer[]) {
      gui.refreshAllCustPan((Customer[])display);
      gui.showCard("allcustomers");
    }
    if (display instanceof Portfolio) {
      //TBD
    }
    if (display instanceof Stock[]) {
      //TBD
    }    
    //** 3 If display variable's the class type is Exception then
    //**   3.1 Invoke updateLog method on the gui passing
    //**       display.toString() as the invoked methods input
    //**       parameter.
    if (display instanceof Exception) {
      // One way to show exceptions 
      gui.updateLog(display.toString());
    }    
  }
  
// iteration 1 Customer segment broker view methods
  /* ---------------------------------------------------------------
   * callback method to handle customer state change notification
   * from the broker model
   */
  public void handleCustomerChange(Customer cust)
    throws BrokerException{
    System.out.println("BrokerViewImpl.processCustomer " + cust);
    // get the cust id currently on the customer details display
    String cId;
    //** 1 Assign cId to customer id on the gui's customer details
    //**   panel. Use the gui's getCustIdOnCustPan() method.
    cId = gui.getCustIdOnCustPan();
    // refresh customer details panel if required
    //** 2 Use an if statement to test if cust.getId().equals(cId)
    //**   is true. 
    //** 2.1 If true:
    //**     Invoke refreshCustPan method on the gui passing
    //**     cust as the invoked methods input parameter. 
    if (cust.getId().equals(cId)) { 
        gui.refreshCustPan(cust);
    }
    
    // refresh all customers Panel
    try {
      Customer custs[];
      //** 1 Assign custs with the Customer[] returned by invoking
      //**   the getAllCustomers() on the attribute brokerModel.
      custs = brokerModel.getAllCustomers();
      //** 2 Invoke the refreshAllCustPan on gui with custs as
      //**   the refreshAllCustPan methods input parameter.
      gui.refreshAllCustPan(custs);
    } catch (Exception e) {
      System.out.println("BrokerViewImpl processCustomer " + e);
    }
  }


//event handler methods--------------------------------------
  // Following is an anonymous inner class declaration
  // The attribute custGetHandler is registered as the action
  // event listener with the "Get Customer" button of the gui,
  // by the constructor of this class.
  transient ActionListener custGetHandler =
    new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        // This method is called when the "Get Customer" button
        // is clicked by the user
        System.out.println("BrokerViewImpl: custGetHandler");
        BrokerController bc;
        String custId;
        //  Assign custId with the value of the customer id on
        //  the gui. Use the getCustIdOnCustPan() method of gui
        custId = gui.getCustIdOnCustPan();
        // Create a for loop: 
        // For every object in the ArrayList brokerControllers:
        // -Use get method to get the object and assign to bc.
        // -Invoke the handleGetCustomerGesture method on bc.
        for (int i=0; i<brokerControllers.size(); i++) {
          bc = (BrokerController) brokerControllers.get(i);
          bc.handleGetCustomerGesture(custId);
        }
      }
    };

  // Following is an anonymous inner class declaration
  // The attribute custAddHandler is registered as the action
  // event listener with the "Add Customer" button of the gui,
  // by the constructor of this class.
  transient ActionListener custAddHandler =
    new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        // This method is called when the "Add Customer" button
        // is clicked by the user
        System.out.println("BrokerViewImpl: custAddHandler");
        BrokerController bc;
        Customer cust;
        //** 1 Assign to cust a customer object that represents
        //**   the customer information on the gui. To get this 
        //**   object use the getCustomerOnCustPan() method of gui
        cust = gui.getCustomerOnCustPan();
        //** 2 Create a for loop: 
        //**   Hint: See actionPerformed method of the
        //**         custGetHandler object.
        //**   Invoke the handleAddCustomerGesture method on 
        //**   every object in the ArrayList brokerControllers.
        for (int i=0; i<brokerControllers.size(); i++) {
          bc = (BrokerController) brokerControllers.get(i);
          bc.handleAddCustomerGesture(cust);
        }
      }
    };

  // Following is an anonymous inner class declaration
  // The attribute custDeleteHandler is registered as the action
  // event listener with the "Delete Customer" button of the 
  // gui, by the constructor of this class.
  transient  ActionListener custDeleteHandler =
    new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        // This method is called when the "Delete Customer"
        //  button is clicked by the user
        System.out.println("BrokerViewImpl: custDeleteHandler");
        BrokerController bc;
        Customer cust;
        //** 1 Assign to cust a customer object that represents
        //**   the customer information on the gui. To get this 
        //**   object Use the getCustomerOnCustPan() method of gui.
        cust = gui.getCustomerOnCustPan();
        //** 2 Create a for loop: 
        //**   Hint: See actionPerformed method of the
        //**         custGetHandler object.
        //**   Invoke the handleDeleteCustomerGesture method on 
        //**   every object in the ArrayList brokerControllers.
        for (int i=0; i<brokerControllers.size(); i++) {
          bc = (BrokerController) brokerControllers.get(i);
          bc.handleDeleteCustomerGesture(cust);
        }
      }
    };

  // Following is an anonymous inner class declaration
  // The attribute custUpdateHandler is registered as the action
  // event listener with the "Update Customer" button of the 
  // gui, by the constructor of this class.
  transient  ActionListener custUpdateHandler =
    new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        System.out.println("BrokerViewImpl: custUpdateHandler");
        BrokerController bc;
        Customer cust;
        //** 1 Assign to cust a customer object that represents
        //**   the customer information on the gui. To get this 
        //**   object Use the getCustOnCustPan() method of gui.
        cust = gui.getCustomerOnCustPan();
        //** 2 Create a for loop: 
        //**   Hint: See actionPerformed method of the
        //**         custGetHandler object.
        //**   Invoke the handleUpdateCustomerGesture method on 
        //**   every object in the ArrayList brokerControllers.
        for (int i=0; i<brokerControllers.size(); i++) {
          bc = (BrokerController) brokerControllers.get(i);
          bc.handleUpdateCustomerGesture(cust);
        }
      }
    };

  // Following is an anonymous inner class declaration
  // The attribute custDetailsPageHandler is registered as the 
  // action event listener with the "Customer Details" button of  
  // the gui, by the constructor of this class.
  transient  ActionListener custDetailsPageHandler =
    new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        // This method is called when the "Customer Details" 
        // button is clicked by the user
        System.out.println("BrokerViewImpl: " +
          "custDetailsPageHandler");
        BrokerController bc;
        String custId;
        //** 1  Assign custId with the value of the customer id
        //** on the gui. Use getCustIdOnCustPan() method of gui.
        custId = gui.getCustIdOnCustPan();
        //** 2 Create a for loop: 
        //**   Hint: See actionPerformed method of the
        //**         custGetHandler object.
        //**   Invoke the handleGetCustomerGesture method on 
        //**   every object in the ArrayList brokerControllers.
        for (int i=0; i<brokerControllers.size(); i++) {
          bc = (BrokerController) brokerControllers.get(i);
          bc.handleGetCustomerGesture(custId);
        }
      }
    };

  // Following is an anonymous inner class declaration
  // The attribute allCustsPageHandler is registered as the action
  // event listener with the "All Customers" button of the 
  // gui, by the constructor of this class.
  transient ActionListener allCustsPageHandler =
    new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        // This method is called when the "All Customers" 
        // button is clicked by the user
        System.out.println("BrokerViewImpl: "
          + "allCustsPageHandler");
        //showCard("allcustomers");
        BrokerController bc;
        //** 1 Create a for loop: 
        //**   Hint: See actionPerformed method of the
        //**         custGetHandler object.
        //**   Invoke the handleGetAllCustomersGesture method on 
        //**   every object in the ArrayList brokerControllers.
        for (int i=0; i<brokerControllers.size(); i++) {
          bc = (BrokerController) brokerControllers.get(i);
          bc.handleGetAllCustomersGesture();
        }
      }
    };

  // No action required for this method
  // This method supports the showing of the portfolio page.
  // The portfolio page is a final iteration action item.
  transient ActionListener portfolioPageHandler =
    new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        System.out.println("BrokerViewImpl: portfolioPageHandler");
      }
    };

  // No action required for this method
  // This method supports the showing of the stock page.
  // The stock page is a final iteration action item.
  transient ActionListener stockPageHandler =
    new ActionListener() {
      public void actionPerformed(ActionEvent e) {
        System.out.println("BrokerViewImpl: stockPageHandler");
      }
    };

  transient ActionListener custPanelListeners[] = {custGetHandler,
    custAddHandler, custDeleteHandler, custUpdateHandler};

  transient ActionListener selectionPanelListeners[] = {
    custDetailsPageHandler, allCustsPageHandler, portfolioPageHandler,
    stockPageHandler};

  public static void main(String args[]){
    try {
      BrokerModel model = new trader.db.BrokerModelDbImpl("localhost");
      BrokerViewImpl view = new BrokerViewImpl(model);
    } catch (Exception e) {
      System.out.println(e.toString());
    }
  }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩一区和二区| 一级特黄大欧美久久久| 91精品国产黑色紧身裤美女| 欧美亚洲一区三区| 99精品国产99久久久久久白柏| 国产一区二区三区综合| 精品一区二区三区免费| 免费高清成人在线| 青青草精品视频| 日韩成人精品视频| 麻豆91精品91久久久的内涵| 蜜臀精品一区二区三区在线观看| 偷拍亚洲欧洲综合| 天堂蜜桃91精品| 日本在线观看不卡视频| 麻豆精品一二三| 久久99久久99精品免视看婷婷| 麻豆久久一区二区| 国产精品88888| 丰满白嫩尤物一区二区| 99精品视频在线观看| 91麻豆自制传媒国产之光| 在线观看国产91| 欧美日韩精品系列| 日韩欧美国产综合| 国产欧美一区二区精品仙草咪| 国产日产欧美一区二区三区| 中文字幕一区av| 一区二区欧美精品| 蜜臀久久久久久久| 国产精品99久久不卡二区| 99久久综合国产精品| 91成人国产精品| 亚洲精品高清视频在线观看| 亚洲成人777| 久久国产精品99久久久久久老狼 | 制服.丝袜.亚洲.中文.综合| 欧美一区二区三区影视| 久久久久久久久久美女| 自拍视频在线观看一区二区| 一卡二卡欧美日韩| 卡一卡二国产精品 | 欧美四级电影网| 欧美一区二区免费视频| 国产欧美日韩在线看| 一区二区在线看| 麻豆91免费看| 99国产精品99久久久久久| 欧美日韩二区三区| 久久精品视频免费| 亚洲永久精品大片| 久久国产三级精品| 91麻豆自制传媒国产之光| 欧美一区二区三区在线观看视频| 国产欧美一区二区精品性| 亚洲第一二三四区| 国产精品一区二区黑丝| 欧美午夜一区二区三区| 久久久久久久网| 亚洲午夜精品在线| 国产成人在线网站| 555www色欧美视频| 国产精品久久久久久久第一福利| 日韩精品1区2区3区| 91在线一区二区三区| 日韩精品一区二区三区在线| 亚洲精品国产一区二区精华液| 久久99精品久久久久久久久久久久| 99久久精品免费| 欧美va亚洲va国产综合| 亚洲制服丝袜av| 国产成人免费视频网站高清观看视频| 欧美婷婷六月丁香综合色| 男女激情视频一区| 91久久久免费一区二区| 国产欧美精品一区二区三区四区| 天堂影院一区二区| 91久久精品一区二区| 日本一区二区三区在线不卡| 日本一区中文字幕| 在线观看www91| 国产精品视频你懂的| 久久精品国产精品亚洲精品| 91福利在线免费观看| 亚洲国产高清不卡| 久久精品国产999大香线蕉| 欧美视频在线一区二区三区 | a亚洲天堂av| 国产日韩影视精品| 青青国产91久久久久久| 欧美视频精品在线| 亚洲精品久久嫩草网站秘色| 国产成人精品三级麻豆| 欧美精品一区二区三区蜜桃视频| 水蜜桃久久夜色精品一区的特点 | 高清在线成人网| 2023国产精品自拍| 看片的网站亚洲| 欧美一级日韩不卡播放免费| 亚洲gay无套男同| 在线观看日韩一区| 亚洲免费看黄网站| 97超碰欧美中文字幕| 中文字幕一区二区三区av| 成人做爰69片免费看网站| 久久久欧美精品sm网站| 美脚の诱脚舐め脚责91 | 欧美日韩免费电影| 亚洲午夜视频在线| 欧美日韩一级视频| 亚洲第一综合色| 欧美视频在线观看一区二区| 亚洲九九爱视频| 色婷婷久久综合| 亚洲美女屁股眼交3| 在线免费观看不卡av| 亚洲综合成人在线| 欧美日韩国产精选| 日韩av中文在线观看| 日韩午夜精品视频| 黄色日韩三级电影| 久久久www免费人成精品| 国产乱国产乱300精品| 国产农村妇女毛片精品久久麻豆 | 国产一区二区三区综合| 久久久久久电影| 成人激情文学综合网| 中文字幕一区二| 精品视频在线免费| 日本亚洲免费观看| 欧美精品一区二区三区久久久| 激情综合五月天| 欧美激情自拍偷拍| 色婷婷精品大在线视频| 亚洲成人av电影| 日韩欧美高清一区| 国产又黄又大久久| 亚洲视频狠狠干| 欧美嫩在线观看| 国内精品在线播放| 国产精品国产三级国产有无不卡| 91视频一区二区三区| 午夜精品爽啪视频| 久久久蜜桃精品| 91在线播放网址| 丝袜脚交一区二区| 国产亚洲一区二区三区| 色综合天天综合网国产成人综合天 | 韩日av一区二区| 成人欧美一区二区三区1314| 精品视频1区2区3区| 国内精品在线播放| 伊人婷婷欧美激情| 日韩欧美国产午夜精品| 粉嫩13p一区二区三区| 亚洲一区二区影院| 精品国产电影一区二区| 91色综合久久久久婷婷| 五月天亚洲精品| 中文在线资源观看网站视频免费不卡| 91国产精品成人| 国产一区三区三区| 一区二区三区成人在线视频| 欧美电视剧在线观看完整版| 99re视频精品| 久久爱另类一区二区小说| 亚洲欧洲制服丝袜| 精品国产一区二区三区久久影院 | 91免费观看在线| 麻豆91精品视频| 亚洲激情图片一区| 欧美精品一区二区三区高清aⅴ | 中文字幕一区二区三区av | 一个色综合网站| 久久综合色天天久久综合图片| 色婷婷激情一区二区三区| 国产一区二区三区免费观看| 亚洲午夜免费视频| 国产精品久久久久婷婷| 欧美一区二区国产| 91成人看片片| 成人网男人的天堂| 国内精品国产成人| 日韩成人伦理电影在线观看| 亚洲免费观看在线视频| 中文字幕欧美国产| 欧美成人三级电影在线| 欧美日韩电影在线播放| 色偷偷88欧美精品久久久| 国产成人精品免费在线| 久久精品国产亚洲5555| 首页国产欧美日韩丝袜| 一区二区三区四区在线免费观看| 国产亚洲欧美日韩俺去了| 欧美一级xxx| 欧美日韩国产免费一区二区| 91免费小视频| k8久久久一区二区三区| 国产成人av电影在线观看| 久久精品国产一区二区三 |