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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? brokerviewimpl.java

?? java寫的股票交易系統(tǒng)
?? JAVA
?? 第 1 頁 / 共 2 頁
字號:
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);
    
    //modified by  ourteam 051228
    //begin
    //gui.addPortPanelListeners(portPanelListeners);
    gui.addPortPanelListeners(portPanelListeners);
    //end
    
    //modified by ourteam 051228
    //begin
    gui.addStockPanelListeners(stockPanelListeners);
    //end
    
  }
      
//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");
    }
    //modified  by  ourteam 051228
    //begin
    if (display instanceof Portfolio) {
      //TBD
      gui.refreshPortPan((Portfolio) display);
      gui.showCard("portfolio");
    }
    //end
    //modified by ourteam 051228
    //begin
    if (display instanceof Stock[]) {
      //TBD
      
      gui.refreshAllStockPan((Stock[])display);
      gui.showCard("allstocks");
   }
    if (display instanceof Stock) {
    //if (true) {
      //TBD
      
      gui.refreshStockPan((Stock)display);
      gui.showCard("stock");
    }
    //end
    
    //** 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;
        custId = gui.getCustIdOnCustPan();
        //modified by ourteam 051228
        //begin
        String custName;
        custName = gui.getCustNameOnCustPan();
        //end
        
        //modified by ourteam 051228
        //begin
        String custAddr;
        custAddr = gui.getCustAddrOnCustPan();
        //end
        //  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);
        //modified by ourteam 051228
        //begin
        //  bc.handleGetCustomerGesture(custId);
          bc.handleGetCustomerGesture(custId,custName,custAddr);
          
        }
      }
    };

  // 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);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
