Package net.helipilot50.stocktrade.model

Examples of net.helipilot50.stocktrade.model.Order


        case Constants.RA_TOP:
        case Constants.RA_BOTTOM:
            this.rowAlignment = pAlignment;
            break;
        default:
            UsageException errorVar = new UsageException("Row alignment passed invalid value of " + pAlignment);
            ErrorMgr.addError(errorVar);
            throw errorVar;
        }
    }
View Full Code Here


                if (gbc.row == -1 || gbc.column == -1) {
                    gbc.row = 0;
                    gbc.column = 0;
                }
                else if (gbc.row < 0 || gbc.column < 0) {
                    UsageException errorVar = new UsageException("gridx and gridy should be >= 0, not row = " + gbc.row + ", column = " + gbc.column);
                    ErrorMgr.addError(errorVar);
                    throw errorVar;
                }
                else if (gbc.row >= rows || gbc.column >= columns) {
                  // TF:28/04/2008:if ignoreCollapse is true, we're doing the initial insert. In this case we don't
                  // have the rows and columns necessarily set, so we need to add the components in by expanding the grid
                  if (ignoreCollapse) {
                    // TF:09/05/2008:JIRA JCT-545:Since this is the initial insert, we must obey the
                    // constraints as posted. This means that we'll get the correct row and column
                    // even if a row or column appears empty when this element is inserted (because
                    // another element might be inserted later to make the empty row/column populated)
//                    if (isCollapsed()) {
//                      if (gbc.row >= rows) {
//                        gbc.row = rows;
//                      }
//                      if (gbc.column >= columns) {
//                        gbc.column = columns;
//                      }
//                    }
                    for (int i = rows; i <= gbc.row; i++) {
                      rowWeights.add(i, new Integer(0));
                    }
                    for (int i = columns; i <= gbc.column; i++) {
                      columnWeights.add(i, new Integer(0));
                    }
                    rows = Math.max(rows, gbc.row + 1);
                    columns = Math.max(columns, gbc.column + 1);
                  }
                  else {
                      // Using the replace policy, we never insert a column outside the grid
                    // TF:10/08/2008:JCT-582:If the grid field is empty, we allow the replace
                    if (parent.getComponentCount() == 0) {
                      fallThroughToExpand = true;
                    }
                    else {
                      return false;
                    }
                  }
                }
                if (!fallThroughToExpand) {
                  JComponent comp = parent.getChildInCell(gbc.row + 1, gbc.column + 1);
                  if (comp != null) {
                      parent.remove(comp);
                  }
                  break;
                }
               
        case Constants.IP_EXPAND:
            // If the row or column is -1, we shuffle everything up and across
            if (gbc.row == -1 || gbc.column == -1) {
                gbc.row = 0;
                gbc.column = 0;
                for (Component thisChild : parent.getComponents()) {
                    if (thisChild != newOne) {
                        GridCell effective = findConstraints(thisChild);
                        effective.row++;
                        effective.column++;
                    }
                }
                rows++;
                columns++;
                rowWeights.add(0, new Integer(0));
                columnWeights.add(0, new Integer(0));
            }
            else if (gbc.column < 0 || gbc.row < 0) {
                UsageException errorVar = new UsageException("gridx and gridy should be >= 0, not gridx = " + gbc.column + ", gridy = " + gbc.row);
                ErrorMgr.addError(errorVar);
                throw errorVar;
            }
            else if (gbc.column >= columns || gbc.row >= rows) {
                // If we need to collapse the columns, update the value passed so that it's the
View Full Code Here

    // ------------
    public OrderWindow() {
        // Explicitly call the superclass constructor to prevent the implicit call
        super();
        this.initialize();
        this.setNewOrderGrid(new Order());

        //self.CustomerName = new;
        //self.StockNamelist = new;

    }
View Full Code Here

    public Array_Of_ListElement<ListElement> getStockNameList() {
        return this.stockNameList;
    }

    public void setNewOrderGrid(Order newOrderGrid) {
        Order oldValue = this.newOrderGrid;
        this.newOrderGrid = newOrderGrid;
        this.firePropertyChange("newOrderGrid", oldValue, this.newOrderGrid);
    }
View Full Code Here

    });
  }
 
  private void makeTrade(){
    TradeServiceAsync tradeSO = Registry.get("TradeService");
    Order buyOrder = null;
    Order sellOrder = null;
    boolean foundSell = false;
    boolean foundBuy = false;
    int quantity = 0;
    double price = 0.0f;
   
View Full Code Here

    TradeServiceAsync tradeSO = Registry.get(CitrusleafStockTrade.TRADE_SERVICE);
    tradeSO.nextOrderID(new AsyncCallback<Integer>() {
     
      @Override
      public void onSuccess(Integer result) {
        Order order = new Order();
        order.setOrderID(result);
        order.setQuantity(0);
        order.setPrice(0);
        order.setCustomerName(customerName);
        order.setType(orderType);
        setHeading(order.getType() + " Order: " + order.getOrderID());
        if (holding != null){
          order.setStockName(holding.getStockName());
        }
       
        OrderWindow.this.setOrder(order);
       
      }
View Full Code Here

                // ----------------------
                else if (qq_currentEvent.isEvent(TradeMgr_OrderProcessed_getInstance)) {
                    try {
                        CursorMgr.startEvent();
                        // ================ Begin Forte Event Handler Translation ================
                        Order theProcessedOrder = qq_currentEvent.getParam("pOrder");
                        if (this.getOrderList() != null) {
                            for (Order row : this.getOrderList()) {
                                if (row.getOrderID() == theProcessedOrder.getOrderID()) {
                                    // TODO [1037,Major]: If you are deleting a row inside a loop, use the Iterator in place of the array
                                    this.getOrderList().remove(row);
                                }
                            }
                        }

                        // ================ End Forte Event Handler Translation ================
                    }
                    finally {
                        CursorMgr.endEvent();
                    }
                }

                // ---------------------
                // TradeSO.NewOrderAdded
                // ---------------------
                else if (qq_currentEvent.isEvent(TradeMgr_NewOrderAdded_getInstance)) {
                    try {
                        CursorMgr.startEvent();
                        // ================ Begin Forte Event Handler Translation ================
                        Order theNewOrder = qq_currentEvent.getParam("pNewOrder");
                        this.getOrderList().add(theNewOrder);

                        // ================ End Forte Event Handler Translation ================
                    }
                    finally {
                        CursorMgr.endEvent();
                    }
                }

                // ----------------------------
                // <ViewHoldingsBtn>.ObjectDrop
                // ----------------------------
                else if (qq_currentEvent.isEvent(PushButton_ObjectDrop_getqq_ViewHoldingsBtn)) {
                    try {
                        CursorMgr.startEvent();
                        // ================ Begin Forte Event Handler Translation ================
                        JComponent theDroppedWidget = qq_currentEvent.getParam("sourceField");
                        int rownum = 0;
                        rownum = TableRow.get(this.getqq_OrderList());
                        CustomerWindow customerWin = new CustomerWindow();
                        customerWin.setUsage(Constants.WU_VIEW);
                        customerWin.display(this.getOrderList().get(rownum-1).getCustomerName());

                        // ================ End Forte Event Handler Translation ================
                    }
                    finally {
                        CursorMgr.endEvent();
                    }
                }

                // -----------------------
                // <ViewHoldingsBtn>.Click
                // -----------------------
                else if (qq_currentEvent.isEvent(PushButton_Click_getqq_ViewHoldingsBtn)) {
                    try {
                        CursorMgr.startEvent();
                        // ================ Begin Forte Event Handler Translation ================
                        //self.Window.MessageDialog(MessageText='View Holdings not yet implemented',
                        //              MessageType=MT_INFO);

                        CustomerWindow customerWin = new CustomerWindow();
                        customerWin.display(this.getTraderName());


                        // ================ End Forte Event Handler Translation ================
                    }
                    finally {
                        CursorMgr.endEvent();
                    }
                }

                // --------------------
                // <MakeTradeBtn>.Click
                // --------------------
                else if (qq_currentEvent.isEvent(PushButton_Click_getqq_MakeTradeBtn)) {
                    try {
                        CursorMgr.startEvent();
                        // ================ Begin Forte Event Handler Translation ================
                        //self.Window.MessageDialog(MessageText='Make Trade not yet implemented',
                        //              MessageType=MT_INFO);
                        try {
                            Order buyOrder = null, sellOrder = null;
                            int tradeQuantity = 0;
                            float tradePrice = 0;

                            // ------------------------------------
                            // Parameters for call to ValidateMatch
View Full Code Here

    Map<String, ClResultCode> rv = DBClient.getInstance().scanAllNodes(DBClient.NAME_SPACE, "Order", new ScanCallback() {
     
      public void scanCallback(String namespace, String set, byte[] digest,
          Map<String, Object> bins, int generation, int expirationDate,
          Object userData) {
        Order order = new Order();
        order.set("orderID", bins.get("OrderID"));
        order.set("stockName", bins.get("StockName"));
        order.set("customerName", bins.get("CustomerName"));
        order.setPrice(((Double)bins.get("Price")).floatValue());
        order.setQuantity(((Double) bins.get("Quantity")).intValue());
        order.set("type", bins.get("type"));
        orders.add(order);
      }
    }, null);
   
   
View Full Code Here

    DBClient.setHostString(hostString);
   
  }
 
  void createDummyTrades(){
    Order order = new Order();
    order.setOrderID(1);
    order.setCustomerName("Bill");
    order.setPrice(200);
    order.setStockName("ORCL");
    order.setType("Buy");
    order.setQuantity(4500);
    order.setPrice(25);
    takeOrder(order);
    order = new Order();
    order.setOrderID(12);
    order.setCustomerName("Pat");
    order.setPrice(200);
    order.setStockName("ORCL");
    order.setType("Sell");
    order.setQuantity(4500);
    order.setPrice(25);
    takeOrder(order);
  }
View Full Code Here

                    // ----------------------
                    else if (qq_currentEvent.isEvent(TradeMgr_OrderProcessed_getInstance)) {
                        try {
                            CursorMgr.startEvent();
                            // ================ Begin Forte Event Handler Translation ================
                            Order orderOK = qq_currentEvent.getParam("pOrder");
                            if ((this.getCustomerGrid().getCustomerName().isEqual(orderOK.getCustomerName())).getValue()) {
                                this.setCustomerGrid(CustomerSO_proxy.getInstance().getCustomer(orderOK.getCustomerName()));
                            }
   
                            // ================ End Forte Event Handler Translation ================
                        }
                        finally {
View Full Code Here

TOP

Related Classes of net.helipilot50.stocktrade.model.Order

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.