Gephi API

GSoC developers forum
Post Reply [phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
cklee
Posts:7
Joined:30 Mar 2010 20:43
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
Gephi API

Post by cklee » 09 Apr 2010 12:02

"Lookup is the backbone of a NetBeans Platform application and must be cited first. We repeatedly use the service provider scenario to propose extensible features like algorithms, filters, or new file format support. I really like that a single annotation is enough to add a feature and directly see it integrated in the user interface." - dzone interview

From last year's wikispace:

Code: Select all

Generator[] generators = Lookup.getDefault().lookupAll(Generator.class).toArray(new Generator[0]);
and
http://openide.netbeans.org/lookup/

All good references, but could someone help me point out instances in the current Gephi 0.7 build in PreviewAPI? I'd rather see it used in the source.

User avatar
mbastian
Gephi Architect
Posts:728
Joined:10 Dec 2009 10:11
Location:San Francisco, CA
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable

Re: Gephi API

Post by mbastian » 09 Apr 2010 22:43

I recommend Netbeans Platfrom's screencast about Lookup, available here.
Many tutorials about Netbeans Platfrom can be found on the website.

There is no extensive use of Lookup in the Preview modules, except for PreviewController. However that must change with the planned refactoring, as more modularity will be developed. Just an exemple applied to Preview, one can imagine Properties class implementing PreviewProperty and setting the annotation

Code: Select all

@ServiceProvider(service=PreviewProperty.class)
and the UI doing

Code: Select all

for(PreviewProperty p : Lookup.getDefault().lookupAll(PreviewProperty.class)) {
   //display property
}
for knowing about declared properties.

The power of this system is that any plug-in just create a PreviewProperty implementation and use @ServiceProvider to be integrated.

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1275: count(): Parameter must be an array or an object that implements Countable