Protégé-OWL 3.3.1

edu.stanford.smi.protegex.owl.ui.widget
Class OWLUI

java.lang.Object
  extended by edu.stanford.smi.protegex.owl.ui.widget.OWLUI

public class OWLUI
extends Object

A collection of global utilities for OWL user interface components.

Note: as of 3.2 beta, much of the functionality was moved into ProtegeUI and its helper classes.

Author:
Holger Knublauch

Field Summary
static String CODE_MENU
          Deprecated. use constant from AbstractOWLModelAction
static String CONSTRAINT_CHECKING
           
static String OWL_MENU
          Deprecated. use constant from AbstractOWLModelAction
static String TOOLS_MENU
          Deprecated. use constant from AbstractOWLModelAction
static int WIZARD_HELP_HEIGHT
           
 
Constructor Summary
OWLUI()
           
 
Method Summary
static void addCopyPastePopup(JTextComponent textComponent)
          Add a context menu containing Cut, Copy, Paste and InsertUnicode
static JButton addFrameTreeFinderButton(edu.stanford.smi.protege.ui.Finder finder, Action action)
           
static JComponent createHelpPanel(String text, String title)
           
static JComponent createHelpPanel(String text, String title, int maxHeight)
           
static JComponent createHelpPanel(String text, String title, int maxHeight, Icon icon)
           
static JFileChooser createJFileChooser(String fileDescription, String suffix)
           
static JToolBar createToolBar()
           
static Component findComponent(Container container, Class componentClass)
          Descends into the component tree of a given Container and returns the first sub-component of a given Java class.
static OWLBrowserSlotPattern fixBrowserSlotPattern(edu.stanford.smi.protege.model.Project project, edu.stanford.smi.protege.model.Cls cls)
           
static void fixBrowserSlotPatterns(edu.stanford.smi.protege.model.Project project)
           
static int getConfirmationThreshold(OWLModel owlModel)
           
static OWLToolTipGenerator getOWLToolTipGenerator()
           
static String getOWLToolTipText(RDFResource res)
           
static String getOWLToolTipText(RDFSClass aClass)
           
static Collection getPathsToRoot(RDFResource resource)
          Computes all paths from a resource to the root node (owl:Thing) by navigating the direct-superclasses slot.
static Collection getPathsToRoot(RDFResource resource, edu.stanford.smi.protege.model.Slot navigationSlot)
          Computes all paths from a resource to the root node (owl:Thing) by navigating on the navigationSlot.
static Collection getPathsToRoot(RDFResource resource, edu.stanford.smi.protege.model.Slot navigationSlot, Class resourceClass)
          Computes all paths from a resource to the root node (owl:Thing) by navigating on the navigationSlot.
static edu.stanford.smi.protege.widget.SlotWidget getSiblingSlotWidget(Component widget, edu.stanford.smi.protege.model.Slot slot)
           
static TreePath getTreePath(JTree tree, Collection objectPath)
           
static String getWidgetLabel(edu.stanford.smi.protege.model.Slot slot)
           
static void handleError(OWLModel owlModel, Throwable t)
           
static void handleError(Throwable t)
          Deprecated.  
static boolean isConfirmationNeeded(OWLModel owlModel)
           
static boolean isConfirmed(OWLModel owlModel, boolean value)
           
static boolean isConfirmed(edu.stanford.smi.protege.model.Project project, boolean value)
          Deprecated.  
static boolean isConstraintChecking(OWLModel owlModel)
           
static boolean isDragAndDropSupported(OWLModel owlModel)
           
static boolean isExternalResourcesSupported(OWLModel owlModel)
           
static boolean isUnsuitableTab(String className)
           
static RDFSClass pickConcreteClass(OWLModel owlModel, Collection allowedClasses)
          Deprecated. use ProtegeUI.getSelectionDialogFactory()...
static RDFSClass pickConcreteClass(OWLModel owlModel, Collection allowedClasses, String label)
          Deprecated. use ProtegeUI.getSelectionDialogFactory()...
static RDFSClass pickConcreteClass(OWLModel owlModel, String label)
          Deprecated. use ProtegeUI.getSelectionDialogFactory()...
static OWLNamedClass pickOWLNamedClass(OWLModel owlModel, Collection classes, String label)
          Deprecated. use ProtegeUI.getSelectionDialogFactory()...
