Question

I'm developing a bundle app for Cytoscape 3. In this app I need a funcionality very similar to the build-in View > Arrange Network Windows > Grid, or Ctrl+G.

However, I cannot seem to find anything in Cytoscape's API that allows me to arrange network windows.

The source code behind the build-in funcionality can be found here: https://github.com/cytoscape/cytoscape-impl/blob/cbd6ae7202a2137d0224862aa371b82c1ec9a7a7/swing-application-impl/src/main/java/org/cytoscape/internal/view/CyDesktopManager.java#L81

As you can see I need a reference to the JDesktopPane, how do I get this through the API?

Was it helpful?

Solution

I don't think there is clean API-way of achieving what I want. You can however do it as follows:

In your activator you are able to retrieve a CySwingApplication reference: getService(bc, CySwingApplication.class), from which you can call the method .getJFrame(). You can recursively scan through all swing Container components with until you find a component of the type JDesktopPane. When you call .getAllFrames() of the JDesktopPane you can do whatever with you network windows (JInternalFrame).

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top