Search in sources :

Example 36 with LinkedHashMapEx

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

the class AbstractLayer method toMap.

@SuppressWarnings("unchecked")
@Override
public MapEx toMap() {
    final MapEx map = new LinkedHashMapEx();
    addTypeToMap(map, this.type);
    addToMap(map, "name", this.name);
    addToMap(map, "visible", this.visible);
    addToMap(map, "open", this.open);
    addToMap(map, "querySupported", this.querySupported);
    if (this.querySupported) {
        addToMap(map, "queryable", this.queryable);
    }
    addToMap(map, "readOnly", this.readOnly);
    if (!this.readOnly) {
        addToMap(map, "editable", this.editable);
    }
    if (this.selectSupported) {
        addToMap(map, "selectable", this.selectable);
    }
    addToMap(map, "selectSupported", this.selectSupported);
    addToMap(map, "maximumScale", this.maximumScale);
    addToMap(map, "minimumScale", this.minimumScale);
    addToMap(map, "style", this.renderer);
    addToMap(map, "pluginConfig", this.pluginConfigByName);
    final Map<String, Object> properties = (Map<String, Object>) toMapValue(getProperties());
    if (properties != null) {
        for (final Entry<String, Object> entry : properties.entrySet()) {
            final String name = entry.getKey();
            if (!map.containsKey(name) && !name.startsWith("INTERNAL")) {
                final Object value = entry.getValue();
                if (!(value instanceof Component)) {
                    map.put(name, value);
                }
            }
        }
    }
    map.remove("showTableView");
    return map;
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) Component(java.awt.Component) Map(java.util.Map) MapSerializerMap(com.revolsys.collection.map.MapSerializerMap) LinkedHashMap(java.util.LinkedHashMap) TreeMap(java.util.TreeMap)

Example 37 with LinkedHashMapEx

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

the class RecordLayerTablePanel method toMap.

@Override
public MapEx toMap() {
    final MapEx map = new LinkedHashMapEx();
    final String tableRecordsMode = this.tableModel.getTableRecordsMode().getKey();
    addToMap(map, "fieldFilterMode", tableRecordsMode);
    final String geometryFilterMode = this.tableModel.getGeometryFilterMode();
    addToMap(map, "geometryFilterMode", geometryFilterMode);
    if (this.fieldFilterPanel != null) {
        addToMap(map, "searchField", this.fieldFilterPanel.getSearchFieldName());
    }
    addToMap(map, "orderBy", this.tableModel.getOrderBy());
    return map;
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx)

Example 38 with LinkedHashMapEx

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

the class UrlUtil method getQueryStringMap.

@SuppressWarnings("unchecked")
public static Map<String, Object> getQueryStringMap(final String queryString) {
    final MapEx map = new LinkedHashMapEx();
    if (Property.hasValue(queryString)) {
        for (final String part : queryString.split("\\&")) {
            final int equalsIndex = part.indexOf("=");
            if (equalsIndex > -1) {
                final String name = part.substring(0, equalsIndex);
                final String value = percentDecode(part.substring(equalsIndex + 1).replaceAll("\\+", " "));
                if (map.containsKey(name)) {
                    final Object existingValue = map.get(name);
                    if (existingValue instanceof List) {
                        final List<Object> list = (List<Object>) existingValue;
                        list.add(value);
                    } else {
                        final List<Object> list = new ArrayList<>();
                        list.add(existingValue);
                        list.add(value);
                    }
                } else {
                    map.put(name, value);
                }
            }
        }
    }
    return map;
}
Also used : LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) MapEx(com.revolsys.collection.map.MapEx) ArrayList(java.util.ArrayList) ArrayList(java.util.ArrayList) List(java.util.List) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx)

Example 39 with LinkedHashMapEx

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

the class WebServiceConnectionTrees method addWebServiceConnection.

@SuppressWarnings("deprecation")
private static void addWebServiceConnection(final WebServiceConnectionRegistry registry, final String type) {
    final ValueField panel = new ValueField();
    panel.setTitle("Add Web Service Connection");
    Borders.titled(panel, "Web Service Connection");
    SwingUtil.addLabel(panel, "Name");
    final TextField nameField = new TextField(20);
    panel.add(nameField);
    SwingUtil.addLabel(panel, "Service URL");
    final TextField urlField = new TextField(50);
    panel.add(urlField);
    SwingUtil.addLabel(panel, "Username");
    final TextField usernameField = new TextField(30);
    panel.add(usernameField);
    SwingUtil.addLabel(panel, "Password");
    final PasswordField passwordField = new PasswordField(30);
    panel.add(passwordField);
    GroupLayouts.makeColumns(panel, 2, true);
    panel.showDialog();
    if (panel.isSaved()) {
        final String url = urlField.getText();
        if (url != null) {
            final String name = nameField.getText();
            final String username = usernameField.getText();
            final String password = passwordField.getText();
            final MapEx config = new LinkedHashMapEx();
            config.put("j:type", type);
            config.put("name", name);
            config.put("serviceUrl", url);
            config.put("username", username);
            config.put("password", PasswordUtil.encrypt(password));
            registry.newConnection(config);
        }
    }
}
Also used : MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) TextField(com.revolsys.swing.field.TextField) PasswordField(com.revolsys.swing.field.PasswordField) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) ValueField(com.revolsys.swing.component.ValueField)

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