/[schmitzm]/trunk/src/skrueger/geotools/XMapPane.java
ViewVC logotype

Diff of /trunk/src/skrueger/geotools/XMapPane.java

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 539 by alfonx, Fri Nov 20 19:10:05 2009 UTC revision 540 by alfonx, Fri Nov 20 19:34:50 2009 UTC
# Line 794  public class XMapPane extends JPanel { Line 794  public class XMapPane extends JPanel {
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                          }                          }
# Line 818  public class XMapPane extends JPanel { Line 818  public class XMapPane extends JPanel {
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                          }                          }
# Line 844  public class XMapPane extends JPanel { Line 844  public class XMapPane extends JPanel {
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                          }                          }
# Line 870  public class XMapPane extends JPanel { Line 870  public class XMapPane extends JPanel {
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                          }                          }
# Line 979  public class XMapPane extends JPanel { Line 979  public class XMapPane extends JPanel {
979           */           */
980          protected boolean drawScaledPreviewImage_Zoom(final Graphics2D graphics) {          protected boolean drawScaledPreviewImage_Zoom(final Graphics2D graphics) {
981    
982                  if (1 == 1)return false;  //              if (1 == 1)return false;
983                                    
984                  if (quickPreviewHint == 0)                  if (quickPreviewHint == 0)
985                          return false;                          return false;
# Line 1055  public class XMapPane extends JPanel { Line 1055  public class XMapPane extends JPanel {
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                  }                  }
# Line 1073  public class XMapPane extends JPanel { Line 1073  public class XMapPane extends JPanel {
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;
# Line 1155  public class XMapPane extends JPanel { Line 1155  public class XMapPane extends JPanel {
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;
# Line 1519  public class XMapPane extends JPanel { Line 1519  public class XMapPane extends JPanel {
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
# Line 1642  public class XMapPane extends JPanel { Line 1643  public class XMapPane extends JPanel {
1643          private void resetTransforms() {          private void resetTransforms() {
1644                  ReferencedEnvelope refMapEnv = new ReferencedEnvelope(mapArea,                  ReferencedEnvelope refMapEnv = new ReferencedEnvelope(mapArea,
1645                                  getContext().getCoordinateReferenceSystem());                                  getContext().getCoordinateReferenceSystem());
1646                  //  
1647                  Rectangle paintArea = getBounds();                  Rectangle paintArea = getVisibleRect(); // NOT USE GET BOUNDS!
1648                                    
                 if (!getBounds().equals(getVisibleRect())) {  
                         System.out.println("did we expect that?");  
                 }  
1649                  //                          //        
1650                  // double xscale = paintArea.getWidth() / refEnv.getWidth();                  // double xscale = paintArea.getWidth() / refEnv.getWidth();
1651                  // double yscale = paintArea.getHeight() / refEnv.getHeight();                  // double yscale = paintArea.getHeight() / refEnv.getHeight();
# Line 2170  public class XMapPane extends JPanel { Line 2168  public class XMapPane extends JPanel {
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    

Legend:
Removed from v.539  
changed lines
  Added in v.540

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26