Hi David,
If you want to listen for a RemoveAssociationEvent, you can try this way:
Model.getPump().addClassModelEventListener(new PropertyChangeListener() {
public void propertyChange(PropertyChangeEvent evt) {
if (evt instanceof RemoveAssociationEvent) {
// do what you want to do when this event is fired
}
}
}, Model.getMetaTypes().getModelElement(), (String []) null);
This way you listen the UML Model element and any of its subtypes.
If you are interested only to listen a single UML Model element then you can use
Model.getPump().addModelEventListener(PropertyChangeListener listener,
Object modelelement)
Bogdan,
On 7/12/07, David Orejuela <[EMAIL PROTECTED]> wrote:
Hi Bogdan,
I'm also interested in this topic but I want to capture a
RemoveAssociationEvent from a FigAssociation class. I'm a newbie and I don't
know what I must do, I have written a modelChangued method with code for
this event, but this method is never executed. have I more to do to enable
it ?
2007/7/11, Bogdan Ciprian Pistol <[EMAIL PROTECTED]>:
>
> Hello,
>
> I have some trouble understanding what are the valid property names of
> the ModelEventPump.
>
> Here is what I investigated so far (please notify me if I'm wrong):
>
> The ModelEventPump notify it's listeners on only 4 kinds of events
changes:
> DeleteInstanceEvent, AttributeChangeEvent, RemoveAssociationEvent and
> AddAssociationEvent.
>
> DeleteInstanceEvent uses the source UML element (the notifier) and a
> property name (a string)
> that in some parts of ArgoUML is expected to be "remove" and in other
> parts it doesn't matter it's value, the only test done is if the event
> is instance of DeleteInstanceEvent.
>
> AttributeChangeEvent is initialized with the source UML element, a
> property name, old and new values. The propery name can have very
> different values like: "name", "isAbstract", "isActive",
> "isRoot", "isLeaf", "isSpecification", "visibility", "multiplicity",
> "ownerScope", "changeability",
> "targetScope" and maybe other values. (I extracted these values while
> debugging).
>
> RemoveAssociation and AddAssociation events (from the MDR
> implementation source code) doesn't give me clues how should be used
> because the AssociationEvent (from MDR) has no source code or javadoc.
> The events are using AssociationEvent#getNewElement(),
> AssociationEvent#getEndName(),
AssociationEvent#getFixedElement(),
> which I do not know what are doing.
>
> The main problem for me are the valid values for property names.
>
> Bogdan,
>
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
[EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]