[Gephi-plugins] changing VizController default settings

Dan Halbert halbert at halwitz.org
Wed Jul 24 19:20:21 CEST 2013


To answer my own question, one can listen for an "init" PropertyChange event:
 
vizController = Lookup.getDefault().lookup(VizController.class);
 vizController.getVizModel().addPropertyChangeListener(new PropertyChangeListener() {
 @Override
 public void propertyChange(PropertyChangeEvent evt) {
 if (evt.getPropertyName().equals("init")) {
 // change some ivzModel settings.
 }
 }
 });


 
On Monday, July 22, 2013 12:34pm, "Dan Halbert" <halbert at halwitz.org> said:



I'm working on a Grphic 0.8.2 plugin and would like to change the default settings of the VizController that is attached to the Gephi GraphTopComponent. I want to change the selection modes, label scaling etc., as well.
 
As an example, I'm doing something like:
 
VizController vizController = Lookup.getDefault().lookup(VizController.class);
 TextManager textManager = vizController.getTextManager();
 TextModel textModel = textManager.getModel();
textModel.setSelectedOnly(true);
// etc.

I want to execute this code as early as possible, but not too early. We load a particular graph automatically when Gephi starts with our plugin loaded. The graph loading is done by another custom-built TopComponent.
 
I've tried changing the VizController settings in the routine that loads the graph, but that seems to be too early: the settings still have their old default values. I've also tried in a Runnable invoked by WindowManager.getDefault().invokeWhenUIReady(). That also is too early.
 
I can eventually change the settings when everything is displayed and I invoke some button in our custom-built TopComponent. Then the settings change.
 
Any suggestions? Is there some event I can listen for that says the VizController has been created? Do I need to subclass GraphTopComponent to do this properly?
 
Thanks,
Dan
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://gephi.org/pipermail/gephi-plugins/attachments/20130724/dae06753/attachment.html>


More information about the gephi-plugins mailing list