Search Mailing List Archives

Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] Setting the instance under consideration in the collaboration plug-in programmatically

Tania Tudorache tudorache at
Thu Aug 13 10:41:21 PDT 2009

Hi Simon,

Thanks. I'm aware now :)

Things are a little bit more complicated than they seem. Problem is that 
the annotation display component is built by a project plugin 
(ProtegeCollabGUIProjectPlugin), which does have a reference to it and 
has a getter method for the panel. Now the problem is how to get the 
project plugin.. There are always ways  :)

I am not sure how to keep the reference to the annotations display 
component, because it is a panel that applies to an entire Protege 
instance. I could keep a static reference to it and provide a getter, 
but I really want to avoid using statics.

The annotation display component will listen to the selection of the 
"class tree" set for a tab (it doesn't necessarily mean "class", could 
be anything else). For example, in the ClassesTab it listens to the 
selection of the class tree, in the Properties/Slots Tab it listens to 
the selection of the properties tree, etc. So, if you have your own tab, 
and call on it setClsTree(myTree), then the annotation display component 
will pick that up and listen to your selection.

If you would like to use the annotation display component in your own 
application, you can just use the constructor, and then call setInstance 
on it.

If you have suggestions on how to better expose the existing annotations 
display component through the API, I'm happy to hear them.


simonpa wrote:
> Hi Timothy,
> thanks for investing the time to figure out this possibility. However, as
> this should just be a stopgap, it would be nice if the plug-in provided
> means to enable setting the instance. Maybe Tania gets aware of this
> requirement somehow ;)
> Cheers
> Simon
> I looked a bit and I also did not see a clean way to do this.  As  far
> as I can tell this is not exported anywhere.  I suspect that Tania did
> not expect the collaborative pane to be updated except in response to a
> selection change.  
> It is possible to get the AnnotationsDisplayComponent by walking the
> gui.  In other words  I  reverse engineered
> ProtegeCollabGUIProjectPlugin.insertCollabPanel and it worked.  But this
> is an *extreme* form of a gross kludged hack.  (But devious enough that
> I thought I  would mention it...)
> -Timothy
> {
>     ProjectView view =
> ProjectManager.getProjectManager().getCurrentProjectView();
>     JSplitPane parent = (JSplitPane) view.getParent();
>     AnnotationsDisplayComponent annotations =
> (AnnotationsDisplayComponent) parent.getRightComponent();
>    OWLModel model = (OWLModel) kb;
>     OWLNamedClass pizza = model.getOWLNamedClass("SpicyPizza");
>     annotations.setInstance(pizza);
> }

More information about the protege-owl mailing list