Ignore:
Timestamp:
2006-04-21T14:31:51+02:00 (18 years ago)
Author:
imi
Message:
  • added conflicts and resolve conflict dialog

This is one of those "changed everything" checkpoint.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/org/openstreetmap/josm/data/osm/visitor/SimplePaintVisitor.java

    r75 r86  
    66
    77import org.openstreetmap.josm.Main;
    8 import org.openstreetmap.josm.data.osm.LineSegment;
     8import org.openstreetmap.josm.data.osm.Segment;
    99import org.openstreetmap.josm.data.osm.Node;
    1010import org.openstreetmap.josm.data.osm.Way;
     
    3232         */
    3333        private final NavigatableComponent nc;
    34        
     34
    3535        /**
    3636         * Construct the painter visitor.
     
    4242                this.nc = mv;
    4343        }
    44        
     44
    4545        /**
    4646         * Draw a small rectangle.
     
    5050         */
    5151        public void visit(Node n) {
    52                 drawNode(n, n.isSelected() ? getPreferencesColor("selected", Color.WHITE)
     52                drawNode(n, n.selected ? getPreferencesColor("selected", Color.WHITE)
    5353                                : getPreferencesColor("node", Color.RED));
    5454        }
     
    5858         * White if selected (as always) or green otherwise.
    5959         */
    60         public void visit(LineSegment ls) {
    61                 drawLineSegment(ls, getPreferencesColor("segment", darkgreen));
     60        public void visit(Segment ls) {
     61                drawSegment(ls, getPreferencesColor("segment", darkgreen));
    6262        }
    6363
    6464        /**
    65          * Draw a darkblue line for all line segments.
    66          * @param t The way to draw.
     65         * Draw a darkblue line for all segments.
     66         * @param w The way to draw.
    6767         */
    68         public void visit(Way t) {
     68        public void visit(Way w) {
    6969                // only to overwrite with blue
    7070                Color wayColor = getPreferencesColor("way", darkblue);
    71                 for (LineSegment ls : t.segments) {
     71                for (Segment ls : w.segments) {
    7272                        if (ls.incomplete) {
    7373                                wayColor = getPreferencesColor("incomplete way", darkerblue);
     
    7575                        }
    7676                }
    77                 for (LineSegment ls : t.segments)
    78                         if (!ls.isSelected()) // selected already in good color
    79                                 drawLineSegment(ls, t.isSelected() ? getPreferencesColor("selected", Color.WHITE) : wayColor);
     77                for (Segment ls : w.segments)
     78                        if (!ls.selected) // selected already in good color
     79                                drawSegment(ls, w.selected ? getPreferencesColor("selected", Color.WHITE) : wayColor);
    8080        }
    8181
     
    9595         * Draw a line with the given color.
    9696         */
    97         private void drawLineSegment(LineSegment ls, Color col) {
     97        private void drawSegment(Segment ls, Color col) {
    9898                if (ls.incomplete)
    9999                        return;
    100                 if (ls.isSelected())
     100                if (ls.selected)
    101101                        col = getPreferencesColor("selected", Color.WHITE);
    102102                g.setColor(col);
     
    105105                g.drawLine(p1.x, p1.y, p2.x, p2.y);
    106106        }
    107        
    108         private Color getPreferencesColor(String colName, Color def) {
     107
     108        public static Color getPreferencesColor(String colName, Color def) {
    109109                String colStr = Main.pref.get("color."+colName);
    110110                if (colStr.equals(""))
Note: See TracChangeset for help on using the changeset viewer.