Examples of TextData


Examples of net.helipilot50.stocktrade.framework.TextData

     * dumpStats<p>
     * <p>
     */
    public void dumpStats() {
        String title1 = null;
        TextData title2 = null;
        TextNullable title3 = null;
        int numCustomers = 0;
        IntegerData numStocks = null;
        double totalValue = 0;

        DBConnectionManager dBConnection = DBConnectionManager.getInstance("DBConnection");

        // -- =============== Original SQL ===============
        // select 
        //     'Customers',
        //     count(distinct CustomerName),
        //     'Stocks',
        //     count(distinct StockName),
        //     'Total value',
        //     sum(Price*Quantity)
        // into
        //     :title1,
        //     :numCustomers,
        //     :title2,
        //     :numStocks,
        //     :title3,
        //     :totalValue
        // from Holding
        // on session DBConnection
        // -- ============================================
        String qq_SQL = "select " +
                        "'Customers', " +
                        "count(distinct CustomerName), " +
                        "'Stocks', " +
                        "count(distinct StockName), " +
                        "'Total value', " +
                        "sum(Price*Quantity) " +
                        "from Holding ";
        final ParameterHolder qqh_title1 = new ParameterHolder(title1);
        final ParameterHolder qqh_numCustomers = new ParameterHolder(numCustomers);
        final ParameterHolder qqh_title2 = new ParameterHolder(title2);
        final ParameterHolder qqh_numStocks = new ParameterHolder(numStocks);
        final ParameterHolder qqh_title3 = new ParameterHolder(title3);
        final ParameterHolder qqh_totalValue = new ParameterHolder(totalValue);
        RowCountCallbackHandler qq_RowCounter = new RowCountCallbackHandler() {
            protected void processRow(ResultSet pResultSet, int pRow) throws SQLException {
                if (pRow >= 1) {
                    throw new IncorrectResultSizeDataAccessException(1, pRow+1);
                }
                ResultSetHelper helper = new ResultSetHelper(pResultSet);
                qqh_title1.setObject(helper.getString(1));
                qqh_numCustomers.setInt(helper.getInt(2));
                qqh_title2.setObject(helper.getTextData(3));
                qqh_numStocks.setObject(helper.getIntegerData(4));
                qqh_title3.setObject(helper.getTextNullable(5));
                qqh_totalValue.setDouble(helper.getDouble(6));
            }
        };
        dBConnection.getTemplate().query(qq_SQL, qq_RowCounter);
        title1 = (String)qqh_title1.getObject();
        numCustomers = qqh_numCustomers.getInt();
        title2 = (TextData)qqh_title2.getObject();
        numStocks = (IntegerData)qqh_numStocks.getObject();
        title3 = (TextNullable)qqh_title3.getObject();
        totalValue = qqh_totalValue.getDouble();

        TextData aMsg = new TextData();
        aMsg.concat(title1).concat(":").concat(numCustomers).concat(", ").concat(title2).concat(":").concat(numStocks).concat(", ").concat(title3).concat(totalValue);

        Log.standardLog().info(aMsg);
    }
View Full Code Here

Examples of net.helipilot50.stocktrade.framework.TextData

        return aCustomer;
    }
   
  public Customer getCustomer(String pGetCustCustomerName) {
    return getCustomer(new TextData(pGetCustCustomerName));
  }
View Full Code Here

Examples of net.helipilot50.stocktrade.framework.TextData

            qq_cmd = dBConnection.getPreparedStatement(qq_SQL);
            qq_rs = qq_cmd.executeQuery();
            ResultSetHelper qq_rsHelper = new ResultSetHelper(qq_rs);
            System.out.println("Stocks:");
            while (qq_rsHelper.next()) {
                TextData temp = qq_rsHelper.getTextData(1);
                ListElement row = new ListElement();
                row.getTextValue().setValue( temp.getValue() );
                this.stockNameList.add(row);
                this.stockNames.add(temp.getValue());
                System.out.println("\t" + temp.getValue());
            }
        }
        catch (SQLException qq_error) {
            throw new SQLErrorCodeSQLExceptionTranslator(dBConnection.getDataSource()).translate("Running SQL", qq_SQL, qq_error);
        }
