Image Icons showing on the left and being modified when updating a table row

15 views
Skip to first unread message

Juanjo Diaz

unread,
Jun 1, 2015, 6:04:19 PM6/1/15
to cytoscap...@googlegroups.com
Hi all,

I'm working on the next release of my app GFD-Net (http://apps.cytoscape.org/apps/gfdnet). 

I just found that the image icon are display at the left of the default icons instead of on the right as they use to be (like in the image in the app store). Any idea of what's going on??

Also, I've found that when updating a row in the nodes table, all the icons are enabled, i.e. I have disable some icons and calling "row.set("MyColumn", MyValue;" enable them magically. Is this a bug? Any idea?


Last question. Once I have my icons on the left. I'd like to separate them from the rest of the icons using  a vertical line or something. That was easy to do in the old plugins. How can it be done in an app?

Thanks in advance!!


Tim Hull

unread,
Jun 2, 2015, 4:01:34 PM6/2/15
to cytoscap...@googlegroups.com
1. As far as the icons, it seems the default gravity was changed at some point from 100 to -1, meaning that icons added to the toolbar by apps end up at the beginning instead of the end. You can make them appear at the end by manually specifying a toolbar gravity as follows:

cyAction.setToolbarGravity(100.0f); // for CyActions
// or
taskFactoryProps.setProperty("toolBarGravity", "100.0f"); // for Task Factories

2. To add a separator, you would have to get the JToolBar object using CySwingApplication's getToolBar method, and then call addSeparator(), which will add a separator at the end of the toolbar.

3. The toolbar icons update their state when a row value is set because that state is automatically updated each time the state is changed in Cytoscape. It is determined using either the TaskFactory.isReady() method (for TaskFactory), or the value of the enableFor property (for AbstractCyAction or TaskFactory - specified in properties object or AbstractCyAction constructor). 

Acceptable values for the enableFor property can be found at:


Hope this helps...

Tim





--
You received this message because you are subscribed to the Google Groups "cytoscape-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cytoscape-disc...@googlegroups.com.
To post to this group, send email to cytoscap...@googlegroups.com.
Visit this group at http://groups.google.com/group/cytoscape-discuss.
For more options, visit https://groups.google.com/d/optout.

Juanjo Diaz

unread,
Jun 3, 2015, 3:21:03 PM6/3/15
to cytoscap...@googlegroups.com
Hi Tim,

Thank you very much! You info explains everything and helped my fixing the icons issue. 

However I'm struggling to find a solution fo the enable/disable state of the CyActions. I want each of the buttons to be enable depending on some custom condintion (for example, once the pluging is run the "Execute" button should be disable). Is there any way to achieve this??

Thanks,
Juanjo

Tim Hull

unread,
Jun 3, 2015, 3:57:48 PM6/3/15
to cytoscap...@googlegroups.com
Using a Task/TaskFactory instead of CyAction and implementing isReady() would accomplish this, though you have to be careful not to display a Swing UI during task execution (instead, we'd advise using Tunables). 

Alternatively, you could implement CyAction rather than extending AbstractCyAction - that way, the enable state would not be automatically determined. 

Tim

Juanjo Diaz

unread,
Jun 3, 2015, 6:11:48 PM6/3/15
to cytoscap...@googlegroups.com
Thanks again! You've been really helpfull. 

Finally, I've overriden the updateEnableState method of my CyActions with a void one like

@Override public Map<String,String> getProperties() { //Do Nothing }

that way, the actions state is never updated and I can enable/disable them at will.
Reply all
Reply to author
Forward
0 new messages