gephi-plugins icon indicating copy to clipboard operation
gephi-plugins copied to clipboard

showing node labels

Open robindemesmaeker opened this issue 9 years ago • 13 comments

Hello,

I am writing a Layout Plugin (for version 0.9.1) and I would like to set the node labels visible. I thought that this code would work, but I get the error below.

in pom.xml

<dependency>
            <groupId>org.gephi</groupId>
            <artifactId>visualization</artifactId>   
</dependency>"

in code itself

import org.gephi.visualization.VizController; import org.gephi.visualization.VizModel;

VizModel vizModel = VizController.getInstance().getVizModel(); vizModel.getTextModel().setShowNodeLabels(true);

[ERROR] Project depends on packages not accessible at runtime in module org.gephi:visualization:jar:0.9.1

What am I missing?

Thanks!

robindemesmaeker avatar Mar 17 '16 15:03 robindemesmaeker

I have the exact same issue. Did you solve it?

Cvikli avatar Sep 21 '16 21:09 Cvikli

Hi, I did not find a solution to solve this issue. Apparently the latest version provides less freedom to plugin developers. But I have to say it has been a while since a last worked on this...

robindemesmaeker avatar Sep 22 '16 12:09 robindemesmaeker

Yes, I saw. This function could be really handy. I hope later they give it back, or provide some other solution for this.

Cvikli avatar Sep 22 '16 12:09 Cvikli

I hope so as well...

robindemesmaeker avatar Sep 22 '16 12:09 robindemesmaeker

That's strange. I think it should just work, since the package is made public in the pom: https://github.com/gephi/gephi/blob/master/modules/VisualizationImpl/pom.xml#L212

What imports are you using from this module?

eduramiba avatar Sep 22 '16 13:09 eduramiba

If I remember well, the problem is with the TextModel.

robindemesmaeker avatar Sep 22 '16 13:09 robindemesmaeker

<dependencies>  
    <dependency>
        <groupId>org.gephi</groupId>
        <artifactId>visualization-api</artifactId>
    </dependency>
    <dependency>
        <groupId>org.gephi</groupId>
        <artifactId>tools-api</artifactId>
    </dependency>
    <dependency>
        <groupId>org.netbeans.api</groupId>
        <artifactId>org-openide-util-lookup</artifactId>
    </dependency>
    <dependency>
        <groupId>org.gephi</groupId>
        <artifactId>graph-api</artifactId>
    </dependency>
    <dependency>
        <groupId>org.gephi</groupId>
        <artifactId>visualization</artifactId>
    </dependency>
    <dependency>
        <groupId>org.gephi</groupId>
        <artifactId>layout-plugin</artifactId>
    </dependency>
    <dependency>
        <groupId>org.gephi</groupId>
        <artifactId>ui-library-wrapper</artifactId>
    </dependency>
    <dependency>
        <groupId>org.gephi</groupId>
        <artifactId>layout-api</artifactId>
    </dependency>
    <dependency>
        <groupId>org.gephi</groupId>
        <artifactId>ui-propertyeditor</artifactId>
    </dependency>
    <dependency>
        <groupId>org.gephi</groupId>
        <artifactId>project-api</artifactId>
    </dependency>
    <dependency>
        <groupId>org.gephi</groupId>
        <artifactId>ui-utils</artifactId>
    </dependency>
    <dependency>
        <groupId>org.gephi</groupId>
        <artifactId>tools-api</artifactId>
    </dependency>
</dependencies>

And the imports are: import org.gephi.visualization.text.TextModelImpl; import org.gephi.visualization.VizController; import org.gephi.visualization.VizModel;

Error: Private classes referenced in module: [org.gephi.visualization.text.TextModelImpl] Project depends on packages not accessible at runtime in module org.gephi:visualization:jar:0.9.1 ... Failed to execute goal org.codehaus.mojo:nbm-maven-plugin:3.14:manifest (default-manifest) on project layout: See above for failures in runtime NetBeans dependencies verification. -> [Help 1]

Can it happen that <publicPackage>org.gephi.visualization.text</publicPackage> is missing from there?

Cvikli avatar Sep 22 '16 13:09 Cvikli

Right, org.gephi.visualization.text must be the problem. What classes do you use from that? We can make it public in next release/update

eduramiba avatar Sep 22 '16 13:09 eduramiba

TextModelImpl. It is nice to hear. However, I am not very good at using maven (just wrote my first plugin yesterday), please check it, to be sure.

Cvikli avatar Sep 22 '16 13:09 Cvikli

As a workaround maybe you are able to do the call with reflection or something, but I am not sure that will work.

eduramiba avatar Sep 22 '16 13:09 eduramiba

I made a pull request, to gephi, I hope it helps. https://github.com/gephi/gephi/pull/1572

Cvikli avatar Sep 22 '16 13:09 Cvikli

Great, I think it will have to be done for 0.9.2 instead of 0.9.1 as an update since you can't compile the plugin against the 0.9.1 release artifacts in maven.

eduramiba avatar Sep 22 '16 13:09 eduramiba

Thanks, I am looking forward to it!

robindemesmaeker avatar Sep 22 '16 13:09 robindemesmaeker