Skip to content
Snippets Groups Projects
Commit fbafb305 authored by Jens Bendisposto's avatar Jens Bendisposto
Browse files

working on the listeners / not yet working

parent a677916e
Branches
No related tags found
No related merge requests found
......@@ -71,8 +71,10 @@ public abstract class StateBasedViewPart extends ViewPart implements
@Override
public void createPartControl(final Composite parent) {
this.parent = parent;
StaticListenerRegistry.registerListener((ILifecycleListener) this);
StaticListenerRegistry.registerListener((IAnimationListener) this);
// StaticListenerRegistry.registerListener((ILifecycleListener) this);
// StaticListenerRegistry.registerListener((IAnimationListener) this);
History history = Activator.getHistory();
if (history != null) history.registerAnimationListener(this);
final Animator animator = Animator.getAnimator();
if (animator.isMachineLoaded()) {
createStateControl();
......@@ -86,6 +88,8 @@ public abstract class StateBasedViewPart extends ViewPart implements
}
}
private void createNoStateMessage() {
if (noStateMessage == null) {
disposeStateView();
......
......@@ -19,6 +19,12 @@ import de.prob.core.domainobjects.State;
public class StaticListenerRegistry implements ILifecycleListener,
IComputationListener, IAnimationListener{
public StaticListenerRegistry() {
History h = new History(null);
h.registerAnimationListener(this);
}
private static final ListenerRegistry registry = new ListenerRegistry();
public static void registerListener(final ILifecycleListener listener) {
......@@ -58,4 +64,5 @@ public class StaticListenerRegistry implements ILifecycleListener,
registry.currentStateChanged(history);
}
}
......@@ -140,6 +140,9 @@ public class StartAnimationHandler extends AbstractHandler implements IHandler {
bindings.setVariable("defaultStateSpace", s);
bindings.setVariable("defaultHistory", h);
System.gc();
Activator.currentStateChanged(null, null);
return null;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment