44 |
import org.geotools.renderer.GTRenderer; |
import org.geotools.renderer.GTRenderer; |
45 |
import org.geotools.renderer.label.LabelCacheImpl; |
import org.geotools.renderer.label.LabelCacheImpl; |
46 |
import org.geotools.renderer.lite.LabelCache; |
import org.geotools.renderer.lite.LabelCache; |
47 |
|
import org.geotools.renderer.lite.RendererUtilities; |
48 |
import org.geotools.renderer.lite.StreamingRenderer; |
import org.geotools.renderer.lite.StreamingRenderer; |
49 |
import org.geotools.swing.JMapPane; |
import org.geotools.swing.JMapPane; |
50 |
import org.geotools.swing.event.MapMouseEvent; |
import org.geotools.swing.event.MapMouseEvent; |
147 |
* Default delay (milliseconds) before the map will be redrawn when resizing |
* Default delay (milliseconds) before the map will be redrawn when resizing |
148 |
* the pane. This is to avoid flickering while drag-resizing. |
* the pane. This is to avoid flickering while drag-resizing. |
149 |
*/ |
*/ |
150 |
public static final int DEFAULT_RESIZING_PAINT_DELAY = 500; |
public static final int DEFAULT_RESIZING_PAINT_DELAY = 600; |
151 |
|
|
152 |
public static final int NONE = -123; |
public static final int NONE = -123; |
153 |
|
|
387 |
localRenderer.setContext(getContext()); |
localRenderer.setContext(getContext()); |
388 |
|
|
389 |
if (localContext.getLayers().length == 1) { // the first one |
if (localContext.getLayers().length == 1) { // the first one |
390 |
|
|
391 |
// if the Area of Interest is unset, the LayerBounds are used |
// if the Area of Interest is unset, the LayerBounds are used |
392 |
if (!setMapArea(localContext.getAreaOfInterest())) |
if (!setMapArea(localContext.getAreaOfInterest())) |
393 |
repaint(); |
repaint(); |
540 |
|
|
541 |
private final Timer resizeTimer; |
private final Timer resizeTimer; |
542 |
|
|
|
private final int resizingPaintDelay; |
|
|
|
|
543 |
/** |
/** |
544 |
* Transformation zwischen Fenster-Koordinaten und Karten-Koordinaten |
* Transformation zwischen Fenster-Koordinaten und Karten-Koordinaten |
545 |
* (lat/lon) |
* (lat/lon) |
620 |
* Using a ComponentListener doesn't work because, unlike a JFrame, the |
* Using a ComponentListener doesn't work because, unlike a JFrame, the |
621 |
* pane receives a stream of events during drag-resizing. |
* pane receives a stream of events during drag-resizing. |
622 |
*/ |
*/ |
623 |
resizingPaintDelay = DEFAULT_RESIZING_PAINT_DELAY; |
resizeTimer = new Timer(DEFAULT_RESIZING_PAINT_DELAY, new ActionListener() { |
|
resizeTimer = new Timer(resizingPaintDelay, new ActionListener() { |
|
624 |
|
|
625 |
public void actionPerformed(final ActionEvent e) { |
public void actionPerformed(final ActionEvent e) { |
626 |
paneResized = true; |
paneResized = true; |
713 |
* Krüger</a> |
* Krüger</a> |
714 |
*/ |
*/ |
715 |
public Envelope bestAllowedMapArea(Envelope env) { |
public Envelope bestAllowedMapArea(Envelope env) { |
716 |
|
// return env; |
717 |
if (getWidth() == 0) |
if (getWidth() == 0) |
718 |
return env; |
return env; |
719 |
if (env == null) |
if (env == null) |
794 |
|
|
795 |
// LOGGER.debug("and fix aspect ratio"); |
// LOGGER.debug("and fix aspect ratio"); |
796 |
|
|
797 |
newArea = JTSUtil.fixAspectRatio(this.getBounds(), newArea, |
newArea = JTSUtil.fixAspectRatio(getVisibleRect(), newArea, |
798 |
false); |
false); |
799 |
} |
} |
800 |
} |
} |
818 |
|
|
819 |
// LOGGER.debug("and fix aspect ratio"); |
// LOGGER.debug("and fix aspect ratio"); |
820 |
|
|
821 |
newArea = JTSUtil.fixAspectRatio(this.getBounds(), newArea, |
newArea = JTSUtil.fixAspectRatio(getVisibleRect(), newArea, |
822 |
false); |
false); |
823 |
} |
} |
824 |
} |
} |
844 |
|
|
845 |
// LOGGER.debug("and fix aspect ratio"); |
// LOGGER.debug("and fix aspect ratio"); |
846 |
|
|
847 |
newArea = JTSUtil.fixAspectRatio(this.getBounds(), newArea, |
newArea = JTSUtil.fixAspectRatio(getVisibleRect(), newArea, |
848 |
false); |
false); |
849 |
} |
} |
850 |
} |
} |
870 |
|
|
871 |
// LOGGER.debug("and fix aspect ratio"); |
// LOGGER.debug("and fix aspect ratio"); |
872 |
|
|
873 |
newArea = JTSUtil.fixAspectRatio(this.getBounds(), newArea, |
newArea = JTSUtil.fixAspectRatio(getVisibleRect(), newArea, |
874 |
false); |
false); |
875 |
} |
} |
876 |
} |
} |
921 |
} |
} |
922 |
localExecuter.dispose(); |
localExecuter.dispose(); |
923 |
} |
} |
924 |
// |
|
|
// if (bgImage != null) { |
|
|
// bgImage = dispose(bgImage); |
|
|
// bgImage = null; |
|
|
// // LangUtil.gcTotal(); |
|
|
// } |
|
|
// |
|
|
// if (localImage != null) { |
|
|
// localImage = dispose(localImage); |
|
|
// localImage = null; |
|
|
// // LangUtil.gcTotal(); |
|
|
// } |
|
|
// |
|
|
// if (finalImage != null) { |
|
|
// finalImage = dispose(finalImage); |
|
|
// finalImage = null; |
|
|
// // LangUtil.gcTotal(); |
|
|
// } |
|
|
// |
|
|
// if (preFinalImage != null) { |
|
|
// preFinalImage = dispose(preFinalImage); |
|
|
// preFinalImage = null; |
|
|
// } |
|
925 |
disposeImages(); |
disposeImages(); |
926 |
|
|
927 |
// LangUtil.gcTotal(); |
// LangUtil.gcTotal(); |
979 |
*/ |
*/ |
980 |
protected boolean drawScaledPreviewImage_Zoom(final Graphics2D graphics) { |
protected boolean drawScaledPreviewImage_Zoom(final Graphics2D graphics) { |
981 |
|
|
982 |
|
// if (1 == 1)return false; |
983 |
|
|
984 |
if (quickPreviewHint == 0) |
if (quickPreviewHint == 0) |
985 |
return false; |
return false; |
986 |
|
|
999 |
// Calculate the oldMapArea in the current WindowCoordinates: |
// Calculate the oldMapArea in the current WindowCoordinates: |
1000 |
final Envelope oldMapWindow = tranformGeoToWindow(oldMapArea.getMinX(), |
final Envelope oldMapWindow = tranformGeoToWindow(oldMapArea.getMinX(), |
1001 |
oldMapArea.getMinY(), oldMapArea.getMaxX(), oldMapArea |
oldMapArea.getMinY(), oldMapArea.getMaxX(), oldMapArea |
1002 |
.getMaxY(), null); |
.getMaxY()); |
1003 |
|
|
1004 |
final int xx1 = (int) Math.round(oldMapWindow.getMinX()); |
final int xx1 = (int) Math.round(oldMapWindow.getMinX()); |
1005 |
final int yy1 = (int) Math.round(oldMapWindow.getMinY()); |
final int yy1 = (int) Math.round(oldMapWindow.getMinY()); |
1055 |
// |
// |
1056 |
if (finalImage == null) { |
if (finalImage == null) { |
1057 |
// Rectangle curPaintArea = getVisibleRect(); |
// Rectangle curPaintArea = getVisibleRect(); |
1058 |
finalImage = new BufferedImage(getBounds().width, |
finalImage = new BufferedImage(getVisibleRect().width, |
1059 |
getBounds().height, IMAGETYPE); |
getVisibleRect().height, IMAGETYPE); |
1060 |
|
|
1061 |
requestStartRendering(); |
requestStartRendering(); |
1062 |
} |
} |
1073 |
private BufferedImage getLocalImage() { |
private BufferedImage getLocalImage() { |
1074 |
|
|
1075 |
if (localImage == null) { |
if (localImage == null) { |
1076 |
localImage = new BufferedImage(getBounds().width, |
localImage = new BufferedImage(getVisibleRect().width, |
1077 |
getBounds().height, IMAGETYPE_withAlpha); |
getVisibleRect().height, IMAGETYPE_withAlpha); |
1078 |
} |
} |
1079 |
|
|
1080 |
return localImage; |
return localImage; |
1104 |
if (mapArea == null) |
if (mapArea == null) |
1105 |
return null; |
return null; |
1106 |
|
|
1107 |
|
// TODO is needed at all, this should go to setMapArea maybe |
1108 |
if (localContext.getCoordinateReferenceSystem() == null) |
if (localContext.getCoordinateReferenceSystem() == null) |
1109 |
try { |
try { |
1110 |
localContext.setCoordinateReferenceSystem(GeoImportUtil |
localContext.setCoordinateReferenceSystem(GeoImportUtil |
1111 |
.getDefaultCRS()); |
.getDefaultCRS()); |
1112 |
} catch (TransformException e) { |
} catch (Exception e) { |
1113 |
// TODO Auto-generated catch block |
throw new RuntimeException("setting context CRS:", e); |
|
e.printStackTrace(); |
|
|
} catch (FactoryException e) { |
|
|
// TODO Auto-generated catch block |
|
|
e.printStackTrace(); |
|
1114 |
} |
} |
1115 |
|
|
1116 |
return new ReferencedEnvelope(mapArea, localContext |
return new ReferencedEnvelope(mapArea, localContext |
1155 |
} |
} |
1156 |
|
|
1157 |
// Kartenbereich um 10% vergroessern |
// Kartenbereich um 10% vergroessern |
1158 |
return JTSUtil.fixAspectRatio(this.getBounds(), JTSUtil |
return JTSUtil.fixAspectRatio(getVisibleRect(), JTSUtil |
1159 |
.expandEnvelope(layerBounds, 0.1), true); |
.expandEnvelope(layerBounds, 0.1), true); |
1160 |
} |
} |
1161 |
return maxExtend; |
return maxExtend; |
1519 |
*/ |
*/ |
1520 |
public void performPan() { |
public void performPan() { |
1521 |
|
|
1522 |
final Rectangle winBounds = getBounds(); |
Rectangle winBounds = getVisibleRect(); |
1523 |
|
|
1524 |
winBounds.translate(-imageOrigin.x, -imageOrigin.y); |
winBounds.translate(-imageOrigin.x, -imageOrigin.y); |
1525 |
final Envelope newMapArea = tranformWindowToGeo(winBounds.x, |
final Envelope newMapArea = tranformWindowToGeo(winBounds.x, |
1526 |
winBounds.y, winBounds.x + winBounds.width, winBounds.y |
winBounds.y, winBounds.x + winBounds.width, winBounds.y |
1588 |
requestStartRendering = true; |
requestStartRendering = true; |
1589 |
|
|
1590 |
} |
} |
1591 |
// |
|
1592 |
// /** |
// |
1593 |
// * Berechnet die Transformation zwischen Fenster- und Karten-Koordinaten |
// /** |
1594 |
// * neu. |
// * Berechnet die Transformation zwischen Fenster- und Karten-Koordinaten |
1595 |
// */ |
// * neu. |
1596 |
// protected void resetTransforms() { |
// */ |
1597 |
// if (getMapArea() == null || getWidth() == 0 || getHeight() == 0) |
// protected void resetTransforms() { |
1598 |
// return; |
// if (getMapArea() == null || getWidth() == 0 || getHeight() == 0) |
1599 |
// |
// return; |
1600 |
// // We store the last Transform |
// |
1601 |
// oldScreenToWorld = screenToWorld; |
// // We store the last Transform |
1602 |
// |
// oldScreenToWorld = screenToWorld; |
1603 |
// this.screenToWorld = new AffineTransform( |
// |
1604 |
// // Genauso wie die Fenster-Koordinaten, werden die Longitude-Koordinaten |
// this.screenToWorld = new AffineTransform( |
1605 |
// // nach rechts (Osten) hin groesser |
// // Genauso wie die Fenster-Koordinaten, werden die Longitude-Koordinaten |
1606 |
// // --> positive Verschiebung |
// // nach rechts (Osten) hin groesser |
1607 |
// getMapArea().getWidth() / getWidth(), |
// // --> positive Verschiebung |
1608 |
// // keine Verzerrung |
// getMapArea().getWidth() / getWidth(), |
1609 |
// 0.0, 0.0, |
// // keine Verzerrung |
1610 |
// // Waehrend die Fenster-Koordinaten nach unten hin groesser |
// 0.0, 0.0, |
1611 |
// // werden, |
// // Waehrend die Fenster-Koordinaten nach unten hin groesser |
1612 |
// // werden Latitude-Koordinaten nach Sueden hin keiner |
// // werden, |
1613 |
// // --> negative Verschiebung |
// // werden Latitude-Koordinaten nach Sueden hin keiner |
1614 |
// -getMapArea().getHeight() / getHeight(), |
// // --> negative Verschiebung |
1615 |
// // Die Longitude-Koordinaten werden nach Osten hin groesser |
// -getMapArea().getHeight() / getHeight(), |
1616 |
// // --> obere linke Ecke des Fensters hat also den Minimalwert |
// // Die Longitude-Koordinaten werden nach Osten hin groesser |
1617 |
// getMapArea().getMinX(), |
// // --> obere linke Ecke des Fensters hat also den Minimalwert |
1618 |
// // Die Latitude-Koordinaten werden nach Norden hin groesser |
// getMapArea().getMinX(), |
1619 |
// // --> obere linke Ecke des Fensters hat also den Maximalwert |
// // Die Latitude-Koordinaten werden nach Norden hin groesser |
1620 |
// getMapArea().getMaxY()); |
// // --> obere linke Ecke des Fensters hat also den Maximalwert |
1621 |
// |
// getMapArea().getMaxY()); |
1622 |
// try { |
// |
1623 |
// this.worldToScreen = screenToWorld.createInverse(); |
// try { |
1624 |
// } catch (final NoninvertibleTransformException e) { |
// this.worldToScreen = screenToWorld.createInverse(); |
1625 |
// LOGGER.error(e); |
// } catch (final NoninvertibleTransformException e) { |
1626 |
// } |
// LOGGER.error(e); |
1627 |
// } |
// } |
1628 |
|
// } |
1629 |
|
|
1630 |
|
/** |
1631 |
/** |
* Calculate the affine transforms used to convert between world and pixel |
1632 |
* Calculate the affine transforms used to convert between |
* coordinates. The calculations here are very basic and assume a cartesian |
1633 |
* world and pixel coordinates. The calculations here are very |
* reference system. |
1634 |
* basic and assume a cartesian reference system. |
* <p> |
1635 |
* <p> |
* Tne transform is calculated such that {@code envelope} will be centred in |
1636 |
* Tne transform is calculated such that {@code envelope} will |
* the display |
1637 |
* be centred in the display |
* |
1638 |
* |
* @param envelope |
1639 |
* @param envelope the current map extent (world coordinates) |
* the current map extent (world coordinates) |
1640 |
* @param paintArea the current map pane extent (screen units) |
* @param paintArea |
1641 |
*/ |
* the current map pane extent (screen units) |
1642 |
private void resetTransforms() { |
*/ |
1643 |
ReferencedEnvelope refEnv = new ReferencedEnvelope(mapArea, getContext().getCoordinateReferenceSystem()); |
private void resetTransforms() { |
1644 |
|
ReferencedEnvelope refMapEnv = new ReferencedEnvelope(mapArea, |
1645 |
Rectangle paintArea = getBounds(); |
getContext().getCoordinateReferenceSystem()); |
1646 |
|
|
1647 |
double xscale = paintArea.getWidth() / refEnv.getWidth(); |
Rectangle paintArea = getVisibleRect(); // NOT USE GET BOUNDS! |
1648 |
double yscale = paintArea.getHeight() / refEnv.getHeight(); |
|
1649 |
|
// |
1650 |
double scale = Math.min(xscale, yscale); |
// double xscale = paintArea.getWidth() / refEnv.getWidth(); |
1651 |
|
// double yscale = paintArea.getHeight() / refEnv.getHeight(); |
1652 |
double xoff = refEnv.getMedian(0) * scale - paintArea.getCenterX(); |
// |
1653 |
double yoff = refEnv.getMedian(1) * scale + paintArea.getCenterY(); |
// double scale = Math.min(xscale, yscale); |
1654 |
|
// |
1655 |
worldToScreen = new AffineTransform(scale, 0, 0, -scale, -xoff, yoff); |
// double xoff = refEnv.getMedian(0) * scale - paintArea.getCenterX(); |
1656 |
try { |
// double yoff = refEnv.getMedian(1) * scale + paintArea.getCenterY(); |
1657 |
screenToWorld = worldToScreen.createInverse(); |
|
1658 |
|
worldToScreen = RendererUtilities.worldToScreenTransform(refMapEnv, |
1659 |
} catch (NoninvertibleTransformException ex) { |
paintArea); |
1660 |
ex.printStackTrace(); |
|
1661 |
} |
// worldToScreen = new AffineTransform(scale, 0, 0, -scale, -xoff, |
1662 |
} |
// yoff); |
1663 |
|
try { |
1664 |
|
screenToWorld = worldToScreen.createInverse(); |
1665 |
|
|
1666 |
|
} catch (NoninvertibleTransformException ex) { |
1667 |
|
ex.printStackTrace(); |
1668 |
|
} |
1669 |
|
} |
1670 |
|
|
1671 |
public void setBgContext(final MapContext context) { |
public void setBgContext(final MapContext context) { |
1672 |
|
|
1759 |
return false; |
return false; |
1760 |
} |
} |
1761 |
|
|
1762 |
|
final Envelope candNew = bestAllowedMapArea(newMapArea); |
1763 |
|
|
1764 |
// Testing, whether the difference if just minimal |
// Testing, whether the difference if just minimal |
1765 |
if (mapArea != null) { |
if (mapArea != null) { |
|
final Envelope candNew = bestAllowedMapArea(newMapArea); |
|
1766 |
final double tolX = mapArea.getWidth() / 1000.; |
final double tolX = mapArea.getWidth() / 1000.; |
1767 |
final double tolY = mapArea.getHeight() / 1000.; |
final double tolY = mapArea.getHeight() / 1000.; |
1768 |
if ((candNew.getMinX() - tolX < mapArea.getMinX()) |
if ((candNew.getMinX() - tolX < mapArea.getMinX()) |
1782 |
} |
} |
1783 |
} |
} |
1784 |
|
|
1785 |
|
// New map are is accepted: |
1786 |
oldMapArea = mapArea; |
oldMapArea = mapArea; |
1787 |
|
mapArea = candNew; |
1788 |
this.mapArea = bestAllowedMapArea(newMapArea); |
resetTransforms(); |
1789 |
|
|
1790 |
if (localContext != null) { |
if (localContext != null) { |
1791 |
localContext.setAreaOfInterest(mapArea, localContext |
localContext.setAreaOfInterest(mapArea, localContext |
1795 |
bgContext.setAreaOfInterest(mapArea, localContext |
bgContext.setAreaOfInterest(mapArea, localContext |
1796 |
.getCoordinateReferenceSystem()); |
.getCoordinateReferenceSystem()); |
1797 |
} |
} |
|
resetTransforms(); |
|
1798 |
mapImageInvalid = true; |
mapImageInvalid = true; |
1799 |
mapAreaChanged = true; |
mapAreaChanged = true; |
1800 |
repaint(); |
repaint(); |
1801 |
|
|
1802 |
// LOGGER.debug("New maparea = " + mapArea); |
LOGGER.debug("New maparea = " + mapArea); |
1803 |
return true; |
return true; |
1804 |
} |
} |
1805 |
|
|
2019 |
* {@link #getScreenToWorld()} is used. |
* {@link #getScreenToWorld()} is used. |
2020 |
*/ |
*/ |
2021 |
public Envelope tranformGeoToWindow(final double ox, final double oy, |
public Envelope tranformGeoToWindow(final double ox, final double oy, |
2022 |
final double px, final double py, |
final double px, final double py) { |
2023 |
final AffineTransform winToGeotransform) { |
final AffineTransform at = getWorldToScreenTransform(); |
|
final AffineTransform at = winToGeotransform == null ? getScreenToWorld() |
|
|
: winToGeotransform; |
|
2024 |
Point2D geoO; |
Point2D geoO; |
2025 |
try { |
// try { |
2026 |
geoO = at.inverseTransform(new Point2D.Double(ox, oy), null); |
geoO = at.transform(new Point2D.Double(ox, oy), null); |
2027 |
final Point2D geoP = at.inverseTransform( |
final Point2D geoP = at.transform(new Point2D.Double(px, py), null); |
2028 |
new Point2D.Double(px, py), null); |
return new Envelope(geoO.getX(), geoP.getX(), geoO.getY(), geoP.getY()); |
2029 |
return new Envelope(geoO.getX(), geoP.getX(), geoO.getY(), geoP |
// } catch (final NoninvertibleTransformException e) { |
2030 |
.getY()); |
// LOGGER.error(e); |
2031 |
} catch (final NoninvertibleTransformException e) { |
// return new Envelope(ox, oy, px, py); |
2032 |
LOGGER.error(e); |
// } |
|
return new Envelope(ox, oy, px, py); |
|
|
} |
|
2033 |
} |
} |
2034 |
|
|
2035 |
/** |
/** |
2049 |
final AffineTransform at = getScreenToWorld(); |
final AffineTransform at = getScreenToWorld(); |
2050 |
final Point2D geoO = at.transform(new Point2D.Double(ox, oy), null); |
final Point2D geoO = at.transform(new Point2D.Double(ox, oy), null); |
2051 |
final Point2D geoP = at.transform(new Point2D.Double(px, py), null); |
final Point2D geoP = at.transform(new Point2D.Double(px, py), null); |
2052 |
return new Envelope(geoO.getX(), geoP.getX(), geoO.getY(), geoP.getY()); |
|
2053 |
|
// Mmmmm... don't really understand why its x,x,y,y |
2054 |
|
// return new Envelope(geoO.getX(), geoP.getX(), geoO.getY(), geoP.getY()); |
2055 |
|
return new Envelope( new Coordinate(geoO.getX(), geoO.getY()), new Coordinate(geoP.getX(), geoP.getY())); |
2056 |
} |
} |
2057 |
|
|
2058 |
/** |
/** |
2168 |
|
|
2169 |
// Paint a logo to the bottom right if available |
// Paint a logo to the bottom right if available |
2170 |
if (mapImage != null) { |
if (mapImage != null) { |
2171 |
graphics.drawImage(mapImage, getBounds().width |
Rectangle visibleRect = getVisibleRect(); |
2172 |
- mapImage.getWidth() - 10, getBounds().height |
graphics.drawImage(mapImage, visibleRect.width |
2173 |
|
- mapImage.getWidth() - 10, getVisibleRect().height |
2174 |
- mapImage.getHeight() - 10, null); |
- mapImage.getHeight() - 10, null); |
2175 |
} |
} |
2176 |
|
|
|
|
|
2177 |
int y = 17; |
int y = 17; |
2178 |
|
|
2179 |
// If the rendering process is still running, indicate this is the image |
// If the rendering process is still running, indicate this is the image |
2180 |
if (forceWait || bgExecuter != null && bgExecuter.isRunning() |
if (forceWait || bgExecuter != null && bgExecuter.isRunning() |
2181 |
|| localExecuter != null && localExecuter.isRunning()) { |
|| localExecuter != null && localExecuter.isRunning()) { |
2182 |
|
|
2183 |
y+=8; |
y += 8; |
2184 |
|
|
2185 |
final Color c = graphics.getColor(); |
final Color c = graphics.getColor(); |
2186 |
graphics.setFont(waitFont); |
graphics.setFont(waitFont); |
|
// String waitStr = "Wait..."; // i8n |
|
2187 |
|
|
2188 |
graphics.setColor(getMapBackgroundColor()); |
graphics.setColor(getMapBackgroundColor()); |
2189 |
graphics.drawString(waitMsg, 5, y); |
graphics.drawString(waitMsg, 5, y); |
2190 |
graphics.setColor(getMapBackgroundColor()); |
graphics.setColor(getMapBackgroundColor()); |
2191 |
graphics.drawString(waitMsg, 7, y+2); |
graphics.drawString(waitMsg, 7, y + 2); |
2192 |
graphics.setColor(Color.BLACK); |
graphics.setColor(Color.BLACK); |
2193 |
graphics.drawString(waitMsg, 6, y+1); |
graphics.drawString(waitMsg, 6, y + 1); |
2194 |
|
|
2195 |
graphics.setColor(c); |
graphics.setColor(c); |
2196 |
|
|
2197 |
y += 24; |
y += 24; |
2198 |
} |
} |
2199 |
|
|
2349 |
newMapArea.expandBy((mapArea.getWidth() * zoomFaktor - mapArea |
newMapArea.expandBy((mapArea.getWidth() * zoomFaktor - mapArea |
2350 |
.getWidth()) / 2., (mapArea.getHeight() * zoomFaktor - mapArea |
.getWidth()) / 2., (mapArea.getHeight() * zoomFaktor - mapArea |
2351 |
.getHeight()) / 2.); |
.getHeight()) / 2.); |
2352 |
|
|
2353 |
// Move the newMapArea above the new center |
// TODO we actually want that |
2354 |
newMapArea.translate(gcenter.getX() - mapArea.centre().x, gcenter |
// // Move the newMapArea above the new center |
2355 |
.getY() |
// newMapArea.translate(gcenter.getX() - mapArea.centre().x, gcenter |
2356 |
- mapArea.centre().y); |
// .getY() |
2357 |
|
// - mapArea.centre().y); |
2358 |
|
|
2359 |
setMapArea(newMapArea); |
setMapArea(newMapArea); |
2360 |
} |
} |