Search in sources :

Example 1 with NullLayer

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

the class LayerRendererOverlay method paintComponent.

@Override
public void paintComponent(final Graphics g) {
    if (!(this.layer instanceof NullLayer)) {
        GeoreferencedImage image;
        synchronized (this.loadSync) {
            image = this.image;
            if ((image == null || this.loadImage) && this.imageWorker == null) {
                final BoundingBox boundingBox = this.viewport.getBoundingBox();
                final int viewWidthPixels = this.viewport.getViewWidthPixels();
                final int viewHeightPixels = this.viewport.getViewHeightPixels();
                final GeoreferencedImage loadImage = new BufferedGeoreferencedImage(boundingBox, viewWidthPixels, viewHeightPixels);
                this.imageWorker = new LayerRendererOverlaySwingWorker(this, loadImage);
                Invoke.worker(this.imageWorker);
            }
        }
        if (image != null) {
            render((Graphics2D) g);
        }
    }
}
Also used : NullLayer(com.revolsys.swing.map.layer.NullLayer) BoundingBox(com.revolsys.geometry.model.BoundingBox) GeoreferencedImage(com.revolsys.raster.GeoreferencedImage) BufferedGeoreferencedImage(com.revolsys.raster.BufferedGeoreferencedImage) BufferedGeoreferencedImage(com.revolsys.raster.BufferedGeoreferencedImage)

Aggregations

BoundingBox (com.revolsys.geometry.model.BoundingBox)1 BufferedGeoreferencedImage (com.revolsys.raster.BufferedGeoreferencedImage)1 GeoreferencedImage (com.revolsys.raster.GeoreferencedImage)1 NullLayer (com.revolsys.swing.map.layer.NullLayer)1