static Collection pickRDFProperties(Collection properties, String title)
          Deprecated. use ProtegeUI.getSelectionDialogFactory()...
static RDFProperty pickRDFProperty(Collection allowedProperties, String title)
          Deprecated. use ProtegeUI.getSelectionDialogFactory()...
static RDFResource pickRDFResource(Collection allowedClasses)
          Deprecated. use ProtegeUI.getSelectionDialogFactory()...
static RDFResource pickRDFResourceFromCollection(Collection allowedResources, String label)
          Deprecated. use ProtegeUI.getSelectionDialogFactory()...
static Collection pickRDFResources(Collection allowedClasses)
          Deprecated. use ProtegeUI.getSelectionDialogFactory()...
static Collection pickRDFResources(Collection allowedClasses, boolean allowsMultipleSelection)
          Deprecated. use ProtegeUI.getSelectionDialogFactory()...
static RDFSNamedClass pickRDFSNamedClass(OWLModel owlModel, Collection cs, String label)
          Deprecated. use ProtegeUI.getSelectionDialogFactory()...
static RDFSNamedClass pickRDFSNamedClass(OWLModel owlModel, String label)
          Deprecated. use ProtegeUI.getSelectionDialogFactory()...
static Collection pickRDFSNamedClasses(OWLModel owlModel, String label)
          Deprecated. use ProtegeUI.getSelectionDialogFactory()...
static Component searchComponentOfType(Container c, Class type)
           
static void selectResource(RDFResource r, HostResourceDisplay host)
          Select a class or other resource - works even when the caller is in a dialog.
static void setConstraintChecking(OWLModel owlModel, boolean value)
           
static void setDragAndDropSupported(OWLModel owlModel, boolean value)
           
static void setExternalResourcesSupported(OWLModel owlModel, boolean value)
           
static void setOWLToolTipGenerator(OWLToolTipGenerator ttg)
           
static boolean setSelectedNodeInTree(edu.stanford.smi.protege.util.SelectableTree tree, RDFResource resource)
          Selects an RDF resource in a selectable class-subclass tree.
static boolean setSelectedNodeInTree(edu.stanford.smi.protege.util.SelectableTree tree, RDFResource resource, edu.stanford.smi.protege.model.Slot navigationSlot)
          Selects an RDF resource in a selectable tree.
static boolean setSelectedNodeInTree(edu.stanford.smi.protege.util.SelectableTree tree, RDFResource resource, edu.stanford.smi.protege.model.Slot navigationSlot, Class resourceClass)
          Selects an RDF resource in a selectable tree.
static boolean showConfirmDialog(edu.stanford.smi.protege.model.Project project, String message, String title)
          Deprecated. use ProtegeUI.getModalDialogFactory()...
static boolean showConfirmDialog(String message, String title)
          Deprecated. use ProtegeUI.getModalDialogFactory()...
static void showErrorMessageDialog(Component parent, String message)
          Deprecated. use ProtegeUI.getModalDialogFactory()...
static void showErrorMessageDialog(OWLModel owlModel, String message)
          Deprecated. use ProtegeUI.getModalDialogFactory()...
static void showErrorMessageDialog(edu.stanford.smi.protege.model.Project project, String message)
          Deprecated. use ProtegeUI.getModalDialogFactory()...
static void showErrorMessageDialog(edu.stanford.smi.protege.model.Project project, String message, String title)
          Deprecated. use ProtegeUI.getModalDialogFactory()...
static void showErrorMessageDialog(String message)
          Deprecated. use ProtegeUI.getModalDialogFactory()...
static void showErrorMessageDialog(String message, String title)
          Deprecated. use ProtegeUI.getModalDialogFactory()...
static void showMessageDialog(Component parent, String message)
          Deprecated. use ProtegeUI.getModalDialogFactory()...
static void showMessageDialog(OWLModel owlModel, String message)
          Deprecated. use ProtegeUI.getModalDialogFactory()...
static void showMessageDialog(OWLModel owlModel, String message, String title, int type)
          Deprecated. use ProtegeUI.getModalDialogFactory()...
static void showMessageDialog(edu.stanford.smi.protege.model.Project project, String message)
          Deprecated. use ProtegeUI.getModalDialogFactory()...
static void showMessageDialog(edu.stanford.smi.protege.model.Project project, String message, String title, int type)
          Deprecated. use ProtegeUI.getModalDialogFactory()...
