- Timestamp:
- 2013-06-26T16:08:56+02:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/actions/mapmode
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/actions/mapmode/ImproveWayAccuracyAction.java
r5947 r6028 2 2 package org.openstreetmap.josm.actions.mapmode; 3 3 4 import static org.openstreetmap.josm.tools.I18n.marktr; 4 5 import static org.openstreetmap.josm.tools.I18n.tr; 5 6 import static org.openstreetmap.josm.tools.I18n.trn; 6 7 7 8 import java.awt.AWTEvent; 8 import java.awt.BasicStroke;9 9 import java.awt.Color; 10 10 import java.awt.Cursor; 11 11 import java.awt.Graphics2D; 12 12 import java.awt.Point; 13 import java.awt.Stroke; 13 14 import java.awt.Toolkit; 14 15 import java.awt.event.AWTEventListener; … … 46 47 import org.openstreetmap.josm.gui.layer.MapViewPaintable; 47 48 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 49 import org.openstreetmap.josm.gui.util.GuiHelper; 48 50 import org.openstreetmap.josm.tools.ImageProvider; 49 51 import org.openstreetmap.josm.tools.Pair; … … 81 83 final private Cursor cursorImproveLock; 82 84 83 private final Color guideColor; 84 private final BasicStroke selectTargetWayStroke; 85 private final BasicStroke moveNodeStroke; 86 private final BasicStroke addNodeStroke; 87 private final BasicStroke deleteNodeStroke; 88 85 private Color guideColor; 86 private Stroke selectTargetWayStroke; 87 private Stroke moveNodeStroke; 88 private Stroke addNodeStroke; 89 private Stroke deleteNodeStroke; 90 private int dotSize; 91 89 92 private boolean selectionChangedBlocked = false; 90 93 … … 107 110 cursorImproveLock = ImageProvider.getCursor("crosshair", "lock"); 108 111 109 guideColor = PaintColors.HIGHLIGHT.get();110 selectTargetWayStroke = new BasicStroke(2, BasicStroke.CAP_ROUND,111 BasicStroke.JOIN_ROUND);112 float dash1[] = {4.0f};113 moveNodeStroke = new BasicStroke(1.0f, BasicStroke.CAP_BUTT,114 BasicStroke.JOIN_MITER, 10.0f, dash1, 0.0f);115 addNodeStroke = new BasicStroke(1, BasicStroke.CAP_BUTT,116 BasicStroke.JOIN_MITER);117 deleteNodeStroke = new BasicStroke(1, BasicStroke.CAP_BUTT,118 BasicStroke.JOIN_MITER);119 112 } 120 113 … … 129 122 super.enterMode(); 130 123 124 guideColor = Main.pref.getColor(marktr("iwa guide"), null); 125 if (guideColor == null) guideColor = PaintColors.HIGHLIGHT.get(); 126 127 selectTargetWayStroke = GuiHelper.getCustomizedStroke(Main.pref.get("iwa.stroke.select-target", "2")); 128 moveNodeStroke = GuiHelper.getCustomizedStroke(Main.pref.get("iwa.stroke.move-node", "1 6")); 129 addNodeStroke = GuiHelper.getCustomizedStroke(Main.pref.get("iwa.stroke.add-node", "1")); 130 deleteNodeStroke = GuiHelper.getCustomizedStroke(Main.pref.get("iwa.stroke.delete-node", "1")); 131 dotSize = Main.pref.getInteger("iwa.dot-size",6); 132 131 133 mv = Main.map.mapView; 132 134 mousePos = null; … … 309 311 if (candidateNode != null) { 310 312 p1 = mv.getPoint(candidateNode); 311 g.fillRect(p1.x - 2, p1.y - 2, 6, 6);313 g.fillRect(p1.x - dotSize/2, p1.y - dotSize/2, dotSize, dotSize); 312 314 } 313 315 -
trunk/src/org/openstreetmap/josm/actions/mapmode/ParallelWayAction.java
r5982 r6028 6 6 7 7 import java.awt.AWTEvent; 8 import java.awt.BasicStroke;9 8 import java.awt.Color; 10 9 import java.awt.Cursor; … … 31 30 import org.openstreetmap.josm.data.osm.Way; 32 31 import org.openstreetmap.josm.data.osm.WaySegment; 32 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors; 33 33 import org.openstreetmap.josm.gui.MapFrame; 34 34 import org.openstreetmap.josm.gui.MapView; … … 38 38 import org.openstreetmap.josm.gui.layer.MapViewPaintable; 39 39 import org.openstreetmap.josm.gui.layer.OsmDataLayer; 40 import org.openstreetmap.josm.gui.util.GuiHelper; 40 41 import org.openstreetmap.josm.tools.Geometry; 42 import static org.openstreetmap.josm.tools.I18n.marktr; 41 43 import org.openstreetmap.josm.tools.ImageProvider; 42 44 import org.openstreetmap.josm.tools.Shortcut; … … 123 125 private EastNorth helperLineStart; 124 126 private EastNorth helperLineEnd; 127 128 Stroke helpLineStroke; 129 Stroke refLineStroke; 130 Color mainColor; 125 131 126 132 public ParallelWayAction(MapFrame mapFrame) { … … 148 154 mv.addTemporaryLayer(this); 149 155 156 helpLineStroke = GuiHelper.getCustomizedStroke(getStringPref("stroke.hepler-line", "1" )); 157 refLineStroke = GuiHelper.getCustomizedStroke(getStringPref("stroke.ref-line", "1 2 2")); 158 mainColor = Main.pref.getColor(marktr("make parallel helper line"), null); 159 if (mainColor == null) mainColor = PaintColors.SELECTED.get(); 160 150 161 //// Needed to update the mouse cursor if modifiers are changed when the mouse is motionless 151 162 try { … … 468 479 469 480 // FIXME: should clip the line (gets insanely slow when zoomed in on a very long line 470 Stroke refLineStroke = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL, 10.0f, new float[] {471 2f, 2f }, 0f);472 481 g.setStroke(refLineStroke); 473 g.setColor( Color.RED);482 g.setColor(mainColor); 474 483 Point p1 = mv.getPoint(referenceSegment.getFirstNode().getEastNorth()); 475 484 Point p2 = mv.getPoint(referenceSegment.getSecondNode().getEastNorth()); 476 485 g.drawLine(p1.x, p1.y, p2.x, p2.y); 477 486 478 Stroke helpLineStroke = new BasicStroke(1, BasicStroke.CAP_BUTT, BasicStroke.JOIN_BEVEL);479 487 g.setStroke(helpLineStroke); 480 g.setColor( Color.RED);488 g.setColor(mainColor); 481 489 p1 = mv.getPoint(helperLineStart); 482 490 p2 = mv.getPoint(helperLineEnd);
Note:
See TracChangeset
for help on using the changeset viewer.