CytoPanel's, Mouse Event.

27 views
Skip to first unread message

Алексей Семибратов

unread,
Dec 13, 2020, 12:51:06 AM12/13/20
to cytoscape-app-dev
Hi everyone. I had a few questions during my work in Cytoscape.
1. I have panel1 (extends JPanel implements CytoPanelComponent) and panel2 (extends JPanel implements CytoPanelComponent). I need to get data from panel1 when I working in panel2. I don't understand how to do this.
2. I need to show a popup menu when I hover over a node / edge. Is there a Cytoscape event that can catch cursor hovering?
3.  If I try to call a JOptionPane.showMessageDialog(...) (or similar) in a method run() in SampleTask extends AbstractTask, then the Cytoscape hangs. Why is this happening?

Thanks for any help.
Alexey.


Mike Kucera

unread,
Dec 13, 2020, 2:47:28 PM12/13/20
to cytoscape-app-dev
Hi,

1) There are many ways to handle scenarios like this. One common way is to put your state in a "manager" class, then pass that class to both panels when you create them. Another more advanced way is to use events. Panel1 would fire events that panel2 handles, and panel2 fires events that panel1 handles.

2) No, there is no cursor hover. There are 2 things you can do to work around this limitation. If you just want to show some text for a node/edge then put the text in the node/edge table and use a passthrough mapping for the tooltip visual property. The other thing you can do is add menu items to the right-click menu for nodes/edges.

3) This is a known bug. There is no way to show a dialog or popup while running a task. You can show a dialog inside a call to SwingUtilities.invokeLater(), but the dialog will show up after the task completes. If you are showing a dialog because the task needs input from the user the standard way to do that is to use fields with @Tunable annotations in the Task.



--
You received this message because you are subscribed to the Google Groups "cytoscape-app-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-app-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cytoscape-app-dev/7a3ad2ec-0547-4d15-a1ad-6c0f811d1f8en%40googlegroups.com.

Alexey

unread,
Dec 15, 2020, 11:49:32 PM12/15/20
to cytoscape-app-dev
I solved all the problems. Thanks for the help!

понедельник, 14 декабря 2020 г. в 02:47:28 UTC+7, mikekucera:
Reply all
Reply to author
Forward
0 new messages