Hi,
I'm looking at using gephi for graph analysis for my organisation.
I want to be able to add in a new tab/page (like what is already present "overview", "data lab", "preview"), so that the user does not necessarily have to play around with the already present tabs/pages if he/she does not want to.
Is it possible to do this?
Adding in New Tabs/Pages
- 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: Adding in New Tabs/Pages
Yes it is possible, it's called a Perspective. Check out this wiki page
-
- Posts:6
- Joined:13 Apr 2011 06:36 [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: Adding in New Tabs/Pages
excellent thanks, in attempting to add in this, I realised I should probably run through some of the plugin tutorials.
When I was attempting to do the filter plugin it wasn't clear to me how the UI was implemented. I'm new to java, so this maybe an entirely stupid question!
the wiki states that an example for a simple panel is as follows:
"public class MyFilter extends javax.swing.JPanel implements ItemListener { ......"
I assume "MyFilter" is a typo, as it has already been defined as a public class earlier on in "public class MyFilter implements NodeFilter {....",
so assuming this, i defined the panel class as
"public class MyFilterUI extends javax.swing.JPanel implements ItemListener { ......"
So once this has been defined, I assume it somehow has to be called from the "getPanel()" method in "MyFilterBuilder". But I am not sure how!
Is there an already implemented plugin that I can look at that pulls all of this together as an example?
Thank you, and apolgies for such basic questions!
When I was attempting to do the filter plugin it wasn't clear to me how the UI was implemented. I'm new to java, so this maybe an entirely stupid question!
the wiki states that an example for a simple panel is as follows:
"public class MyFilter extends javax.swing.JPanel implements ItemListener { ......"
I assume "MyFilter" is a typo, as it has already been defined as a public class earlier on in "public class MyFilter implements NodeFilter {....",
so assuming this, i defined the panel class as
"public class MyFilterUI extends javax.swing.JPanel implements ItemListener { ......"
So once this has been defined, I assume it somehow has to be called from the "getPanel()" method in "MyFilterBuilder". But I am not sure how!
Is there an already implemented plugin that I can look at that pulls all of this together as an example?
Thank you, and apolgies for such basic questions!
- 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: Adding in New Tabs/Pages
Correct, thanks for reporting, I fixed the page.When I was attempting to do the filter plugin it wasn't clear to me how the UI was implemented. I'm new to java, so this maybe an entirely stupid question!
the wiki states that an example for a simple panel is as follows:
"public class MyFilter extends javax.swing.JPanel implements ItemListener { ......"
I assume "MyFilter" is a typo, as it has already been defined as a public class earlier on in "public class MyFilter implements NodeFilter {....",
so assuming this, i defined the panel class as
"public class MyFilterUI extends javax.swing.JPanel implements ItemListener { ......"
simply by doingSo once this has been defined, I assume it somehow has to be called from the "getPanel()" method in "MyFilterBuilder". But I am not sure how!
Code: Select all
return new MyFilterUI((MyFilter)filter)
Example with EdgeWeightFilterIs there an already implemented plugin that I can look at that pulls all of this together as an example?
The way UI is defined is a little different, as we wanted to have UIs in a different module, and therefore used Lookup to find UI implementation at runtime.
-
- Posts:6
- Joined:13 Apr 2011 06:36 [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: Adding in New Tabs/Pages
Great, that helped lots! I think I have got the basics of it.
One other question, I am using the Gephi 0.7 beta source code at the moment.
When I open the source code via Netbeans, then build/run the software, I get a different view of the software to what I see when I just run the Gephi application (both are using the Gephi 0.7 beta software).
The main difference being that I cannot see the different perspectives (such as Overview, Labratory, Preview) in the compiled Gephi view.
Thanks
One other question, I am using the Gephi 0.7 beta source code at the moment.
When I open the source code via Netbeans, then build/run the software, I get a different view of the software to what I see when I just run the Gephi application (both are using the Gephi 0.7 beta software).
The main difference being that I cannot see the different perspectives (such as Overview, Labratory, Preview) in the compiled Gephi view.
Thanks
- 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: Adding in New Tabs/Pages
Something must be wrong and the banner component crash at startup. Please consult the messages.log file in the gephi user dir, you should see an exception with BannerTopComponent. Please report it here.
-
- Posts:6
- Joined:13 Apr 2011 06:36 [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: Adding in New Tabs/Pages
Looking at the logs, the error is due to a plugin I wrote to add in a new perspective (apologies I should have mentioned that earlier, also I have moved to gephi 0.8 alpha version).
Basically
1. added a new module - MyPerspectivePlugin
2. added libraries Lookup, Utilities API, Desktop Perspective
3. created class that implements Perspective as follows:
4.In the "Bundle.properties" added line: TopazPerspective.name=Topaz
(Based this on what was already there in DesktopPerspective.java)
This causes the banner to crash just as you stated. As far as I can see from the errors, it seems to be caused by this line
(When I've commented out that line, (and replaced with "return null"), the perspectives do come up (all 4 of them), however there are other errors when I try to access the perspectives.)
Thanks
Basically
1. added a new module - MyPerspectivePlugin
2. added libraries Lookup, Utilities API, Desktop Perspective
3. created class that implements Perspective as follows:
Code: Select all
@ServiceProvider(service = Perspective.class, position=500)
public class TopazPerspective implements Perspective{
public String getDisplayName() {
return NbBundle.getMessage(PreviewPerspective.class, "TopazPerspective.name");
}
public String getName() {
return "TopazGroup";
}
public Icon getIcon() {
return ImageUtilities.loadImageIcon("org/gephi/myperspectiveplugin/resources/topaz.png", false);
}
}
(Based this on what was already there in DesktopPerspective.java)
This causes the banner to crash just as you stated. As far as I can see from the errors, it seems to be caused by this line
-return NbBundle.getMessage(PreviewPerspective.class, "TopazPerspective.name");
(When I've commented out that line, (and replaced with "return null"), the perspectives do come up (all 4 of them), however there are other errors when I try to access the perspectives.)
My guess is that its unable to find "TopazPerspective.name", have I added it in correctly? Or how do I add this in?Method: getDefault
Class: class org.gephi.desktop.perspective.BannerTopComponent
Caused: java.util.MissingResourceException: Can't find resource for bundle org.openide.util.NbBundle$PBundle, key TopazPerspective.name
at java.util.ResourceBundle.getObject(ResourceBundle.java:374)
at java.util.ResourceBundle.getString(ResourceBundle.java:334)
at org.openide.util.NbBundle.getMessage(NbBundle.java:637)
at org.gephi.myperspective.TopazPerspective.getDisplayName(TopazPerspective.java:25)
at org.gephi.desktop.perspective.BannerTopComponent.addGroupTabs(BannerTopComponent.java:104)
at org.gephi.desktop.perspective.BannerTopComponent.<init>(BannerTopComponent.java:63)
at org.gephi.desktop.perspective.BannerTopComponent.getDefault(BannerTopComponent.java:286)
Thanks
- Attachments
-
- messages.log
- (20.48KiB)Downloaded 208 times
- 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: Adding in New Tabs/Pages
The first parameter should be the name of the package where the Bundle.properties file is located. In which Bundle.properties did you add this? If your 'TopazPerspective' class is in a different package, create a new Bundle.properties in this package and replace PreviewPerspective.class with TopazPerspective.class.NbBundle.getMessage(PreviewPerspective.class, "TopazPerspective.name");
-
- Posts:6
- Joined:13 Apr 2011 06:36 [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: Adding in New Tabs/Pages
Yes that was it, thank you!