Changeset 7549 in josm for trunk/src


Ignore:
Timestamp:
2014-09-16T21:28:53+02:00 (5 years ago)
Author:
Don-vip
Message:

fix #10307 - improvements to rendering of relations in wireframe mode

Location:
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRenderer.java

    r6069 r7549  
    3838    /** Color Preference for selected objects */
    3939    protected Color selectedColor;
     40    /** Color Preference for members of selected relations */
     41    protected Color relationSelectedColor;
    4042    /** Color Preference for nodes */
    4143    protected Color nodeColor;
     
    7072
    7173    /**
    72      * Draw the node as small rectangle with the given color.
     74     * Draw the node as small square with the given color.
    7375     *
    7476     * @param n  The node to draw.
    7577     * @param color The color of the node.
     78     * @param size size in pixels
     79     * @param fill determines if the square mmust be filled
    7680     */
    7781    public abstract void drawNode(Node n, Color color, int size, boolean fill);
     
    151155        this.inactiveColor = PaintColors.INACTIVE.get();
    152156        this.selectedColor = PaintColors.SELECTED.get();
     157        this.relationSelectedColor = PaintColors.RELATIONSELECTED.get();
    153158        this.nodeColor = PaintColors.NODE.get();
    154159        this.highlightColor = PaintColors.HIGHLIGHT.get();
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRenderer.java

    r7509 r7549  
    285285    private MapPaintSettings paintSettings;
    286286
    287     private Color relationSelectedColor;
    288287    private Color highlightColorTransparent;
    289288
     
    13561355    public void getColors() {
    13571356        super.getColors();
    1358         this.relationSelectedColor = PaintColors.RELATIONSELECTED.get();
    13591357        this.highlightColorTransparent = new Color(highlightColor.getRed(), highlightColor.getGreen(), highlightColor.getBlue(), 100);
    13601358        this.backgroundColor = PaintColors.getBackgroundColor();
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRenderer.java

    r7022 r7549  
    3232 * A map renderer that paints a simple scheme of every primitive it visits to a
    3333 * previous set graphic environment.
     34 * @since 23
    3435 */
    3536public class WireframeMapRenderer extends AbstractMapRenderer implements Visitor {
     
    153154     * @param bounds display boundaries
    154155     */
    155     @SuppressWarnings("unchecked")
    156156    @Override
    157157    public void render(DataSet data, boolean virtual, Bounds bounds) {
     
    246246            if (isInactiveMode || n.isDisabled()) {
    247247                color = inactiveColor;
    248             } else if (ds.isSelected(n)) {
     248            } else if (n.isSelected()) {
    249249                color = selectedColor;
     250            } else if (n.isMemberOfSelected()) {
     251                color = relationSelectedColor;
    250252            } else if (n.isConnectionNode()) {
    251253                if (isNodeTagged(n)) {
     
    300302        if (isInactiveMode || w.isDisabled()) {
    301303            wayColor = inactiveColor;
    302         } else if(w.isHighlighted()) {
     304        } else if (w.isHighlighted()) {
    303305            wayColor = highlightColor;
    304         } else if(ds.isSelected(w)) {
     306        } else if (w.isSelected()) {
    305307            wayColor = selectedColor;
     308        } else if (w.isMemberOfSelected()) {
     309            wayColor = relationSelectedColor;
    306310        } else if (!w.isTagged()) {
    307311            wayColor = untaggedWayColor;
     
    355359                }
    356360
    357                 g.drawOval(p.x-3, p.y-3, 6, 6);
     361                g.drawOval(p.x-4, p.y-4, 9, 9);
    358362            } else if (m.isWay()) {
    359363                GeneralPath path = new GeneralPath();
Note: See TracChangeset for help on using the changeset viewer.