Protege 2.1

edu.stanford.smi.protege.util
Class ComponentUtilities

java.lang.Object
  extended byedu.stanford.smi.protege.util.ComponentUtilities

public class ComponentUtilities
extends Object

Utility methods for dealing with various swing components.

Author:
Ray Fergerson

Constructor Summary
ComponentUtilities()
           
 
Method Summary
static void addColumn(JTable table, TableCellRenderer renderer)
           
static void addColumn(JTable table, TableCellRenderer renderer, TableCellEditor editor)
           
static int addListValue(JList list, Object newValue)
           
static int addListValue(JList list, Object newValue, Comparator comparator)
           
static void addListValue(JList list, Object newValue, int index)
           
static void addListValues(JList list, Collection newValues)
           
static int addSelectedListValue(JList list, Object newValue)
           
static void addSelectedListValues(JList list, Collection newValues)
           
static void addUniqueListValues(JList list, Collection newValues)
           
static void apply(Component component, UnaryFunction f)
           
static void applyToDescendents(Component component, UnaryFunction f)
           
static void center(Component c)
           
static void clearListValues(JList list)
           
static void closeAllWindows()
           
static void closeWindow(Window window)
           
static void deregisterWindow(Window window)
           
static void dispose(Component component)
           
static void ensureSelectionIsVisible(JList list)
           
static boolean equals(Object o1, Object o2)
           
static void extendSelection(JTree tree, Object userObject)
           
static void fullSelectionCollapse(JTree tree)
           
static void fullSelectionExpand(JTree tree, int max_expansions)
           
static LazyTreeNode getChildNode(LazyTreeNode node, Object userObject)
           
static Component getDescendentOfClass(Class componentClass, Component root)
           
static Collection getDescendentsOfClass(Class componentClass, Component root)
           
static Dialog getDialog(Component c)
           
static Object getFirstSelectionParent(JTree tree)
           
static Frame getFrame(Component c)
           
static Collection getListValues(JList list)
           
static Collection getObjectPath(TreePath path)
           
static Object getSelectedValue(JList list)
           
static Collection getSelection(JList list)
           
static Collection getSelection(JTable table)
           
static Collection getSelection(JTree tree)
           
static Collection getSelection(JTree tree, Class c)
           
static int getStandardColumnWidth()
           
static int getStandardRowHeight()
           
static TreePath getTreePath(JTree tree, Collection objectPath)
           
static void hide(Component c, int delayInMillisec)
           
static boolean isDragAndDropEnabled(JComponent c)
           
static boolean listValuesContain(JList list, Object value)
           
static ImageIcon loadImageIcon(Class cls, String name)
           
static void pack(Component c)
           
static void paintImmediately(Component component)
           
static void registerWindow(Window window)
           
static void removeListValue(JList list, Object oldValue)
           
static void removeListValues(JList list, Collection values)
           
static void removeSelection(JTree tree)
           
static void replaceListValue(JList list, Object oldValue, Object newValue)
           
static void reposition(JList list, Object value, Comparator comparator)
           
static void requestFocus(JComponent component)
           
static void setDisplayParent(JTree tree, Object parent, Object child, Traverser traverser)
           
static void setDisplayParent(JTree tree, Object parent, Traverser traverser)
           
static void setDragAndDropEnabled(JComponent c, boolean enable)
           
static void setEnabled(Component component, boolean enabled)
           
static void setExpanded(JTree tree, Collection objectPath, boolean expand)
           
static void setFrameTitle(Component c, String title)
           
static void setListValues(JList list, Collection values)
           
static void setSelectedNode(JTree tree, TreeNode node)
           
static void setSelectedObjectPath(JTree tree, Collection objectPath)
           
static void setSelectedValue(JList list, Object value)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentUtilities

public ComponentUtilities()
Method Detail

addColumn

public static void addColumn(JTable table,
                             TableCellRenderer renderer)

addColumn

public static void addColumn(JTable table,
                             TableCellRenderer renderer,
                             TableCellEditor editor)

addListValue

public static int addListValue(JList list,
                               Object newValue)

addListValue

public static void addListValue(JList list,
                                Object newValue,
                                int index)

addListValue

public static int addListValue(JList list,
                               Object newValue,
                               Comparator comparator)

addListValues

public static void addListValues(JList list,
                                 Collection newValues)