www日韩大片| 久久久精品tv| 国产精品中文字幕日韩精品| 国产欧美精品一区二区色综合| 99精品一区二区三区| 亚洲成av人片在线| 国产欧美一区二区精品仙草咪| 99久久精品久久久久久清纯| 亚洲欧洲日韩av| 91麻豆精品国产| 国产尤物一区二区| 亚洲综合色丁香婷婷六月图片| 日韩三级免费观看| 99精品热视频| 精品亚洲国内自在自线福利| 成人免费小视频| 精品精品国产高清a毛片牛牛| 99久久精品国产导航| 久久99久久久久| 亚洲免费观看在线观看| 欧美本精品男人aⅴ天堂| 久久不见久久见免费视频7| 中文久久乱码一区二区| 精品视频999| 91在线观看成人| 午夜精品久久久久久久99水蜜桃 | 岛国av在线一区| 日本aⅴ免费视频一区二区三区| 自拍视频在线观看一区二区| 精品剧情v国产在线观看在线| 91久久精品日日躁夜夜躁欧美| 国产suv一区二区三区88区| 亚洲综合偷拍欧美一区色| 久久九九国产精品| 日韩精品在线一区| 欧美丰满少妇xxxxx高潮对白| 91免费国产在线观看| 国产一区二区三区久久久| 日韩二区在线观看| 亚洲国产sm捆绑调教视频| 国产精品久久一卡二卡| 精品国产一区二区精华| 欧美天堂一区二区三区| av激情综合网| 成人中文字幕电影| 精品一二三四在线| 麻豆成人久久精品二区三区红| 亚洲成人av中文| 一区二区日韩电影| 中文字幕色av一区二区三区| 国产精品久久一级| 中文字幕中文字幕一区| 亚洲国产高清aⅴ视频| 久久久久久久综合色一本| 精品不卡在线视频| 久久婷婷国产综合精品青草| 日韩美女视频一区二区在线观看| 日韩三级视频在线观看| 精品国产免费一区二区三区香蕉| 欧美zozozo| 久久天天做天天爱综合色| 久久精品视频免费| 中文久久乱码一区二区| 亚洲欧美国产77777| 一区二区三区中文字幕| 亚洲电影你懂得| 日韩精品一卡二卡三卡四卡无卡| 日本成人中文字幕在线视频| 日韩综合小视频| 久久精品国产免费| 国产在线播精品第三| 国产成人自拍在线| av电影在线观看一区| 色猫猫国产区一区二在线视频| 欧美三级日韩三级| 日韩欧美综合在线| 国产亚洲综合在线| 亚洲精品五月天| 日本一不卡视频| 国产成人在线视频免费播放| 99久久综合狠狠综合久久| 在线一区二区三区四区| 91精品国产综合久久久久久久| 欧美大片一区二区| 国产精品另类一区| 亚洲一级电影视频| 精品无人码麻豆乱码1区2区 | 欧美一三区三区四区免费在线看 | 亚洲欧洲av在线| 午夜视频一区在线观看| 久草在线在线精品观看| 成人sese在线| 欧美网站一区二区| 精品国产免费视频| 亚洲男人天堂av网| 狂野欧美性猛交blacked| 精品一区二区免费| 91理论电影在线观看| 制服丝袜国产精品| 国产精品国模大尺度视频| 亚洲国产成人精品视频| 国产精品资源网站| 欧美日韩夫妻久久| 国产午夜精品一区二区| 亚洲丶国产丶欧美一区二区三区| 精品一区二区免费看| 日本道精品一区二区三区| 精品日韩欧美在线| 中文字幕一区二区三区不卡 | 天堂在线亚洲视频| 久久66热re国产| 91污在线观看| 91精品国产综合久久婷婷香蕉| 久久久一区二区三区捆绑**| 亚洲一区二区三区在线播放| 国产一区欧美一区| 欧美日韩一区二区三区免费看 | 美腿丝袜一区二区三区| gogo大胆日本视频一区| 欧美一级久久久| 亚洲综合图片区| 国产在线播放一区三区四| 成人午夜av电影| 精品国免费一区二区三区| 亚洲综合激情网| 国精产品一区一区三区mba桃花 | 免费人成在线不卡| 色婷婷精品久久二区二区蜜臂av | 亚洲最大成人综合| 9i在线看片成人免费| 精品成人在线观看| 日韩不卡手机在线v区| 一本到高清视频免费精品| 国产无遮挡一区二区三区毛片日本| 午夜久久久久久久久| 成人少妇影院yyyy| 日韩欧美国产小视频| 中文字幕一区二区三区在线观看| 激情另类小说区图片区视频区| 欧美精品自拍偷拍动漫精品| 亚洲视频在线观看三级| 国产成人av一区二区三区在线 | 亚洲图片有声小说| 97se亚洲国产综合自在线| 精品第一国产综合精品aⅴ| 日本欧美加勒比视频| 欧美精品vⅰdeose4hd| 天天射综合影视| 欧美肥妇毛茸茸| 亚洲成精国产精品女| 欧美艳星brazzers| 亚洲国产精品久久艾草纯爱| 在线视频国内自拍亚洲视频| 一区二区三区免费看视频| 色偷偷一区二区三区| 亚洲免费av高清| 在线观看不卡一区| 亚洲专区一二三| 在线亚洲高清视频| 亚洲成人av福利| 91精品国产色综合久久| 男女男精品视频网| 久久青草欧美一区二区三区| 国产在线精品一区二区夜色| 久久综合一区二区| 成人一区在线观看| 亚洲三级电影全部在线观看高清| 色婷婷久久久综合中文字幕| 亚洲一区二区在线观看视频| 在线视频国内自拍亚洲视频| 亚洲国产一区在线观看| 欧美一区二区播放| 国产精品69毛片高清亚洲| 国产精品国产三级国产普通话99 | 麻豆精品久久精品色综合| 精品国产污污免费网站入口| 国产成人精品www牛牛影视| 亚洲欧美一区二区在线观看| 一本到不卡免费一区二区| 婷婷丁香激情综合| 久久女同精品一区二区| av在线播放一区二区三区| 亚洲国产一区二区视频| 日韩精品最新网址| 成人美女在线观看| 18欧美乱大交hd1984| 欧美中文字幕亚洲一区二区va在线| 欧美日韩一区二区欧美激情| 亚洲精品欧美二区三区中文字幕| 欧美一区二区三区不卡| 懂色av一区二区夜夜嗨| 婷婷综合久久一区二区三区| 日本一区二区高清| 日韩亚洲欧美成人一区| 一本色道久久综合亚洲aⅴ蜜桃| 日韩在线一区二区三区| 国产精品国产三级国产普通话99| 日韩欧美在线观看一区二区三区| 91丨九色丨蝌蚪富婆spa| 国产毛片精品国产一区二区三区|