Changeset 32930 in osm for applications/editors/josm/plugins/FastDraw/src
- Timestamp:
- 2016-09-06T23:29:57+02:00 (8 years ago)
- Location:
- applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FDSettings.java
r32548 r32930 9 9 10 10 import org.openstreetmap.josm.Main; 11 import org.openstreetmap.josm.data.preferences.ColorProperty; 11 12 import org.openstreetmap.josm.gui.util.GuiHelper; 12 13 13 14 public class FDSettings { 14 public Color COLOR_FIXED;15 public Color COLOR_NORMAL;16 public Color COLOR_DELETE;17 public Color COLOR_SELECTEDFRAGMENT;18 public Color COLOR_EDITEDFRAGMENT;19 public Color COLOR_SIMPLIFIED;15 public ColorProperty COLOR_FIXED = new ColorProperty("fastdraw.color.delete", Color.red); 16 public ColorProperty COLOR_NORMAL = new ColorProperty("fastdraw.color.edit", Color.orange); 17 public ColorProperty COLOR_DELETE = new ColorProperty("fastdraw.color.fixed", Color.green); 18 public ColorProperty COLOR_SELECTEDFRAGMENT = new ColorProperty("fastdraw.color.normal", Color.red); 19 public ColorProperty COLOR_EDITEDFRAGMENT = new ColorProperty("fastdraw.color.select", Color.blue); 20 public ColorProperty COLOR_SIMPLIFIED = new ColorProperty("fastdraw.color.simplified", Color.orange); 20 21 21 22 public double maxDist; … … 51 52 52 53 public void loadPrefs() { 53 COLOR_DELETE = Main.pref.getColor("fastdraw.color.delete", Color.red);54 COLOR_EDITEDFRAGMENT = Main.pref.getColor("fastdraw.color.edit", Color.orange);55 COLOR_FIXED = Main.pref.getColor("fastdraw.color.fixed", Color.green);56 COLOR_NORMAL = Main.pref.getColor("fastdraw.color.normal", Color.red);57 COLOR_SELECTEDFRAGMENT = Main.pref.getColor("fastdraw.color.select", Color.blue);58 COLOR_SIMPLIFIED = Main.pref.getColor("fastdraw.color.simplified", Color.orange);59 60 54 normalStroke = GuiHelper.getCustomizedStroke(Main.pref.get("fastdraw.stroke.normal", "2")); 61 55 deleteStroke = GuiHelper.getCustomizedStroke(Main.pref.get("fastdraw.stroke.delete", "3")); -
applications/editors/josm/plugins/FastDraw/src/org/openstreetmap/josm/plugins/fastdraw/FastDrawingMode.java
r32929 r32930 162 162 LatLon pp1, pp2; 163 163 p1 = line.getPoint(pts.get(0)); 164 g.setColor(settings.COLOR_FIXED );164 g.setColor(settings.COLOR_FIXED.get()); 165 165 g.fillOval(p1.x - bigDotSize/2, p1.y - bigDotSize/2, bigDotSize, bigDotSize); 166 166 Color lineColor, initLineColor; 167 initLineColor = line.wasSimplified() ? settings.COLOR_SIMPLIFIED : settings.COLOR_NORMAL;167 initLineColor = line.wasSimplified() ? settings.COLOR_SIMPLIFIED.get() : settings.COLOR_NORMAL.get(); 168 168 lineColor = initLineColor; 169 169 int rp, dp; … … 180 180 p2 = line.getPoint(pp2); 181 181 if (shift && highlightedFragmentStart == pp1 && nearestPointIndex < 0) { 182 lineColor = settings.COLOR_SELECTEDFRAGMENT ;182 lineColor = settings.COLOR_SELECTEDFRAGMENT.get(); 183 183 } 184 184 if (!shift && line.isLastPoint(i)) { 185 lineColor = settings.COLOR_EDITEDFRAGMENT ;185 lineColor = settings.COLOR_EDITEDFRAGMENT.get(); 186 186 } 187 187 g.setColor(lineColor); … … 198 198 // highlight node to delete 199 199 g.setStroke(settings.deleteStroke); 200 g.setColor(settings.COLOR_DELETE );200 g.setColor(settings.COLOR_DELETE.get()); 201 201 g.drawLine(p2.x - 5, p2.y - 5, p2.x + 5, p2.y + 5); 202 202 g.drawLine(p2.x - 5, p2.y + 5, p2.x + 5, p2.y - 5); … … 205 205 // highlight node to toggle fixation 206 206 g.setStroke(settings.deleteStroke); 207 g.setColor(line.isFixed(pp2) ? settings.COLOR_NORMAL : settings.COLOR_FIXED);207 g.setColor(line.isFixed(pp2) ? settings.COLOR_NORMAL.get() : settings.COLOR_FIXED.get()); 208 208 g.fillOval(p2.x - bigDotSize/2-2, p2.y - bigDotSize/2-2, bigDotSize+4, bigDotSize+4); 209 209 g.setStroke(settings.normalStroke); … … 212 212 } 213 213 } 214 g.setColor(settings.COLOR_FIXED );214 g.setColor(settings.COLOR_FIXED.get()); 215 215 for (Point p: fixedPoints) { 216 216 g.fillOval(p.x - bigDotSize/2, p.y - bigDotSize/2, bigDotSize, bigDotSize);
Note:
See TracChangeset
for help on using the changeset viewer.