On Sun, Jan 18, 2009 at 4:02 PM, Bob Tarling <[email protected]> wrote:

> What is the concept of the 'active' diagram in that case? A TabDiagram
> should contain a diagram, I think the term active is meaningless
> though and possibly misleading.

2009/1/18 Michiel van der Wulp <[email protected]>:

> Anyhow, it is a bit early to deprecate functions that have no
> replacement (architecture) yet.

Bob questions the concept of an active diagram in an MDI world, but
it's really irrelevant even now for the vast majority of the cases.
The reason those methods are deprecated without a replacement being
defined is because the entire concept is wrong.

When a piece of code is asking about the "active" diagram, it really
means it wants to know the diagram containing the Fig that it is
working on or the diagram contained in the window the user clicked on
or something else which can be better gotten via an entirely different
method.

DiagramUtils.getActiveDiagram() will get the diagram for the window
that last contained the mouse (from GEF).  To get the diagram from a
Fig, use
((LayerPerspective) getLayer()).getDiagram()

If folks come across a need that isn't being met by one of these two
methods, file a bug report and we'll create some other little utility
to fill the gap.

> One small remark: If the TabDiagram maintains the notion of the active
> diagram, then the Presentation Tab depends on it, since it only works on
> Figs on the current diagram.

Why can't it just work on the selected Figs?  I don't see anything
there that even needs to know what diagram the Fig is located on, but
if it does, it can ask the Figs.  Of course it should support multiple
selected Figs and be prepared for them to be on different diagrams
(another reason the concept of an active diagram breaks down).

Tom

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=450&dsMessageId=1034029

To unsubscribe from this discussion, e-mail: 
[[email protected]].

Reply via email to