Changeset 198 in josm for src/org/openstreetmap/josm/actions


Ignore:
Timestamp:
2007-01-14T09:41:24+01:00 (18 years ago)
Author:
imi
Message:
  • added different cursors for mapmodes (actually just finished what was begun)
  • added feature to change the key in property dialog as well as the value
  • added dockable toggle dialogs
  • fixed exception when loading GPX files at command line
Location:
src/org/openstreetmap/josm/actions/mapmode
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/org/openstreetmap/josm/actions/mapmode/AddNodeAction.java

    r184 r198  
    2525import org.openstreetmap.josm.data.osm.Way;
    2626import org.openstreetmap.josm.gui.MapFrame;
    27 import org.openstreetmap.josm.tools.ImageProvider;
    2827
    2928/**
     
    5453
    5554        public AddNodeAction(MapFrame mapFrame, String name, Mode mode, String desc) {
    56                 super(name, "node/"+mode, desc, mapFrame, ImageProvider.getCursor("crosshair", "node"));
     55                super(name, "node/"+mode, desc, mapFrame, Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
    5756                this.mode = mode;
    5857                putValue("help", "Action/AddNode/"+Character.toUpperCase(mode.toString().charAt(0))+mode.toString().substring(1));
     
    6261                super.enterMode();
    6362                Main.map.mapView.addMouseListener(this);
    64                 Main.map.mapView.setCursor(Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR));
    6563        }
    6664
     
    6866                super.exitMode();
    6967                Main.map.mapView.removeMouseListener(this);
    70                 Main.map.mapView.setCursor(Cursor.getDefaultCursor());
    7168        }
    7269
  • src/org/openstreetmap/josm/actions/mapmode/MapMode.java

    r178 r198  
    2121 */
    2222abstract public class MapMode extends JosmAction implements MouseListener, MouseMotionListener {
    23 //      private final Cursor cursor;
    24 //      private Cursor oldCursor;
     23        private final Cursor cursor;
     24        private Cursor oldCursor;
    2525
    2626        /**
     
    2929        public MapMode(String name, String iconName, String tooltip, int keystroke, MapFrame mapFrame, Cursor cursor) {
    3030                super(name, "mapmode/"+iconName, tooltip, keystroke, 0, false);
    31 //              this.cursor = cursor;
     31                this.cursor = cursor;
    3232                putValue("active", false);
    3333        }
     
    4040                putValue(SMALL_ICON, ImageProvider.get("mapmode", iconName));
    4141                putValue(SHORT_DESCRIPTION, tooltip);
    42 //              this.cursor = cursor;
     42                this.cursor = cursor;
    4343        }
    4444
    4545        public void enterMode() {
    4646                putValue("active", true);
    47 //              oldCursor = Main.map.mapView.getCursor();
    48 //              Main.map.mapView.setCursor(cursor);
     47                oldCursor = Main.map.mapView.getCursor();
     48                Main.map.mapView.setCursor(cursor);
    4949               
    5050        }
    5151        public void exitMode() {
    5252                putValue("active", false);
    53 //              Main.map.mapView.setCursor(oldCursor);
     53                Main.map.mapView.setCursor(oldCursor);
    5454        }
    5555
Note: See TracChangeset for help on using the changeset viewer.