Examples of DateAttribute


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

      case CURRENCY:
        return new CurrencyAttribute((String) convertToClass(value, String.class));
      case STRING:
        return new StringAttribute(value == null ? null : value.toString());
      case DATE:
        return new DateAttribute((Date) value);
      case URL:
        return new UrlAttribute((String) value);
      case IMGURL:
        return new ImageUrlAttribute((String) value);
      default:
View Full Code Here

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

    attributes.put(PARAM_TEXT_ATTR, new StringAttribute("manyToOne-1"));
    attributes.put(PARAM_BOOLEAN_ATTR, new BooleanAttribute(true));
    attributes.put(PARAM_INT_ATTR, new IntegerAttribute(100));
    attributes.put(PARAM_FLOAT_ATTR, new FloatAttribute(100.0f));
    attributes.put(PARAM_DOUBLE_ATTR, new DoubleAttribute(100.0));
    attributes.put(PARAM_DATE_ATTR, new DateAttribute(date));

    return new ManyToOneAttribute(new AssociationValue(new LongAttribute(id), attributes));
  }
View Full Code Here

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

    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());
    Assert.assertEquals(5, featureModel.getAttribute(feature1, PARAM_INT_ATTR).getValue());
    Assert.assertEquals(5.0f, featureModel.getAttribute(feature1, PARAM_FLOAT_ATTR).getValue());
    Assert.assertEquals(5.0, featureModel.getAttribute(feature1, PARAM_DOUBLE_ATTR).getValue());
View Full Code Here

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

    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());
    Assert.assertEquals(5, featureModel.getAttribute(feature1, PARAM_INT_ATTR).getValue());
    Assert.assertEquals(5.0f, featureModel.getAttribute(feature1, PARAM_FLOAT_ATTR).getValue());
    Assert.assertEquals(5.0, featureModel.getAttribute(feature1, PARAM_DOUBLE_ATTR).getValue());
View Full Code Here

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

    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);
    layer.saveOrUpdate(detached);
View Full Code Here

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

    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)
    attributes.put(PARAM_MANY_TO_ONE, HibernateTestManyToOne.getDefaultAttributeInstance1(null));
View Full Code Here

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

    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());
    Assert.assertEquals(5, featureModel.getAttribute(feature1, PARAM_INT_ATTR).getValue());
    Assert.assertEquals(5.0f, featureModel.getAttribute(feature1, PARAM_FLOAT_ATTR).getValue());
    Assert.assertEquals(5.0, featureModel.getAttribute(feature1, PARAM_DOUBLE_ATTR).getValue());
View Full Code Here

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

    try {
      date = format.parse("01/01/2009");
    } catch (ParseException e) {
      date = new Date();
    }
    attributes.put("dateAttr", new DateAttribute(date));
    return new ManyToOneAttribute(new AssociationValue(new LongAttribute(id), attributes));
  }
View Full Code Here

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

        break;
      case STRING:
        attribute = new StringAttribute();
        break;
      case DATE:
        attribute = new DateAttribute();
        break;
      case URL:
        attribute = new UrlAttribute();
        break;
      case IMGURL:
View Full Code Here

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

      case BOOLEAN:
        return new BooleanAttribute();
      case CURRENCY:
        return new CurrencyAttribute();
      case DATE:
        return new DateAttribute();
      case DOUBLE:
        return new DoubleAttribute();
      case FLOAT:
        return new FloatAttribute();
      case IMGURL:
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.