Changeset 16879 in josm for trunk/src/org
- Timestamp:
- 2020-08-12T20:42:35+02:00 (4 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/layer/markerlayer
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/ButtonMarker.java
r15497 r16879 2 2 package org.openstreetmap.josm.gui.layer.markerlayer; 3 3 4 import java.awt.Graphics ;4 import java.awt.Graphics2D; 5 5 import java.awt.Insets; 6 6 import java.awt.Point; … … 44 44 } 45 45 46 @Override public void paint(Graphics g, MapView mv, boolean mousePressed, boolean showTextOrIcon) {46 @Override public void paint(Graphics2D g, MapView mv, boolean mousePressed, boolean showTextOrIcon) { 47 47 if (!showTextOrIcon) { 48 48 super.paint(g, mv, mousePressed, showTextOrIcon); -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/Marker.java
r16438 r16879 7 7 import java.awt.Graphics2D; 8 8 import java.awt.Point; 9 import java.awt.Stroke; 9 10 import java.awt.event.ActionEvent; 10 11 import java.awt.image.BufferedImage; … … 268 269 * @param showTextOrIcon true if text and icon shall be drawn 269 270 */ 270 public void paint(Graphics g, MapView mv, boolean mousePressed, boolean showTextOrIcon) {271 public void paint(Graphics2D g, MapView mv, boolean mousePressed, boolean showTextOrIcon) { 271 272 Point screen = mv.getPoint(this); 273 int size2 = parentLayer.markerSize / 2; 274 272 275 if (symbol != null && showTextOrIcon) { 273 276 paintIcon(mv, g, screen.x-symbol.getIconWidth()/2, screen.y-symbol.getIconHeight()/2); 274 277 } else { 275 g.drawLine(screen.x-2, screen.y-2, screen.x+2, screen.y+2); 276 g.drawLine(screen.x+2, screen.y-2, screen.x-2, screen.y+2); 278 Stroke stroke = g.getStroke(); 279 g.setStroke(parentLayer.markerStroke); 280 g.drawLine(screen.x - size2, screen.y - size2, screen.x + size2, screen.y + size2); 281 g.drawLine(screen.x + size2, screen.y - size2, screen.x - size2, screen.y + size2); 282 g.setStroke(stroke); 277 283 } 278 284 279 285 String labelText = getText(); 280 286 if (!labelText.isEmpty() && showTextOrIcon) { 281 g.drawString(labelText, screen.x +4, screen.y+2);287 g.drawString(labelText, screen.x + size2 + 2, screen.y + size2); 282 288 } 283 289 } -
trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerLayer.java
r16438 r16879 7 7 import static org.openstreetmap.josm.tools.I18n.trn; 8 8 9 import java.awt.BasicStroke; 9 10 import java.awt.Color; 10 11 import java.awt.Component; … … 38 39 import org.openstreetmap.josm.data.gpx.WayPoint; 39 40 import org.openstreetmap.josm.data.osm.visitor.BoundingXYVisitor; 41 import org.openstreetmap.josm.data.preferences.IntegerProperty; 40 42 import org.openstreetmap.josm.data.preferences.NamedColorProperty; 43 import org.openstreetmap.josm.data.preferences.StrokeProperty; 41 44 import org.openstreetmap.josm.gui.MainApplication; 42 45 import org.openstreetmap.josm.gui.MapView; … … 79 82 public AudioMarker syncAudioMarker; 80 83 private Color color, realcolor; 84 final int markerSize = new IntegerProperty("draw.rawgps.markers.size", 4).get(); 85 final BasicStroke markerStroke = new StrokeProperty("draw.rawgps.markers.stroke", "1").get(); 81 86 82 87 /**
Note:
See TracChangeset
for help on using the changeset viewer.