Changeset 13919 in josm for trunk/src/org/openstreetmap/josm/data
- Timestamp:
- 2018-06-11T20:52:44+02:00 (7 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/osm/visitor/paint
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/OffsetIterator.java
r12505 r13919 7 7 import java.util.stream.Collectors; 8 8 9 import org.openstreetmap.josm.data.osm.Node; 9 import org.openstreetmap.josm.data.osm.INode; 10 10 import org.openstreetmap.josm.gui.MapViewState; 11 11 import org.openstreetmap.josm.gui.MapViewState.MapViewPoint; … … 55 55 * @param offset The offset of the line. 56 56 */ 57 public OffsetIterator(MapViewState mapState, List<Node> nodes, double offset) { 57 public OffsetIterator(MapViewState mapState, List<? extends INode> nodes, double offset) { 58 58 this.mapState = mapState; 59 this.nodes = nodes.stream().filter(Node::isLatLonKnown).map(mapState::getPointFor).collect(Collectors.toList()); 59 this.nodes = nodes.stream().filter(INode::isLatLonKnown).map(mapState::getPointFor).collect(Collectors.toList()); 60 60 this.offset = offset; 61 61 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r13852 r13919 49 49 import org.openstreetmap.josm.data.osm.IPrimitive; 50 50 import org.openstreetmap.josm.data.osm.IRelation; 51 import org.openstreetmap.josm.data.osm.IRelationMember; 51 52 import org.openstreetmap.josm.data.osm.IWay; 52 53 import org.openstreetmap.josm.data.osm.Node; … … 55 56 import org.openstreetmap.josm.data.osm.OsmUtils; 56 57 import org.openstreetmap.josm.data.osm.Relation; 57 import org.openstreetmap.josm.data.osm.RelationMember;58 58 import org.openstreetmap.josm.data.osm.Way; 59 59 import org.openstreetmap.josm.data.osm.WaySegment; … … 526 526 * @since 12285 527 527 */ 528 public void drawArea( Wayw, Color color, MapImage fillImage, Float extent, Float extentThreshold, boolean disabled) {528 public void drawArea(IWay<?> w, Color color, MapImage fillImage, Float extent, Float extentThreshold, boolean disabled) { 529 529 Path2D.Double pfClip = null; 530 530 if (extent != null) { … … 561 561 * @param bs The text and it's alignment. 562 562 */ 563 public void drawBoxText(Node n, BoxTextElement bs) { 563 public void drawBoxText(INode n, BoxTextElement bs) { 564 564 if (!isShowNames() || bs == null) 565 565 return; … … 631 631 * @param align alignment of the image. The top, center or bottom edge can be aligned with the way. 632 632 */ 633 public void drawRepeatImage( Wayway, MapImage pattern, boolean disabled, double offset, double spacing, double phase,633 public void drawRepeatImage(IWay<?> way, MapImage pattern, boolean disabled, double offset, double spacing, double phase, 634 634 LineImageAlignment align) { 635 635 final int imgWidth = pattern.getWidth(); … … 730 730 * @param theta the angle of rotation in radians 731 731 */ 732 public void drawNodeIcon(Node n, MapImage img, boolean disabled, boolean selected, boolean member, double theta) { 732 public void drawNodeIcon(INode n, MapImage img, boolean disabled, boolean selected, boolean member, double theta) { 733 733 MapViewPoint p = mapState.getPointFor(n); 734 734 … … 821 821 * @param strokeColor The color to use for the outer corner of the symbol 822 822 */ 823 public void drawNodeSymbol(Node n, Symbol s, Color fillColor, Color strokeColor) { 823 public void drawNodeSymbol(INode n, Symbol s, Color fillColor, Color strokeColor) { 824 824 MapViewPoint p = mapState.getPointFor(n); 825 825 … … 853 853 * @param clr The color to use for drawing the text. 854 854 */ 855 public void drawOrderNumber(Node n1, Node n2, int orderNumber, Color clr) { 855 public void drawOrderNumber(INode n1, INode n2, int orderNumber, Color clr) { 856 856 MapViewPoint p1 = mapState.getPointFor(n1); 857 857 MapViewPoint p2 = mapState.getPointFor(n2); … … 929 929 * @param disabled draw using disabled style 930 930 */ 931 public void drawRestriction( Relationr, MapImage icon, boolean disabled) {932 WayfromWay = null;933 WaytoWay = null;934 OsmPrimitive via = null;931 public void drawRestriction(IRelation<?> r, MapImage icon, boolean disabled) { 932 IWay<?> fromWay = null; 933 IWay<?> toWay = null; 934 IPrimitive via = null; 935 935 936 936 /* find the "from", "via" and "to" elements */ 937 for (RelationMember m : r.getMembers()) { 937 for (IRelationMember<?> m : r.getMembers()) { 938 938 if (m.getMember().isIncomplete()) 939 939 return; 940 940 else { 941 941 if (m.isWay()) { 942 Way w = m.getWay();942 IWay<?> w = (IWay<?>) m.getMember(); 943 943 if (w.getNodesCount() < 2) { 944 944 continue; … … 964 964 } 965 965 } else if (m.isNode()) { 966 Node n = m.getNode();966 INode n = (INode) m.getMember(); 967 967 if (via == null && "via".equals(m.getRole())) { 968 968 via = n; … … 1007 1007 1008 1008 /* find the "direct" nodes before the via node */ 1009 Node fromNode; 1009 INode fromNode; 1010 1010 if (fromWay.firstNode() == via) { 1011 1011 fromNode = fromWay.getNode(1); … … 1227 1227 * @param onewayReversed for oneway=-1 and similar 1228 1228 */ 1229 public void drawWay( Wayway, Color color, BasicStroke line, BasicStroke dashes, Color dashedColor, float offset,1229 public void drawWay(IWay<?> way, Color color, BasicStroke line, BasicStroke dashes, Color dashedColor, float offset, 1230 1230 boolean showOrientation, boolean showHeadArrowOnly, 1231 1231 boolean showOneway, boolean onewayReversed) { … … 1241 1241 } 1242 1242 1243 List<Node> wayNodes = way.getNodes(); 1243 List<? extends INode> wayNodes = way.getNodes(); 1244 1244 if (wayNodes.size() < 2) return; 1245 1245 … … 1410 1410 } 1411 1411 1412 private MapViewPath getPath( Wayw) {1412 private MapViewPath getPath(IWay<?> w) { 1413 1413 MapViewPath path = new MapViewPath(mapState); 1414 1414 if (w.isClosed()) { … … 1420 1420 } 1421 1421 1422 private static Path2D.Double getPFClip( Wayw, double extent) {1422 private static Path2D.Double getPFClip(IWay<?> w, double extent) { 1423 1423 Path2D.Double clip = new Path2D.Double(); 1424 1424 buildPFClip(clip, w.getNodes(), extent); … … 1451 1451 * @param extent the extent 1452 1452 */ 1453 private static void buildPFClip(Path2D.Double clip, List<Node> nodes, double extent) { 1453 private static void buildPFClip(Path2D.Double clip, List<? extends INode> nodes, double extent) { 1454 1454 boolean initial = true; 1455 for (Node n : nodes) { 1455 for (INode n : nodes) { 1456 1456 EastNorth p = n.getEastNorth(); 1457 1457 if (p != null) {
Note:
See TracChangeset
for help on using the changeset viewer.