Examples of StringAttribute


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

        false));

    // create 2 manyInMany
    OneToManyAttribute manyInMany = new OneToManyAttribute(new ArrayList<AssociationValue>());
    AssociationValue manyInMany1 = new AssociationValue(null, new HashMap<String, Attribute<?>>(), false);
    manyInMany1.getAllAttributes().put("textAttr", new StringAttribute("manyInMany1"));
    manyInMany.getValue().add(manyInMany1);
    AssociationValue manyInMany2 = new AssociationValue(null, new HashMap<String, Attribute<?>>(), false);
    manyInMany2.getAllAttributes().put("textAttr", new StringAttribute("manyInMany2"));
    manyInMany.getValue().add(manyInMany2);

    // create oneInMany
    ManyToOneAttribute oneInMany = new ManyToOneAttribute();
    AssociationValue oneInManyValue = new AssociationValue(null, new HashMap<String, Attribute<?>>(), false);
    oneInManyValue.getAllAttributes().put("textAttr", new StringAttribute("oneInMany"));
    oneInMany.setValue(oneInManyValue);

    // create 2 manyInOne
    OneToManyAttribute manyInOne = new OneToManyAttribute(new ArrayList<AssociationValue>());
    AssociationValue manyInOne1 = new AssociationValue(null, new HashMap<String, Attribute<?>>(), false);
    manyInOne1.getAllAttributes().put("textAttr", new StringAttribute("manyInOne1"));
    manyInOne.getValue().add(manyInOne1);
    AssociationValue manyInOne2 = new AssociationValue(null, new HashMap<String, Attribute<?>>(), false);
    manyInOne2.getAllAttributes().put("textAttr", new StringAttribute("manyInOne2"));
    manyInOne.getValue().add(manyInOne2);

    // create oneInOne
    ManyToOneAttribute oneInOne = new ManyToOneAttribute();
    AssociationValue oneInOneValue = new AssociationValue(null, new HashMap<String, Attribute<?>>(), false);
    oneInOneValue.getAllAttributes().put("textAttr", new StringAttribute("oneInOne"));
    oneInOne.setValue(oneInOneValue);

    // create 2 many
    AssociationValue many1 = new AssociationValue(null, new HashMap<String, Attribute<?>>(), false);
    AssociationValue many2 = new AssociationValue(null, new HashMap<String, Attribute<?>>(), false);
View Full Code Here

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

        crs, filter, null, VectorLayerService.FEATURE_INCLUDE_ATTRIBUTES);
    Assert.assertEquals(1, oldFeatures.size());
    InternalFeature feature = oldFeatures.get(0);
    List<InternalFeature> newFeatures = new ArrayList<InternalFeature>();
    feature = feature.clone();
    feature.getAttributes().put(STRING_ATTR, new StringAttribute("changed"));
    newFeatures.add(feature);
    layerService.saveOrUpdate(LAYER_ID, crs, oldFeatures, newFeatures);

    Iterator<FeatureBean> iterator =
        (Iterator<FeatureBean>) beanLayer.getElements(filterService.createTrueFilter(), 0, 0);
View Full Code Here

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

      case DOUBLE:
        return new DoubleAttribute((Double) convertToClass(value, Double.class));
      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:
View Full Code Here

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

      date = format.parse("01/01/2009");
    } catch (ParseException e) {
      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));
View Full Code Here

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

  public void setAttributesManyToOne() throws Exception {
    // TODO: check manyToOne value with an ID (so the corresponding object must be fetched from DB).

    final String newValue = "hello world";
    Map<String, PrimitiveAttribute<?>> mtoAttributes = new HashMap<String, PrimitiveAttribute<?>>();
    mtoAttributes.put(ManyToOneProperty.PARAM_TEXT_ATTR, new StringAttribute(newValue));
    AssociationValue assoValue = new AssociationValue(null, mtoAttributes);
    ManyToOneAttribute mtoAttribute = new ManyToOneAttribute(assoValue);

    Map<String, Attribute> attributes = new HashMap<String, Attribute>();
    attributes.put(MTO, mtoAttribute);
View Full Code Here

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

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

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

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

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

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

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

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

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

  @SuppressWarnings("unchecked")
  @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));
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.