• Post Reply Bookmark Topic Watch Topic
  • New Topic

linking movable Jpanels  RSS feed

 
Samer Telawi
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Dears,
do anyone give a hint how to connect more than two components (JPnel ) using one association ....
should I add some control points to the line or add a special component in the middle to connect the rest of components.
please check the attached file.
thanks.
diagram.jpg
[Thumbnail for diagram.jpg]
 
Samer Telawi
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I added this new picture to clear my point..
I am able to draw line with two components but the problem is when I want to connect multiple components together
like in the picture ...
should I add control points to the line to make it more than one line connected to each other .
thanks
Unbenannt.PNG
[Thumbnail for Unbenannt.PNG]
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are the lines drawn programmatically or manually? You can create a "junction" component which is where the lines intersect. That way it would be the same as drawing lines between those panels
 
Samer Telawi
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks a lot for your reply
the lines will be drawn manually so I will choose the first component and move the pointer to the next component
but in case I have to connect more than two in one association .... it is confused.
in case I want to use a junction component like the first picture
how that should be added ... lets say that define two kinds of connections ... like the first one just two components and the second connection type is more than two components so we add the junction component and start connecting them ?
.......
thanks
 
Maneesh Godbole
Bartender
Posts: 11445
18
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The hard way would be to sense that the user tried to add a connection when one already exists. Then prompt him to use junctions.
The elegant way would be to sense the user tried to add a connection when one already exists and programmatically insert a junction, updating the connections along the way. Same would apply in case the user removes any connections.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!