static void showMessageDialog(String message)
          Deprecated. use ProtegeUI.getModalDialogFactory()...
static void showMessageDialog(String message, String title, int type)
          Deprecated. use ProtegeUI.getModalDialogFactory()...
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CODE_MENU

public static String CODE_MENU
Deprecated. use constant from AbstractOWLModelAction

CONSTRAINT_CHECKING

public static final String CONSTRAINT_CHECKING
See Also:
Constant Field Values

OWL_MENU

public static String OWL_MENU
Deprecated. use constant from AbstractOWLModelAction

TOOLS_MENU

public static final String TOOLS_MENU
Deprecated. use constant from AbstractOWLModelAction

WIZARD_HELP_HEIGHT

public static final int WIZARD_HELP_HEIGHT
See Also:
Constant Field Values
Constructor Detail

OWLUI

public OWLUI()
Method Detail

selectResource

public static void selectResource(RDFResource r,
                                  HostResourceDisplay host)
Select a class or other resource - works even when the caller is in a dialog. If no host is supplied, the TabWidgets will be searched for an appropriate host.

Parameters:
r - the resource to select in the interface
host - (optional) the host resource display on which you want to select the Resource

addCopyPastePopup

public static void addCopyPastePopup(JTextComponent textComponent)
Add a context menu containing Cut, Copy, Paste and InsertUnicode

Parameters:
textComponent - Add a context menu to this component

addFrameTreeFinderButton

public static JButton addFrameTreeFinderButton(edu.stanford.smi.protege.ui.Finder finder,
                                               Action action)

createJFileChooser

public static JFileChooser createJFileChooser(String fileDescription,
                                              String suffix)

createHelpPanel

public static JComponent createHelpPanel(String text,
                                         String title)

createHelpPanel

public static JComponent createHelpPanel(String text,
                                         String title,
                                         int maxHeight)

createHelpPanel

public static JComponent createHelpPanel(String text,
                                         String title,
                                         int maxHeight,
                                         Icon icon)

createToolBar

public static JToolBar createToolBar()

findComponent

public static Component findComponent(Container container,
                                      Class componentClass)
Descends into the component tree of a given Container and returns the first sub-component of a given Java class.

Parameters:
container - the Container to start looking into
componentClass - the component class to look for
Returns:
an instanceof componentClass or null if none was found

getConfirmationThreshold

public static int getConfirmationThreshold(OWLModel owlModel)

getOWLToolTipText

public static String getOWLToolTipText(RDFSClass aClass)

getOWLToolTipText

public static String getOWLToolTipText(RDFResource res)

getOWLToolTipGenerator

public static OWLToolTipGenerator getOWLToolTipGenerator()

getSiblingSlotWidget

public static edu.stanford.smi.protege.widget.SlotWidget getSiblingSlotWidget(Component widget,
                                                                              edu.stanford.smi.protege.model.Slot slot)

getWidgetLabel

public static String getWidgetLabel(edu.stanford.smi.protege.model.Slot slot)

handleError

public static void handleError(Throwable t)
Deprecated. 


handleError

public static void handleError(OWLModel owlModel,
                               Throwable t)

isConfirmationNeeded

public static boolean isConfirmationNeeded(OWLModel owlModel)

isConfirmed

public static boolean isConfirmed(edu.stanford.smi.protege.model.Project project,
                                  boolean value)
Deprecated. 


isConfirmed

public static boolean isConfirmed(OWLModel owlModel,
                                  boolean value)

isConstraintChecking

public static boolean isConstraintChecking(OWLModel owlModel)

isDragAndDropSupported

public static boolean isDragAndDropSupported(OWLModel owlModel)

isExternalResourcesSupported

public static boolean isExternalResourcesSupported(OWLModel owlModel)

pickConcreteClass

public static RDFSClass pickConcreteClass(OWLModel owlModel,
                                          String label)
Deprecated. use ProtegeUI.getSelectionDialogFactory()...


pickConcreteClass

public static RDFSClass pickConcreteClass(OWLModel owlModel,
                                          Collection allowedClasses)
Deprecated. use ProtegeUI.getSelectionDialogFactory()...


pickConcreteClass

public static RDFSClass pickConcreteClass(OWLModel owlModel,
                                          Collection allowedClasses,
                                          String label)
