Package org.geomajas.layer.feature.attribute

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


    geometry = (Point) wktReader.read("POINT (0 0)");

    Object feature = (SimpleFeature)layer.getFeatureModel().newInstance("500");
    Map<String, Attribute> map = new HashMap<String, Attribute>();
    map.put("NAME", new StringAttribute("Tsjakamaka"));
    map.put("POP_OTHER", new IntegerAttribute(342));
    layer.getFeatureModel().setAttributes(feature, map);
    layer.getFeatureModel().setGeometry(feature, geometry);
   
    created = layer.create(feature);
    Assert.assertNotNull(created);
View Full Code Here


  @SuppressWarnings("unchecked")
  @Test
  public void testSetAttributes() throws Exception {
    Map<String, Attribute> map = new HashMap<String, Attribute>();
    map.put(ATTRIBUTE_NAME, new StringAttribute("Heikant"));
    map.put(ATTRIBUTE_POPULATION, new IntegerAttribute(100));
    featureModel.setAttributes(feature, map);
    Assert.assertEquals("Heikant", featureModel.getAttribute(feature, ATTRIBUTE_NAME).getValue());
  }
View Full Code Here

        break;
      case SHORT:
        result = new ShortAttribute((Short) value);
        break;
      case INTEGER:
        result = new IntegerAttribute((Integer) value);
        break;
      case LONG:
        result = new LongAttribute((Long) value);
        break;
      case FLOAT:
View Full Code Here

    feature = oldFeatures.get(0);
    newFeatures = new ArrayList<InternalFeature>();
    feature = feature.clone();
    newFeatures.add(feature);
    feature.getAttributes().put(STRING_ATTR, new StringAttribute("changed"));
    feature.getAttributes().put(INTEGER_ATTR, new IntegerAttribute(12345));
    layerService.saveOrUpdate(LAYER_ID, crs, oldFeatures, newFeatures);
    // check changes
    filter = filterService.createFidFilter(new String[]{"1"});
    oldFeatures = layerService.getFeatures(LAYER_ID, crs, filter, null,
        VectorLayerService.FEATURE_INCLUDE_ATTRIBUTES);
View Full Code Here

      case BOOLEAN:
        return new BooleanAttribute((Boolean) convertToClass(value, Boolean.class));
      case SHORT:
        return new ShortAttribute((Short) convertToClass(value, Short.class));
      case INTEGER:
        return new IntegerAttribute((Integer) convertToClass(value, Integer.class));
      case LONG:
        return new LongAttribute((Long) convertToClass(value, Long.class));
      case FLOAT:
        return new FloatAttribute((Float) convertToClass(value, Float.class));
      case DOUBLE:
View Full Code Here

      date = new Date();
    }
    Map<String, PrimitiveAttribute<?>> attributes = new HashMap<String, PrimitiveAttribute<?>>();
    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

  @SuppressWarnings("rawtypes")
  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);
View Full Code Here

    Assert.assertNull(featureModel.getAttribute(feature1, PARAM_DOUBLE_ATTR).getValue());
    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);
View Full Code Here

  @Test
  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);
View Full Code Here

  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;
View Full Code Here

TOP

Related Classes of org.geomajas.layer.feature.attribute.IntegerAttribute

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.