Changeset 3291 in josm
- Timestamp:
- 2010-06-01T19:20:46+02:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPaintSettings.java
r3185 r3291 30 30 private boolean fillConnectionNode; 31 31 private Color selectedColor; 32 private Color relationSelectedColor; 32 33 private Color highlightColor; 33 34 private Color inactiveColor; … … 49 50 50 51 selectedColor = PaintColors.SELECTED.get(); 52 relationSelectedColor = PaintColors.RELATIONSELECTED.get(); 51 53 highlightColor = PaintColors.HIGHLIGHT.get(); 52 54 inactiveColor = PaintColors.INACTIVE.get(); … … 100 102 public Color getSelectedColor() { 101 103 return selectedColor; 104 } 105 106 public Color getRelationSelectedColor() { 107 return relationSelectedColor; 102 108 } 103 109 -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPaintVisitor.java
r3269 r3291 129 129 130 130 if (isZoomOk(nodeStyle)) { 131 nodeStyle.paintPrimitive(n, paintSettings, painter, n.isSelected()); 131 nodeStyle.paintPrimitive(n, paintSettings, painter, n.isSelected(), 132 false); 132 133 } 133 134 } … … 178 179 179 180 if(wayStyle instanceof LineElemStyle) { 180 wayStyle.paintPrimitive(w, paintSettings, painter, data.isSelected(w) );181 wayStyle.paintPrimitive(w, paintSettings, painter, data.isSelected(w), false); 181 182 } else if (wayStyle instanceof AreaElemStyle) { 182 183 AreaElemStyle areaStyle = (AreaElemStyle) wayStyle; … … 189 190 } 190 191 } 191 areaStyle.getLineStyle().paintPrimitive(w, paintSettings, painter, data.isSelected(w) );192 areaStyle.getLineStyle().paintPrimitive(w, paintSettings, painter, data.isSelected(w), false); 192 193 } 193 194 } … … 201 202 Way way = (Way)osm; 202 203 AreaElemStyle areaStyle = (AreaElemStyle)style; 203 areaStyle.getLineStyle().paintPrimitive(way, paintSettings, painter, true );204 areaStyle.getLineStyle().paintPrimitive(way, paintSettings, painter, true, true); 204 205 if(area) { 205 painter.drawArea(getPolygon(way), (areaselected ? paintSettings.get SelectedColor() : areaStyle.color), painter.getAreaName(way));206 painter.drawArea(getPolygon(way), (areaselected ? paintSettings.getRelationSelectedColor() : areaStyle.color), painter.getAreaName(way)); 206 207 } 207 208 } else { 208 style.paintPrimitive(osm, paintSettings, painter, true );209 style.paintPrimitive(osm, paintSettings, painter, true, true); 209 210 } 210 211 } … … 212 213 { 213 214 if(isZoomOk(style)) { 214 style.paintPrimitive(osm, paintSettings, painter, true );215 style.paintPrimitive(osm, paintSettings, painter, true, true); 215 216 } 216 217 } … … 497 498 498 499 boolean selected = pd.selected || data.isSelected(r); 499 painter.drawArea(p, selected ? paintSettings.getSelectedColor() : areaStyle.color, painter.getAreaName(r)); 500 painter.drawArea(p, selected ? paintSettings.getRelationSelectedColor() 501 : areaStyle.color, painter.getAreaName(r)); 500 502 visible = true; 501 503 } … … 514 516 if(zoomok && (wInner.mappaintDrawnCode != paintid || multipolygon.getOuterWays().isEmpty())) { 515 517 ((AreaElemStyle)wayStyle).getLineStyle().paintPrimitive(wInner, paintSettings, painter, (data.isSelected(wInner) 516 || data.isSelected(r)) );518 || data.isSelected(r)), r.isSelected()); 517 519 } 518 520 wInner.mappaintDrawnCode = paintid; … … 546 548 if(zoomok) 547 549 { 548 ((AreaElemStyle)wayStyle).getLineStyle().paintPrimitive(wOuter, paintSettings, painter, (data.isSelected(wOuter) || data.isSelected(r)) );550 ((AreaElemStyle)wayStyle).getLineStyle().paintPrimitive(wOuter, paintSettings, painter, (data.isSelected(wOuter) || data.isSelected(r)), r.isSelected()); 549 551 } 550 552 wOuter.mappaintDrawnCode = paintid; -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java
r3269 r3291 39 39 private final Color textColor; 40 40 private final Color selectedColor; 41 private final Color relationSelectedColor; 41 42 private final Color areaTextColor; 42 43 private final Color nodeColor; … … 64 65 this.textColor = PaintColors.TEXT.get(); 65 66 this.selectedColor = PaintColors.SELECTED.get(); 67 this.relationSelectedColor = PaintColors.RELATIONSELECTED.get(); 66 68 this.areaTextColor = PaintColors.AREA_TEXT.get(); 67 69 this.nodeColor = PaintColors.NODE.get(); … … 181 183 } 182 184 183 public void drawNodeIcon(Node n, ImageIcon icon, boolean selected, String name) {185 public void drawNodeIcon(Node n, ImageIcon icon, boolean selected, boolean member, String name) { 184 186 Point p = nc.getPoint(n); 185 187 if ((p.x < 0) || (p.y < 0) || (p.x > nc.getWidth()) || (p.y > nc.getHeight())) return; … … 200 202 if (selected) 201 203 { 202 g.setColor ( selectedColor );204 g.setColor ( member ? relationSelectedColor : selectedColor ); 203 205 g.drawRect (p.x-w/2-2, p.y-h/2-2, w+4, h+4); 204 206 } … … 298 300 299 301 if (selected) { 300 g.setColor( selectedColor);302 g.setColor(relationSelectedColor); 301 303 g.drawRect((int)(pVia.x+vx+vx2)-w/2-2,(int)(pVia.y+vy+vy2)-h/2-2, w+4, h+4); 302 304 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/PaintColors.java
r3180 r3291 13 13 INACTIVE(marktr("inactive"), Color.darkGray), 14 14 SELECTED(marktr("selected"), Color.red), 15 RELATIONSELECTED(marktr("Relation: selected"), Color.magenta), 15 16 NODE(marktr("Node: standard"), Color.yellow), 16 17 CONNECTION(marktr("Node: connection"), Color.yellow), -
trunk/src/org/openstreetmap/josm/gui/DefaultNameFormatter.java
r3286 r3291 169 169 name = tr("incomplete"); 170 170 } else { 171 name = relation.get("type");171 name = tr(relation.get("type")); 172 172 if (name == null) { 173 173 name = (relation.get("public_transport") != null) ? tr("public transport") : ""; -
trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java
r2675 r3291 48 48 49 49 @Override 50 public void paintPrimitive(OsmPrimitive primitive, MapPaintSettings paintSettings, MapPainter painter, boolean selected ) {50 public void paintPrimitive(OsmPrimitive primitive, MapPaintSettings paintSettings, MapPainter painter, boolean selected, boolean member) { 51 51 // TODO 52 52 /*Way way = (Way)primitive; -
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyle.java
r2679 r3291 53 53 } 54 54 55 public abstract void paintPrimitive(OsmPrimitive primitive, MapPaintSettings paintSettings, MapPainter painter, boolean selected );55 public abstract void paintPrimitive(OsmPrimitive primitive, MapPaintSettings paintSettings, MapPainter painter, boolean selected, boolean member); 56 56 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/IconElemStyle.java
r3222 r3291 39 39 } 40 40 @Override 41 public void paintPrimitive(OsmPrimitive primitive, MapPaintSettings settings, MapPainter painter, boolean selected ) {41 public void paintPrimitive(OsmPrimitive primitive, MapPaintSettings settings, MapPainter painter, boolean selected, boolean member) { 42 42 if (painter.isShowIcons()) { 43 43 Node n = (Node) primitive; 44 44 String name = painter.isShowNames() && annotate?painter.getNodeName(n):null; 45 painter.drawNodeIcon(n, (painter.isInactive() || n.isDisabled())?getDisabledIcon():icon, selected, name);45 painter.drawNodeIcon(n, (painter.isInactive() || n.isDisabled())?getDisabledIcon():icon, selected, member, name); 46 46 } else { 47 SimpleNodeElemStyle.INSTANCE.paintPrimitive(primitive, settings, painter, selected );47 SimpleNodeElemStyle.INSTANCE.paintPrimitive(primitive, settings, painter, selected, member); 48 48 } 49 49 -
trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java
r3191 r3291 139 139 140 140 @Override 141 public void paintPrimitive(OsmPrimitive primitive, MapPaintSettings paintSettings, MapPainter painter, boolean selected ) {141 public void paintPrimitive(OsmPrimitive primitive, MapPaintSettings paintSettings, MapPainter painter, boolean selected, boolean member) { 142 142 Way w = (Way)primitive; 143 143 /* show direction arrows, if draw.segment.relevant_directions_only is not set, … … 180 180 myColor = paintSettings.getHighlightColor(); 181 181 } else if (selected) { 182 myColor = paintSettings.getSelectedColor();182 myColor = member ? paintSettings.getRelationSelectedColor() : paintSettings.getSelectedColor(); 183 183 } else if(w.isDisabled()) { 184 184 myColor = paintSettings.getInactiveColor(); … … 189 189 for(LineElemStyle s : overlays) { 190 190 if(!s.over) { 191 painter.drawWay(w, s.color != null && selected? myColor: s.color, s.getWidth(myWidth),191 painter.drawWay(w, (s.color == null || selected) ? myColor: s.color, s.getWidth(myWidth), 192 192 s.getDashed(), s.dashedColor, false, false, false); 193 193 } … … 202 202 for(LineElemStyle s : overlays) { 203 203 if(s.over) { 204 painter.drawWay(w, s.color != null && selected? myColor : s.color, s.getWidth(myWidth),204 painter.drawWay(w, (s.color == null || selected) ? myColor : s.color, s.getWidth(myWidth), 205 205 s.getDashed(), s.dashedColor, false, false, false); 206 206 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/SimpleNodeElemStyle.java
r3180 r3291 23 23 @Override 24 24 public void paintPrimitive(OsmPrimitive primitive, MapPaintSettings settings, MapPainter painter, 25 boolean selected ) {25 boolean selected, boolean member) { 26 26 Node n = (Node)primitive; 27 27 String name = painter.isShowNames()?painter.getNodeName(n):null; … … 37 37 color = settings.getInactiveColor(); 38 38 } else if (selected) { 39 color = settings.getSelectedColor();39 color = member ? settings.getRelationSelectedColor() : settings.getSelectedColor(); 40 40 } else if (n.isConnectionNode()) { 41 41 if (n.isTagged()) {
Note:
See TracChangeset
for help on using the changeset viewer.