1 |
| |
2 |
| |
3 |
| |
4 |
| |
5 |
| |
6 |
| |
7 |
| |
8 |
| |
9 |
| |
10 |
| |
11 |
| |
12 |
| |
13 |
| |
14 |
| |
15 |
| |
16 |
| |
17 |
| |
18 |
| package org.ericmignot.modeler.helpers; |
19 |
| |
20 |
| import org.ericmignot.modeler.Interoperable; |
21 |
| import org.ericmignot.modeler.data.BusinessObject; |
22 |
| import org.ericmignot.modeler.gui.Controller; |
23 |
| import org.ericmignot.modeler.util.action.NotifyableAction; |
24 |
| |
25 |
| public class DefaultInteroperable implements Interoperable |
26 |
| { |
27 |
| private Controller controller; |
28 |
| private NotifyableAction action; |
29 |
| private BusinessObject bo; |
30 |
| private String event; |
31 |
| |
32 |
| private boolean lastEventIsDo; |
33 |
| |
34 |
4
| public boolean isLastEventIsDo()
|
35 |
| { |
36 |
4
| return lastEventIsDo;
|
37 |
| } |
38 |
0
| public void setLastEventIsDo(boolean lastEventIsDo)
|
39 |
| { |
40 |
0
| this.lastEventIsDo = lastEventIsDo;
|
41 |
| } |
42 |
0
| public void setController(Controller controller)
|
43 |
| { |
44 |
0
| this.controller = controller;
|
45 |
| } |
46 |
0
| public Controller getController()
|
47 |
| { |
48 |
0
| return this.controller;
|
49 |
| } |
50 |
| |
51 |
0
| public void setData(String xml) throws IllegalArgumentException
|
52 |
| { |
53 |
0
| this.controller.setData(xml);
|
54 |
| } |
55 |
| |
56 |
0
| public String getData()
|
57 |
| { |
58 |
0
| return this.controller.getModel().getXML();
|
59 |
| } |
60 |
| |
61 |
11
| public void fireDoEvent(NotifyableAction action, BusinessObject bo)
|
62 |
| { |
63 |
11
| this.action = action;
|
64 |
11
| this.bo = bo;
|
65 |
11
| this.lastEventIsDo = true;
|
66 |
| } |
67 |
6
| public void fireUndoEvent(NotifyableAction action, BusinessObject target)
|
68 |
| { |
69 |
6
| this.action = action;
|
70 |
6
| this.bo = target;
|
71 |
6
| this.lastEventIsDo = false;
|
72 |
| } |
73 |
0
| public void fireEvent(String event)
|
74 |
| { |
75 |
0
| this.event = event;
|
76 |
| } |
77 |
6
| public NotifyableAction getLastAction()
|
78 |
| { |
79 |
6
| return this.action;
|
80 |
| } |
81 |
6
| public BusinessObject getLastBusinessObject()
|
82 |
| { |
83 |
6
| return this.bo;
|
84 |
| } |
85 |
0
| public String getLastEvent()
|
86 |
| { |
87 |
0
| return this.event;
|
88 |
| } |
89 |
| |
90 |
| |
91 |
| } |