edu.stanford.smi.protegex.owl.ui.code
Class SymbolPanel

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JPanel
                  extended byedu.stanford.smi.protegex.owl.ui.code.SymbolPanel
All Implemented Interfaces:
Accessible, ImageObserver, MenuContainer, Serializable, SymbolErrorDisplay
Direct Known Subclasses:
OWLSymbolPanel, SWRLSymbolPanel

public abstract class SymbolPanel
extends JPanel
implements SymbolErrorDisplay

A JPanel hosting buttons that accelerate editing of OWL/SWRL expressions.

Author:
Holger Knublauch
See Also:
Serialized Form

Nested Class Summary
private  class SymbolPanel.InsertClassAction
           
private  class SymbolPanel.InsertIndividualAction
           
private  class SymbolPanel.InsertPropertyAction
           
 
Nested classes inherited from class javax.swing.JPanel
JPanel.AccessibleJPanel
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
private  Action backspaceAction
           
protected  ResourceSelectionAction classAction
           
private  JLabel errorLabel
          The JLabel to display error messages
protected  ResourceSelectionAction individiualAction
           
private  JButton nerdButton
          A JButton placed beside the errorLabel to display whether there is an error or not
private  OWLModel owlModel
           
protected  ResourceSelectionAction propertyAction
           
private  SymbolEditor symbolEditor
          The object that handles various button commands (e.g. the FillerTextField)
 
Fields inherited from class javax.swing.JPanel
 
Fields inherited from class javax.swing.JComponent
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
 
Fields inherited from class java.awt.Container
 
Fields inherited from class java.awt.Component
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
SymbolPanel(OWLModel owlModel, boolean closable)
           
SymbolPanel(OWLModel owlModel, boolean closable, boolean draggable)
           
SymbolPanel(OWLModel owlModel, boolean closable, boolean draggable, boolean withMiddleBar)
           
 
Method Summary
private  Action addAction(String text, String insert, Icon icon, JToolBar toolBar)
           
protected  Action addAction(String text, String iconName, String insert, JToolBar toolBar)
           
protected  JButton addButton(JToolBar toolBar, Action action)
           
 void displayError(String message)
           
 void displayError(Throwable ex)
           
 void enableActions(boolean clses, boolean instances)
           
protected abstract  String getDisplayErrorMessage(Throwable ex)
           
 OWLModel getOWLModel()
           
protected  SymbolEditor getSymbolEditor()
           
protected  void initMiddleBar(JToolBar middleBar)
           
protected abstract  void initTopBar(JToolBar topBar)
           
protected  void insertCls(edu.stanford.smi.protege.model.Cls cls)
           
protected  void insertIndividual(RDFResource instance)
           
protected  void insertSlot(edu.stanford.smi.protege.model.Slot slot)
           
 void setEnabled(boolean enabled)
           
 void setErrorFlag(boolean error)
           
 void setSymbolEditor(SymbolEditor editor)
           
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPreferredSize, getPropertyChangeListeners, getPropertyChangeListeners, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isPreferredSizeSet, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

backspaceAction

private Action backspaceAction

classAction

protected ResourceSelectionAction classAction

errorLabel

private JLabel errorLabel
The JLabel to display error messages


individiualAction

protected ResourceSelectionAction individiualAction

nerdButton

private JButton nerdButton
A JButton placed beside the errorLabel to display whether there is an error or not


owlModel

private OWLModel owlModel

propertyAction

protected ResourceSelectionAction propertyAction

symbolEditor

private SymbolEditor symbolEditor
The object that handles various button commands (e.g. the FillerTextField)

Constructor Detail

SymbolPanel

public SymbolPanel(OWLModel owlModel,
                   boolean closable)

SymbolPanel

public SymbolPanel(OWLModel owlModel,
                   boolean closable,
                   boolean draggable)

SymbolPanel

public SymbolPanel(OWLModel owlModel,
                   boolean closable,
                   boolean draggable,
                   boolean withMiddleBar)
Method Detail

addAction

protected Action addAction(String text,
                           String iconName,
                           String insert,
                           JToolBar toolBar)

addAction

private Action addAction(String text,
                         String insert,
                         Icon icon,
                         JToolBar toolBar)

addButton

protected JButton addButton(JToolBar toolBar,
                            Action action)

displayError

public void displayError(Throwable ex)
Specified by:
displayError in interface SymbolErrorDisplay

getDisplayErrorMessage

protected abstract String getDisplayErrorMessage(Throwable ex)

displayError

public void displayError(String message)
Specified by:
displayError in interface SymbolErrorDisplay

enableActions

public void enableActions(boolean clses,
                          boolean instances)

getOWLModel

public OWLModel getOWLModel()

getSymbolEditor

protected SymbolEditor getSymbolEditor()

initMiddleBar

protected void initMiddleBar(JToolBar middleBar)

initTopBar

protected abstract void initTopBar(JToolBar topBar)

insertCls

protected void insertCls(edu.stanford.smi.protege.model.Cls cls)

insertIndividual

protected void insertIndividual(RDFResource instance)

insertSlot

protected void insertSlot(edu.stanford.smi.protege.model.Slot slot)

setSymbolEditor

public void setSymbolEditor(SymbolEditor editor)

setEnabled

public void setEnabled(boolean enabled)

setErrorFlag

public void setErrorFlag(boolean error)
Specified by:
setErrorFlag in interface SymbolErrorDisplay