Search in sources :

Example 26 with BaseCloseable

use of com.revolsys.io.BaseCloseable in project com.revolsys.open by revolsys.

the class GeoreferencedImageLayerRenderer method renderDifferentCoordinateSystem.

public static void renderDifferentCoordinateSystem(final Viewport2D viewport, final Graphics2D graphics, final BoundingBox boundingBox) {
    if (!boundingBox.isSameCoordinateSystem(viewport)) {
        try (BaseCloseable transformCloseable = viewport.setUseModelCoordinates(true)) {
            final Polygon polygon = boundingBox.toPolygon(0);
            viewport.drawGeometryOutline(polygon, STYLE_DIFFERENT_COORDINATE_SYSTEM);
        }
    }
}
Also used : BaseCloseable(com.revolsys.io.BaseCloseable) Polygon(com.revolsys.geometry.model.Polygon)

Example 27 with BaseCloseable

use of com.revolsys.io.BaseCloseable in project com.revolsys.open by revolsys.

the class LayerRecordForm method setRecordDo.

protected void setRecordDo(final LayerRecord record) {
    if (!isSame(record)) {
        requestFocusInWindow();
    }
    if (this.undoManager != null) {
        try (final BaseCloseable cu = this.undoManager.setEventsEnabled(false);
            final BaseCloseable c = setFieldValidationEnabled(false)) {
            this.record = record;
            this.fieldsTableModel.setRecord(record);
            fireButtonPropertyChanges();
            setValues(record);
            this.undoManager.discardAllEdits();
        }
    }
}
Also used : BaseCloseable(com.revolsys.io.BaseCloseable)

Example 28 with BaseCloseable

use of com.revolsys.io.BaseCloseable in project com.revolsys.open by revolsys.

the class AbstractLayer method initializeForce.

protected void initializeForce() {
    try {
        final boolean exists;
        try (BaseCloseable eventsDisabled = eventsDisabled()) {
            exists = initializeDo();
        }
        setExists(exists);
        if (exists && Property.getBoolean(this, "showTableView")) {
            Invoke.later(this::showTableView);
        }
    } catch (final RuntimeException e) {
        Logs.error(this, getPath() + ": Unable to initialize layer", e);
        setExists(false);
    } finally {
        setInitialized(true);
    }
}
Also used : BaseCloseable(com.revolsys.io.BaseCloseable)

Example 29 with BaseCloseable

use of com.revolsys.io.BaseCloseable in project com.revolsys.open by revolsys.

the class FieldFilterPanel method clear.

public void clear() {
    Invoke.later(() -> {
        try (BaseCloseable settingFilter = this.settingFilter.closeable(true)) {
            String searchField = this.previousSearchFieldName;
            if (!Property.hasValue(searchField)) {
                searchField = this.recordDefinition.getFieldNames().get(0);
            }
            setSearchFieldName(searchField);
            setFilter(Condition.ALL);
        }
    });
}
Also used : BaseCloseable(com.revolsys.io.BaseCloseable)

Example 30 with BaseCloseable

use of com.revolsys.io.BaseCloseable in project com.revolsys.open by revolsys.

the class AbstractRecordLayerRenderer method render.

@Override
public void render(final Viewport2D viewport, final Cancellable cancellable, final AbstractRecordLayer layer) {
    if (layer.hasGeometryField()) {
        final BoundingBox boundingBox = viewport.getBoundingBox();
        final List<LayerRecord> records = layer.getRecordsBackground(boundingBox);
        try (BaseCloseable transformCloseable = viewport.setUseModelCoordinates(true)) {
            renderRecords(viewport, cancellable, layer, records);
        }
    }
}
Also used : BaseCloseable(com.revolsys.io.BaseCloseable) BoundingBox(com.revolsys.geometry.model.BoundingBox) LayerRecord(com.revolsys.swing.map.layer.record.LayerRecord)

Aggregations

BaseCloseable (com.revolsys.io.BaseCloseable)46 Point (com.revolsys.geometry.model.Point)9 BoundingBox (com.revolsys.geometry.model.BoundingBox)8 Geometry (com.revolsys.geometry.model.Geometry)7 GeometryFactory (com.revolsys.geometry.model.GeometryFactory)6 Polygon (com.revolsys.geometry.model.Polygon)6 Record (com.revolsys.record.Record)5 LineString (com.revolsys.geometry.model.LineString)4 Identifier (com.revolsys.identifier.Identifier)4 RecordReader (com.revolsys.record.io.RecordReader)4 Graphics2D (java.awt.Graphics2D)4 ArrayList (java.util.ArrayList)4 Vertex (com.revolsys.geometry.model.vertex.Vertex)3 RecordDefinition (com.revolsys.record.schema.RecordDefinition)3 CloseableAffineTransform (com.revolsys.awt.CloseableAffineTransform)2 GeoreferencedImage (com.revolsys.raster.GeoreferencedImage)2 ArrayRecord (com.revolsys.record.ArrayRecord)2 RecordStore (com.revolsys.record.schema.RecordStore)2 Resource (com.revolsys.spring.resource.Resource)2 MapPanel (com.revolsys.swing.map.MapPanel)2