~tapaal-maintainers/tapaal/tapaal-dev

« back to all changes in this revision

Viewing changes to src/pipe/gui/undo/DeleteArcPathPointEdit.java

Merged branch lp:~yrke/tapaal/modelControlsDrawingsurface 

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
 
5
5
package pipe.gui.undo;
6
6
 
 
7
import pipe.dataLayer.DataLayer;
7
8
import pipe.gui.graphicElements.Arc;
8
9
import pipe.gui.graphicElements.ArcPath;
9
10
import pipe.gui.graphicElements.ArcPathPoint;
18
19
        ArcPath arcPath;
19
20
        ArcPathPoint point;
20
21
        Integer index;
 
22
        private DataLayer guiModel;
21
23
 
22
24
        /** Creates a new instance of placeWeightEdit */
23
 
        public DeleteArcPathPointEdit(Arc _arc, ArcPathPoint _point, Integer _index) {
 
25
        public DeleteArcPathPointEdit(Arc _arc, ArcPathPoint _point, Integer _index, DataLayer guiModel) {
24
26
                arcPath = _arc.getArcPath();
25
27
                point = _point;
26
28
                index = _index;
 
29
                this.guiModel = guiModel;
27
30
        }
28
31
 
29
32
        /** */
30
33
        @Override
31
34
        public void undo() {
 
35
 
 
36
                //guiModel.addPetriNetObject(point);
32
37
                arcPath.insertPoint(index, point);
33
38
                arcPath.updateArc();
34
39
        }
36
41
        /** */
37
42
        @Override
38
43
        public void redo() {
39
 
                point.delete();
 
44
 
 
45
                guiModel.removePetriNetObject(point);
 
46
                arcPath.deletePoint(point);
 
47
                arcPath.updateArc();
40
48
        }
41
49
 
42
50
}