Changeset 19549 in josm
- Timestamp:
- 2026-03-19T14:31:13+01:00 (3 days ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 3 edited
-
data/osm/visitor/paint/MapPaintSettings.java (modified) (1 diff)
-
data/osm/visitor/paint/StyledMapRenderer.java (modified) (2 diffs)
-
gui/mappaint/RenderingHelper.java (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPaintSettings.java
r17874 r19549 72 72 } 73 73 74 /** 75 * Creates MapPaintSettings with most neutral settings, that do not override MapCSS. 76 * Useful for MapCSS CLI/Plugin rendering, via {@link org.openstreetmap.josm.gui.mappaint.RenderingHelper} 77 * @return a new MapPaintSettings instance with neutral values. 78 * @since 19549 79 */ 80 public static MapPaintSettings createNeutralSettings() { 81 MapPaintSettings neutralSettings = new MapPaintSettings(); 82 neutralSettings.useRealWidth = false; // Real width is not used (at least currently) 83 neutralSettings.showDirectionArrow = false; // Direction arrows are turned off 84 neutralSettings.showOnewayArrow = false; // One way arrows are disabled 85 neutralSettings.showNamesDistance = 0; // Forced labels are turned off 86 neutralSettings.showOrderNumber = false; 87 neutralSettings.showOrderNumberOnSelectedWay = false; 88 neutralSettings.outlineOnly = false; 89 return neutralSettings; 90 } 91 74 92 private void load() { 75 93 showDirectionArrow = Config.getPref().getBoolean("draw.segment.direction", false); -
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java
r19050 r19549 384 384 385 385 /** 386 * Constructs a new {@code StyledMapRenderer} with custom map paint settings. 387 * 388 * @param g the graphics context. Must not be null. 389 * @param nc the map viewport. Must not be null. 390 * @param isInactiveMode if true, the paint visitor shall render OSM objects such that they 391 * look inactive. Example: rendering of data in an inactive layer using light gray as color only. 392 * @param paintSettings the map paint settings to use. Must not be null. 393 * @throws IllegalArgumentException if {@code g} is null 394 * @throws IllegalArgumentException if {@code nc} is null 395 * @throws IllegalArgumentException if {@code paintSettings} is null 396 * @since 19549 397 */ 398 public StyledMapRenderer(Graphics2D g, NavigatableComponent nc, boolean isInactiveMode, MapPaintSettings paintSettings) { 399 this(g, nc, isInactiveMode); 400 this.paintSettings = paintSettings; 401 } 402 403 /** 386 404 * Set the {@link ElemStyles} instance to use for this renderer. 387 405 * @param styles the {@code ElemStyles} instance to use … … 1411 1429 public void getSettings(boolean virtual) { 1412 1430 super.getSettings(virtual); 1413 paintSettings = MapPaintSettings.INSTANCE; 1431 if (paintSettings == null) { 1432 paintSettings = MapPaintSettings.INSTANCE; 1433 } 1414 1434 1415 1435 circum = nc.getDist100Pixel(); -
trunk/src/org/openstreetmap/josm/gui/mappaint/RenderingHelper.java
r19519 r19549 27 27 import org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource; 28 28 import org.openstreetmap.josm.gui.mappaint.styleelement.StyleElement; 29 import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintSettings; 29 30 import org.openstreetmap.josm.io.IllegalDataException; 30 31 import org.openstreetmap.josm.tools.CheckParameterUtil; … … 184 185 g.fillRect(0, 0, imgDimPx.width, imgDimPx.height); 185 186 } 186 StyledMapRenderer smr = new StyledMapRenderer(g, nc, false); 187 StyledMapRenderer smr = new StyledMapRenderer(g, nc, false, MapPaintSettings.createNeutralSettings()); 187 188 smr.setStyles(elemStyles); 188 189 smr.render(ds, false, bounds);
Note:
See TracChangeset
for help on using the changeset viewer.