Deprecated. use ProtegeUI.getSelectionDialogFactory()...


pickRDFProperties

public static Collection pickRDFProperties(Collection properties,
                                           String title)
Deprecated. use ProtegeUI.getSelectionDialogFactory()...


pickRDFProperty

public static RDFProperty pickRDFProperty(Collection allowedProperties,
                                          String title)
Deprecated. use ProtegeUI.getSelectionDialogFactory()...


pickRDFResource

public static RDFResource pickRDFResource(Collection allowedClasses)
Deprecated. use ProtegeUI.getSelectionDialogFactory()...


pickRDFResources

public static Collection pickRDFResources(Collection allowedClasses)
Deprecated. use ProtegeUI.getSelectionDialogFactory()...


pickRDFResources

public static Collection pickRDFResources(Collection allowedClasses,
                                          boolean allowsMultipleSelection)
Deprecated. use ProtegeUI.getSelectionDialogFactory()...


pickRDFResourceFromCollection

public static RDFResource pickRDFResourceFromCollection(Collection allowedResources,
                                                        String label)
Deprecated. use ProtegeUI.getSelectionDialogFactory()...


pickRDFSNamedClass

public static RDFSNamedClass pickRDFSNamedClass(OWLModel owlModel,
                                                String label)
Deprecated. use ProtegeUI.getSelectionDialogFactory()...


pickRDFSNamedClass

public static RDFSNamedClass pickRDFSNamedClass(OWLModel owlModel,
                                                Collection cs,
                                                String label)
Deprecated. use ProtegeUI.getSelectionDialogFactory()...


pickRDFSNamedClasses

public static Collection pickRDFSNamedClasses(OWLModel owlModel,
                                              String label)
Deprecated. use ProtegeUI.getSelectionDialogFactory()...


pickOWLNamedClass

public static OWLNamedClass pickOWLNamedClass(OWLModel owlModel,
                                              Collection classes,
                                              String label)
Deprecated. use ProtegeUI.getSelectionDialogFactory()...


searchComponentOfType

public static Component searchComponentOfType(Container c,
                                              Class type)

setConstraintChecking

public static void setConstraintChecking(OWLModel owlModel,
                                         boolean value)

setDragAndDropSupported

public static void setDragAndDropSupported(OWLModel owlModel,
                                           boolean value)

setExternalResourcesSupported

public static void setExternalResourcesSupported(OWLModel owlModel,
                                                 boolean value)

setOWLToolTipGenerator

public static void setOWLToolTipGenerator(OWLToolTipGenerator ttg)

showErrorMessageDialog

public static void showErrorMessageDialog(String message)
Deprecated. use ProtegeUI.getModalDialogFactory()...


showErrorMessageDialog

public static void showErrorMessageDialog(Component parent,
                                          String message)
Deprecated. use ProtegeUI.getModalDialogFactory()...


showErrorMessageDialog

public static void showErrorMessageDialog(edu.stanford.smi.protege.model.Project project,
                                          String message)
Deprecated. use ProtegeUI.getModalDialogFactory()...


showErrorMessageDialog

public static void showErrorMessageDialog(OWLModel owlModel,
                                          String message)
Deprecated. use ProtegeUI.getModalDialogFactory()...


showErrorMessageDialog

public static void showErrorMessageDialog(String message,
                                          String title)
Deprecated. use ProtegeUI.getModalDialogFactory()...


showErrorMessageDialog

public static void showErrorMessageDialog(edu.stanford.smi.protege.model.Project project,
                                          String message,
                                          String title)
Deprecated. use ProtegeUI.getModalDialogFactory()...


showMessageDialog

public static void showMessageDialog(String message)
Deprecated. use ProtegeUI.getModalDialogFactory()...


showMessageDialog

public static void showMessageDialog(Component parent,
                                     String message)
Deprecated. use ProtegeUI.getModalDialogFactory()...


showMessageDialog

public static void showMessageDialog(OWLModel owlModel,
                                     String message)
Deprecated. use ProtegeUI.getModalDialogFactory()...


showMessageDialog

public static void showMessageDialog(edu.stanford.smi.protege.model.Project project,
                                     String message)
Deprecated. use ProtegeUI.getModalDialogFactory()...


showMessageDialog

public static void showMessageDialog(String message,
                                     String title,
                                     int type)
