I'm trying to map data flow between some server hosts. The idea is that data flows between multicast sessions in a network, and I have a table of where the data goes from and to. I want to generate diagrams showing what goes where using arrows.
I've drawn a few shapes (rectangles for hosts, and ovals for multicast sessions) using the Graphics library and stored the position/scale data of the shapes in objects so I can calculate where the arrows should latch on. I have also made arrows between them. The arrows are added using a custom function with the paintComponenet method, sort of like addArrow(startShape, endShape), which will find the two nearest anchor points of the shapes and draw the arrow between them.
My work so far, randomly using the addArrow function
However, this is very lifeless in itself. I also want to add a hover effect to the arrows, so that it thickens and displays some custom text when the mouse pointer touches it. This doesn't seem viable using the paintComponent function, since I can't add events to the shapes it draws.
I think it would be possible to draw the arrows, then put them into a JLabel component and define mouse events on that. I may also be able to create a new "arrow swing component", but I think that's above my level right now.
Do you guys have a recommendation for how to proceed?