Package ca.nengo.config

Examples of ca.nengo.config.SingleValuedProperty


      Method valuesGetter = this.getClass().getMethod("getValues1D", new Class[0]);
      result.defineProperty(new SingleValuedPropertyImpl(result, "values", float[].class, valuesGetter));

      final Method labelGetter = this.getClass().getMethod("getLabels", new Class[0]);
      Method labelSetter = this.getClass().getMethod("setLabel", new Class[]{String.class});
      SingleValuedProperty labelProp = new SingleValuedPropertyImpl(result, "label", String.class, labelGetter, labelSetter) {

        @Override
        public Object getValue() {
          Object result = null;
          try {
View Full Code Here


        Property p = (Property) child;
        List<String> propertyNames = c.getPropertyNames();
        Collections.sort(propertyNames);
        index = propertyNames.indexOf(p.getName());
      } else if (parent instanceof SingleValuedProperty) {
        SingleValuedProperty p = (SingleValuedProperty) parent;
        Value v = (Value) child;
        if (p.getValue() != null && p.getValue().equals(v.getObject())) {
          index = 0;
        }
      } else if (parent instanceof ListProperty) {
        ListProperty p = (ListProperty) parent;
        Value v = (Value) child;
        for (int i = 0; i < p.getNumValues() && index == -1; i++) {
          if (p.getValue(i) != null && p.getValue(i).equals(v.getObject())) {
                        index = i;
                    }
        }
      } else if (parent instanceof NamedValueProperty) {
        NamedValueProperty p = (NamedValueProperty) parent;
        String name = ((Value) child).getName();
        for (int i = 0; i < p.getValueNames().size() && index == -1; i++) {
          if (p.getValueNames().get(i).equals(name)) {
                        index = i;
                    }
        }
      }
    } catch (StructuralException e) {
View Full Code Here

TOP

Related Classes of ca.nengo.config.SingleValuedProperty

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.