Search in sources :

Example 21 with Identifier

use of com.revolsys.identifier.Identifier in project com.revolsys.open by revolsys.

the class OsmProxyLayerRecord method getRecordProxied.

@Override
protected LayerRecord getRecordProxied() {
    final Identifier identifier = getIdentifier();
    final OsmElement record = this.document.getRecord(identifier);
    final AbstractRecordLayer layer = getLayer();
    return new ArrayLayerRecord(layer, record);
}
Also used : OsmElement(com.revolsys.record.io.format.openstreetmap.model.OsmElement) ArrayLayerRecord(com.revolsys.swing.map.layer.record.ArrayLayerRecord) Identifier(com.revolsys.identifier.Identifier) AbstractRecordLayer(com.revolsys.swing.map.layer.record.AbstractRecordLayer)

Example 22 with Identifier

use of com.revolsys.identifier.Identifier in project com.revolsys.open by revolsys.

the class AbstractProxyLayerRecord method getRecordProxied.

protected LayerRecord getRecordProxied() {
    final AbstractRecordLayer layer = getLayer();
    final Identifier identifier = getIdentifier();
    final LayerRecord layerRecord = layer.getCachedRecord(identifier);
    return layerRecord;
}
Also used : Identifier(com.revolsys.identifier.Identifier)

Example 23 with Identifier

use of com.revolsys.identifier.Identifier in project com.revolsys.open by revolsys.

the class RecordStoreLayer method showForm.

@Override
public void showForm(final LayerRecord record, final String fieldName) {
    if (record != null) {
        final Identifier identifier = getId(record);
        if (identifier != null) {
            addRecordToCache(getCacheIdForm(), record);
        }
        final LayerRecord proxyRecord = record.newRecordProxy();
        super.showForm(proxyRecord, fieldName);
    }
}
Also used : Identifier(com.revolsys.identifier.Identifier)

Example 24 with Identifier

use of com.revolsys.identifier.Identifier in project com.revolsys.open by revolsys.

the class RecordStoreLayer method newProxyLayerRecordNoId.

protected LayerRecord newProxyLayerRecordNoId(LayerRecord record) {
    final AbstractProxyLayerRecord proxyRecord = new NoIdProxyLayerRecord(this, record);
    final Identifier identifier2 = proxyRecord.getIdentifier();
    if (identifier2 != null) {
        this.recordsByIdentifier.put(identifier2, (RecordStoreLayerRecord) record);
    }
    record = proxyRecord;
    return record;
}
Also used : Identifier(com.revolsys.identifier.Identifier)

Example 25 with Identifier

use of com.revolsys.identifier.Identifier in project com.revolsys.open by revolsys.

the class RecordStoreLayer method removeRecordFromCache.

@Override
protected boolean removeRecordFromCache(final Label cacheId, final LayerRecord record) {
    boolean removed = false;
    if (isLayerRecord(record)) {
        final Identifier identifier = record.getIdentifier();
        if (identifier != null) {
            synchronized (getSync()) {
                removed = Maps.removeFromSet(this.recordIdentifiersByCacheId, cacheId, identifier);
            }
        }
    }
    removed |= super.removeRecordFromCache(cacheId, record);
    return removed;
}
Also used : Identifier(com.revolsys.identifier.Identifier)

Aggregations

Identifier (com.revolsys.identifier.Identifier)56 Record (com.revolsys.record.Record)17 ArrayList (java.util.ArrayList)12 RecordDefinition (com.revolsys.record.schema.RecordDefinition)11 SingleIdentifier (com.revolsys.identifier.SingleIdentifier)8 ListIdentifier (com.revolsys.identifier.ListIdentifier)7 TypedIdentifier (com.revolsys.identifier.TypedIdentifier)6 CodeTable (com.revolsys.record.code.CodeTable)6 RecordReader (com.revolsys.record.io.RecordReader)5 RecordStore (com.revolsys.record.schema.RecordStore)5 Transaction (com.revolsys.transaction.Transaction)5 List (java.util.List)5 Geometry (com.revolsys.geometry.model.Geometry)4 BaseCloseable (com.revolsys.io.BaseCloseable)4 PathName (com.revolsys.io.PathName)4 ArrayRecord (com.revolsys.record.ArrayRecord)4 Query (com.revolsys.record.query.Query)4 OsmElement (com.revolsys.record.io.format.openstreetmap.model.OsmElement)3 FieldDefinition (com.revolsys.record.schema.FieldDefinition)3 CompoundCoordinateSystem (com.revolsys.geometry.cs.CompoundCoordinateSystem)2