Search in sources :

Example 16 with LinkedHashMapEx

use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.

the class MappedLocation method toMap.

@Override
public MapEx toMap() {
    final MapEx map = new LinkedHashMapEx();
    map.put("sourceX", this.sourcePixel.getX());
    map.put("sourceY", this.sourcePixel.getY());
    map.put("target", this.targetPoint.toEwkt());
    return map;
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx)

Example 17 with LinkedHashMapEx

use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.

the class FeatureSource method refreshDo.

@Override
protected void refreshDo() {
    final MapEx properties = new LinkedHashMapEx();
    final String resourceId = getResourceId();
    properties.put("RESOURCEID", resourceId);
    final MapGuideWebService webService = getWebService();
    final MapEx schemaResource = webService.getJsonResponse("DESCRIBEFEATURESCHEMA", properties);
    final MapEx schema = schemaResource.getValue("xs:schema");
    if (schema != null) {
        final Map<String, String> prefixByUri = new HashMap<>();
        for (final String name : schema.keySet()) {
            if (name.startsWith("@xmlns:")) {
                final String namespaceUri = getString(schema, name);
                final String prefix = name.substring(7);
                prefixByUri.put(namespaceUri, prefix);
            }
        }
        final String targetNamespace = getString(schema, "@targetNamespace");
        final String prefix = prefixByUri.get(targetNamespace);
        final Map<String, MapEx> complexTypeDefinitions = new HashMap<>();
        for (final MapEx complexType : schema.getValue("xs:complexType", Collections.<MapEx>emptyList())) {
            String name = getString(complexType, "@name");
            if (prefix != null) {
                name = prefix + ":" + name;
            }
            complexTypeDefinitions.put(name, complexType);
        }
        final List<FeatureLayer> layers = new ArrayList<>();
        final Map<String, FeatureLayer> layerByName = new HashMap<>();
        for (final MapEx element : schema.getValue("xs:element", Collections.<MapEx>emptyList())) {
            final String name = getString(element, "@name");
            final String type = getString(element, "@type");
            final MapEx complexType = complexTypeDefinitions.get(type);
            final FeatureLayer layer = newLayer(name, element, complexType);
            if (layer != null) {
                layers.add(layer);
                layerByName.put(name.toLowerCase(), layer);
            }
            this.layers = layers;
            this.layerByName = layerByName;
        }
    }
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) HashMap(java.util.HashMap) ArrayList(java.util.ArrayList) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx)

Example 18 with LinkedHashMapEx

use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.

the class TestFile method toMap.

@Override
public MapEx toMap() {
    final MapEx map = new LinkedHashMapEx();
    map.put("type", "test");
    addToMap(map, "testDescription", this.testDescription);
    final Map<String, Object> properties = getProperties();
    addToMap(map, "properties", properties, Collections.emptyMap());
    return map;
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx)

Example 19 with LinkedHashMapEx

use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.

the class TestCase method toMap.

@Override
public MapEx toMap() {
    final MapEx map = new LinkedHashMapEx();
    map.put("type", "test");
    if (Property.hasValue(this.testDescription)) {
        map.put("description", this.testDescription);
    }
    addToMap(map, "geometryFactory", this.geometryFactory);
    final Map<String, Object> properties = new LinkedHashMap<>();
    if (this.testFile != null) {
        addAllToMap(properties, this.testFile.getProperties());
    }
    addToMap(properties, "a", this.a);
    addToMap(properties, "b", this.b);
    if (!properties.isEmpty()) {
        map.put("properties", properties);
    }
    // MapSerializerUtil.add(map, "tests", tests);
    return map;
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) LinkedHashMap(java.util.LinkedHashMap)

Example 20 with LinkedHashMapEx

use of com.revolsys.collection.map.LinkedHashMapEx in project com.revolsys.open by revolsys.

the class MarkerStyle method toMap.

@Override
public MapEx toMap() {
    final boolean geometryStyle = this instanceof GeometryStyle;
    final MapEx map = new LinkedHashMapEx();
    for (final String name : PROPERTY_NAMES) {
        if (geometryStyle || name.startsWith("marker")) {
            final Object value = Property.get(this, name);
            boolean defaultEqual = false;
            if (DEFAULT_VALUES.containsKey(name)) {
                final Object defaultValue = DEFAULT_VALUES.get(name);
                defaultEqual = DataType.equal(defaultValue, value);
            }
            if (!defaultEqual) {
                addToMap(map, name, value);
            }
        }
    }
    return map;
}
Also used : MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx)

Aggregations

LinkedHashMapEx (com.revolsys.collection.map.LinkedHashMapEx)39 MapEx (com.revolsys.collection.map.MapEx)38 ArrayList (java.util.ArrayList)6 HashMap (java.util.HashMap)3 Map (java.util.Map)3 BoundingBox (com.revolsys.geometry.model.BoundingBox)2 UrlResource (com.revolsys.spring.resource.UrlResource)2 Component (java.awt.Component)2 LinkedHashMap (java.util.LinkedHashMap)2 List (java.util.List)2 PropertyChangeArrayList (com.revolsys.collection.PropertyChangeArrayList)1 MapSerializerMap (com.revolsys.collection.map.MapSerializerMap)1 LasPoint (com.revolsys.elevation.cloud.las.pointformat.LasPoint)1 CoordinateSystem (com.revolsys.geometry.cs.CoordinateSystem)1 ClockDirection (com.revolsys.geometry.model.ClockDirection)1 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)1 PathName (com.revolsys.io.PathName)1 Resource (com.revolsys.spring.resource.Resource)1 ValueField (com.revolsys.swing.component.ValueField)1 PasswordField (com.revolsys.swing.field.PasswordField)1