~yrke/tapaal/slimImageIcons-2

« back to all changes in this revision

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

  • Committer: Jiri Srba
  • Date: 2020-04-28 19:15:28 UTC
  • mfrom: (998.2.376 testbranch)
  • Revision ID: srba@cs.aau.dk-20200428191528-3xxjqa1r4jcob5ur
merged in lp:~yrke/tapaal/testbranch doing majour refactoring of the GUI

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;
17
18
 
18
19
        ArcPath arcPath;
19
20
        ArcPathPoint point;
 
21
        private DataLayer guiModel;
20
22
        Integer index;
21
23
 
22
24
        /** Creates a new instance of AddArcPathPointEdit */
23
 
        public AddArcPathPointEdit(Arc _arc, ArcPathPoint _point) {
 
25
        public AddArcPathPointEdit(Arc _arc, ArcPathPoint _point, DataLayer guiModel) {
24
26
                arcPath = _arc.getArcPath();
25
27
                point = _point;
 
28
                this.guiModel = guiModel;
26
29
                index = point.getIndex();
27
30
        }
28
31
 
31
34
    */
32
35
        @Override
33
36
        public void undo() {
34
 
                point.delete();
 
37
                arcPath.deletePoint(point);
 
38
                arcPath.updateArc();
 
39
 
 
40
                guiModel.removePetriNetObject(point);
35
41
        }
36
42
 
37
43
        /** */
38
44
        @Override
39
45
        public void redo() {
 
46
                //guiModel.addPetriNetObject(point);
 
47
 
40
48
                arcPath.insertPoint(index, point);
41
49
                arcPath.updateArc();
42
50
        }