~tapaal-contributor/tapaal/disappearing-tokens-1940098

« back to all changes in this revision

Viewing changes to src/dk/aau/cs/gui/undo/AddSharedPlaceCommand.java

  • Committer: Kenneth Yrke Jørgensen
  • Date: 2011-04-12 09:50:16 UTC
  • mfrom: (329.1.188 tapaal-1.5)
  • Revision ID: mail@yrke.dk-20110412095016-e4hqdgab5596ja09
Merged with branch addning support for new 1.5 features

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package dk.aau.cs.gui.undo;
 
2
 
 
3
import dk.aau.cs.gui.SharedPlacesAndTransitionsPanel.SharedPlacesListModel;
 
4
import dk.aau.cs.model.tapn.SharedPlace;
 
5
 
 
6
public class AddSharedPlaceCommand extends Command {
 
7
        private SharedPlace place;
 
8
        private SharedPlacesListModel listModel;
 
9
        
 
10
        public AddSharedPlaceCommand(SharedPlacesListModel listModel, SharedPlace place){
 
11
                this.listModel = listModel;
 
12
                this.place = place;
 
13
        }
 
14
        
 
15
        @Override
 
16
        public void redo() {
 
17
                listModel.addElement(place);
 
18
        }
 
19
 
 
20
        @Override
 
21
        public void undo() {
 
22
                listModel.removeElement(place);
 
23
        }
 
24
}