68 |
import org.geotools.renderer.label.LabelCacheImpl; |
import org.geotools.renderer.label.LabelCacheImpl; |
69 |
import org.geotools.renderer.lite.LabelCache; |
import org.geotools.renderer.lite.LabelCache; |
70 |
import org.geotools.swing.JMapPane; |
import org.geotools.swing.JMapPane; |
|
import org.geotools.swing.RenderingExecutor; |
|
71 |
import org.geotools.swing.event.MapMouseEvent; |
import org.geotools.swing.event.MapMouseEvent; |
72 |
import org.geotools.swing.event.MapPaneEvent; |
import org.geotools.swing.event.MapPaneEvent; |
73 |
import org.geotools.swing.event.MapPaneListener; |
import org.geotools.swing.event.MapPaneListener; |
84 |
import schmitzm.geotools.map.event.JMapPaneListener; |
import schmitzm.geotools.map.event.JMapPaneListener; |
85 |
import schmitzm.geotools.map.event.MapLayerAdapter; |
import schmitzm.geotools.map.event.MapLayerAdapter; |
86 |
import schmitzm.swing.SwingUtil; |
import schmitzm.swing.SwingUtil; |
87 |
|
import skrueger.geotools.RenderingExecutor; |
88 |
|
|
89 |
import com.vividsolutions.jts.geom.Coordinate; |
import com.vividsolutions.jts.geom.Coordinate; |
90 |
import com.vividsolutions.jts.geom.Envelope; |
import com.vividsolutions.jts.geom.Envelope; |
174 |
* @see #setState(int) |
* @see #setState(int) |
175 |
*/ |
*/ |
176 |
public static final int SELECT_ONE_FROM_TOP = 104; |
public static final int SELECT_ONE_FROM_TOP = 104; |
177 |
|
// |
178 |
|
// /** |
179 |
|
// * While threads are working, we call {@link XMapPane#updateFinalImage()} |
180 |
|
// * regularly and repaint(). This {@link Timer} is stopped when all renderers |
181 |
|
// * have finished. |
182 |
|
// */ |
183 |
|
// final private Timer repainterTimer; |
184 |
|
// |
185 |
|
// /** |
186 |
|
// * While the {@link #bgExecuter} and {@link #localExecuter} are rendering, |
187 |
|
// * the {@link #repainterTimer} is regularly updating the {@link #finalImage} |
188 |
|
// * with previews. |
189 |
|
// */ |
190 |
|
// public static final long REPEATING_REPAINT_DELAY = 500; |
191 |
|
// |
192 |
|
// /** |
193 |
|
// * The initial delay in milliseconds until the {@link #finalImage} is updated the first time. |
194 |
|
// */ |
195 |
|
// public static final long INITIAL_REPAINT_DELAY = 333; |
196 |
|
|
197 |
public static final long DEFAULT_REPAINTING_DELAY = 200; |
protected RenderingExecutor bgExecuter; |
|
|
|
|
protected skrueger.geotools.RenderingExecutor bgExecuter; |
|
198 |
|
|
199 |
/** |
/** |
200 |
* the map context to render |
* the map context to render |
235 |
/** |
/** |
236 |
* compass and icon are rendered into this image |
* compass and icon are rendered into this image |
237 |
*/ |
*/ |
238 |
// protected BufferedImage gadgetsImage; |
// protected BufferedImage gadgetsImage; |
239 |
|
|
240 |
/** |
/** |
241 |
* The default state is ZOOM_IN, hence by default the |
* The default state is ZOOM_IN, hence by default the |
264 |
|
|
265 |
// aktuelle Geo-Position ueber Transformation des JMapPane berechnen |
// aktuelle Geo-Position ueber Transformation des JMapPane berechnen |
266 |
if (e != null && e.getSource() instanceof XMapPane) { |
if (e != null && e.getSource() instanceof XMapPane) { |
267 |
|
|
268 |
final XMapPane xMapPane = (XMapPane) e.getSource(); |
final XMapPane xMapPane = (XMapPane) e.getSource(); |
269 |
|
|
270 |
if (!xMapPane.isWellDefined()) return null; |
if (!xMapPane.isWellDefined()) |
271 |
|
return null; |
272 |
|
|
273 |
AffineTransform at = xMapPane.getScreenToWorld(); |
AffineTransform at = xMapPane.getScreenToWorld(); |
274 |
if (at != null) |
if (at != null) |
275 |
return at.transform(e.getPoint(), null); |
return at.transform(e.getPoint(), null); |
314 |
protected boolean paneResized = false; |
protected boolean paneResized = false; |
315 |
|
|
316 |
/** |
/** |
|
* While threads are working, we call {@link XMapPane#updateFinalImage()} |
|
|
* regularly and repaint(). This {@link Timer} is stoppen when all renderers |
|
|
* finished. |
|
|
*/ |
|
|
final private Timer repainterTimer; |
|
|
|
|
|
/** |
|
317 |
* The flag {@link #requestStartRendering} can be set to true by events. |
* The flag {@link #requestStartRendering} can be set to true by events. |
318 |
* This {@link Timer} checks the flag regularly and starts one renderer |
* This {@link Timer} checks the flag regularly and starts one renderer |
319 |
* thread. |
* thread. |
415 |
|
|
416 |
}); |
}); |
417 |
|
|
418 |
repainterTimer = new Timer((int) DEFAULT_REPAINTING_DELAY, |
// repainterTimer = new Timer((int) REPEATING_REPAINT_DELAY, |
419 |
new ActionListener() { |
// new ActionListener() { |
420 |
|
// |
421 |
@Override |
// @Override |
422 |
public void actionPerformed(ActionEvent e) { |
// public void actionPerformed(ActionEvent e) { |
423 |
updateFinalImage(); |
// updateFinalImage(); |
424 |
XMapPane.this.repaint(DEFAULT_REPAINTING_DELAY); |
// XMapPane.this.repaint(); |
425 |
} |
// } |
426 |
}); |
// }); |
427 |
repainterTimer.setInitialDelay(1000); |
// repainterTimer.setInitialDelay(300); |
428 |
repainterTimer.setRepeats(true); |
// repainterTimer.setRepeats(true); |
429 |
|
|
430 |
startRenderThreadsTimer = new Timer(200, new ActionListener() { |
startRenderThreadsTimer = new Timer(200, new ActionListener() { |
431 |
|
|
543 |
* {@link XMapPane} is visible and has bounds set. |
* {@link XMapPane} is visible and has bounds set. |
544 |
*/ |
*/ |
545 |
public boolean isWellDefined() { |
public boolean isWellDefined() { |
546 |
|
|
547 |
try { |
try { |
548 |
|
|
549 |
if (getContext() == null) |
if (getContext() == null) |
550 |
return false; |
return false; |
551 |
if (getContext().getLayerCount() <= 0) |
if (getContext().getLayerCount() <= 0) |
552 |
return false; |
return false; |
553 |
if (getMapArea() == null) |
if (getMapArea() == null) |
554 |
return false; |
return false; |
555 |
if (getBounds().getWidth() == 0) |
if (getBounds().getWidth() == 0) |
556 |
return false; |
return false; |
557 |
if (getBounds().getHeight() == 0) |
if (getBounds().getHeight() == 0) |
558 |
return false; |
return false; |
559 |
} catch (Exception e) { |
} catch (Exception e) { |
560 |
return false; |
return false; |
561 |
} |
} |
620 |
setCursor(WAIT_CURSOR); |
setCursor(WAIT_CURSOR); |
621 |
return; |
return; |
622 |
} else { |
} else { |
623 |
// Allow one last rendering |
// // Allow one last rendering |
624 |
if (repainterTimer.isRunning()) { |
// if (repainterTimer.isRunning()) { |
625 |
repainterTimer.stop(); |
// repainterTimer.stop(); |
626 |
updateFinalImage(); |
// updateFinalImage(); |
627 |
repaint(); |
// repaint(); |
628 |
} |
// } |
629 |
} |
} |
630 |
|
|
631 |
// wenn manueller Cursor gesetzt ist, dann diesen verwenden (unabhaengig |
// wenn manueller Cursor gesetzt ist, dann diesen verwenden (unabhaengig |
1026 |
return false; |
return false; |
1027 |
} |
} |
1028 |
|
|
1029 |
// Testen, ob der Unterschied nur im minimalen Rundungsfehlerbereich |
// Testing, whether NaN or Infinity are used in the newMapArea |
1030 |
// liegt |
if (newMapArea.isNull() || Double.isInfinite(newMapArea.getMaxX()) |
1031 |
|
|| Double.isInfinite(newMapArea.getMaxY()) |
1032 |
|
|| Double.isInfinite(newMapArea.getMinX()) |
1033 |
|
|| Double.isInfinite(newMapArea.getMinY())) { |
1034 |
|
// No change.. ugly new values |
1035 |
|
LOGGER.warn("setMapArea has been called with newArea = " |
1036 |
|
+ newMapArea); |
1037 |
|
return false; |
1038 |
|
} |
1039 |
|
|
1040 |
|
// Testing, whether the difference if just minimal |
1041 |
if (mapArea != null) { |
if (mapArea != null) { |
1042 |
Envelope candNew = bestAllowedMapArea(newMapArea); |
Envelope candNew = bestAllowedMapArea(newMapArea); |
1043 |
double tolX = mapArea.getWidth() / 1000.; |
double tolX = mapArea.getWidth() / 1000.; |
1077 |
mapImageInvalid = true; |
mapImageInvalid = true; |
1078 |
mapAreaChanged = true; |
mapAreaChanged = true; |
1079 |
repaint(); |
repaint(); |
1080 |
|
|
1081 |
|
LOGGER.debug("New maparea = " + mapArea); |
1082 |
return true; |
return true; |
1083 |
} |
} |
1084 |
|
|
1111 |
|
|
1112 |
public static final int NONE = -123; |
public static final int NONE = -123; |
1113 |
|
|
1114 |
private skrueger.geotools.RenderingExecutor localExecuter; |
private RenderingExecutor localExecuter; |
1115 |
|
|
1116 |
private BufferedImage finalImage; |
private BufferedImage finalImage; |
1117 |
|
|
1167 |
finalImage = null; |
finalImage = null; |
1168 |
localImage = null; |
localImage = null; |
1169 |
bgImage = null; |
bgImage = null; |
1170 |
// gadgetsImage = null; |
// gadgetsImage = null; |
1171 |
} |
} |
1172 |
|
|
1173 |
// Start the Threads and Timers to render the image |
// Start the Threads and Timers to render the image |
1296 |
(int) visibleArea.getMinX(), (int) visibleArea.getMinY(), |
(int) visibleArea.getMinX(), (int) visibleArea.getMinY(), |
1297 |
(int) visibleArea.getMaxX(), (int) visibleArea.getMaxY(), |
(int) visibleArea.getMaxX(), (int) visibleArea.getMaxY(), |
1298 |
getMapBackgroundColor(), null); |
getMapBackgroundColor(), null); |
|
|
|
1299 |
|
|
1300 |
Rectangle painedArea = new Rectangle(xx1, yy1, xx2 - xx1, yy2 - yy1); |
Rectangle painedArea = new Rectangle(xx1, yy1, xx2 - xx1, yy2 - yy1); |
1301 |
|
|
1302 |
SwingUtil.clearAround(graphics, painedArea, visibleArea); |
SwingUtil.clearAround(graphics, painedArea, visibleArea); |
1303 |
|
|
1304 |
addGadgets(graphics); |
addGadgets(graphics); |
1305 |
// graphics.drawImage(getGadgetsImage(), 0,0, (int) visibleArea.getMaxX(), (int) visibleArea.getMaxY(),null); |
// graphics.drawImage(getGadgetsImage(), 0,0, (int) |
1306 |
|
// visibleArea.getMaxX(), (int) visibleArea.getMaxY(),null); |
1307 |
|
|
1308 |
quickPreviewHint = 0; |
quickPreviewHint = 0; |
1309 |
|
|
1311 |
// Something has been drawn |
// Something has been drawn |
1312 |
return true; |
return true; |
1313 |
} |
} |
1314 |
|
|
1315 |
final static Font waitFont = new Font("Arial", Font.BOLD, 30); |
final static Font waitFont = new Font("Arial", Font.BOLD, 30); |
1316 |
|
|
1317 |
/** |
/** |
1318 |
* Paints some optinal stuff into the given {@link Graphics2D}. Usually called as the last paint on the mapImage. |
* Paints some optinal stuff into the given {@link Graphics2D}. Usually |
1319 |
|
* called as the last paint on the mapImage. |
1320 |
*/ |
*/ |
1321 |
private void addGadgets(Graphics2D graphics) { |
private void addGadgets(Graphics2D graphics) { |
1322 |
|
|
1323 |
if (mapImage != null) |
if (mapImage != null) |
1324 |
graphics.drawImage(mapImage, |
graphics.drawImage(mapImage, getBounds().width |
1325 |
getBounds().width - mapImage.getWidth() - 10, |
- mapImage.getWidth() - 10, getBounds().height |
1326 |
getBounds().height - mapImage.getHeight() - 10, this); |
- mapImage.getHeight() - 10, this); |
1327 |
|
|
1328 |
// If still rendering, paint a gray shadow or so... |
// If still rendering, paint a gray shadow or so... |
1329 |
if (bgExecuter != null && bgExecuter.isRunning() |
if (bgExecuter != null && bgExecuter.isRunning() |
1330 |
|| localExecuter != null && localExecuter.isRunning()) { |
|| localExecuter != null && localExecuter.isRunning()) { |
1331 |
graphics.setColor(Color.BLACK); |
graphics.setColor(Color.BLACK); |
1332 |
|
|
1333 |
graphics.setFont(waitFont); |
graphics.setFont(waitFont); |
1334 |
graphics.drawString("Wait...", 40, 70); |
graphics.drawString("Wait...", 40, 70); |
1335 |
} |
} |
1336 |
|
|
1337 |
} |
} |
1338 |
|
|
1339 |
/** |
/** |
1345 |
|
|
1346 |
final Graphics2D finalG = (Graphics2D) getFinalImage().getGraphics(); |
final Graphics2D finalG = (Graphics2D) getFinalImage().getGraphics(); |
1347 |
finalG.setBackground(getMapBackgroundColor()); |
finalG.setBackground(getMapBackgroundColor()); |
1348 |
|
|
|
|
|
1349 |
// Render the two map images first, into the preFinalImage |
// Render the two map images first, into the preFinalImage |
1350 |
{ |
{ |
1351 |
final Graphics2D preFinalG = (Graphics2D) getPreFinalImage().getGraphics(); |
final Graphics2D preFinalG = (Graphics2D) getPreFinalImage() |
1352 |
|
.getGraphics(); |
1353 |
preFinalG.setBackground(getMapBackgroundColor()); |
preFinalG.setBackground(getMapBackgroundColor()); |
1354 |
|
|
1355 |
preFinalG.drawImage(getBgImage(), 0, 0, |
preFinalG.drawImage(getBgImage(), 0, 0, getMapBackgroundColor(), |
1356 |
getMapBackgroundColor(), null); |
null); |
1357 |
// // Draw the local layers image |
// // Draw the local layers image |
1358 |
preFinalG.drawImage(getLocalImage(), 0, 0, null); |
preFinalG.drawImage(getLocalImage(), 0, 0, null); |
1359 |
preFinalG.dispose(); |
preFinalG.dispose(); |
1360 |
} |
} |
1361 |
|
|
1362 |
finalG.drawImage(getPreFinalImage(), imageOrigin.x, imageOrigin.y, |
finalG.drawImage(getPreFinalImage(), imageOrigin.x, imageOrigin.y, |
1363 |
getMapBackgroundColor(), null); |
getMapBackgroundColor(), null); |
1364 |
|
|
1383 |
SwingUtil.clearAround(finalG, painedArea, getVisibleRect()); |
SwingUtil.clearAround(finalG, painedArea, getVisibleRect()); |
1384 |
|
|
1385 |
addGadgets(finalG); |
addGadgets(finalG); |
1386 |
// finalG.drawImage(getGadgetsImage(), 0, 0, null); |
// finalG.drawImage(getGadgetsImage(), 0, 0, null); |
1387 |
|
|
1388 |
finalG.dispose(); |
finalG.dispose(); |
1389 |
|
|
1411 |
} |
} |
1412 |
return finalImage; |
return finalImage; |
1413 |
} |
} |
1414 |
|
|
1415 |
private Image getPreFinalImage() { |
private Image getPreFinalImage() { |
1416 |
|
|
1417 |
if (preFinalImage == null) { |
if (preFinalImage == null) { |
1418 |
preFinalImage = null; |
preFinalImage = null; |
1419 |
Rectangle curPaintArea = getVisibleRect(); |
Rectangle curPaintArea = getVisibleRect(); |
1420 |
|
|
1421 |
preFinalImage = new BufferedImage(curPaintArea.width, |
preFinalImage = new BufferedImage(curPaintArea.width, |
1422 |
curPaintArea.height, BufferedImage.TYPE_INT_RGB); |
curPaintArea.height, BufferedImage.TYPE_INT_RGB); |
1423 |
|
|
1424 |
requestStartRendering(); |
requestStartRendering(); |
1425 |
} |
} |
1426 |
return preFinalImage; |
return preFinalImage; |
1487 |
*/ |
*/ |
1488 |
|
|
1489 |
if (getBgContext() != null) { |
if (getBgContext() != null) { |
1490 |
bgExecuter = new skrueger.geotools.RenderingExecutor(this); |
bgExecuter = new RenderingExecutor(this, 333l); |
1491 |
LOGGER.debug("starting bg renderer:"); |
LOGGER.debug("starting bg renderer:"); |
1492 |
// /* System.out.println("rendering"); */ |
// /* System.out.println("rendering"); */ |
1493 |
final GTRenderer createGTRenderer = GTUtil.createGTRenderer( |
final GTRenderer createGTRenderer = GTUtil.createGTRenderer( |
1498 |
} |
} |
1499 |
|
|
1500 |
if (getContext() != null) { |
if (getContext() != null) { |
1501 |
localExecuter = new skrueger.geotools.RenderingExecutor(this); |
localExecuter = new RenderingExecutor(this, 150l); |
1502 |
LOGGER.debug("starting local renderer:"); |
LOGGER.debug("starting local renderer:"); |
1503 |
final GTRenderer createGTRenderer = GTUtil.createGTRenderer( |
final GTRenderer createGTRenderer = GTUtil.createGTRenderer( |
1504 |
localContext, getRendererHints()); |
localContext, getRendererHints()); |
1509 |
} |
} |
1510 |
|
|
1511 |
updateCursorAndRepaintTimer(); |
updateCursorAndRepaintTimer(); |
1512 |
|
// |
1513 |
// start regular repaints until all renderers are done. |
// // start regular repaints until all renderers are done. |
1514 |
repainterTimer.setRepeats(true); |
// repainterTimer.setRepeats(true); |
1515 |
repainterTimer.restart(); |
// repainterTimer.restart(); |
1516 |
|
|
1517 |
} |
} |
1518 |
|
|
1559 |
*/ |
*/ |
1560 |
public void setMapImage(BufferedImage mapImage) { |
public void setMapImage(BufferedImage mapImage) { |
1561 |
this.mapImage = mapImage; |
this.mapImage = mapImage; |
1562 |
// gadgetsImage = null; |
// gadgetsImage = null; |
1563 |
} |
} |
1564 |
|
|
1565 |
/** |
/** |
1581 |
|
|
1582 |
return localImage; |
return localImage; |
1583 |
} |
} |
1584 |
// |
|
1585 |
// /** |
// |
1586 |
// * Lazyly initializes a {@link BufferedImage} for the background renderer. |
// /** |
1587 |
// */ |
// * Lazyly initializes a {@link BufferedImage} for the background renderer. |
1588 |
// private BufferedImage getGadgetsImage() { |
// */ |
1589 |
// |
// private BufferedImage getGadgetsImage() { |
1590 |
// if (gadgetsImage == null) { |
// |
1591 |
// LOGGER.debug("creating a new gadgets image"); |
// if (gadgetsImage == null) { |
1592 |
// |
// LOGGER.debug("creating a new gadgets image"); |
1593 |
// Rectangle curPaintArea = getVisibleRect(); |
// |
1594 |
// // allow a single pixel margin at the right and bottom edges |
// Rectangle curPaintArea = getVisibleRect(); |
1595 |
// curPaintArea.width -= 1; |
// // allow a single pixel margin at the right and bottom edges |
1596 |
// curPaintArea.height -= 1; |
// curPaintArea.width -= 1; |
1597 |
// |
// curPaintArea.height -= 1; |
1598 |
// gadgetsImage = new BufferedImage(curPaintArea.width + 1, |
// |
1599 |
// curPaintArea.height + 1, BufferedImage.TYPE_INT_ARGB); |
// gadgetsImage = new BufferedImage(curPaintArea.width + 1, |
1600 |
// |
// curPaintArea.height + 1, BufferedImage.TYPE_INT_ARGB); |
1601 |
// if (mapImage != null) |
// |
1602 |
// gadgetsImage.getGraphics().drawImage(mapImage, |
// if (mapImage != null) |
1603 |
// curPaintArea.width - mapImage.getWidth() - 10, |
// gadgetsImage.getGraphics().drawImage(mapImage, |
1604 |
// curPaintArea.height - mapImage.getHeight() - 10, this); |
// curPaintArea.width - mapImage.getWidth() - 10, |
1605 |
// |
// curPaintArea.height - mapImage.getHeight() - 10, this); |
1606 |
// } |
// |
1607 |
// |
// } |
1608 |
// return gadgetsImage; |
// |
1609 |
// } |
// return gadgetsImage; |
1610 |
|
// } |
1611 |
|
|
1612 |
/** |
/** |
1613 |
* Called by the {@linkplain XMapPane.RenderingTask} when rendering has been |
* Called by the {@linkplain XMapPane.RenderingTask} when rendering has been |
2045 |
} |
} |
2046 |
|
|
2047 |
startRenderThreadsTimer.stop(); |
startRenderThreadsTimer.stop(); |
2048 |
repainterTimer.stop(); |
// repainterTimer.stop(); |
2049 |
|
|
2050 |
if (bgImage != null) |
if (bgImage != null) |
2051 |
bgImage.flush(); |
bgImage.flush(); |
2052 |
if (localImage != null) |
if (localImage != null) |
2053 |
localImage.flush(); |
localImage.flush(); |
2054 |
// if (gadgetsImage != null) |
// if (gadgetsImage != null) |
2055 |
// gadgetsImage.flush(); |
// gadgetsImage.flush(); |
2056 |
if (finalImage != null) |
if (finalImage != null) |
2057 |
finalImage.flush(); |
finalImage.flush(); |
2058 |
if (preFinalImage != null) |
if (preFinalImage != null) |
2112 |
|
|
2113 |
Point2D gcenter = getScreenToWorld().transform(center, null); |
Point2D gcenter = getScreenToWorld().transform(center, null); |
2114 |
center = null; |
center = null; |
2115 |
|
|
2116 |
if ( |
if (Double.isNaN(gcenter.getX()) || Double.isNaN(gcenter.getY()) |
2117 |
Double.isNaN(gcenter.getX()) || Double.isNaN(gcenter.getY()) |
|| Double.isInfinite(gcenter.getX()) |
2118 |
|| |
|| Double.isInfinite(gcenter.getY()) |
2119 |
Double.isInfinite(gcenter.getX()) || Double.isInfinite(gcenter.getY()) |
|
|
|
|
2120 |
) { |
) { |
2121 |
// Not inside valid CRS area! cancel |
// Not inside valid CRS area! cancel |
2122 |
return; |
return; |
2123 |
} |
} |
2124 |
|
|
2125 |
final Envelope mapArea = getMapArea(); |
final Envelope mapArea = getMapArea(); |
2126 |
|
|
2127 |
Envelope newMapArea = new Envelope(mapArea); |
Envelope newMapArea = new Envelope(mapArea); |
2128 |
newMapArea |
newMapArea.expandBy((mapArea.getWidth() * zoomFaktor - mapArea |
2129 |
.expandBy((mapArea.getWidth() * zoomFaktor - mapArea |
.getWidth()) / 2., (mapArea.getHeight() * zoomFaktor - mapArea |
2130 |
.getWidth()) / 2., (mapArea.getHeight() |
.getHeight()) / 2.); |
|
* zoomFaktor - mapArea.getHeight()) / 2.); |
|
2131 |
|
|
2132 |
// Move the newMapArea above the new center |
// Move the newMapArea above the new center |
2133 |
newMapArea.translate(gcenter.getX() - mapArea.centre().x, gcenter.getY() |
newMapArea.translate(gcenter.getX() - mapArea.centre().x, gcenter |
2134 |
|
.getY() |
2135 |
- mapArea.centre().y); |
- mapArea.centre().y); |
2136 |
|
|
2137 |
setMapArea(newMapArea); |
setMapArea(newMapArea); |
2256 |
imageOrigin.x = 0; |
imageOrigin.x = 0; |
2257 |
imageOrigin.y = 0; |
imageOrigin.y = 0; |
2258 |
|
|
2259 |
if (!setMapArea(newMapArea)){ |
if (!setMapArea(newMapArea)) { |
2260 |
updateFinalImage(); |
updateFinalImage(); |
2261 |
repaint(); |
repaint(); |
2262 |
} |
} |
2265 |
setCursor(SwingUtil.PAN_CURSOR); |
setCursor(SwingUtil.PAN_CURSOR); |
2266 |
} |
} |
2267 |
|
|
2268 |
|
public void onRenderingPending() { |
2269 |
|
LOGGER.debug("Pending rendering updates the preview..."); |
2270 |
|
updateFinalImage(); |
2271 |
|
XMapPane.this.repaint(); |
2272 |
|
} |
2273 |
|
|
2274 |
} |
} |