Hyperedges with Junction points (just) in Notation Model [message #181076] |
Sat, 05 April 2008 21:40 |
Eclipse User |
|
|
|
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 #181164 is a reply to message #181148] |
Mon, 07 April 2008 12:52 |
Eclipse User |
|
|
|
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
>
>
|
|
|
|
Powered by
FUDForum. Page generated in 0.03425 seconds