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);
}
}
}
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();
}
}
}
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);
}
}
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);
}
});
}
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);
}
}
}
Aggregations