Search Mailing List Archives
[protege-discussion] using PromptTab in my own application
Norma Elisa Cabrera Gonzales
normacg at uclv.edu.cu
Thu Aug 19 18:25:38 PDT 2010
Hi everyone,
I am a Cuban professor and I need to merge two domain ontologies semiautomatically. I want to use PROMPT because it is the most closely tool to what I need, but I want to use it without Protégé. How can I use PROMPT in my own application?
I tried with the code below, but raise this exception:
Exception in thread "main" java.lang.NullPointerException
at edu.stanford.smi.protegex.prompt.PromptTab.addNotify(PromptTab.java:280)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at javax.swing.JComponent.addNotify(Unknown Source)
at javax.swing.JRootPane.addNotify(Unknown Source)
at java.awt.Container.addNotify(Unknown Source)
at java.awt.Window.addNotify(Unknown Source)
at java.awt.Frame.addNotify(Unknown Source)
at java.awt.Window.pack(Unknown Source)
at cu.edu.uclv.mermai.LoadPrompt.LoadPrompt.main(LoadPrompt.java:39)
public static void main(String[] args) {
ArrayList errors = new ArrayList();
Project prj = Project.loadProjectFromFile("test/default.pprj", errors);
if (errors.size() > 0) {
System.out.println("There were erros at loading prj: " + prj);
return;}
// In the next line, replace "PromptTab" with the plug-in class that you want to show in the JFrame
WidgetDescriptor widgetDescriptor = prj.getTabWidgetDescriptor("edu.stanford.smi.protegex.prompt.PromptTab");
if (widgetDescriptor == null) {
System.out.println("Cannot instantiate tab widget.");
return;}
TabWidget widget = WidgetUtilities.createTabWidget(widgetDescriptor, prj);
JFrame frame = new JFrame("My Application Frame");
frame.getContentPane().add((Component)widget);
frame.pack();
frame.setVisible(true);
}
Best regards,
Norma
________________________________
Universidad Central "Marta Abreu" de Las Villas. http://www.uclv.edu.cu
More information about the protege-discussion
mailing list