Changeset 3994 in josm
- Timestamp:
- 2011-03-18T00:22:13+01:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPaintSettings.java
r3862 r3994 14 14 private boolean useRealWidth; 15 15 private boolean showDirectionArrow; 16 private boolean show RelevantDirectionsOnly;16 private boolean showOnewayArrow; 17 17 private int defaultSegmentWidth; 18 18 private boolean showOrderNumber; … … 46 46 private void load() { 47 47 showDirectionArrow = Main.pref.getBoolean("draw.segment.direction", true); 48 show RelevantDirectionsOnly = Main.pref.getBoolean("draw.segment.relevant_directions_only", true);48 showOnewayArrow = Main.pref.getBoolean("draw.oneway", true); 49 49 useRealWidth = Main.pref.getBoolean("mappaint.useRealWidth", false); 50 50 defaultSegmentWidth = Main.pref.getInteger("mappaint.segment.default-width", 2); … … 81 81 82 82 outlineOnly = Main.pref.getBoolean("draw.data.area_outline_only", false); 83 83 84 84 } 85 85 … … 96 96 } 97 97 98 public boolean isShow RelevantDirectionsOnly() {99 return show RelevantDirectionsOnly;98 public boolean isShowOnewayArrow() { 99 return showOnewayArrow; 100 100 } 101 101 -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/SimplePaintVisitor.java
r3895 r3994 63 63 protected Color taggedConnectionColor; 64 64 protected boolean showDirectionArrow; 65 protected boolean show RelevantDirectionsOnly;65 protected boolean showOnewayArrow; 66 66 protected boolean showHeadArrowOnly; 67 67 protected boolean showOrderNumber; … … 109 109 MapPaintSettings settings = MapPaintSettings.INSTANCE; 110 110 showDirectionArrow = settings.isShowDirectionArrow(); 111 show RelevantDirectionsOnly = settings.isShowRelevantDirectionsOnly();111 showOnewayArrow = settings.isShowOnewayArrow(); 112 112 showHeadArrowOnly = settings.isShowHeadArrowOnly(); 113 113 showOrderNumber = settings.isShowOrderNumber(); … … 333 333 (even if the tag is negated as in oneway=false) or the way is selected */ 334 334 335 boolean showThisDirectionArrow = ds.isSelected(w) 336 || (showDirectionArrow && (!showRelevantDirectionsOnly || w.hasDirectionKeys())); 335 boolean showThisDirectionArrow = ds.isSelected(w) || showDirectionArrow; 337 336 /* head only takes over control if the option is true, 338 337 the direction should be shown at all and not only because it's selected */ -
trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java
r3992 r3994 121 121 } 122 122 } 123 if (!hasPositive || dashes.length == 0) {123 if (!hasPositive || (dashes != null && dashes.length == 0)) { 124 124 dashes = null; 125 125 } … … 198 198 the way is tagged with a direction key 199 199 (even if the tag is negated as in oneway=false) or the way is selected */ 200 boolean showOrientation = !isModifier && selected&& !paintSettings.isUseRealWidth();200 boolean showOrientation = !isModifier && (selected || paintSettings.isShowDirectionArrow()) && !paintSettings.isUseRealWidth(); 201 201 boolean showOneway = !isModifier && !selected && 202 203 paintSettings.isShowDirectionArrow() && w.hasDirectionKeys();202 !paintSettings.isUseRealWidth() && 203 paintSettings.isShowOnewayArrow() && w.hasDirectionKeys(); 204 204 boolean onewayReversed = w.reversedDirection(); 205 205 /* head only takes over control if the option is true, … … 215 215 myWidth = line.getLineWidth(); 216 216 } 217 myLine = new BasicStroke(myWidth, line.getEndCap(), line.getLineJoin(), 217 myLine = new BasicStroke(myWidth, line.getEndCap(), line.getLineJoin(), 218 218 line.getMiterLimit(), line.getDashArray(), line.getDashPhase()); 219 219 if (dashesLine != null) { … … 259 259 final LineElemStyle other = (LineElemStyle) obj; 260 260 return equal(line, other.line) && 261 262 263 264 265 261 equal(color, other.color) && 262 equal(dashesLine, other.dashesLine) && 263 equal(dashesBackground, other.dashesBackground) && 264 equal(text, other.text) && 265 realWidth == other.realWidth; 266 266 } 267 267 … … 281 281 public String toString() { 282 282 return "LineElemStyle{" + super.toString() + "width=" + line.getLineWidth() + 283 284 285 286 283 " realWidth=" + realWidth + " color=" + Utils.toString(color) + 284 " dashed=" + Arrays.toString(line.getDashArray()) + 285 (line.getDashPhase() == 0f ? "" : " dashesOffses=" + line.getDashPhase()) + 286 " dashedColor=" + Utils.toString(dashesBackground) + '}'; 287 287 } 288 288 } -
trunk/src/org/openstreetmap/josm/gui/preferences/DrawingPreference.java
r3895 r3994 52 52 private JCheckBox drawGpsArrowsFast = new JCheckBox(tr("Fast drawing (looks uglier)")); 53 53 private JTextField drawGpsArrowsMinDist = new JTextField(8); 54 private JCheckBox interestingDirections = new JCheckBox(tr("Only interesting direction hints (e.g. with oneway tag)."));55 54 private JCheckBox headArrow = new JCheckBox(tr("Only on the head of a way.")); 55 private JCheckBox onewayArrow = new JCheckBox(tr("Draw oneway arrows.")); 56 56 private JCheckBox segmentOrderNumber = new JCheckBox(tr("Draw segment order numbers")); 57 57 private JCheckBox sourceBounds = new JCheckBox(tr("Draw boundaries of downloaded data")); … … 62 62 private JCheckBox outlineOnly = new JCheckBox(tr("Draw only outlines of areas")); 63 63 private JComboBox waypointLabel = new JComboBox(new String[] {tr("Auto"), /* gpx data field name */ trc("gpx_field", "Name"), 64 64 /* gpx data field name */ trc("gpx_field", "Desc(ription)"), tr("Both"), tr("None")}); 65 65 66 66 public void addGui(PreferenceTabbedPane gui) { … … 227 227 public void actionPerformed(ActionEvent e) { 228 228 if (directionHint.isSelected()){ 229 interestingDirections.setSelected(Main.pref.getBoolean("draw.segment.relevant_directions_only", true));230 229 headArrow.setSelected(Main.pref.getBoolean("draw.segment.head_only", false)); 231 230 }else{ 232 interestingDirections.setSelected(false);233 231 headArrow.setSelected(false); 234 232 } 235 interestingDirections.setEnabled(directionHint.isSelected());236 233 headArrow.setEnabled(directionHint.isSelected()); 237 234 } … … 240 237 directionHint.setSelected(Main.pref.getBoolean("draw.segment.direction", true)); 241 238 panel.add(directionHint, GBC.eop().insets(20,0,0,0)); 242 243 // only interesting directions244 interestingDirections.setToolTipText(tr("Only interesting direction hints (e.g. with oneway tag)."));245 interestingDirections.setSelected(Main.pref.getBoolean("draw.segment.relevant_directions_only", true));246 interestingDirections.setEnabled(directionHint.isSelected());247 panel.add(interestingDirections, GBC.eop().insets(40,0,0,0));248 239 249 240 // only on the head of a way … … 252 243 headArrow.setEnabled(directionHint.isSelected()); 253 244 panel.add(headArrow, GBC.eop().insets(40, 0, 0, 0)); 245 246 // draw oneway arrows 247 onewayArrow.setToolTipText(tr("Draw arrows in the direction of oneways and other directed features.")); 248 onewayArrow.setSelected(Main.pref.getBoolean("draw.oneway", true)); 249 panel.add(onewayArrow, GBC.eop().insets(20,0,0,0)); 254 250 255 251 // segment order number … … 312 308 Main.pref.put("draw.rawgps.large", largeGpsPoints.isSelected()); 313 309 Main.pref.put("draw.segment.direction", directionHint.isSelected()); 314 Main.pref.put("draw.segment.relevant_directions_only", interestingDirections.isSelected());315 310 Main.pref.put("draw.segment.head_only", headArrow.isSelected()); 311 Main.pref.put("draw.oneway", onewayArrow.isSelected()); 316 312 Main.pref.put("draw.segment.order_number", segmentOrderNumber.isSelected()); 317 313 Main.pref.put("draw.data.downloaded_area", sourceBounds.isSelected());
Note:
See TracChangeset
for help on using the changeset viewer.