Author: b00__1
Date: 2007-07-15 08:42:30-0700
New Revision: 13079
Modified:
branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java
branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/RootContainerAdapter.java
Log:
The RootContainerAdapter notifies the ModelEventPump of UML events.
Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java?view=diff&rev=13079&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java&r1=13078&r2=13079
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java (original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/ModelEventPumpEUMLImpl.java 2007-07-15 08:42:30-0700
@@ -29,6 +29,7 @@
import java.beans.PropertyChangeListener;
import org.argouml.model.ModelEventPump;
+import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.Notifier;
/**
@@ -43,7 +44,7 @@
private Notifier rootContainer;
- private RootContainerAdapter rootContainerAdapter;
+ private RootContainerAdapter rootContainerAdapter = new RootContainerAdapter(this);
/**
* Constructor.
@@ -56,9 +57,6 @@
}
public void setRootContainer(Notifier container) {
- if (rootContainerAdapter == null) {
- rootContainerAdapter = new RootContainerAdapter();
- }
rootContainerAdapter.setRootContainer(container);
}
@@ -126,15 +124,17 @@
// TODO Auto-generated method stub
}
+
+ public void notifyChanged(Notification notification) {
+
+ }
public void startPumpingEvents() {
- // TODO Auto-generated method stub
-
+ rootContainerAdapter.setDeliverEvents(true);
}
public void stopPumpingEvents() {
- // TODO Auto-generated method stub
-
+ rootContainerAdapter.setDeliverEvents(false);
}
}
Modified: branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/RootContainerAdapter.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/RootContainerAdapter.java?view=diff&rev=13079&p1=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/RootContainerAdapter.java&p2=branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/RootContainerAdapter.java&r1=13078&r2=13079
==============================================================================
--- branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/RootContainerAdapter.java (original)
+++ branches/gsoc2007/b00__1/model-euml/src/org/argouml/model/euml/RootContainerAdapter.java 2007-07-15 08:42:30-0700
@@ -45,6 +45,27 @@
private Notifier rootContainer;
+ private ModelEventPumpEUMLImpl pump;
+
+ private boolean deliverEvents = true;
+
+ /**
+ * Constructor
+ * @param pump The ModelEventPump instance
+ */
+ public RootContainerAdapter(ModelEventPumpEUMLImpl pump) {
+ super();
+ this.pump = pump;
+ }
+
+ /**
+ * Stop or start the firing of events.
+ * @param value True for delivering events, false otherwise
+ */
+ public void setDeliverEvents(boolean value) {
+ deliverEvents = value;
+ }
+
/**
* Setter for the root container
* @param n the new root container
@@ -90,6 +111,9 @@
@Override
public void notifyChanged(Notification notification) {
super.notifyChanged(notification);
+ if (deliverEvents) {
+ pump.notifyChanged(notification);
+ }
}
}
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.