Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Migration of plugin to Cytoscape 3.0.0 Beta2 API ...
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  2 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Bram Van de Sande  
View profile  
 More options Sep 14 2012, 5:58 am
From: Bram Van de Sande <vandesande.b...@gmail.com>
Date: Fri, 14 Sep 2012 02:58:42 -0700 (PDT)
Local: Fri, Sep 14 2012 5:58 am
Subject: Migration of plugin to Cytoscape 3.0.0 Beta2 API ...

Dear Cytoscape team,

I recently ported my Cytoscape 2.8.x plugin to the new Cytoscape 3.0.0 API.
I'm using the Simplified App approach.
My current version of the port works nice, but there are some minor
problems remaining:

A. In the previous version I created a custom VisualStyle programmatically
and want to do the same in the new version of the plugin. I followed the
example in the CookBook but this results in an error when trying to install
the plugin from a JAR file (using the App Manager):
Caused by: java.lang.NoClassDefFoundError:
org/cytoscape/view/vizmap/mappings/DiscreteMapping
at view.IRegulonVisualStyle.createVisualStyle(Unknown Source)
at view.IRegulonVisualStyle.install(Unknown Source)
at view.IRegulonApp.<init>(Unknown Source)
... 16 more
Caused by: java.lang.ClassNotFoundException:
org.cytoscape.view.vizmap.mappings.DiscreteMapping
at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
at java.lang.ClassLoader.loadClass(ClassLoader.java:306)
at java.lang.ClassLoader.loadClass(ClassLoader.java:247)
... 19 more
The code snippet that results in the error is:
        final VisualStyleFactory factory =
serviceRegistrar.getService(VisualStyleFactory.class);
        final VisualMappingFunctionFactory continuousMappingFactory =
serviceRegistrar.getService(VisualMappingFunctionFactory.class,
"(mapping.type=continuous)");
        final VisualMappingFunctionFactory discreteMappingFactory =
serviceRegistrar.getService(VisualMappingFunctionFactory.class,
"(mapping.type=discrete)");
        final VisualMappingFunctionFactory passthroughMappingFactory =
serviceRegistrar.getService(VisualMappingFunctionFactory.class,
"(mapping.type=passthrough)");

        final VisualStyle style = factory.createVisualStyle(NAME);
        style.setDefaultValue(BasicVisualLexicon.NETWORK_BACKGROUND_PAINT,
Color.GRAY);

        // Node label = name

style.addVisualMappingFunction(passthroughMappingFactory.createVisualMappin gFunction(
                NetworkUtilities.ID_ATTRIBUTE_NAME,
                String.class,
                BasicVisualLexicon.NODE_LABEL));

        // Node shape =
        // 1. Ellipse when regulator
        // 2. Rectangle when target gene
        final DiscreteMapping<String,NodeShape> nodeShapeMapper =
(DiscreteMapping) discreteMappingFactory.createVisualMappingFunction(
                NetworkUtilities.REGULATORY_FUNCTION_ATTRIBUTE_NAME,
                String.class,
                BasicVisualLexicon.NODE_SHAPE);

nodeShapeMapper.putMapValue(NetworkUtilities.REGULATORY_FUNCTION_TARGET_GEN E,
NodeShapeVisualProperty.RECTANGLE);

nodeShapeMapper.putMapValue(NetworkUtilities.REGULATORY_FUNCTION_REGULATOR,
NodeShapeVisualProperty.ELLIPSE);
        style.addVisualMappingFunction(nodeShapeMapper);

B. Is there a way to log messages to the Developer's Log Console. I tried
to get an implementation of the OSGi LogService interface but this resulted
in a RuntimeException.

C. I tried to hook up HTML help pages to the Cytoscape help system via the
instructions provided in the CookBook. Unfortunately this results in a
HelpSetException at plugin installation time. The code snippet that results
in this error:
private void addHelp(final CyAppAdapter adapter) {
try {
            final CyHelpBroker helpBroker =
adapter.getCyServiceRegistrar().getService(CyHelpBroker.class);
            final ClassLoader classLoader = getClass().getClassLoader();
            final URL helpSetURL = HelpSet.findHelpSet(classLoader,
HELP_SET_NAME);
final HelpSet newHelpSet = new HelpSet(classLoader, helpSetURL);
            helpBroker.getHelpSet().add(newHelpSet);

} catch (RuntimeException e) {

Logger.getInstance().error("iRegulon: Could not install help.");
} catch (HelpSetException e) {

            //TODO: Apparently this doesn't work ...
            Logger.getInstance().error("iRegulon: Could not find help set:
\"" + HELP_SET_NAME + "\".");
        } catch (LinkageError e) {
Logger.getInstance().error("iRegulon: Could not install help.");
        }

}

D. My plugin registers the following listeners: NetworkViewAddedListener,
NetworkViewDestroyedListener and NetworkViewChangedListener. Could it be
that my listeners are not always called in the current version of Cytoscape
3.0?

Thanks for your feedback,
Bram Van de Sande


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Jason Montojo  
View profile  
 More options Sep 27 2012, 10:35 am
From: Jason Montojo <jrr...@gmail.com>
Date: Thu, 27 Sep 2012 10:35:33 -0400
Local: Thurs, Sep 27 2012 10:35 am
Subject: Re: [Cytoscape-discuss] Migration of plugin to Cytoscape 3.0.0 Beta2 API ...

Hi Bram,

Thanks for your feedback!  My comments are inlined below:

On Fri, Sep 14, 2012 at 5:58 AM, Bram Van de Sande <

vandesande.b...@gmail.com> wrote:
> A. In the previous version I created a custom VisualStyle programmatically
> and want to do the same in the new version of the plugin. I followed the
> example in the CookBook but this results in an error when trying to install
> the plugin from a JAR file (using the App Manager):
> Caused by: java.lang.NoClassDefFoundError:
> org/cytoscape/view/vizmap/mappings/DiscreteMapping
> at view.IRegulonVisualStyle.createVisualStyle(Unknown Source)
> at view.IRegulonVisualStyle.install(Unknown Source)
> at view.IRegulonApp.<init>(Unknown Source)
> ... 16 more

Which version of the API are you compiling against?  And which version of
Cytoscape are you running your plugin with?  I tried to reproduce this
using the M5 release (a.k.a the developer's beta) as well as the latest
stable build but I couldn't trigger that exception...

> B. Is there a way to log messages to the Developer's Log Console. I tried
> to get an implementation of the OSGi LogService interface but this resulted
> in a RuntimeException.

You'll need to add a reference to pax-logging-api to your compile time
classpath.  We use version 1.5.2 currently at runtime so that's probably a
good choice to compile against.  Once that's done, you can obtain a logger
like this:

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
...
Logger logger = LoggerFactory.getLogger(Your.class);

C. I tried to hook up HTML help pages to the Cytoscape help system via the

> instructions provided in the CookBook. Unfortunately this results in a
> HelpSetException at plugin installation time. The code snippet that results
> in this error:

The cookbook instructions have a bit of a bug.  HELP_SET_NAME should be
pointing to a file like /help/jhelpset.hs which should be present in your
app's JAR.  Can you confirm the URL is right and that jhelpset.hs is in the
appropriate spot in your JAR?

D. My plugin registers the following listeners: NetworkViewAddedListener,
NetworkViewDestroyedListener and NetworkViewChangedListener. Could it be
that my listeners are not always called in the current version of Cytoscape
3.0?

Your listeners should always be called.  Can you provide more information
about the symptoms you're seeing?  As long as the listeners get registered
as soon as your app starts up, they should get all the notifications.

Hope this helps,
Jason


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »