On Mon, Jun 30, 2008 at 10:52 AM, Brian Hudson <[EMAIL PROTECTED]> wrote:
> I am trying to observe when a Diagram is added/removed from a Project. [...] > So it seems that there currently really isn't any way of listening for these > type of events. > > I can either create my own Actions which fire off some custom event > indicating a Diagram has been Added/Removed, or attempt to fix this > limitation in ArgoUML. The first is easier - but a hack, the second is more > involved - but likely of more long-term value to ArgoUML. This is a generally useful capability, so please look at doing it right as opposed to just hacking something together. > Assuming I attempt to fix this in ArgoUML... does ArgoUML have a convention > for events? It seems that a few different approaches are used... If it were > up to me I'd create an ProjectListener which the ProjectImpl would call the > appropriate methods on as things were modified... but property change events > seem to be used quite a bit in ArgoUML. I'd rather take the approach that is > more likely to be rolled into ArgoUML. As you've discovered, we've got a few conventions. :-) Some things extend ArgoEventListener in an event-specific manner and others implement PropertyChangeListener directly. Generally I prefer the former style, but I'm not really thrilled with the central event types registry in ArgoEventTypes since this seems to introduce more coupling than is desirable. Having said that, I think extending ArgoEventListener is the right way to go for this since it will keep things consistent. What do others think? Tom --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
