use of com.revolsys.swing.map.ProjectFrame in project com.revolsys.open by revolsys.
the class AbstractLayer method delete.
@Override
public void delete() {
this.deleted = true;
setExists(false);
this.beanPropertyListener = null;
final ProjectFrame projectFrame = ProjectFrame.get(this);
if (projectFrame != null) {
projectFrame.removeBottomTab(this);
}
firePropertyChange("deleted", false, true);
final LayerGroup layerGroup = getLayerGroup();
if (layerGroup != null) {
layerGroup.removeLayer(this);
this.layerGroup = new EmptyReference<>();
}
this.eventsEnabled.closeable(false);
final PropertyChangeSupport propertyChangeSupport = this.propertyChangeSupport;
if (propertyChangeSupport != null) {
Property.removeAllListeners(propertyChangeSupport);
this.propertyChangeSupport = null;
}
if (this.renderer != null) {
this.renderer.setLayer(null);
}
}
use of com.revolsys.swing.map.ProjectFrame in project com.revolsys.open by revolsys.
the class Project method toMap.
@Override
public MapEx toMap() {
final MapEx map = super.toMap();
BoundingBox boundingBox = getViewBoundingBox();
if (!RectangleUtil.isEmpty(boundingBox)) {
BoundingBox defaultBoundingBox = null;
final GeometryFactory geometryFactory = getGeometryFactory();
if (geometryFactory != null) {
final CoordinateSystem coordinateSystem = geometryFactory.getCoordinateSystem();
if (coordinateSystem != null) {
defaultBoundingBox = coordinateSystem.getAreaBoundingBox();
}
boundingBox = boundingBox.convert(geometryFactory);
}
addToMap(map, "viewBoundingBox", boundingBox, defaultBoundingBox);
final Map<String, BoundingBox> zoomBookmarks = getZoomBookmarks();
addToMap(map, "zoomBookmarks", zoomBookmarks);
}
final ProjectFrame projectFrame = ProjectFrame.get(this);
if (projectFrame != null) {
final Rectangle frameBounds = projectFrame.getBounds();
if (frameBounds != null) {
map.put("frameBounds", Arrays.asList(frameBounds.x, frameBounds.y, frameBounds.width, frameBounds.height));
}
}
return map;
}
Aggregations