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

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

?? brokerviewimpl.java

?? java寫的股票交易系統
?? 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);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲午夜免费视频| 欧美亚一区二区| 婷婷中文字幕综合| 亚洲美女一区二区三区| 国产精品成人免费精品自在线观看| 精品成人一区二区三区四区| 欧美tickling网站挠脚心| 欧美男男青年gay1069videost| 在线一区二区三区| 欧美中文一区二区三区| 欧美亚洲高清一区二区三区不卡| 99在线热播精品免费| caoporn国产一区二区| 99久久婷婷国产综合精品| 成人免费不卡视频| 91亚洲大成网污www| 色香色香欲天天天影视综合网| 91片黄在线观看| 色哟哟国产精品免费观看| 欧美亚洲动漫另类| 日韩欧美国产一区二区在线播放| 精品国产制服丝袜高跟| 国产欧美日韩在线| 成人欧美一区二区三区黑人麻豆| 亚洲精品国产一区二区三区四区在线| 亚洲综合另类小说| 免费观看日韩av| 国产成人夜色高潮福利影视| k8久久久一区二区三区| 欧美日韩一区国产| 久久久影院官网| 亚洲欧美激情插 | 精品国产成人系列| 久久色在线观看| 亚洲女同ⅹxx女同tv| 视频一区视频二区中文字幕| 韩日欧美一区二区三区| 91视频com| 精品国产一区二区三区av性色| 国产精品国产三级国产三级人妇 | 成人黄动漫网站免费app| 欧美一a一片一级一片| 欧美成人女星排名| 亚洲欧洲精品天堂一级| 免费看欧美女人艹b| 91丝袜美腿高跟国产极品老师| 91精品欧美综合在线观看最新| 国产日韩精品视频一区| 日本在线不卡一区| 91麻豆精东视频| 精品日韩99亚洲| 亚洲一区二区在线免费观看视频| 国产乱子伦视频一区二区三区| 欧美色图一区二区三区| 亚洲国产成人在线| 蜜桃av噜噜一区| 欧美调教femdomvk| 日韩伦理av电影| 国产乱码精品一区二区三区忘忧草 | 欧美日韩一区视频| 国产精品欧美综合在线| 麻豆久久久久久久| 欧美日韩视频一区二区| 最近中文字幕一区二区三区| 国产精品自拍网站| 精品日韩在线观看| 欧美aⅴ一区二区三区视频| 色综合中文字幕国产| 精品久久久久久亚洲综合网 | 国产精品综合网| 精品久久人人做人人爱| 奇米色777欧美一区二区| 欧美日韩精品一区二区天天拍小说| 国产精品理伦片| 国产成人在线视频网址| 久久久三级国产网站| 国产激情一区二区三区桃花岛亚洲| 7777精品伊人久久久大香线蕉完整版 | 色综合天天狠狠| 一区在线播放视频| 成人av网站大全| 国产精品福利影院| 丁香六月综合激情| 中文字幕在线一区二区三区| 成人免费精品视频| 一区二区三区免费| 欧美日韩精品是欧美日韩精品| 亚洲综合一二三区| 欧亚一区二区三区| 香蕉久久一区二区不卡无毒影院| 欧美婷婷六月丁香综合色| 天堂av在线一区| 欧美变态tickling挠脚心| 国产成人av一区二区| 国产精品久久久一本精品| 91丝袜美腿高跟国产极品老师| 亚洲国产欧美日韩另类综合| 在线播放中文字幕一区| 久久成人免费日本黄色| 国产精品久久久久久久久免费樱桃| aaa欧美日韩| 日日摸夜夜添夜夜添亚洲女人| 欧美一区二区大片| 国产成人在线观看免费网站| 中文字幕一区二区不卡| 欧美日韩精品一区视频| 国产精一区二区三区| 亚洲免费观看在线观看| 91精品国产综合久久香蕉麻豆| 国产精品一区二区91| 亚洲视频小说图片| 精品国产一区二区精华| 97久久精品人人做人人爽50路| 亚洲一二三区在线观看| 久久人人97超碰com| 一本一道综合狠狠老| 琪琪久久久久日韩精品| 亚洲色图在线视频| 精品国产区一区| 色婷婷综合视频在线观看| 欧美96一区二区免费视频| 国产精品久久久久久久久晋中| 欧美日韩五月天| 成人国产电影网| 人人精品人人爱| 国产精品第五页| 久久夜色精品一区| 欧美综合色免费| 国产成人一级电影| 美日韩一区二区| 亚洲成人资源网| 久久精品一级爱片| 91精品国产日韩91久久久久久| 99久久国产综合精品女不卡| 国产一区二区精品久久| 免费成人在线网站| 一区二区三区不卡在线观看| 久久久精品国产免费观看同学| 欧美一级艳片视频免费观看| 91视频国产资源| 99re热这里只有精品免费视频| 国产一区二区伦理片| 日本成人在线看| 亚洲高清视频在线| 亚洲欧美另类久久久精品| 国产精品无码永久免费888| 久久综合999| 久久色在线观看| 精品久久久久久无| 日韩免费一区二区| 91精品在线免费观看| 欧美一区二区三区小说| 欧美三级电影网| 欧美三级蜜桃2在线观看| 91麻豆精东视频| 欧美少妇性性性| 欧美区视频在线观看| 欧美久久一二三四区| 欧美精品 国产精品| 欧美日韩国产综合一区二区| 欧美日韩国产高清一区二区三区| 欧美在线|欧美| 欧美性videosxxxxx| 在线观看日韩av先锋影音电影院| 色综合久久久久网| 色噜噜狠狠成人网p站| 日本韩国一区二区三区视频| 在线看不卡av| 3d成人动漫网站| 精品捆绑美女sm三区| 久久久久久久久久久久久女国产乱| 久久久久9999亚洲精品| 亚洲国产精品激情在线观看| 亚洲图片欧美激情| 亚洲v中文字幕| 久久精品免费观看| 福利一区福利二区| 一本大道久久a久久精二百| 欧美色老头old∨ideo| 日韩欧美国产精品一区| 国产三级一区二区三区| 亚洲男同性恋视频| 视频在线观看91| 高清不卡在线观看av| 在线视频欧美精品| 精品久久99ma| 亚洲人精品午夜| 麻豆成人久久精品二区三区小说| 国产成人亚洲综合色影视| 欧美在线free| 国产校园另类小说区| 亚洲综合在线电影| 精品一区二区久久| 日本福利一区二区| 久久亚洲影视婷婷| 亚洲图片有声小说| 成人av在线看| 91精品国产麻豆国产自产在线| 日本一区二区三区久久久久久久久不| 夜夜精品浪潮av一区二区三区|