2
* This file is part of Zaluum
4
* Zaluum is free software: you can redistribute it and/or modify
5
* it under the terms of the GNU Lesser General Public License as published by
6
* the Free Software Foundation, either version 3 of the License, or
7
* (at your option) any later version.
9
* Zaluum is distributed in the hope that it will be useful,
10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
* GNU Lesser General Public License for more details.
14
* You should have received a copy of the GNU Lesser General Public License
15
* along with Zaluum. If not, see <http://www.gnu.org/licenses/>.
17
* Copyright 2008,2009 Frederic Perez Ordeig
18
* Copyright 2008,2009 Elias Hortas Garcia
20
package org.zaluum.ide.editor.parts.fsm;
22
import org.eclipse.gef.commands.Command;
23
import org.zaluum.model.State;
24
import org.zaluum.model.Transition;
30
public class CreateTransitionCommand extends Command {
33
private final State source;
34
private Transition trans;
36
public CreateTransitionCommand(State stateModel) {
37
this.source = stateModel;
40
public void setTarget(State stateModel) {
41
this.target = stateModel;
45
public void execute() {
51
trans = Transition.create(source,target);
56
source.removeSourceTransition(trans);
57
target.removeTargetTransition(trans);