View Full Code Here

Examples of net.helipilot50.stocktrade.framework.TextData

            throw errorVar;
        }
    }

    protected String dataValueToString(DataValue value) {
        TextData buffer = new TextData();
        value.fillString(buffer);
        return buffer.toString();
    }
View Full Code Here

Examples of net.helipilot50.stocktrade.framework.TextData

      clearCache(e);
    }
  };

  private void clearCache(JFrame frame) {
    TextData statusTextDataObject = (TextData)UIutils.getForm(frame).getClientProperty(cSTATUS_WIDGET);
      if (statusTextDataObject != null) {
      statusTextDataObject.removePropertyChangeListener("value", oldValueChangeListener);
      oldValueCache.remove(statusTextDataObject);
    }
  }
View Full Code Here

Examples of net.helipilot50.stocktrade.framework.TextData

    private StatusTextListener(){
    }

    public void mouseEntered(MouseEvent e) {
        TextData statusTextValue = (TextData)((JComponent)e.getSource()).getClientProperty(StatusText.cSTATUS_TEXT);
        // TF:01/03/2010:DET-130:Check to see if the value is null
      setStatusTextForComponent((JComponent)e.getSource(), statusTextValue);
    }
View Full Code Here

Examples of net.helipilot50.stocktrade.framework.TextData

     * @param component the component inside of the window.
     * @param statusTextValue the status text value.
     */
  public void setStatusTextForComponent(JComponent component, TextData statusTextValue) {
    JFrame topLevelAncestor = (JFrame)component.getTopLevelAncestor();
        TextData mappedProperty = (TextData)UIutils.getForm(topLevelAncestor).getClientProperty(cSTATUS_WIDGET);
       
    if (mappedProperty != null){
      if (!oldValueCache.containsKey(mappedProperty)) {
        oldValueCache.put(mappedProperty, mappedProperty.toString());
         
        mappedProperty.addPropertyChangeListener("value", oldValueChangeListener);
        // TF:01/03/2010:Ensure we're only in the cache once, even if the status text field is changed
        topLevelAncestor.removeWindowListener(windowClosingListener);
        topLevelAncestor.addWindowListener(windowClosingListener);
      }
      // TF:01/03/2010:Always update the old value in the cache, as the mouse exit handler will expect a valid value
      oldValueCache.put(mappedProperty, mappedProperty.toString());
      if (statusTextValue != null) {
        setStatusText(mappedProperty, statusTextValue.toString());
      }
        }
  }
View Full Code Here

Examples of net.helipilot50.stocktrade.framework.TextData

    /**
     * Revert status text value to previous one.
     * @param component the component in window with status line.
     */
  public void resetStatusTextForComponent(JComponent component) {
        TextData mappedProperty = (TextData)UIutils.getForm((JFrame)component.getTopLevelAncestor()).getClientProperty(cSTATUS_WIDGET);
        if (mappedProperty != null){
          String oldText = oldValueCache.get(mappedProperty);
          setStatusText(mappedProperty, oldText);
        }
  }
View Full Code Here

Examples of net.helipilot50.stocktrade.framework.TextData

        return "";
    }

    protected String dataValueToString(DataValue value) {
        TextData buffer = new TextData();
        value.fillString(buffer);
        return buffer.toString();
    }
View Full Code Here

Examples of net.helipilot50.stocktrade.framework.TextData

  }

  public TextData getName() {
    if (this.data != null) {
      try {
        return new TextData(this.data.getColumnName(this.column));
      }
      catch (Exception e) {
      }
    }
        return new TextData(this.name);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.