Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » GMF (Graphical Modeling Framework) » Hyperedges with Junction points (just) in Notation Model
Hyperedges with Junction points (just) in Notation Model [message #181076] Sat, 05 April 2008 21:40 Go to next message
Eclipse UserFriend
Originally posted by: miguel.pazza.gmail.com

Hello,

I am implementing a visual editor for component system. Connections can be
created between two or among more components.

The domain model already exists and it represents connections as connection
object with list of components participating on this connection. The
component also contains a list of connection objects on which it
participates (bidirectional reference). (See example below.)

Case when two components are linked with a connection is trivial - an edge
is drawn between them.
Case when three or more components participates on a connection is
interesting. We have to draw a hyperedge by drawing one or more junction
points [1] and drawing a tree with components as leaves. The junction point
(as auxiliary node) and bunch of (physical) connections (also called
branches) around it is just for presentation and does not have any
counterpart in the given domain model.

Please, could you give me some advices if there is a way how to create
mapping from the domain model and store the junction points and branches for
given multiconnection in notation model?



Thanks,

MiG


PS: For reference - if you want to drag something on connection, you firstly
have to create your own DragEditPartsTracker, because default implementation
puts CONNECTION_LAYER to exclusionSet (method getExclusionSet()) [2].




[1] You can see the junction point concept in "Circuit Symbols - Wires
joined" http://www.kpsec.freeuk.com/symbol.htm

[2] http://dev.eclipse.org/newslists/news.eclipse.tools.gef/msg1 4344.html



Example of my domain model:
************************************************
Component A : connections {1}
Component B: connections {1, 2}
Component C: connections {2}
Component D: connections {2}
Component E: connections {2}

Connection 1 {A, B} //two components connected
Connection 2 {B, C, D, E} //three components connected
************************************************
Re: Hyperedges with Junction points (just) in Notation Model [message #181148 is a reply to message #181076] Mon, 07 April 2008 11:09 Go to previous messageGo to next message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Miguel,

I can suggest you to model this kond of connection as an additional node
(connection objects) represented on diagram as a "dot" and a set of connection
to/from this node from/to components.

-----------------
Alex Shatalin
Re: Hyperedges with Junction points (just) in Notation Model [message #181164 is a reply to message #181148] Mon, 07 April 2008 12:52 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: miguel.pazza.gmail.com

Hello Alex,

Thanks for your response! The original idea behind my question is to
allow multiple "dots" for one connection to make the result diagram more
clear if one has to wire multiple components visually partitioned to two
(n) partitions at diagram. Then one can draw just one "super" connection
between these parts, place two junction points one for each (visual)
partition of diagram and make bunch of short local links among
components in particular part.

And the actual question is how to store these multiple "dots"? There is
place for just one dot per connection in my domain model. :-) (Into
diagram model...)

It seems to be a lot of customizations needed to be done. Firstly we
need to extend the domain model with "dot-helper-model". Then we have to
do some hand-weaving to keep things in sync with old domain model:

1) Discard non-existing connections (hyper edges)
{discarded} = {actual connections} and {old connections}

2) Reveal newly added connections
{newly added connections} = {actual connections} \ {old connections}

3) Intelligently update visual presentation of partially changed
connections (rescue the connections discared in step 1 :-) )

3.1) Discover and rescue connections with just changed
ordering of terminals or positions in connection list
(We can't use standard ID / UUID approach because firstly we do
not have them in domain model for connection elements and we
cannot probbably cannot make derived ID (is it even possible?)
based on set of terminals, because two connections with same sets
of terminals is still valid configuration in domain model; the
best guess heuristics and FCFS approach is needed here)

3.2) Rescue partially changed connections where some terminals were
added / removed.
(symmetric set difference for best match and shortest junction
dot routing...)

Needed algorithms are no rocket science but *how can this be implemented
in context of GMF*? Is anybody doing this already?

We can generalize and split this problem:

A) extending domain model with elements needed just for concrete (nice)
visual representation without any representation in underlying domain
model (and not contained in GMF notation model, either). (Mind the
multiple junction dots ("Steiner vertices") for hyperedges visualized as
tree.)

A.1) Storing this information somewhere / somehow in diagram resource.

A.2) synchronization of these extended parts (see (1) and (2)).

B) intelligent update of diagram nodes and connections (concrete syntax)
after domain model changes when we cannot afford identifying the domain
objects with IDs. (See (3).)
This can be probbably one with custom implementation of layout algorithm
and feeding it with hints about old domain model and its visual
representation. But now, we have to store this information somewhere and
we are back to (A.1).




Thanks for any clues,



MiG


Alex Shatalin wrote:
> Hello Miguel,
>
> I can suggest you to model this kond of connection as an additional node
> (connection objects) represented on diagram as a "dot" and a set of
> connection to/from this node from/to components.
>
> -----------------
> Alex Shatalin
>
>
Re: Hyperedges with Junction points (just) in Notation Model [message #181228 is a reply to message #181164] Mon, 07 April 2008 15:50 Go to previous message
Alexander Shatalin is currently offline Alexander ShatalinFriend
Messages: 2928
Registered: July 2009
Senior Member
Hello Miguel,

> Thanks for your response! The original idea behind my question is to
> allow multiple "dots" for one connection to make the result diagram
I understand that..

> It seems to be a lot of customizations needed to be done. Firstly we
Well, yes. But it looks easy to do these steps instead of implementing link
branching manually.

> 3) Intelligently update visual presentation of partially changed
> connections (rescue the connections discared in step 1 :-) )
I think this is the only task you have to perform – the rest should be done
by default updating process.

> best guess heuristics and FCFS approach is needed here)
I think you can perform some sorting before “canonical” processing of the
connections based on the attributes you are talking about.

> Needed algorithms are no rocket science but *how can this be
> implemented in context of GMF*? Is anybody doing this already?
We implemented some diagram migration logic – it was custom subclass of CanonicalEditpolicy
and this subclass was responsible for diagram structure modification. You
can try doing the same or find better place for domain model structure update.

It looks like a generic question about model contents migration while changing
the model version. Another option is to use QVT for this task.

> A) extending domain model with elements needed just for concrete
> (nice) visual representation without any representation in underlying
> domain model (and not contained in GMF notation model, either). (Mind
> the multiple junction dots ("Steiner vertices") for hyperedges
> visualized as tree.)
I’m suggesting to modify domain model. Without these modification it can
be more tricky to implement this functionality – you should be ready for
hand-coding corresponding logic into the generated code.

-----------------
Alex Shatalin
Previous Topic:Copy/Paste tutorial
Next Topic:Making Labels Visible on Custom Images (Urgent Please)
Goto Forum:
  


Current Time: Sat Apr 20 11:16:55 GMT 2024

Powered by FUDForum. Page generated in 0.03425 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top