Changeset 15 in josm for src/org/openstreetmap/josm/actions/mapmode/AddLineSegmentAction.java
- Timestamp:
- 2005-10-07T01:13:49+02:00 (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/org/openstreetmap/josm/actions/mapmode/AddLineSegmentAction.java
r8 r15 59 59 public void registerListener() { 60 60 super.registerListener(); 61 mv.addMouseListener(this);62 mv.addMouseMotionListener(this);61 layer.addMouseListener(this); 62 layer.addMouseMotionListener(this); 63 63 } 64 64 … … 66 66 public void unregisterListener() { 67 67 super.unregisterListener(); 68 mv.removeMouseListener(this);69 mv.removeMouseMotionListener(this);68 layer.removeMouseListener(this); 69 layer.removeMouseMotionListener(this); 70 70 drawHint(false); 71 71 } … … 79 79 return; 80 80 81 OsmPrimitive clicked = mv.getNearest(e.getPoint(), false);81 OsmPrimitive clicked = layer.getNearest(e.getPoint(), false); 82 82 if (clicked == null || !(clicked instanceof Node)) 83 83 return; … … 96 96 return; 97 97 98 OsmPrimitive clicked = mv.getNearest(e.getPoint(), (e.getModifiersEx() & MouseEvent.ALT_DOWN_MASK) != 0);98 OsmPrimitive clicked = layer.getNearest(e.getPoint(), (e.getModifiersEx() & MouseEvent.ALT_DOWN_MASK) != 0); 99 99 if (clicked == null || clicked == second || !(clicked instanceof Node)) 100 100 return; … … 161 161 } 162 162 163 mv.repaint();163 layer.repaint(); 164 164 } 165 165 … … 175 175 return; 176 176 177 Graphics g = mv.getGraphics();177 Graphics g = layer.getGraphics(); 178 178 g.setColor(Color.BLACK); 179 179 g.setXORMode(Color.WHITE); 180 Point firstDrawn = mv.getScreenPoint(first.coor);181 Point secondDrawn = mv.getScreenPoint(second.coor);180 Point firstDrawn = layer.getScreenPoint(first.coor); 181 Point secondDrawn = layer.getScreenPoint(second.coor); 182 182 g.drawLine(firstDrawn.x, firstDrawn.y, secondDrawn.x, secondDrawn.y); 183 183 hintDrawn = !hintDrawn;
Note:
See TracChangeset
for help on using the changeset viewer.