I am having list of nodes to be drawn.Here Node means RectangleFigure
. So, all these nodes are plotted first on canvas(FigureCanvas
)
Then I have a map maintained having dependency relations between nodes drawn earlier.
In the map, keys are the nodes and values are nothing but a list of nodes maintained.
e.g. There are 3 nodes, [ClassA, ClassB, InterfaceC]
I have them drawn on a canvas.
And my map is like below:
[ClassA=[ClassB], ClassB=[InterfaceC]]
So, it means ClassA extends ClassB
and ClassB implements InterfaceC
.
Now, I want to draw PolylineConnection
in between the nodes drawn already ,using the map maintained.
So, how can I proceed for this?
Any pointers are really appreciated, Thanks in advance!
Tried ways to solve the problem, and it worked. So, adding answer for the own question.
Steps are as below:- 1. Consider the example in the question itself. There are 3 nodes, [ClassA, ClassB, InterfaceC] and we have a map of relations in these nodes as [ClassA=[ClassB], ClassB=[InterfaceC]] means
ClassA extends ClassB
andClassB implements InterfaceC
.PolylineConnection
.Anchors
The logic for fetching node is as below:-
RectangleFigure
(node) then comparing the label given to it we can fetch the node required.Code snippet for more clarification