104 |
// private static final int IMAGETYPE_withAlpha = |
// private static final int IMAGETYPE_withAlpha = |
105 |
// BufferedImage.TYPE_INT_ARGB; |
// BufferedImage.TYPE_INT_ARGB; |
106 |
private static final int IMAGETYPE = BufferedImage.TYPE_3BYTE_BGR; |
private static final int IMAGETYPE = BufferedImage.TYPE_3BYTE_BGR; |
107 |
|
public XMapPaneTool getTool() { |
108 |
|
return tool; |
109 |
|
} |
110 |
|
|
111 |
private static final int IMAGETYPE_withAlpha = BufferedImage.TYPE_4BYTE_ABGR; |
private static final int IMAGETYPE_withAlpha = BufferedImage.TYPE_4BYTE_ABGR; |
112 |
|
|
113 |
private final static Logger LOGGER = Logger.getLogger(XMapPane.class); |
private final static Logger LOGGER = Logger.getLogger(XMapPane.class); |
178 |
* Flag for no-tool. |
* Flag for no-tool. |
179 |
*/ |
*/ |
180 |
public static final int NONE = -123; |
public static final int NONE = -123; |
181 |
|
// |
182 |
/** |
// /** |
183 |
* Flag fuer Modus "Kartenausschnitt bewegen". Nicht fuer Window-Auswahl |
// * Flag fuer Modus "Kartenausschnitt bewegen". Nicht fuer Window-Auswahl |
184 |
* moeglich! |
// * moeglich! |
185 |
* |
// * |
186 |
* @see #setState(int) |
// * @see #setState(int) |
187 |
*/ |
// */ |
188 |
public static final int PAN = 1; |
// public static final int PAN = 1; |
189 |
|
// |
190 |
/** |
// /** |
191 |
* Flag fuer Modus "Heran zoomen". |
// * Flag fuer Modus "Heran zoomen". |
192 |
* |
// * |
193 |
* @see #setState(int) |
// * @see #setState(int) |
194 |
* @see #setState(int) |
// * @see #setState(int) |
195 |
*/ |
// */ |
196 |
public static final int ZOOM_IN = 2; |
// public static final int ZOOM_IN = 2; |
197 |
|
// |
198 |
/** |
// /** |
199 |
* Flag fuer Modus "Heraus zoomen". Nicht fuer Window-Auswahl moeglich! |
// * Flag fuer Modus "Heraus zoomen". Nicht fuer Window-Auswahl moeglich! |
200 |
* |
// * |
201 |
* @see #setState(int) |
// * @see #setState(int) |
202 |
*/ |
// */ |
203 |
public static final int ZOOM_OUT = 3; |
// public static final int ZOOM_OUT = 3; |
|
|
|
|
/** |
|
|
* Flag fuer Modus "SimpleFeature-Auswahl auf allen (sichtbaren) Layern". |
|
|
* |
|
|
* @see #setState(int) |
|
|
* @see #setState(int) |
|
|
*/ |
|
|
public static final int SELECT_ALL = 103; |
|
|
/** |
|
|
* Flag fuer Modus |
|
|
* "Auswahl nur eines Features, das erste sichtbare von Oben". |
|
|
* |
|
|
* @see #setState(int) |
|
|
* @see #setState(int) |
|
|
*/ |
|
|
public static final int SELECT_ONE_FROM_TOP = 104; |
|
|
/** |
|
|
* Flag fuer Modus |
|
|
* "SimpleFeature-Auswahl auf dem obersten (sichtbaren) Layer". |
|
|
* |
|
|
* @see #setState(int) |
|
|
* @see #setState(int) |
|
|
*/ |
|
|
public static final int SELECT_TOP = 4; |
|
204 |
|
|
205 |
/** |
/** |
206 |
* {@link Font} used to paint the wait messages into the map |
* {@link Font} used to paint the wait messages into the map |
281 |
final MapLayer layer = event.getLayer(); |
final MapLayer layer = event.getLayer(); |
282 |
layer.addMapLayerListener(bgMapLayerListener); |
layer.addMapLayerListener(bgMapLayerListener); |
283 |
requestStartRendering(); |
requestStartRendering(); |
|
|
|
284 |
} |
} |
285 |
|
|
286 |
@Override |
@Override |
374 |
* While dragging, the {@link #updateFinalImage()} method is translating the |
* While dragging, the {@link #updateFinalImage()} method is translating the |
375 |
* cached images while setting it together. |
* cached images while setting it together. |
376 |
**/ |
**/ |
377 |
Point imageOrigin = new Point(0, 0); |
private final Point imageOrigin = new Point(0, 0); |
378 |
/** |
/** |
379 |
* For every rendering thread started, |
* For every rendering thread started, |
380 |
* {@link GTUtil#createGTRenderer(MapContext)} is called to create a new |
* {@link GTUtil#createGTRenderer(MapContext)} is called to create a new |
541 |
* thread. |
* thread. |
542 |
*/ |
*/ |
543 |
final private Timer startRenderThreadsTimer; |
final private Timer startRenderThreadsTimer; |
544 |
|
// |
545 |
/** |
// /** |
546 |
* The default state is ZOOM_IN, hence by default the |
// * The default state is ZOOM_IN, hence by default the |
547 |
* {@link #xMapPaneMouseListener} is also enabled. |
// * {@link #xMapPaneMouseListener} is also enabled. |
548 |
**/ |
// **/ |
549 |
private int state = ZOOM_IN; |
// private int state = ZOOM_IN; |
550 |
|
|
551 |
/** |
/** |
552 |
* Manuell gesetzter statischer Cursor, unabhaengig von der aktuellen |
* Manuell gesetzter statischer Cursor, unabhaengig von der aktuellen |
611 |
this.addMouseListener(xMapPaneMouseListener); |
this.addMouseListener(xMapPaneMouseListener); |
612 |
this.addMouseMotionListener(xMapPaneMouseListener); |
this.addMouseMotionListener(xMapPaneMouseListener); |
613 |
this.addMouseWheelListener(xMapPaneMouseListener); |
this.addMouseWheelListener(xMapPaneMouseListener); |
614 |
xMapPaneMouseListener.actions.put(MouseInputType.LClick, |
|
615 |
XMapPaneAction.ZOOM_IN); |
// By default the XMapPAne uses the ZOOM_IN tool. |
616 |
xMapPaneMouseListener.actions.put(MouseInputType.LDrag, |
setTool(XMapPaneTool.ZOOM_IN); |
617 |
XMapPaneAction.ZOOM_IN); |
|
|
xMapPaneMouseListener.actions.put(MouseInputType.Wheel, |
|
|
XMapPaneAction.ZOOM_IN); |
|
|
|
|
|
xMapPaneMouseListener.actions.put(MouseInputType.RClick, |
|
|
XMapPaneAction.ZOOM_OUT); |
|
|
|
|
|
xMapPaneMouseListener.actions.put(MouseInputType.RDrag, |
|
|
XMapPaneAction.ZOOM_OUT); |
|
|
|
|
618 |
/* |
/* |
619 |
* We use a Timer object to avoid rendering delays and flickering when |
* We use a Timer object to avoid rendering delays and flickering when |
620 |
* the user is drag-resizing the parent container of this map pane. |
* the user is drag-resizing the parent container of this map pane. |
985 |
*/ |
*/ |
986 |
protected void drawRectangle(final Graphics graphics, final Point startPos, |
protected void drawRectangle(final Graphics graphics, final Point startPos, |
987 |
final Point e) { |
final Point e) { |
988 |
drawRectangle(graphics, startPos, e, Color.WHITE); |
drawRectangle(graphics, startPos, e, Color.WHITE, false); |
989 |
} |
} |
990 |
|
|
991 |
/** |
/** |
993 |
* given point. All in screen coordinates. |
* given point. All in screen coordinates. |
994 |
*/ |
*/ |
995 |
protected void drawRectangle(final Graphics graphics, final Point startPos, |
protected void drawRectangle(final Graphics graphics, final Point startPos, |
996 |
final Point e, Color color) { |
final Point e, Color color, boolean fill) { |
997 |
|
|
998 |
if (!isWellDefined()) |
if (!isWellDefined()) |
999 |
return; |
return; |
1010 |
return; |
return; |
1011 |
|
|
1012 |
graphics.setXORMode(color); |
graphics.setXORMode(color); |
1013 |
|
|
1014 |
|
if (fill) { |
1015 |
|
graphics.fillRect(left, bottom, width, height); |
1016 |
|
graphics.setXORMode(Color.WHITE); |
1017 |
|
} |
1018 |
|
|
1019 |
|
|
1020 |
graphics.drawRect(left, bottom, width, height); |
graphics.drawRect(left, bottom, width, height); |
1021 |
} |
} |
1022 |
|
|
1288 |
return new AffineTransform(screenToWorld); |
return new AffineTransform(screenToWorld); |
1289 |
} |
} |
1290 |
|
|
1291 |
public int getState() { |
// public int getState() { |
1292 |
return state; |
// return state; |
1293 |
} |
// } |
1294 |
|
|
1295 |
/** |
/** |
1296 |
* Liefert den statisch eingestellten Cursor, der unabhaengig von der |
* Liefert den statisch eingestellten Cursor, der unabhaengig von der |
1355 |
} |
} |
1356 |
|
|
1357 |
/** |
/** |
1358 |
* Called from the listeners while the mouse is dragging, this method either |
* Usually called from {@link XMapPaneAction_Pan} to pan the image. |
|
* paints a translated (moved/panned) version of the image, or a rectangle. |
|
1359 |
* |
* |
1360 |
* @param startPos |
* @param startPos |
1361 |
* in screen coordinates |
* in screen coordinates |
1362 |
* @param lastPos |
* @param lastPos |
1363 |
* in screen coordinates |
* in screen coordinates |
|
* @param event |
|
|
* the {@link MouseEvent} to read the mouse buttons from |
|
1364 |
*/ |
*/ |
1365 |
public void mouseDragged(final Point startPos, final Point lastPos, |
public void pan(final int dX, final int dY) { |
|
final MouseEvent event) { |
|
|
|
|
|
if ((getState() == XMapPane.PAN) |
|
|
|| ((event.getModifiersEx() & InputEvent.BUTTON3_DOWN_MASK) != 0)) { |
|
1366 |
|
|
1367 |
// Panning needs a panning coursor |
// Panning needs a panning coursor |
1368 |
if (getCursor() != SwingUtil.PANNING_CURSOR) { |
if (getCursor() != SwingUtil.PANNING_CURSOR) { |
1369 |
setCursor(SwingUtil.PANNING_CURSOR); |
setCursor(SwingUtil.PANNING_CURSOR); |
1370 |
|
|
1371 |
// While panning, we deactivate the rendering. So the tasks are |
// While panning, we deactivate the rendering. So the tasks are |
1372 |
// ready to start when the panning is finished. |
// ready to start when the panning is finished. |
1373 |
if (bgExecuter != null && bgExecuter.isRunning()) |
if (bgExecuter != null && bgExecuter.isRunning()) |
1374 |
bgExecuter.cancelTask(); |
bgExecuter.cancelTask(); |
1375 |
if (localExecuter.isRunning()) |
if (localExecuter.isRunning()) |
1376 |
localExecuter.cancelTask(); |
localExecuter.cancelTask(); |
1377 |
} |
} |
1378 |
|
// |
1379 |
if (lastPos.x > 0 && lastPos.y > 0) { |
// if (lastPos.x > 0 && lastPos.y > 0) { |
1380 |
final int dx = event.getX() - lastPos.x; |
// final int dx = event.getX() - lastPos.x; |
1381 |
final int dy = event.getY() - lastPos.y; |
// final int dy = event.getY() - lastPos.y; |
1382 |
|
|
1383 |
// TODO Stop dragging when the drag would not be valid... |
// TODO Stop dragging when the drag would not be valid... |
1384 |
// boolean dragValid = true; |
// boolean dragValid = true; |
1385 |
// // check if this panning results in a valid mapArea |
// // check if this panning results in a valid mapArea |
1386 |
// { |
// { |
1387 |
// Rectangle winBounds = xMapPane.getBounds(); |
// Rectangle winBounds = xMapPane.getBounds(); |
1388 |
// winBounds.translate(xMapPane.imageOrigin.x, |
// winBounds.translate(xMapPane.imageOrigin.x, |
1389 |
// -xMapPane.imageOrigin.y); |
// -xMapPane.imageOrigin.y); |
1390 |
// Envelope newMapAreaBefore = xMapPane.tranformWindowToGeo( |
// Envelope newMapAreaBefore = xMapPane.tranformWindowToGeo( |
1391 |
// winBounds.x, winBounds.y, winBounds.x |
// winBounds.x, winBounds.y, winBounds.x |
1392 |
// + winBounds.width, winBounds.y |
// + winBounds.width, winBounds.y |
1393 |
// + winBounds.height); |
// + winBounds.height); |
1394 |
// |
// |
1395 |
// |
// |
1396 |
// winBounds = xMapPane.getBounds(); |
// winBounds = xMapPane.getBounds(); |
1397 |
// Point testIng = new Point(xMapPane.imageOrigin); |
// Point testIng = new Point(xMapPane.imageOrigin); |
1398 |
// testIng.translate(dx, dy); |
// testIng.translate(dx, dy); |
1399 |
// winBounds.translate(testIng.x, -testIng.y); |
// winBounds.translate(testIng.x, -testIng.y); |
1400 |
// Envelope newMapAreaAfter = xMapPane.tranformWindowToGeo( |
// Envelope newMapAreaAfter = xMapPane.tranformWindowToGeo( |
1401 |
// winBounds.x, winBounds.y, winBounds.x |
// winBounds.x, winBounds.y, winBounds.x |
1402 |
// + winBounds.width, winBounds.y |
// + winBounds.width, winBounds.y |
1403 |
// + winBounds.height); |
// + winBounds.height); |
1404 |
// |
// |
1405 |
// // If the last drag doesn't change the MapArea anymore cancel |
// // If the last drag doesn't change the MapArea anymore cancel |
1406 |
// it. |
// it. |
1407 |
// if (xMapPane.bestAllowedMapArea(newMapAreaAfter).equals( |
// if (xMapPane.bestAllowedMapArea(newMapAreaAfter).equals( |
1408 |
// xMapPane.bestAllowedMapArea(newMapAreaBefore))){ |
// xMapPane.bestAllowedMapArea(newMapAreaBefore))){ |
1409 |
// dragValid = false; |
// dragValid = false; |
1410 |
// return; |
// return; |
1411 |
// } |
// } |
1412 |
// } |
// } |
1413 |
|
|
1414 |
imageOrigin.translate(dx, dy); |
getImageOrigin().translate(dX, dY); |
1415 |
updateFinalImage(); |
updateFinalImage(); |
1416 |
repaint(); |
repaint(); |
1417 |
} |
// } |
1418 |
|
|
1419 |
} else if ((getState() == XMapPane.ZOOM_IN) |
// } else if ((getState() == XMapPane.ZOOM_IN) |
1420 |
|| (getState() == XMapPane.ZOOM_OUT) |
// || (getState() == XMapPane.ZOOM_OUT) |
1421 |
|| (getState() == XMapPane.SELECT_ALL) |
// || (getState() == XMapPane.SELECT_ALL) |
1422 |
|| (getState() == XMapPane.SELECT_TOP)) { |
// || (getState() == XMapPane.SELECT_TOP)) { |
1423 |
|
// |
1424 |
// Draws a rectangle |
// // Draws a rectangle |
1425 |
final Graphics2D graphics = (Graphics2D) getGraphics(); |
// final Graphics2D graphics = (Graphics2D) getGraphics(); |
1426 |
drawRectangle(graphics, startPos, event.getPoint()); |
// drawRectangle(graphics, startPos, event.getPoint()); |
1427 |
if ((lastPos.x > 0) && (lastPos.y > 0)) |
// if ((lastPos.x > 0) && (lastPos.y > 0)) |
1428 |
drawRectangle(graphics, startPos, lastPos); |
// drawRectangle(graphics, startPos, lastPos); |
1429 |
graphics.dispose(); |
// graphics.dispose(); |
1430 |
} |
// } |
1431 |
} |
} |
1432 |
|
|
1433 |
/** |
/** |
1589 |
} |
} |
1590 |
|
|
1591 |
} |
} |
1592 |
|
// |
1593 |
/** |
// /** |
1594 |
* Performs a {@value #PAN} action. During panning, the displacement is |
// * Performs a {@value #PAN} action. During panning, the displacement is |
1595 |
* stored in {@link #imageOrigin} object. Calling {@link #performPan()} will |
// * stored in {@link #imageOrigin} object. Calling {@link #performPan()} will |
1596 |
* reset the offset and call {@link #setMapArea(Envelope)}. |
// * reset the offset and call {@link #setMapArea(Envelope)}. |
1597 |
*/ |
// */ |
1598 |
public void performPan() { |
// public void performPan() { |
1599 |
|
// |
1600 |
final Rectangle winBounds = getVisibleRect(); |
// final Rectangle winBounds = getVisibleRect(); |
1601 |
|
// |
1602 |
winBounds.translate(-imageOrigin.x, -imageOrigin.y); |
// winBounds.translate(-imageOrigin.x, -imageOrigin.y); |
1603 |
final Envelope newMapArea = tranformWindowToGeo(winBounds.x, |
// final Envelope newMapArea = tranformWindowToGeo(winBounds.x, |
1604 |
winBounds.y, winBounds.x + winBounds.width, winBounds.y |
// winBounds.y, winBounds.x + winBounds.width, winBounds.y |
1605 |
+ winBounds.height); |
// + winBounds.height); |
1606 |
|
// |
1607 |
imageOrigin.x = 0; |
// imageOrigin.x = 0; |
1608 |
imageOrigin.y = 0; |
// imageOrigin.y = 0; |
1609 |
|
// |
1610 |
if (!setMapArea(newMapArea)) { |
// if (!setMapArea(newMapArea)) { |
1611 |
/** |
// /** |
1612 |
* If setMapArea returns true, the finalImage is updated anyways. |
// * If setMapArea returns true, the finalImage is updated anyways. |
1613 |
* This if-case exists to ensure that we repaint a correct image |
// * This if-case exists to ensure that we repaint a correct image |
1614 |
* even if the new panning area has been denied. |
// * even if the new panning area has been denied. |
1615 |
*/ |
// */ |
1616 |
updateFinalImage(); |
// updateFinalImage(); |
1617 |
repaint(); |
// repaint(); |
1618 |
} |
// } |
1619 |
|
// |
1620 |
if (getCursor() == SwingUtil.PANNING_CURSOR) |
// if (getCursor() == SwingUtil.PANNING_CURSOR) |
1621 |
setCursor(SwingUtil.PAN_CURSOR); |
// setCursor(SwingUtil.PAN_CURSOR); |
1622 |
} |
// } |
1623 |
|
|
1624 |
/** |
/** |
1625 |
* Entfernt einen Listener von der Map. |
* Entfernt einen Listener von der Map. |
1928 |
|
|
1929 |
// /** Stored the time used for the last real rendering in ms. **/ |
// /** Stored the time used for the last real rendering in ms. **/ |
1930 |
private long lastRenderingDuration = 1000; |
private long lastRenderingDuration = 1000; |
1931 |
|
private XMapPaneTool tool = null; |
1932 |
|
|
1933 |
/** |
/** |
1934 |
* Set the minimum (nearest) allowed zoom scale. This is the bigger number |
* Set the minimum (nearest) allowed zoom scale. This is the bigger number |
1960 |
this.rendererHints = rendererHints; |
this.rendererHints = rendererHints; |
1961 |
} |
} |
1962 |
|
|
1963 |
/** |
// @Deprecated |
1964 |
* Enables/Disables the ZOOM Mouse Listener. Upates the Cursor and stops the |
// public void setState(final int state) { |
1965 |
* repaint Timer if |
// this.state = state; |
1966 |
* |
// |
1967 |
* @param state |
// // throw new RuntimeException("Old concept.. migrate to new concept!"); |
1968 |
*/ |
// |
1969 |
@Deprecated |
// // xMapPaneMouseListener.setEnabled((state == ZOOM_IN |
1970 |
public void setState(final int state) { |
// // || state == ZOOM_OUT || state == PAN)); |
1971 |
this.state = state; |
// |
1972 |
|
// // Je nach Aktion den Cursor umsetzen |
1973 |
// throw new RuntimeException("Old concept.. migrate to new concept!"); |
// updateCursor(); |
1974 |
|
// } |
|
// xMapPaneMouseListener.setEnabled((state == ZOOM_IN |
|
|
// || state == ZOOM_OUT || state == PAN)); |
|
|
|
|
|
// Je nach Aktion den Cursor umsetzen |
|
|
updateCursor(); |
|
|
} |
|
1975 |
|
|
1976 |
public void configureMouse(MouseInputType type, XMapPaneAction action) { |
public void configureMouse(MouseInputType type, XMapPaneAction action) { |
1977 |
xMapPaneMouseListener.actions.put(type, action); |
xMapPaneMouseListener.actions.put(type, action); |
1978 |
} |
} |
1979 |
|
|
1980 |
|
/** |
1981 |
|
* Configure the {@link XMapPaneTool} that active on the map. Passing |
1982 |
|
* <code>null</code> will set the NO_ACTION tool. |
1983 |
|
*/ |
1984 |
|
public void setTool(XMapPaneTool tool) { |
1985 |
|
if (tool == null) |
1986 |
|
tool = XMapPaneTool.NO_ACTION; |
1987 |
|
this.tool = tool; |
1988 |
|
xMapPaneMouseListener.configure(tool); |
1989 |
|
setCursor(tool.cursor); |
1990 |
|
} |
1991 |
|
|
1992 |
/** |
/** |
1993 |
* Standardmaessig wird der Cursor automatisch je nach MapPane-Aktion (Zoom, |
* Standardmaessig wird der Cursor automatisch je nach MapPane-Aktion (Zoom, |
2145 |
repaint(); |
repaint(); |
2146 |
} |
} |
2147 |
} |
} |
2148 |
|
|
2149 |
|
// |
2150 |
// wenn manueller Cursor gesetzt ist, dann diesen verwenden (unabhaengig |
// wenn manueller Cursor gesetzt ist, dann diesen verwenden (unabhaengig |
2151 |
// von der aktuellen Aktion |
// von der aktuellen Aktion |
2152 |
if (this.staticCursor != null) { |
if (this.staticCursor != null) { |
2153 |
setCursor(staticCursor); |
setCursor(staticCursor); |
2154 |
return; |
return; |
2155 |
} |
} |
2156 |
|
|
2157 |
if (getCursor() == SwingUtil.PANNING_CURSOR) { |
if (getCursor() == SwingUtil.PANNING_CURSOR) { |
2158 |
// This cursor will reset itself |
// This cursor will reset itself |
2159 |
return; |
return; |
2160 |
} |
} |
2161 |
|
|
2162 |
// Set the cursor depending on what tool is in use... |
setCursor(tool.cursor); |
2163 |
switch (state) { |
|
2164 |
case SELECT_TOP: |
// |
2165 |
case SELECT_ONE_FROM_TOP: |
// // Set the cursor depending on what tool is in use... |
2166 |
case SELECT_ALL: |
// switch (state) { |
2167 |
setCursor(SwingUtil.CROSSHAIR_CURSOR); |
// case SELECT_TOP: |
2168 |
break; |
// case SELECT_ONE_FROM_TOP: |
2169 |
case ZOOM_IN: |
// case SELECT_ALL: |
2170 |
setCursor(SwingUtil.ZOOMIN_CURSOR); |
// setCursor(SwingUtil.CROSSHAIR_CURSOR); |
2171 |
break; |
// break; |
2172 |
case ZOOM_OUT: |
// case ZOOM_IN: |
2173 |
setCursor(SwingUtil.ZOOMOUT_CURSOR); |
// setCursor(SwingUtil.ZOOMIN_CURSOR); |
2174 |
break; |
// break; |
2175 |
case PAN: |
// case ZOOM_OUT: |
2176 |
setCursor(SwingUtil.PAN_CURSOR); |
// setCursor(SwingUtil.ZOOMOUT_CURSOR); |
2177 |
break; |
// break; |
2178 |
default: |
// case PAN: |
2179 |
setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); |
// setCursor(SwingUtil.PAN_CURSOR); |
2180 |
break; |
// break; |
2181 |
} |
// default: |
2182 |
|
// setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); |
2183 |
|
// break; |
2184 |
|
// } |
2185 |
} |
} |
2186 |
|
|
2187 |
/** |
/** |
2211 |
|
|
2212 |
final Graphics2D finalG = getFinalImage().createGraphics(); |
final Graphics2D finalG = getFinalImage().createGraphics(); |
2213 |
finalG.setBackground(getMapBackgroundColor()); |
finalG.setBackground(getMapBackgroundColor()); |
2214 |
finalG.drawImage(getPreFinalImage(), imageOrigin.x, imageOrigin.y, |
finalG.drawImage(getPreFinalImage(), getImageOrigin().x, getImageOrigin().y, |
2215 |
getMapBackgroundColor(), null); |
getMapBackgroundColor(), null); |
2216 |
|
|
2217 |
// When panning, we have to clear the area around the image |
// When panning, we have to clear the area around the image |
2218 |
final Rectangle painedArea = new Rectangle(imageOrigin.x, |
final Rectangle painedArea = new Rectangle(getImageOrigin().x, |
2219 |
imageOrigin.y, getFinalImage().getWidth(), getFinalImage() |
getImageOrigin().y, getFinalImage().getWidth(), getFinalImage() |
2220 |
.getHeight()); |
.getHeight()); |
2221 |
SwingUtil.clearAround(finalG, painedArea, getVisibleRect(), |
SwingUtil.clearAround(finalG, painedArea, getVisibleRect(), |
2222 |
getMapBackgroundColor()); |
getMapBackgroundColor()); |
2223 |
|
|
2224 |
addGadgets(finalG, false); |
// addGadgets(finalG, false); |
2225 |
|
|
2226 |
finalG.dispose(); |
finalG.dispose(); |
2227 |
|
|
2614 |
|
|
2615 |
} |
} |
2616 |
|
|
2617 |
|
public Point getImageOrigin() { |
2618 |
|
return imageOrigin; |
2619 |
|
} |
2620 |
|
|
2621 |
} |
} |