Package net.helipilot50.stocktrade.framework

Examples of net.helipilot50.stocktrade.framework.IntegerData


        if (Integer.class.equals(elementClass)) {
            return new Integer(element.getIntegerValue());
        }
        else if (IntegerData.class.isAssignableFrom(elementClass)) {
            try {
                IntegerData newValue = (IntegerData)elementClass.newInstance();
                newValue.setValue(element.getIntegerValue());
                return newValue;
            }
            catch (Exception e) {
                // Shouldn't get here, let's keep the compiler happy
                return new IntegerData(element.getIntegerValue());
            }
        }
        else if (TextData.class.isAssignableFrom(elementClass)) {
            try {
                TextData newValue = (TextData)elementClass.newInstance();
                newValue.setValue(element.getTextValue());
                return newValue;
            }
            catch (Exception e) {
                // Shouldn't get here, let's keep the compiler happy
                return element == null ? null : element.getTextValue();
View Full Code Here


          return null;
        }
    }

    public int getIntegerValue() {
        final IntegerData target = new IntegerData();
        UIutils.invokeOnGuiThread(
            new Runnable () {
                public void run() {
                    if (cb.getSelectedIndex() == -1) {
                      // TF:07/10/2008:Tests show that Forte didn't return 0, but rather Integer.MIN_VALUE
                        target.setValue(Integer.MIN_VALUE);
                    }
                    else {
                        target.setValue(((ListElement)cb.getSelectedItem()).getIntegerValue());
                    }
                }
            });
        return target.getValue();
    }
View Full Code Here

        }
        else if (Number.class.isAssignableFrom(subjectType)) {
            subject.setValue(newValue);
        }
        else if (IntegerData.class.equals(subjectType))
            subject.setValue(new IntegerData(i));

        else if (IntegerNullable.class.equals(subjectType))
            subject.setValue(new IntegerNullable(i));

        else if (NumericData.class.isAssignableFrom(subjectType)) {
            try {
                IntegerData anIntData = (IntegerData)subjectType.newInstance();
                anIntData.setValue(i);
            }
            catch (Exception e) {
                // No default constructor
                _log.debug("Could not instantiate class " + subjectType.getName(), e);
            }
View Full Code Here

            if (Integer.class.equals(subjectType) || Integer.TYPE.equals(subjectType)) {
                subject.setValue(new Integer(element.getIntegerValue()));
            }
            else if (IntegerData.class.equals(subjectType)) {
                subject.setValue(new IntegerData(element.getIntegerValue()));
            }
            else if (IntegerNullable.class.equals(subjectType)) {
                subject.setValue(new IntegerNullable(element.getIntegerValue()));
            }
            else if (IntegerData.class.isAssignableFrom(subjectType)) {
                try {
                    IntegerData anIntData = (IntegerData)subjectType.newInstance();
                    anIntData.setValue(element.getIntegerValue());
                    subject.setValue(anIntData);
                }
                catch (Exception e) {
                    // No default constructor
                    _log.debug("Could not instantiate class " + subjectType.getName(), e);
View Full Code Here

                        float outputPrice = (Float)qq_currentEvent.getParam("pMTPrice");
                        String returnSecName = qq_currentEvent.getParam("return");
                        TextData tempMsg = new TextData();
                        TextData objSecName = new TextData(returnSecName);
                        DecimalData objPrice = new DecimalData(outputPrice);
                        IntegerData objQuantity = new IntegerData(outputQuantity);
                        tempMsg.replaceParameters("Trade for %1 at price $%2 for %3 shares completed successfully", objSecName, objPrice, objQuantity);
                        WindowManager.messageDialog(this, tempMsg, Constants.MT_INFO, 50);

                        //   when TradeSO.MakeTrade_exception do
                        //       self.Window.MessageDialog(
View Full Code Here

    public void setIntegerValue(int value) {
        if (scrollList != null) {
            int limit = this.list.getSize();
            for (int i = 0; i < limit; i++) {
                ListElement el = (ListElement)this.list.getElementAt(i);
                if (el.getIntegerValue() == value) {
                    this.list.setSelection(el);
                    return;
                }
            }
        }
View Full Code Here

    public void setObjectValue(Object value) {
        if (scrollList != null) {
            if (scrollList != null) {
                int limit = this.list.getSize();
                for (int i = 0; i < limit; i++) {
                    ListElement el = (ListElement)this.list.getElementAt(i);
                    if (el.getObjectValue() != null && el.getObjectValue().equals(value)) {
                        this.list.setSelection(el);
                        return;
                    }
                }
            }
View Full Code Here

    public void setTextValue(TextData value) {
        if (scrollList != null) {
            if (scrollList != null) {
                int limit = this.list.getSize();
                for (int i = 0; i < limit; i++) {
                    ListElement el = (ListElement)this.list.getElementAt(i);
                    if (el.getTextValue() == value) {
                        this.list.setSelection(el);
                        return;
                    }
                }
            }
View Full Code Here

   
    public void setElementList(Array_Of_ListElement<ListElement> les) {
        // TF:8/8/07:Made a shallow clone in case there is a really big object attached to the list element
        Array_Of_ListElement<ListElement> clonedList = CloneHelper.clone(les, false);
        Object currentValue = this.list.getValue();
        ListElement valueToReselect = null;
        if (currentValue instanceof ListElement && clonedList != null && this.list.getSelectionHolder() instanceof TypeAwareValueModel) {
          TypeAwareValueModel tavm = (TypeAwareValueModel)this.list.getSelectionHolder();
          // We need to find an item in the new list which is the same as an item in the old list,
          // depending on the type being considered. For example, if the list is mapped to an int,
          // we need to find an element in the new list with the same IntegerValue.
          Class<?> clazz = tavm.getValueType();
          ListElement currentSelection = (ListElement)currentValue;
          for (ListElement item : clonedList) {
            if (clazz.equals(Integer.TYPE) ||
                clazz.equals(Short.TYPE) ||
                NumericData.class.isAssignableFrom(clazz) ||
                Number.class.isAssignableFrom(clazz)) {
              if (item.getIntegerValue() == currentSelection.getIntegerValue()) {
                valueToReselect = item;
                break;
              }
            }
            else if (String.class.isAssignableFrom(clazz) || TextData.class.isAssignableFrom(clazz) && currentSelection.getTextValue() != null) {
              if (currentSelection.getTextValue().equals(item.getTextValue())) {
                valueToReselect = item;
                break;
              }
            }
            else {
              if (currentSelection.getObjectValue() != null && currentSelection.getObjectValue() == item.getObjectValue()) {
                valueToReselect = item;
                break;
              }
            }
          }
View Full Code Here

    }

    public int getIntegerValue() {
        if (scrollList != null) {
            int index = this.list.getSelectionIndex();
            ListElement el = (ListElement)this.list.getElementAt(index);
            return el == null ? 0 : el.getIntegerValue();
        }
        else
            return 0;
    }
View Full Code Here

TOP

Related Classes of net.helipilot50.stocktrade.framework.IntegerData

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.