/[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 614 by alfonx, Sat Dec 12 18:26:15 2009 UTC revision 615 by alfonx, Mon Dec 14 17:31:41 2009 UTC
# Line 2380  public class XMapPane extends JPanel { Line 2380  public class XMapPane extends JPanel {
2380           * @param center           * @param center
2381           *            position in window coordinates           *            position in window coordinates
2382           * @param zoomFaktor           * @param zoomFaktor
2383           *            > 1 for zoom in, < 1 for zoom out. Default is 1.33.           *            > 1 for zoom out, < 1 for zoom in. Default is .5
2384           */           */
2385          public void zoomTo(Point center, Double zoomFaktor) {          public void zoomTo(Point center, Double zoomFaktor) {
2386                  if (zoomFaktor == null || zoomFaktor == 0.)                  if (zoomFaktor == null || zoomFaktor == 0.)
2387                          zoomFaktor = 2.;                          zoomFaktor = .5;
2388    
2389                  final Point2D gcenter = getScreenToWorld().transform(center, null);                  final Point2D gcenter = getScreenToWorld().transform(center, null);
2390                  center = null;                  center = null;
# Line 2406  public class XMapPane extends JPanel { Line 2406  public class XMapPane extends JPanel {
2406                                  .getHeight()) / 2.);                                  .getHeight()) / 2.);
2407    
2408                  // // Move the newMapArea above the new center if we zoom in:                  // // Move the newMapArea above the new center if we zoom in:
2409                  if (zoomFaktor >= 1) {                  newMapArea.translate(gcenter.getX() - mapArea.centre().x, gcenter
2410                          newMapArea.translate(gcenter.getX() - mapArea.centre().x, gcenter                                  .getY()
2411                                          .getY()                                  - mapArea.centre().y);
                                         - mapArea.centre().y);  
                 }  
2412    
2413                  setMapArea(newMapArea);                  setMapArea(newMapArea);
2414          }          }

Legend:
Removed from v.614  
changed lines
  Added in v.615

[email protected]
ViewVC Help
Powered by ViewVC 1.1.26