Ignore:
Timestamp:
2005-10-27T00:38:03+02:00 (19 years ago)
Author:
imi
Message:
  • added commands to support undo later
  • added Edit-Layer concept
  • painting of deleted objects
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/org/openstreetmap/josm/command/AddCommand.java

    r22 r23  
    4343                SelectionComponentVisitor v = new SelectionComponentVisitor();
    4444                osm.visit(v);
    45                 return new JLabel(v.name, v.icon, JLabel.LEADING);
     45                return new JLabel("Add "+v.name, v.icon, JLabel.LEADING);
    4646        }
    4747       
    4848        public void fillModifiedData(Collection<OsmPrimitive> modified, Collection<OsmPrimitive> deleted, Collection<OsmPrimitive> added) {
    49                 if (!added.contains(osm))
     49                if (added != null && !added.contains(osm))
    5050                        added.add(osm);
    5151        }
     
    6565        public void visit(LineSegment ls) {
    6666                Main.main.ds.pendingLineSegments.add(ls);
     67                Main.main.ds.addBackReference(ls.start, ls);
     68                Main.main.ds.addBackReference(ls.end, ls);
    6769        }
    6870
     
    7476                Main.main.ds.tracks.add(t);
    7577                for (Iterator<LineSegment> it =  Main.main.ds.pendingLineSegments.iterator(); it.hasNext();)
    76                         if (t.segments().contains(it.next()))
     78                        if (t.segments.contains(it.next()))
    7779                                it.remove();
     80                for (LineSegment ls : t.segments) {
     81                        Main.main.ds.addBackReference(ls, t);
     82                        Main.main.ds.addBackReference(ls.start, t);
     83                        Main.main.ds.addBackReference(ls.end, t);
     84                }
    7885        }
    7986
Note: See TracChangeset for help on using the changeset viewer.