Changeset 33408 in osm for applications/editors/josm/plugins/pt_assistant
- Timestamp:
- 2017-06-22T18:15:31+02:00 (7 years ago)
- Location:
- applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/actions/AddStopPositionAction.java
r33367 r33408 1 // License: GPL. For details, see LICENSE file. 1 2 package org.openstreetmap.josm.plugins.pt_assistant.actions; 2 3 … … 50 51 51 52 private static Cursor getCursor() { 52 try { 53 return ImageProvider.getCursor("crosshair", "bus"); 54 } catch (Exception e) { 55 Main.error(e); 56 } 57 return Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR); 53 Cursor cursor = ImageProvider.getCursor("crosshair", "bus"); 54 if(cursor == null) 55 cursor = Cursor.getPredefinedCursor(Cursor.CROSSHAIR_CURSOR); 56 return cursor; 58 57 } 59 58 … … 73 72 74 73 @Override 75 public void mouseMoved 74 public void mouseMoved(MouseEvent e) { 76 75 77 76 //while the mouse is moving, surroundings are checked … … 88 87 Main.map.mapView.getNearestWaySegments(e.getPoint(), OsmPrimitive::isSelectable); 89 88 90 if( wss.size() > 0) {89 if(!wss.isEmpty()) { 91 90 for(WaySegment ws : wss) { 92 91 newHighlights.add(ws.way); … … 101 100 102 101 @Override 103 public void mouseClicked 102 public void mouseClicked(MouseEvent e) { 104 103 105 104 Boolean newNode = false; … … 150 149 private void updateHighlights() 151 150 { 152 if(oldHighlights.size() > 0 || newHighlights.size() > 0) { 151 if(oldHighlights.isEmpty() && newHighlights.isEmpty()) { 152 return; 153 } 153 154 154 155 156 155 for(OsmPrimitive osm : oldHighlights) { 156 osm.setHighlighted(false); 157 } 157 158 158 159 160 159 for(OsmPrimitive osm : newHighlights) { 160 osm.setHighlighted(true); 161 } 161 162 162 163 Main.getLayerManager().getEditLayer().invalidate(); 163 164 164 oldHighlights.clear(); 165 oldHighlights.addAll(newHighlights); 166 newHighlights.clear(); 167 } 165 oldHighlights.clear(); 166 oldHighlights.addAll(newHighlights); 167 newHighlights.clear(); 168 168 } 169 169 -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/actions/EdgeSelectionAction.java
r33407 r33408 1 // License: GPL. For details, see LICENSE file. 1 2 package org.openstreetmap.josm.plugins.pt_assistant.actions; 2 3 -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/actions/SplitRoundaboutAction.java
r33404 r33408 1 // License: GPL. For details, see LICENSE file. 1 2 package org.openstreetmap.josm.plugins.pt_assistant.actions; 2 3 -
applications/editors/josm/plugins/pt_assistant/src/org/openstreetmap/josm/plugins/pt_assistant/gui/PTAssistantLayerManager.java
r33362 r33408 1 // License: GPL. For details, see LICENSE file. 1 2 package org.openstreetmap.josm.plugins.pt_assistant.gui; 2 3 … … 11 12 import org.openstreetmap.josm.plugins.pt_assistant.utils.RouteUtils; 12 13 13 public class PTAssistantLayerManager implements SelectionChangedListener {14 public class PTAssistantLayerManager implements SelectionChangedListener { 14 15 15 public static PTAssistantLayerManager PTLM = new PTAssistantLayerManager();16 16 public final static PTAssistantLayerManager PTLM = new PTAssistantLayerManager(); 17 private PTAssistantLayer layer; 17 18 18 19 public PTAssistantLayer getLayer() { … … 23 24 } 24 25 25 public void resetLayer() 26 { 26 public void resetLayer() { 27 27 layer = null; 28 28 } … … 37 37 38 38 for (OsmPrimitive primitive : newSelection) { 39 if (primitive.getType().equals(OsmPrimitiveType.RELATION) ) {40 if (RouteUtils.isTwoDirectionRoute((Relation) primitive)) {39 if (primitive.getType().equals(OsmPrimitiveType.RELATION) 40 && RouteUtils.isTwoDirectionRoute((Relation) primitive)) { 41 41 routes.add(primitive); 42 }43 42 } 44 43 }
Note:
See TracChangeset
for help on using the changeset viewer.