Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • sjivan
    replied
    Added to SVN, thanks.

    Leave a comment:


  • fatzopilot
    replied
    OK, I created a patch to a recent SVN version (see attachement). Seems to work in all my cases. I'd be glad if you could include it into the official build.
    Attached Files

    Leave a comment:


  • fatzopilot
    started a topic Add support for double[] arrays in DataClass

    Add support for double[] arrays in DataClass

    Basically, I think just the following would need to be added to add support for double[] arrays:
    In DataClass.java:
    Code:
        public double[] getAttributeAsDoubleArray(String property) {
            return JSOHelper.getAttributeAsDoubleArray(jsObj, property);
        }
    
        public static void setAttribute(JavaScriptObject elem, String attr, double[] values) {
            setAttribute(elem, attr, JSOHelper.convertToJavaScriptArray(values));
        }
    and in JSOHelper.java

    Code:
        public static JavaScriptObject convertToJavaScriptArray(double[] array) {
            if(array == null) return null;
            JavaScriptObject jsArray = createJavaScriptArray();
            for (int i = 0; i < array.length; i++) {
                JSOHelper.setArrayValue(jsArray, i, array[i]);
            }
            return jsArray;
        }
Working...
X