Search in sources :

Example 76 with LayerRecord

use of com.revolsys.swing.map.layer.record.LayerRecord in project com.revolsys.open by revolsys.

the class RecordStoreLayerTest method testNewRecordSaveChanges.

@Test
public void testNewRecordSaveChanges() {
    final LayerRecord testRecord = testNewRecord();
    this.layer.saveChanges();
    final List<LayerRecord> records2 = assertGetRecords(1);
    final LayerRecord actualRecord = assertRecordAtIndex(1, records2, 0, testRecord, IdentifierProxyLayerRecord.class);
    assertRecordCounts(0, 1, 0, 0);
    assertRecordState(testRecord, RecordState.PERSISTED);
    assertRecordState(actualRecord, RecordState.PERSISTED);
    Assert.assertFalse("Has Changes", this.layer.isHasChanges());
}
Also used : NewProxyLayerRecord(com.revolsys.swing.map.layer.record.NewProxyLayerRecord) IdentifierProxyLayerRecord(com.revolsys.swing.map.layer.record.IdentifierProxyLayerRecord) LayerRecord(com.revolsys.swing.map.layer.record.LayerRecord) Test(org.junit.Test)

Example 77 with LayerRecord

use of com.revolsys.swing.map.layer.record.LayerRecord in project com.revolsys.open by revolsys.

the class RecordStoreLayerTest method testNewRecordCancelChanges.

@Test
public void testNewRecordCancelChanges() {
    final LayerRecord testRecord = testNewRecord();
    this.layer.cancelChanges();
    assertRecordCounts(0, 0, 0, 0);
    assertRecordState(testRecord, RecordState.DELETED);
    Assert.assertFalse("Has Changes", this.layer.isHasChanges());
}
Also used : NewProxyLayerRecord(com.revolsys.swing.map.layer.record.NewProxyLayerRecord) IdentifierProxyLayerRecord(com.revolsys.swing.map.layer.record.IdentifierProxyLayerRecord) LayerRecord(com.revolsys.swing.map.layer.record.LayerRecord) Test(org.junit.Test)

Example 78 with LayerRecord

use of com.revolsys.swing.map.layer.record.LayerRecord in project com.revolsys.open by revolsys.

the class RecordStoreLayerTest method testNewRecordDelete.

@Test
public void testNewRecordDelete() {
    final LayerRecord testRecord = testNewRecord();
    this.layer.deleteRecord(testRecord);
    assertRecordCounts(0, 0, 0, 0);
    assertRecordState(testRecord, RecordState.DELETED);
    Assert.assertFalse("Has Changes", this.layer.isHasChanges());
}
Also used : NewProxyLayerRecord(com.revolsys.swing.map.layer.record.NewProxyLayerRecord) IdentifierProxyLayerRecord(com.revolsys.swing.map.layer.record.IdentifierProxyLayerRecord) LayerRecord(com.revolsys.swing.map.layer.record.LayerRecord) Test(org.junit.Test)

Example 79 with LayerRecord

use of com.revolsys.swing.map.layer.record.LayerRecord in project com.revolsys.open by revolsys.

the class DeleteLayerRecordUndo method undoDo.

@Override
protected void undoDo() {
    if (this.record == null && this.layer != null) {
        final LayerRecord newRecord = this.layer.newLayerRecord(this.originalValues);
        this.layer.saveChanges(newRecord);
        this.layer.addSelectedRecords(newRecord);
        this.record = newRecord;
    }
}
Also used : LayerRecord(com.revolsys.swing.map.layer.record.LayerRecord)

Aggregations

LayerRecord (com.revolsys.swing.map.layer.record.LayerRecord)79 AbstractRecordLayer (com.revolsys.swing.map.layer.record.AbstractRecordLayer)34 Geometry (com.revolsys.geometry.model.Geometry)15 IdentifierProxyLayerRecord (com.revolsys.swing.map.layer.record.IdentifierProxyLayerRecord)15 NewProxyLayerRecord (com.revolsys.swing.map.layer.record.NewProxyLayerRecord)15 BoundingBox (com.revolsys.geometry.model.BoundingBox)11 Record (com.revolsys.record.Record)11 ArrayList (java.util.ArrayList)11 List (java.util.List)10 Test (org.junit.Test)10 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)7 Point (com.revolsys.geometry.model.Point)6 Condition (com.revolsys.record.query.Condition)4 LayerRecordMenu (com.revolsys.swing.map.layer.record.LayerRecordMenu)4 CloseLocation (com.revolsys.swing.map.overlay.CloseLocation)4 RecordRowTable (com.revolsys.swing.table.record.RecordRowTable)4 LineString (com.revolsys.geometry.model.LineString)3 RecordDefinition (com.revolsys.record.schema.RecordDefinition)3 AbstractLayer (com.revolsys.swing.map.layer.AbstractLayer)3 Layer (com.revolsys.swing.map.layer.Layer)3