@Override protected void drawLayers(boolean recreate) { drawingLock.lock(); try { if (mapContent != null && !mapContent.layers().isEmpty() && !mapContent.getViewport().isEmpty() && acceptRepaintRequests.get()) { getRenderingExecutor().submit(mapContent, getOperands(recreate), this); } } finally { drawingLock.unlock(); } }
throw new IllegalArgumentException("graphics must not be null"); if (mapContent.getViewport().isEmpty()) { throw new IllegalArgumentException("The viewport must not be empty");
try { if (mapContent != null && !mapContent.getViewport().isEmpty() && acceptRepaintRequests.get()) {
throw new IllegalArgumentException("mapContent must not be null"); if (mapContent.getViewport().isEmpty()) { throw new IllegalArgumentException("The viewport must not be empty");
@Test public void boundsCtor() { MapViewport vp = new MapViewport(WORLD_1_1); assertTrue(vp.isEmpty()); assertFalse(vp.isMatchingAspectRatio()); assertTrue(vp.getScreenArea().isEmpty()); assertTrue(WORLD_1_1.boundsEquals2D(vp.getBounds(), TOL)); }
@Test public void fullCtor() { MapViewport vp = new MapViewport(WORLD_1_1, true); assertTrue(vp.isEmpty()); assertTrue(vp.isMatchingAspectRatio()); assertTrue(vp.getScreenArea().isEmpty()); assertTrue(WORLD_1_1.boundsEquals2D(vp.getBounds(), TOL)); }
@Test public void booleanCtor() { MapViewport vp = new MapViewport(true); assertTrue(vp.isEmpty()); assertTrue(vp.isMatchingAspectRatio()); assertTrue(vp.getBounds().isEmpty()); assertTrue(vp.getScreenArea().isEmpty()); }
@Test public void defaultCtor() { MapViewport vp = new MapViewport(); assertFalse(vp.isMatchingAspectRatio()); assertTrue(vp.isEmpty()); assertTrue(vp.getBounds().isEmpty()); assertTrue(vp.getScreenArea().isEmpty()); assertNull(vp.getCoordinateReferenceSystem()); }
@Override protected void drawLayers(boolean recreate) { drawingLock.lock(); try { if (mapContent != null && !mapContent.layers().isEmpty() && !mapContent.getViewport().isEmpty() && acceptRepaintRequests.get()) { getRenderingExecutor().submit(mapContent, getOperands(recreate), this); } } finally { drawingLock.unlock(); } }
@Override protected void drawLayers(boolean createNewImage) { drawingLock.lock(); try { if (mapContent != null && !mapContent.getViewport().isEmpty() && acceptRepaintRequests.get()) { Rectangle r = getVisibleRect(); if (baseImage == null || createNewImage) { baseImage = GraphicsEnvironment.getLocalGraphicsEnvironment(). getDefaultScreenDevice().getDefaultConfiguration(). createCompatibleImage(r.width, r.height, Transparency.TRANSLUCENT); if (baseImageGraphics != null) { baseImageGraphics.dispose(); } baseImageGraphics = baseImage.createGraphics(); clearLabelCache.set(true); } else { baseImageGraphics.setBackground(getBackground()); baseImageGraphics.clearRect(0, 0, r.width, r.height); } if (mapContent != null && !mapContent.layers().isEmpty()) { getRenderingExecutor().submit(mapContent, getRenderer(), baseImageGraphics, this); } } } finally { drawingLock.unlock(); } }
throw new IllegalArgumentException("graphics must not be null"); if (mapContent.getViewport().isEmpty()) { throw new IllegalArgumentException("The viewport must not be empty");
try { if (mapContent != null && !mapContent.getViewport().isEmpty() && acceptRepaintRequests.get()) {
throw new IllegalArgumentException("mapContent must not be null"); if (mapContent.getViewport().isEmpty()) { throw new IllegalArgumentException("The viewport must not be empty");