Search in sources :

Example 31 with LinkedHashMapEx

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

the class FeatureLayer method newRecordReader.

@Override
public <V extends Record> RecordReader newRecordReader(final RecordFactory<V> recordFactory, final Query query) {
    final MapEx queryParameters = new LinkedHashMapEx();
    final String resourceId = this.featureSource.getResourceId();
    queryParameters.put("RESOURCEID", resourceId);
    final String name = this.recordDefinition.getName();
    queryParameters.put("CLASSNAME", name);
    int offset = 0;
    int limit = Integer.MAX_VALUE;
    if (query != null) {
        offset = query.getOffset();
        limit = query.getLimit();
    }
    return new MapGuideServerFeatureIterator(this, queryParameters, offset, limit, recordFactory);
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx)

Example 32 with LinkedHashMapEx

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

the class GeometryOperationTest method toMap.

@Override
public MapEx toMap() {
    final MapEx map = new LinkedHashMapEx();
    map.put("type", "test");
    addToMap(map, "description", this.testDescription);
    map.put("propertyName", this.geometryIndex.toLowerCase());
    map.put("methodName", this.operation);
    final List<Object> arguments = new ArrayList<>();
    for (int i = 0; i < this.arguments.size(); i++) {
        final Object argument = this.arguments.get(i);
        if (argument instanceof String) {
            final String string = (String) argument;
            if ("a".equalsIgnoreCase(string)) {
                arguments.add(Collections.singletonMap("reference", "a"));
            } else if ("b".equalsIgnoreCase(string)) {
                arguments.add(Collections.singletonMap("reference", "b"));
            } else {
                arguments.add(argument);
            }
        } else {
            arguments.add(argument);
        }
    }
    addToMap(map, "arguments", arguments, Collections.emptyList());
    return map;
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) ArrayList(java.util.ArrayList) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx)

Example 33 with LinkedHashMapEx

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

the class MapSerializer method newTypeMap.

default MapEx newTypeMap(final String type) {
    final MapEx map = new LinkedHashMapEx();
    addTypeToMap(map, type);
    return map;
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx)

Example 34 with LinkedHashMapEx

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

the class AbstractLayerRenderer method toMap.

@Override
public MapEx toMap() {
    final MapEx map = new LinkedHashMapEx();
    addTypeToMap(map, this.type);
    addToMap(map, "name", this.name);
    addToMap(map, "visible", this.visible, true);
    addToMap(map, "maximumScale", this.maximumScale, 0);
    addToMap(map, "minimumScale", this.minimumScale, Long.MAX_VALUE);
    addToMap(map, "open", this.open, false);
    return map;
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx)

Example 35 with LinkedHashMapEx

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

the class AbstractGeoreferencedImage method loadSettings.

protected long loadSettings() {
    final Resource resource = getImageResource();
    final Resource settingsFile = resource.newResourceAddExtension("rgobject");
    if (settingsFile.exists()) {
        try {
            Map<String, Object> settings;
            try {
                settings = Json.toMap(settingsFile);
            } catch (final Throwable e) {
                settings = new LinkedHashMapEx();
            }
            final String boundingBoxWkt = (String) settings.get("boundingBox");
            if (Property.hasValue(boundingBoxWkt)) {
                final BoundingBox boundingBox = BoundingBox.newBoundingBox(boundingBoxWkt);
                if (!boundingBox.isEmpty()) {
                    setBoundingBox(boundingBox);
                }
            }
            final List<?> tiePointsProperty = (List<?>) settings.get("tiePoints");
            final List<MappedLocation> tiePoints = new ArrayList<>();
            if (tiePointsProperty != null) {
                for (final Object tiePointValue : tiePointsProperty) {
                    if (tiePointValue instanceof MappedLocation) {
                        tiePoints.add((MappedLocation) tiePointValue);
                    } else if (tiePointValue instanceof Map) {
                        @SuppressWarnings("unchecked") final Map<String, Object> map = (Map<String, Object>) tiePointValue;
                        tiePoints.add(new MappedLocation(map));
                    }
                }
            }
            if (!tiePoints.isEmpty()) {
                setTiePoints(tiePoints);
            }
            return settingsFile.getLastModified();
        } catch (final Throwable e) {
            Logs.error(this, "Unable to load:" + settingsFile, e);
            return -1;
        }
    } else {
        return -1;
    }
}
Also used : Resource(com.revolsys.spring.resource.Resource) ArrayList(java.util.ArrayList) PropertyChangeArrayList(com.revolsys.collection.PropertyChangeArrayList) BoundingBox(com.revolsys.geometry.model.BoundingBox) ArrayList(java.util.ArrayList) NodeList(org.w3c.dom.NodeList) PropertyChangeArrayList(com.revolsys.collection.PropertyChangeArrayList) List(java.util.List) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) HashMap(java.util.HashMap) Map(java.util.Map)

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