Search in sources :

Example 61 with MapEx

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

the class AbstractRecordLayer method toMap.

@Override
public MapEx toMap() {
    final MapEx map = super.toMap();
    if (!super.isReadOnly()) {
        addToMap(map, "canAddRecords", this.canAddRecords);
        addToMap(map, "canDeleteRecords", this.canDeleteRecords);
        addToMap(map, "canEditRecords", this.canEditRecords);
        addToMap(map, "canPasteRecords", this.canPasteRecords);
        addToMap(map, "snapToAllLayers", this.snapToAllLayers);
    }
    addToMap(map, "fieldNamesSetName", this.fieldNamesSetName, ALL);
    addToMap(map, "fieldNamesSets", getFieldNamesSets());
    addToMap(map, "fieldColumnWidths", getFieldColumnWidths());
    addToMap(map, "useFieldTitles", this.useFieldTitles);
    map.remove("filter");
    String where;
    if (Property.isEmpty(this.filter)) {
        where = this.where;
    } else {
        where = this.filter.toFormattedString();
    }
    if (Property.hasValue(where)) {
        final RecordDefinitionSqlFilter filter = new RecordDefinitionSqlFilter(this, where);
        addToMap(map, "filter", filter);
    }
    return map;
}
Also used : MapEx(com.revolsys.collection.map.MapEx) LineString(com.revolsys.geometry.model.LineString)

Example 62 with MapEx

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

the class AbstractTiledLayer method toMap.

@Override
public MapEx toMap() {
    final MapEx map = super.toMap();
    map.keySet().removeAll(Arrays.asList("readOnly", "querySupported", "selectSupported"));
    return map;
}
Also used : MapEx(com.revolsys.collection.map.MapEx)

Example 63 with MapEx

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

the class TextStyle method toMap.

@Override
public MapEx toMap() {
    final MapEx map = new LinkedHashMapEx();
    for (final String name : PROPERTY_NAMES) {
        Object value = Property.get(this, name);
        if (value instanceof Color) {
            final Color color = (Color) value;
            value = WebColors.newAlpha(color, 255);
        }
        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) Color(java.awt.Color) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx)

Example 64 with MapEx

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

the class TextMarker method toMap.

@Override
public MapEx toMap() {
    final MapEx map = super.toMap();
    addTypeToMap(map, "markerText");
    addToMap(map, "textFaceName", this.textFaceName);
    addToMap(map, "text", this.text);
    return map;
}
Also used : MapEx(com.revolsys.collection.map.MapEx)

Example 65 with MapEx

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

the class WebServiceConnectionTrees method editConnection.

@SuppressWarnings("deprecation")
private static void editConnection(final WebServiceConnection connection) {
    final WebServiceConnectionRegistry registry = connection.getRegistry();
    final ValueField panel = new ValueField();
    panel.setTitle("Edit Web Service Connection");
    Borders.titled(panel, "Web Service Connection");
    SwingUtil.addLabel(panel, "Name");
    final MapEx config = connection.getConfig();
    final String oldName = connection.getName();
    final TextField nameField = new TextField("name", oldName, 20);
    panel.add(nameField);
    SwingUtil.addLabel(panel, "Service URL");
    String serviceUrl = config.getString("serviceUrl");
    final TextField urlField = new TextField("serviceUrl", serviceUrl, 50);
    panel.add(urlField);
    SwingUtil.addLabel(panel, "Username");
    String username = config.getString("username");
    final TextField usernameField = new TextField("username", username, 30);
    panel.add(usernameField);
    SwingUtil.addLabel(panel, "Password");
    String password = PasswordUtil.decrypt(config.getString("password"));
    final PasswordField passwordField = new PasswordField("password", password, 30);
    panel.add(passwordField);
    GroupLayouts.makeColumns(panel, 2, true);
    panel.showDialog();
    if (panel.isSaved()) {
        serviceUrl = urlField.getText();
        if (serviceUrl != null) {
            final String name = nameField.getText();
            username = usernameField.getText();
            password = passwordField.getText();
            config.put("name", name);
            config.put("serviceUrl", serviceUrl);
            config.put("username", username);
            config.put("password", PasswordUtil.encrypt(password));
            if (Strings.equals(oldName, name)) {
                connection.setProperties(config);
            } else {
                registry.removeConnection(connection);
                registry.newConnection(config);
            }
        }
    }
}
Also used : MapEx(com.revolsys.collection.map.MapEx) LinkedHashMapEx(com.revolsys.collection.map.LinkedHashMapEx) WebServiceConnectionRegistry(com.revolsys.webservice.WebServiceConnectionRegistry) TextField(com.revolsys.swing.field.TextField) PasswordField(com.revolsys.swing.field.PasswordField) ValueField(com.revolsys.swing.component.ValueField)

Aggregations

MapEx (com.revolsys.collection.map.MapEx)144 LinkedHashMapEx (com.revolsys.collection.map.LinkedHashMapEx)48 ArrayList (java.util.ArrayList)17 Resource (com.revolsys.spring.resource.Resource)9 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)7 Map (java.util.Map)7 HashMap (java.util.HashMap)6 PathName (com.revolsys.io.PathName)5 UrlResource (com.revolsys.spring.resource.UrlResource)5 DataType (com.revolsys.datatype.DataType)4 FieldDefinition (com.revolsys.record.schema.FieldDefinition)4 PathResource (com.revolsys.spring.resource.PathResource)4 Color (java.awt.Color)4 LinkedHashMap (java.util.LinkedHashMap)4 List (java.util.List)4 TreeMap (java.util.TreeMap)4 NamedLinkedHashMapEx (com.revolsys.collection.map.NamedLinkedHashMapEx)3 Geometry (com.revolsys.geometry.model.Geometry)3 LineString (com.revolsys.geometry.model.LineString)3 Record (com.revolsys.record.Record)3