Ignore:
Timestamp:
2009-12-20T16:19:03+01:00 (14 years ago)
Author:
jttt
Message:

Minor mappaint cleanup, use constants for colors

Location:
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint
Files:
2 added
2 moved

Legend:

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

    r2665 r2666  
    11/* License: GPL. Copyright 2007 by Immanuel Scholz and others */
    2 package org.openstreetmap.josm.data.osm.visitor;
     2package org.openstreetmap.josm.data.osm.visitor.paint;
    33
    44/* To enable debugging or profiling remove the double / signs */
    55
    6 import static org.openstreetmap.josm.tools.I18n.marktr;
    76import static org.openstreetmap.josm.tools.I18n.tr;
    87
     
    4140import org.openstreetmap.josm.data.osm.RelationMember;
    4241import org.openstreetmap.josm.data.osm.Way;
     42import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor;
    4343import org.openstreetmap.josm.gui.DefaultNameFormatter;
    4444import org.openstreetmap.josm.gui.mappaint.AreaElemStyle;
     
    12481248    {
    12491249        super.getColors();
    1250         untaggedColor = Main.pref.getColor(marktr("untagged"),Color.GRAY);
    1251         textColor = Main.pref.getColor (marktr("text"), Color.WHITE);
    1252         areaTextColor = Main.pref.getColor (marktr("areatext"), Color.LIGHT_GRAY);
     1250        untaggedColor = PaintColors.UNTAGGED.get();
     1251        textColor = PaintColors.TEXT.get();
     1252        areaTextColor = PaintColors.AREA_TEXT.get();
    12531253    }
    12541254
  • trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/SimplePaintVisitor.java

    r2665 r2666  
    11/* License: GPL. Copyright 2007 by Immanuel Scholz and others */
    2 package org.openstreetmap.josm.data.osm.visitor;
     2package org.openstreetmap.josm.data.osm.visitor.paint;
    33
    44/* To enable debugging or profiling remove the double / signs */
    5 
    6 import static org.openstreetmap.josm.tools.I18n.marktr;
    75
    86import java.awt.BasicStroke;
     
    2624import org.openstreetmap.josm.data.osm.RelationMember;
    2725import org.openstreetmap.josm.data.osm.Way;
     26import org.openstreetmap.josm.data.osm.visitor.AbstractVisitor;
    2827import org.openstreetmap.josm.gui.NavigatableComponent;
    2928
     
    3534 */
    3635public class SimplePaintVisitor extends AbstractVisitor {
    37 
    38     public final static Color darkerblue = new Color(0,0,96);
    39     public final static Color darkblue = new Color(0,0,128);
    40     public final static Color darkgreen = new Color(0,128,0);
    41     public final static Color teal = new Color(0,128,128);
    42     public final static Color lightteal= new Color(0, 255, 186);
    43 
    4436    /**
    4537     * The environment to paint to.
     
    9284    public void getColors()
    9385    {
    94         inactiveColor = Main.pref.getColor(marktr("inactive"), Color.darkGray);
    95         selectedColor = Main.pref.getColor(marktr("selected"), Color.red);
    96         nodeColor = Main.pref.getColor(marktr("node"), Color.yellow);
    97         dfltWayColor = Main.pref.getColor(marktr("way"), darkblue);
    98         relationColor = Main.pref.getColor(marktr("relation"), teal);
    99         untaggedWayColor = Main.pref.getColor(marktr("untagged way"), darkgreen);
    100         incompleteColor = Main.pref.getColor(marktr("incomplete way"), darkerblue);
    101         backgroundColor = Main.pref.getColor(marktr("background"), Color.BLACK);
    102         highlightColor = Main.pref.getColor(marktr("highlight"), lightteal);
     86        inactiveColor = PaintColors.INACTIVE.get();
     87        selectedColor = PaintColors.SELECTED.get();
     88        nodeColor = PaintColors.NODE.get();
     89        dfltWayColor = PaintColors.DEFAULT_WAY.get();
     90        relationColor = PaintColors.RELATION.get();
     91        untaggedWayColor = PaintColors.UNTAGGED_WAY.get();
     92        incompleteColor = PaintColors.INCOMPLETE_WAY.get();
     93        backgroundColor = PaintColors.BACKGROUND.get();
     94        highlightColor = PaintColors.HIGHLIGHT.get();
    10395    }
    10496
Note: See TracChangeset for help on using the changeset viewer.