Changeset 4080 in josm
- Timestamp:
- 2011-05-15T14:58:09+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/WMSLayer.java
r4079 r4080 28 28 import javax.swing.JCheckBoxMenuItem; 29 29 import javax.swing.JFileChooser; 30 import javax.swing.JMenuItem; 30 31 import javax.swing.JOptionPane; 31 32 … … 574 575 } 575 576 576 public class ChangeResolutionAction extends AbstractAction {577 public static class ChangeResolutionAction extends AbstractAction implements LayerAction { 577 578 public ChangeResolutionAction() { 578 579 super(tr("Change resolution")); 579 580 } 581 582 private void changeResolution(WMSLayer layer) { 583 layer.resolution = layer.mv.getDist100PixelText(); 584 layer.info.setPixelPerDegree(layer.getPPD()); 585 layer.settingsChanged = true; 586 for(int x = 0; x<layer.dax; ++x) { 587 for(int y = 0; y<layer.day; ++y) { 588 layer.images[x][y].changePosition(-1, -1); 589 } 590 } 591 } 592 580 593 @Override 581 594 public void actionPerformed(ActionEvent ev) { 582 resolution = mv.getDist100PixelText(); 583 info.setPixelPerDegree(getPPD()); 584 settingsChanged = true; 585 for(int x = 0; x<dax; ++x) { 586 for(int y = 0; y<day; ++y) { 587 images[x][y].changePosition(-1, -1); 588 } 589 } 590 mv.repaint(); 595 596 if (LayerListDialog.getInstance() == null) 597 return; 598 599 List<Layer> layers = LayerListDialog.getInstance().getModel().getSelectedLayers(); 600 for (Layer l: layers) { 601 changeResolution((WMSLayer) l); 602 } 603 Main.map.mapView.repaint(); 604 } 605 606 @Override 607 public boolean supportLayers(List<Layer> layers) { 608 for (Layer l: layers) { 609 if (!(l instanceof WMSLayer)) 610 return false; 611 } 612 return true; 613 } 614 615 @Override 616 public Component createMenuComponent() { 617 return new JMenuItem(this); 618 } 619 620 @Override 621 public boolean equals(Object obj) { 622 return obj instanceof ChangeResolutionAction; 591 623 } 592 624 }
Note:
See TracChangeset
for help on using the changeset viewer.