Changeset 1289 in josm for trunk/src/org
- Timestamp:
- 2009-01-17T23:45:34+01:00 (16 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/MapPaintVisitor.java
r1282 r1289 17 17 import java.util.LinkedList; 18 18 import java.util.Locale; 19 import java.util.Iterator; 19 20 20 21 import javax.swing.ImageIcon; … … 225 226 boolean showDirection = w.selected || ((!useRealWidth) && (showDirectionArrow 226 227 && (!showRelevantDirectionsOnly || w.hasDirectionKeys))); 228 // head only takes over control if the option is true, 229 // the direction should be shown at all and not only because it's selected 230 boolean showOnlyHeadArrowOnly = showDirection && !w.selected && showHeadArrowOnly; 227 231 int width = defaultSegmentWidth; 228 232 int realWidth = 0; //the real width of the element in meters … … 270 274 // draw the way 271 275 lastN = null; 272 for(Node n : w.nodes) 273 { 276 Iterator<Node> it = w.nodes.iterator(); 277 while (it.hasNext()) 278 { 279 Node n = it.next(); 274 280 if(lastN != null) 275 drawSeg(lastN, n, color, showDirection, width, dashed); 281 drawSeg(lastN, n, color, 282 showOnlyHeadArrowOnly ? !it.hasNext() : showDirection, width, dashed); 276 283 lastN = n; 277 284 } -
trunk/src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java
r1251 r1289 64 64 protected boolean showDirectionArrow; 65 65 protected boolean showRelevantDirectionsOnly; 66 protected boolean showHeadArrowOnly; 66 67 protected boolean showOrderNumber; 67 68 protected boolean fillSelectedNode; … … 101 102 showDirectionArrow = Main.pref.getBoolean("draw.segment.direction", true); 102 103 showRelevantDirectionsOnly = Main.pref.getBoolean("draw.segment.relevant_directions_only", true); 104 showHeadArrowOnly = Main.pref.getBoolean("draw.segment.head_only", false); 103 105 showOrderNumber = Main.pref.getBoolean("draw.segment.order_number", false); 104 106 selectedNodeRadius = Main.pref.getInteger("mappaint.node.selected-size", 5) / 2; … … 292 294 boolean showThisDirectionArrow = w.selected 293 295 || (showDirectionArrow && (!showRelevantDirectionsOnly || w.hasDirectionKeys)); 296 // head only takes over control if the option is true, 297 // the direction should be shown at all and not only because it's selected 298 boolean showOnlyHeadArrowOnly = showThisDirectionArrow && !w.selected && showHeadArrowOnly; 294 299 Color wayColor; 295 300 … … 307 312 for (int orderNumber = 1; it.hasNext(); orderNumber++) { 308 313 Point p = nc.getPoint(it.next().eastNorth); 309 drawSegment(lastP, p, w.selected && !inactive ? selectedColor : wayColor, showThisDirectionArrow); 314 drawSegment(lastP, p, w.selected && !inactive ? selectedColor : wayColor, 315 showOnlyHeadArrowOnly ? !it.hasNext() : showThisDirectionArrow); 310 316 if (showOrderNumber) 311 317 drawOrderNumber(lastP, p, orderNumber); -
trunk/src/org/openstreetmap/josm/gui/preferences/DrawingPreference.java
r1283 r1289 34 34 private JTextField drawGpsArrowsMinDist = new JTextField(8); 35 35 private JCheckBox interestingDirections = new JCheckBox(tr("Only interesting direction hints (e.g. with oneway tag).")); 36 private JCheckBox headArrow = new JCheckBox(tr("Only on the head of a way.")); 36 37 private JCheckBox segmentOrderNumber = new JCheckBox(tr("Draw segment order numbers")); 37 38 private JCheckBox sourceBounds = new JCheckBox(tr("Draw boundaries of downloaded data")); … … 132 133 directionHint.addActionListener(new ActionListener(){ 133 134 public void actionPerformed(ActionEvent e) { 134 if (directionHint.isSelected()){ 135 interestingDirections.setSelected(Main.pref.getBoolean("draw.segment.relevant_directions_only", true)); 136 }else{ 137 interestingDirections.setSelected(false); 138 } 139 interestingDirections.setEnabled(directionHint.isSelected()); 135 if (directionHint.isSelected()){ 136 interestingDirections.setSelected(Main.pref.getBoolean("draw.segment.relevant_directions_only", true)); 137 headArrow.setSelected(Main.pref.getBoolean("draw.segment.head_only", false)); 138 }else{ 139 interestingDirections.setSelected(false); 140 headArrow.setSelected(false); 141 } 142 interestingDirections.setEnabled(directionHint.isSelected()); 143 headArrow.setEnabled(directionHint.isSelected()); 140 144 } 141 145 }); … … 149 153 interestingDirections.setEnabled(directionHint.isSelected()); 150 154 panel.add(interestingDirections, GBC.eop().insets(40,0,0,0)); 155 156 // only on the head of a way 157 headArrow.setToolTipText(tr("Only on the head of a way.")); 158 headArrow.setSelected(Main.pref.getBoolean("draw.segment.head_only", false)); 159 headArrow.setEnabled(directionHint.isSelected()); 160 panel.add(headArrow, GBC.eop().insets(40, 0, 0, 0)); 151 161 152 162 // segment order number … … 194 204 Main.pref.put("draw.segment.direction", directionHint.isSelected()); 195 205 Main.pref.put("draw.segment.relevant_directions_only", interestingDirections.isSelected()); 206 Main.pref.put("draw.segment.head_only", headArrow.isSelected()); 196 207 Main.pref.put("draw.segment.order_number", segmentOrderNumber.isSelected()); 197 208 Main.pref.put("draw.data.downloaded_area", sourceBounds.isSelected());
Note:
See TracChangeset
for help on using the changeset viewer.