addSelectedListValue

public static int addSelectedListValue(JList list,
                                       Object newValue)

addSelectedListValues

public static void addSelectedListValues(JList list,
                                         Collection newValues)

addUniqueListValues

public static void addUniqueListValues(JList list,
                                       Collection newValues)

apply

public static void apply(Component component,
                         UnaryFunction f)

applyToDescendents

public static void applyToDescendents(Component component,
                                      UnaryFunction f)

center

public static void center(Component c)

clearListValues

public static void clearListValues(JList list)

closeAllWindows

public static void closeAllWindows()

closeWindow

public static void closeWindow(Window window)

deregisterWindow

public static void deregisterWindow(Window window)

dispose

public static void dispose(Component component)

ensureSelectionIsVisible

public static void ensureSelectionIsVisible(JList list)

extendSelection

public static void extendSelection(JTree tree,
                                   Object userObject)

fullSelectionCollapse

public static void fullSelectionCollapse(JTree tree)

fullSelectionExpand

public static void fullSelectionExpand(JTree tree,
                                       int max_expansions)

getChildNode

public static LazyTreeNode getChildNode(LazyTreeNode node,
                                        Object userObject)

equals

public static boolean equals(Object o1,
                             Object o2)

getDescendentOfClass

public static Component getDescendentOfClass(Class componentClass,
                                             Component root)

getDescendentsOfClass

public static Collection getDescendentsOfClass(Class componentClass,
                                               Component root)

getDialog

public static Dialog getDialog(Component c)

getFirstSelectionParent

public static Object getFirstSelectionParent(JTree tree)

getFrame

public static Frame getFrame(Component c)

getListValues

public static Collection getListValues(JList list)

getSelectedValue

public static Object getSelectedValue(JList list)

getSelection

public static Collection getSelection(JList list)

setSelectedValue

public static void setSelectedValue(JList list,
                                    Object value)

getSelection

public static Collection getSelection(JTable table)

getSelection

public static Collection getSelection(JTree tree)

getSelection

public static Collection getSelection(JTree tree,
                                      Class c)

getStandardColumnWidth

public static int getStandardColumnWidth()

getStandardRowHeight

public static int getStandardRowHeight()

getTreePath

public static TreePath getTreePath(JTree tree,
                                   Collection objectPath)

getObjectPath

public static Collection getObjectPath(TreePath path)

hide

public static void hide(Component c,
                        int delayInMillisec)

isDragAndDropEnabled

public static boolean isDragAndDropEnabled(JComponent c)

listValuesContain

public static boolean listValuesContain(JList list,
                                        Object value)

loadImageIcon

public static ImageIcon loadImageIcon(Class cls,
                                      String name)

pack

public static void pack(Component c)

paintImmediately

public static void paintImmediately(Component component)

registerWindow

public static void registerWindow(Window window)

removeListValue

public static void removeListValue(JList list,
                                   Object oldValue)

removeListValues

public static void removeListValues(JList list,
                                    Collection values)

removeSelection

public static void removeSelection(JTree tree)

replaceListValue

public static void replaceListValue(JList list,
                                    Object oldValue,
                                    Object newValue)

reposition

public static void reposition(JList list,
                              Object value,
                              Comparator comparator)

setDragAndDropEnabled

public static void setDragAndDropEnabled(JComponent c,
                                         boolean enable)

setEnabled

public static void setEnabled(Component component,
                              boolean enabled)

setExpanded

public static void setExpanded(JTree tree,
                               Collection objectPath,
                               boolean expand)

setFrameTitle

public static void setFrameTitle(Component c,
                                 String title)

setListValues

public static void setListValues(JList list,
                                 Collection values)

setSelectedNode

public static void setSelectedNode(JTree tree,
                                   TreeNode node)

setSelectedObjectPath

public static void setSelectedObjectPath(JTree tree,
                                         Collection objectPath)

requestFocus

public static void requestFocus(JComponent component)

setDisplayParent

public static void setDisplayParent(JTree tree,
                                    Object parent,
                                    Traverser traverser)

setDisplayParent

public static void setDisplayParent(JTree tree,
                                    Object parent,
                                    Object child,
                                    Traverser traverser)

Protege 2.1

Submit a bug report or feature request
Protégé is a trademark of Stanford University.
Copyright (c) 1998-2004 Stanford University.