Examples of FloatAttribute


Examples of org.geomajas.layer.feature.attribute.FloatAttribute

    Assert.assertNull(featureModel.getAttribute(feature1, PARAM_BOOLEAN_ATTR).getValue());
    Assert.assertNull(featureModel.getAttribute(feature1, PARAM_DATE_ATTR).getValue());

    attributes.put(PARAM_TEXT_ATTR, new StringAttribute("new name"));
    attributes.put(PARAM_INT_ATTR, new IntegerAttribute(5));
    attributes.put(PARAM_FLOAT_ATTR, new FloatAttribute(5.0f));
    attributes.put(PARAM_DOUBLE_ATTR, new DoubleAttribute(5.0));
    attributes.put(PARAM_BOOLEAN_ATTR, new BooleanAttribute(false));
    attributes.put(PARAM_DATE_ATTR, new DateAttribute(date));
    featureModel.setAttributes(feature1, attributes);
    Assert.assertEquals("new name", featureModel.getAttribute(feature1, PARAM_TEXT_ATTR).getValue());
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.FloatAttribute

    // Create a detached copy
    SimpleFeature detached = SimpleFeature.getDefaultInstance1(null);
    detached.setId(((SimpleFeature) feature).getId());
    Map<String, Attribute> attributes = new HashMap<String, Attribute>();
    attributes.put(PARAM_TEXT_ATTR, new StringAttribute("new name"));
    attributes.put(PARAM_FLOAT_ATTR, new FloatAttribute(5f));
    Calendar c = Calendar.getInstance();
    attributes.put(PARAM_DATE_ATTR, new DateAttribute(c.getTime()));
    attributes.put(PARAM_BOOLEAN_ATTR, new BooleanAttribute(false));

    layer.getFeatureModel().setAttributes(detached, attributes);
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.FloatAttribute

    // Create a detached copy
    HibernateTestFeature detached = HibernateTestFeature.getDefaultInstance1(null);
    detached.setId(((HibernateTestFeature) feature).getId());
    Map<String, Attribute> attributes = new HashMap<String, Attribute>();
    attributes.put(PARAM_TEXT_ATTR, new StringAttribute("new name"));
    attributes.put(PARAM_FLOAT_ATTR, new FloatAttribute(5f));
    Calendar c = Calendar.getInstance();
    attributes.put(PARAM_DATE_ATTR, new DateAttribute(c.getTime()));
    attributes.put(PARAM_BOOLEAN_ATTR, new BooleanAttribute(false));

    // Set a ManyToOne attribute without an ID (a new one)
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.FloatAttribute

  public void setAttributes() throws Exception {
    Date date = new Date();
    Map<String, Attribute> attributes = new HashMap<String, Attribute>();
    attributes.put(PARAM_TEXT_ATTR, new StringAttribute("new name"));
    attributes.put(PARAM_INT_ATTR, new IntegerAttribute(5));
    attributes.put(PARAM_FLOAT_ATTR, new FloatAttribute(5.0f));
    attributes.put(PARAM_DOUBLE_ATTR, new DoubleAttribute(5.0));
    attributes.put(PARAM_BOOLEAN_ATTR, new BooleanAttribute(false));
    attributes.put(PARAM_DATE_ATTR, new DateAttribute(date));
    featureModel.setAttributes(feature1, attributes);
    Assert.assertEquals("new name", featureModel.getAttribute(feature1, PARAM_TEXT_ATTR).getValue());
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.FloatAttribute

  public static ManyToOneAttribute getDefaultAttributeInstance1(Long id) {
     Map<String, PrimitiveAttribute<?>> attributes = new HashMap<String, PrimitiveAttribute<?>>();
    attributes.put("textAttr", new StringAttribute("manyToOne-1"));
    attributes.put("booleanAttr", new BooleanAttribute(true));
    attributes.put("intAttr", new IntegerAttribute(100));
    attributes.put("floatAttr", new FloatAttribute(100.0f));
    attributes.put("doubleAttr", new DoubleAttribute(100.0));
   
    DateFormat format = new SimpleDateFormat("dd/MM/yyyy");
    Date date;
    try {
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.FloatAttribute

        break;
      case LONG:
        attribute = new LongAttribute();
        break;
      case FLOAT:
        attribute = new FloatAttribute();
        break;
      case DOUBLE:
        attribute = new DoubleAttribute();
        break;
      case CURRENCY:
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.FloatAttribute

      case DATE:
        return new DateAttribute();
      case DOUBLE:
        return new DoubleAttribute();
      case FLOAT:
        return new FloatAttribute();
      case IMGURL:
        return new ImageUrlAttribute();
      case INTEGER:
        return new IntegerAttribute();
      case LONG:
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.FloatAttribute

      this.attribute = new LongAttribute(value);
      this.info = new PrimitiveAttributeInfo(name, label, PrimitiveType.LONG);
    }

    AttributeInfoPair(String name, String label, float value) {
      this.attribute = new FloatAttribute(value);
      this.info = new PrimitiveAttributeInfo(name, label, PrimitiveType.FLOAT);
    }
View Full Code Here

Examples of org.geomajas.layer.feature.attribute.FloatAttribute

          case INTEGER:
            return new IntegerAttribute();
          case LONG:
            return new LongAttribute();
          case FLOAT:
            return new FloatAttribute();
          case DOUBLE:
            return new DoubleAttribute();
          case CURRENCY:
            return new CurrencyAttribute();
          case STRING:
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.