Deprecated. use ProtegeUI.getModalDialogFactory()...


showMessageDialog

public static void showMessageDialog(OWLModel owlModel,
                                     String message,
                                     String title,
                                     int type)
Deprecated. use ProtegeUI.getModalDialogFactory()...


showMessageDialog

public static void showMessageDialog(edu.stanford.smi.protege.model.Project project,
                                     String message,
                                     String title,
                                     int type)
Deprecated. use ProtegeUI.getModalDialogFactory()...


showConfirmDialog

public static boolean showConfirmDialog(String message,
                                        String title)
Deprecated. use ProtegeUI.getModalDialogFactory()...


showConfirmDialog

public static boolean showConfirmDialog(edu.stanford.smi.protege.model.Project project,
                                        String message,
                                        String title)
Deprecated. use ProtegeUI.getModalDialogFactory()...


isUnsuitableTab

public static boolean isUnsuitableTab(String className)

getPathsToRoot

public static Collection getPathsToRoot(RDFResource resource)
Computes all paths from a resource to the root node (owl:Thing) by navigating the direct-superclasses slot.

Parameters:
resource - - the resource
Returns:
a collection of the paths from the resource to the root (owl:Thing), which contain instances of RDFResource

getPathsToRoot

public static Collection getPathsToRoot(RDFResource resource,
                                        edu.stanford.smi.protege.model.Slot navigationSlot)
Computes all paths from a resource to the root node (owl:Thing) by navigating on the navigationSlot.

Parameters:
resource - - the resource
navigationSlot - - the navigation slot (if null, the direct superclasses slot is used) *
Returns:
a collection of the paths from the resource to the root (owl:Thing), which contain instances of RDFResource

getPathsToRoot

public static Collection getPathsToRoot(RDFResource resource,
                                        edu.stanford.smi.protege.model.Slot navigationSlot,
                                        Class resourceClass)
Computes all paths from a resource to the root node (owl:Thing) by navigating on the navigationSlot.

Parameters:
resource - - the resource
navigationSlot - - the navigation slot (if null, the direct superclasses slot is used)
resourceClass - - a filter for the returned paths - only elements of this type are returned in the path
Returns:
a collection of the paths from the resource to the root (owl:Thing), which contain instances of resourceClass

setSelectedNodeInTree

public static boolean setSelectedNodeInTree(edu.stanford.smi.protege.util.SelectableTree tree,
                                            RDFResource resource)
Selects an RDF resource in a selectable class-subclass tree.

Parameters:
tree - - a SelectableTree
resource - - the resources that will be selected
Returns:
true - if node was selected, false otherwise.

setSelectedNodeInTree

public static boolean setSelectedNodeInTree(edu.stanford.smi.protege.util.SelectableTree tree,
                                            RDFResource resource,
                                            edu.stanford.smi.protege.model.Slot navigationSlot)
Selects an RDF resource in a selectable tree.

Parameters:
tree - - a SelectableTree
resource - - the resources that will be selected
navigationSlot - - the upwards navigation slot of the tree (if null, then the direct superclasses slot is used)
Returns:
true - if node was selected, false otherwise.

setSelectedNodeInTree

public static boolean setSelectedNodeInTree(edu.stanford.smi.protege.util.SelectableTree tree,
                                            RDFResource resource,
                                            edu.stanford.smi.protege.model.Slot navigationSlot,
                                            Class resourceClass)
Selects an RDF resource in a selectable tree.

Parameters:
tree - - a SelectableTree
resource - - the resources that will be selected
navigationSlot - - the upwards navigation slot of the tree (if null, then the direct superclasses slot is used)
resourceClass - - a filter for the classes in the searched class path (if null, then the RDFResource.class is used)
Returns:
true - if node was selected, false otherwise.

getTreePath

public static TreePath getTreePath(JTree tree,
                                   Collection objectPath)

fixBrowserSlotPatterns

public static void fixBrowserSlotPatterns(edu.stanford.smi.protege.model.Project project)

fixBrowserSlotPattern

public static OWLBrowserSlotPattern fixBrowserSlotPattern(edu.stanford.smi.protege.model.Project project,
                                                          edu.stanford.smi.protege.model.Cls cls)

Protégé-OWL 3.3.1

Submit a bug report or feature request
Copyright (c) 1998-2007 Stanford University.