Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [tools-dev] [GEF] I am missing an addListener-Method...

----- Original Message -----
From: "Randy Hudson" <hudsonr@xxxxxxxxxx>
To: <tools-dev@xxxxxxxxxxx>
Sent: Tuesday, May 14, 2002 5:43 PM
Subject: Re: [tools-dev] [GEF] I am missing an addListener-Method...


> The figure should not know about the EditPart nor the model.

Yes, that is clear. And it would not, even if it was a listener to the
EditPart, because than the EditPart knows about the figure (it actually
does), not the other way round.

> In activate(), your EditPart should add listener(s) to the model.  When
the
> model changes, it should call refreshSourceConnections based on the type
of
> change.  I don't think you will need to override refreshSourceConnections,
> just getModelSourceConnections().

I dont see how overriding getModelSourceConnections() could help me here,
rather would I override addSourceConnection or primAddSourceConnection.

But probably I did'nt state my situation clearly. I want to have anchors
added dynamically to the NodeFigures, e.g. when the connection-commands get
executed - in contrary to the LogicDesigner example, where the number and
positions of the anchors are static/fixed for every node in the diagram.

So somehow the figure has to be informed that new anchors are needed (for
connections) and have to be created or old anchors are superfluous and
can/should be deleted.

If we agree that this is a reasonable proceeding (maybe something is wrong
at this point), then the discussion is only about which mechanism should be
used to acchieve this notification that leads to a manipulation of the
figure's ConnectionAnchor lists.

I still dont see why not to use the EditPart's event notification mechanism,
where the Node-EditPart registers "its" Node-figure as NodeListener because
it (the EP) already automagically fires events whenever itself is informed
of "connection-changes" by its observed model, so why not using this (imho)
well designed and convenient way?

Regards, Thilo.



Back to the top