Changeset 29586 in osm for applications/editors/josm/plugins/routing
- Timestamp:
- 2013-05-12T17:45:58+02:00 (11 years ago)
- Location:
- applications/editors/josm/plugins/routing
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/routing/.settings/org.eclipse.jdt.core.prefs
r28966 r29586 1 1 eclipse.preferences.version=1 2 org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore 3 org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull 4 org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault 5 org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable 6 org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled 2 7 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled 3 8 org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 … … 7 12 org.eclipse.jdt.core.compiler.debug.localVariable=generate 8 13 org.eclipse.jdt.core.compiler.debug.sourceFile=generate 14 org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning 9 15 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error 16 org.eclipse.jdt.core.compiler.problem.autoboxing=ignore 17 org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning 18 org.eclipse.jdt.core.compiler.problem.deadCode=warning 19 org.eclipse.jdt.core.compiler.problem.deprecation=warning 20 org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled 21 org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled 22 org.eclipse.jdt.core.compiler.problem.discouragedReference=warning 23 org.eclipse.jdt.core.compiler.problem.emptyStatement=ignore 10 24 org.eclipse.jdt.core.compiler.problem.enumIdentifier=error 25 org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore 26 org.eclipse.jdt.core.compiler.problem.fallthroughCase=ignore 27 org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled 28 org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore 29 org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning 30 org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning 31 org.eclipse.jdt.core.compiler.problem.forbiddenReference=error 32 org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning 33 org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled 34 org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning 35 org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning 36 org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore 37 org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore 38 org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning 39 org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore 40 org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore 41 org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled 42 org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=ignore 43 org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore 44 org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled 45 org.eclipse.jdt.core.compiler.problem.missingSerialVersion=ignore 46 org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=ignore 47 org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning 48 org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning 49 org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=ignore 50 org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error 51 org.eclipse.jdt.core.compiler.problem.nullReference=warning 52 org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error 53 org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning 54 org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning 55 org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore 56 org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=ignore 57 org.eclipse.jdt.core.compiler.problem.potentialNullReference=ignore 58 org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore 59 org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning 60 org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning 61 org.eclipse.jdt.core.compiler.problem.redundantNullCheck=ignore 62 org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore 63 org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=ignore 64 org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore 65 org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore 66 org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled 67 org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning 68 org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled 69 org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled 70 org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore 71 org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning 72 org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled 73 org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning 74 org.eclipse.jdt.core.compiler.problem.unclosedCloseable=warning 75 org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore 76 org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning 77 org.eclipse.jdt.core.compiler.problem.unnecessaryElse=ignore 78 org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=ignore 79 org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore 80 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore 81 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled 82 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled 83 org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled 84 org.eclipse.jdt.core.compiler.problem.unusedImport=warning 85 org.eclipse.jdt.core.compiler.problem.unusedLabel=warning 86 org.eclipse.jdt.core.compiler.problem.unusedLocal=warning 87 org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=ignore 88 org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore 89 org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled 90 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled 91 org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled 92 org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning 93 org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning 94 org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning 11 95 org.eclipse.jdt.core.compiler.source=1.6 -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingLayer.java
r27760 r29586 275 275 if(routingModel != null) { 276 276 if(routingModel.routingGraph != null && routingModel.routingGraph.getGraph() != null) { 277 Color color2 = ColorHelper.html2color("#00ff00"); /* just green for now */278 277 Set<OsmEdge> graphEdges = routingModel.routingGraph.getGraph().edgeSet(); 279 OsmEdge firstedge = (OsmEdge) graphEdges.toArray()[0]; 280 Point from = mv.getPoint(firstedge.fromEastNorth()); 281 g.drawRect(from.x-4, from.y+4, from.x+4, from.y-4); 282 for(OsmEdge edge : graphEdges) { 283 drawGraph(g, mv, edge, color2, width); 278 if (!graphEdges.isEmpty()) { 279 Color color2 = ColorHelper.html2color("#00ff00"); /* just green for now */ 280 OsmEdge firstedge = (OsmEdge) graphEdges.toArray()[0]; 281 Point from = mv.getPoint(firstedge.fromEastNorth()); 282 g.drawRect(from.x-4, from.y+4, from.x+4, from.y-4); 283 for(OsmEdge edge : graphEdges) { 284 drawGraph(g, mv, edge, color2, width); 285 } 284 286 } 285 287 } -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/RoutingPlugin.java
r29525 r29586 175 175 public void addLayer() { 176 176 OsmDataLayer osmLayer = Main.map.mapView.getEditLayer(); 177 RoutingLayer layer = new RoutingLayer(tr("Routing") + " [" + osmLayer.getName() + "]", osmLayer); 178 layers.add(layer); 179 Main.main.addLayer(layer); 177 if (osmLayer != null) { 178 RoutingLayer layer = new RoutingLayer(tr("Routing") + " [" + osmLayer.getName() + "]", osmLayer); 179 layers.add(layer); 180 Main.main.addLayer(layer); 181 } 180 182 } 181 183 -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/AddRouteNodeAction.java
r27288 r29586 37 37 import org.openstreetmap.josm.data.osm.Node; 38 38 import org.openstreetmap.josm.gui.MapFrame; 39 import org.openstreetmap.josm.gui.layer.Layer; 39 40 import org.openstreetmap.josm.tools.ImageProvider; 40 41 import org.openstreetmap.josm.gui.layer.Layer;42 41 43 42 import com.innovant.josm.plugin.routing.RoutingLayer; 44 43 import com.innovant.josm.plugin.routing.RoutingPlugin; 45 import com.innovant.josm.plugin.routing.gui.RoutingDialog;46 44 47 45 /** … … 53 51 */ 54 52 public class AddRouteNodeAction extends MapMode { 55 /** 56 * Serial. 57 */ 58 private static final long serialVersionUID = 1L; 53 59 54 /** 60 55 * Logger. 61 56 */ 62 57 static Logger logger = Logger.getLogger(AddRouteNodeAction.class); 63 /**64 * Routing Dialog.65 */66 private RoutingDialog routingDialog;67 58 68 59 /** … … 75 66 tr("Click to add destination."), 76 67 mapFrame, ImageProvider.getCursor("crosshair", null)); 77 this.routingDialog = RoutingPlugin.getInstance().getRoutingDialog();78 68 } 79 69 … … 102 92 logger.debug("selected node " + node); 103 93 layer.getRoutingModel().addNode(node); 104 routingDialog.addNode(node);94 RoutingPlugin.getInstance().getRoutingDialog().addNode(node); 105 95 } 106 96 } -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/MoveRouteNodeAction.java
r27288 r29586 56 56 */ 57 57 public class MoveRouteNodeAction extends MapMode { 58 /**59 * Serial.60 */61 private static final long serialVersionUID = 1L;62 58 63 59 /** … … 70 66 */ 71 67 static Logger logger = Logger.getLogger(RoutingLayer.class); 72 73 /**74 * Routing Dialog.75 */76 private RoutingDialog routingDialog;77 68 78 69 /** … … 90 81 tr("Click and drag to move destination"), 91 82 mapFrame, ImageProvider.getCursor("normal", "move")); 92 this.routingDialog = RoutingPlugin.getInstance().getRoutingDialog();93 83 } 94 84 … … 141 131 RoutingLayer layer = (RoutingLayer)Main.map.mapView.getActiveLayer(); 142 132 RoutingModel routingModel = layer.getRoutingModel(); 133 RoutingDialog routingDialog = RoutingPlugin.getInstance().getRoutingDialog(); 143 134 // Search for nearest highway node 144 135 Node node = null; -
applications/editors/josm/plugins/routing/src/com/innovant/josm/plugin/routing/actions/RemoveRouteNodeAction.java
r27288 r29586 38 38 import org.openstreetmap.josm.data.osm.Node; 39 39 import org.openstreetmap.josm.gui.MapFrame; 40 import org.openstreetmap.josm.gui.layer.Layer; 40 41 import org.openstreetmap.josm.tools.ImageProvider; 41 import org.openstreetmap.josm.gui.layer.Layer;42 42 43 43 import com.innovant.josm.plugin.routing.RoutingLayer; 44 44 import com.innovant.josm.plugin.routing.RoutingModel; 45 45 import com.innovant.josm.plugin.routing.RoutingPlugin; 46 import com.innovant.josm.plugin.routing.gui.RoutingDialog;47 46 48 47 /** … … 54 53 */ 55 54 public class RemoveRouteNodeAction extends MapMode { 56 /**57 * Serial.58 */59 private static final long serialVersionUID = 1L;60 55 61 56 /** … … 68 63 */ 69 64 static Logger logger = Logger.getLogger(RoutingLayer.class); 70 /**71 * Routing Dialog.72 */73 private RoutingDialog routingDialog;74 65 75 66 public RemoveRouteNodeAction(MapFrame mapFrame) { … … 78 69 tr("Click to remove destination"), 79 70 mapFrame, ImageProvider.getCursor("normal", "delete")); 80 this.routingDialog = RoutingPlugin.getInstance().getRoutingDialog();81 71 } 82 72 … … 114 104 logger.debug("Removing node " + nl.get(index)); 115 105 routingModel.removeNode(index); 116 routingDialog.removeNode(index);106 RoutingPlugin.getInstance().getRoutingDialog().removeNode(index); 117 107 Main.map.repaint(); 118 108 } else {
Note:
See TracChangeset
for help on using the changeset viewer.