- Resource v1 = graph.getSingleObject(mapElement, DN.HasStartVertex);
- double[] coords1 = graph.getRelatedValue(v1, DIA.HasLocation);
- Resource v2 = graph.getSingleObject(mapElement, DN.HasEndVertex);
- double[] coords2 = graph.getRelatedValue(v2, DIA.HasLocation);
- Point2D p1 = DistrictNetworkNodeUtils.calculatePoint2D(new Point2D.Double(coords1[0], coords1[1]), null);
- Point2D p2 = DistrictNetworkNodeUtils.calculatePoint2D(new Point2D.Double(coords2[0], coords2[1]), null);
+ if (isVertex) {
+ double[] coords = graph.getRelatedValue(mapElement, DIA.HasLocation);
+ Point2D p = DistrictNetworkNodeUtils.calculatePoint2D(new Point2D.Double(coords[0], coords[1]), null);
+ return new StyleResult(p, p, result);
+ }
+ else if (isEdge) {
+ Resource v1 = graph.getSingleObject(mapElement, DN.HasStartVertex);
+ double[] coords1 = graph.getRelatedValue(v1, DIA.HasLocation);
+ Resource v2 = graph.getSingleObject(mapElement, DN.HasEndVertex);
+ double[] coords2 = graph.getRelatedValue(v2, DIA.HasLocation);
+ Point2D p1 = DistrictNetworkNodeUtils.calculatePoint2D(new Point2D.Double(coords1[0], coords1[1]), null);
+ Point2D p2 = DistrictNetworkNodeUtils.calculatePoint2D(new Point2D.Double(coords2[0], coords2[1]), null);
+
+ return new StyleResult(p1, p2, result);
+ }