use of com.revolsys.swing.map.layer.Layer in project com.revolsys.open by revolsys.
the class SelectRecordsOverlay method unSelectRecords.
private void unSelectRecords(final LayerGroup group, final BoundingBox boundingBox) {
final double scale = getViewportScale();
final List<Layer> layers = group.getLayers();
Collections.reverse(layers);
for (final Layer layer : layers) {
if (layer instanceof LayerGroup) {
final LayerGroup childGroup = (LayerGroup) layer;
unSelectRecords(childGroup, boundingBox);
} else if (layer instanceof AbstractRecordLayer) {
final AbstractRecordLayer recordLayer = (AbstractRecordLayer) layer;
if (recordLayer.isSelectable(scale)) {
recordLayer.unSelectRecords(boundingBox);
}
}
}
}
use of com.revolsys.swing.map.layer.Layer in project com.revolsys.open by revolsys.
the class SelectRecordsOverlay method addSelectedRecords.
private void addSelectedRecords(final LayerGroup group, final BoundingBox boundingBox) {
final double scale = getViewportScale();
final List<Layer> layers = group.getLayers();
Collections.reverse(layers);
for (final Layer layer : layers) {
if (layer instanceof LayerGroup) {
final LayerGroup childGroup = (LayerGroup) layer;
addSelectedRecords(childGroup, boundingBox);
} else if (layer instanceof AbstractRecordLayer) {
final AbstractRecordLayer recordLayer = (AbstractRecordLayer) layer;
if (recordLayer.isSelectable(scale)) {
recordLayer.addSelectedRecords(boundingBox);
}
}
}
}
use of com.revolsys.swing.map.layer.Layer in project com.revolsys.open by revolsys.
the class SinglePage method print.
@Override
public int print(final Graphics graphics, final PageFormat pageFormat, final int pageIndex) throws PrinterException {
if (pageIndex == 0) {
setGraphics((Graphics2D) graphics);
final int translateX = (int) pageFormat.getImageableX();
final int translateY = (int) pageFormat.getImageableY();
graphics.translate(translateX - 1, translateY - 1);
final Project project = getProject();
final MapPanel mapPanel = project.getMapPanel();
final Layer baseMapLayer = mapPanel.getBaseMapLayer();
render(baseMapLayer);
render(project);
return PAGE_EXISTS;
} else {
return NO_SUCH_PAGE;
}
}
use of com.revolsys.swing.map.layer.Layer in project com.revolsys.open by revolsys.
the class SelectRecordsOverlay method refreshImageRenderer.
private void refreshImageRenderer(final ImageViewport viewport, final LayerGroup layerGroup) {
for (final Layer layer : layerGroup.getLayers()) {
if (layer instanceof LayerGroup) {
final LayerGroup childGroup = (LayerGroup) layer;
refreshImageRenderer(viewport, childGroup);
} else if (layer instanceof AbstractRecordLayer) {
final AbstractRecordLayer recordLayer = (AbstractRecordLayer) layer;
final AbstractRecordLayerRenderer layerRenderer = layer.getRenderer();
if (recordLayer.isSelectable()) {
final List<LayerRecord> selectedRecords = recordLayer.getSelectedRecords();
for (final LayerRecord record : selectedRecords) {
if (record != null && recordLayer.isVisible(record)) {
if (!recordLayer.isDeleted(record)) {
layerRenderer.renderSelectedRecord(viewport, recordLayer, record);
}
}
}
}
}
}
}
use of com.revolsys.swing.map.layer.Layer in project com.revolsys.open by revolsys.
the class SelectRecordsOverlay method selectRecords.
private void selectRecords(final LayerGroup group, final BoundingBox boundingBox) {
final double scale = getViewportScale();
final List<Layer> layers = group.getLayers();
Collections.reverse(layers);
for (final Layer layer : layers) {
if (layer instanceof LayerGroup) {
final LayerGroup childGroup = (LayerGroup) layer;
selectRecords(childGroup, boundingBox);
} else if (layer instanceof AbstractRecordLayer) {
final AbstractRecordLayer recordLayer = (AbstractRecordLayer) layer;
if (recordLayer.isSelectable(scale)) {
recordLayer.setSelectedRecords(boundingBox);
} else {
recordLayer.clearSelectedRecords();
}
}
}
}
Aggregations