Overview | Package | Class | Tree | Deprecated | Index | Help
| Protege 3.5 alpha
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## edu.stanford.smi.protege.util
Class DefaultRenderer

    java.lang.Object
      java.awt.Component
          java.awt.Container
              javax.swing.JComponent
                  edu.stanford.smi.protege.util.DefaultRenderer

All Implemented Interfaces:
  ImageObserver, MenuContainer, Serializable, ListCellRenderer, TableCellRenderer, TreeCellRenderer

Direct Known Subclasses:
  CardinalityFacetRenderer, DefaultValueRenderer, FactoryRenderer, FormRenderer, FrameRenderer, LocaleRenderer, OtherFacetsRenderer, SlotPairRenderer, TypeFacetRenderer, ValueTypeRenderer, WidgetClassNameRenderer, WidgetDescriptorRenderer

    public class DefaultRenderer

extends JComponent
implements TreeCellRenderer, ListCellRenderer, TableCellRenderer

Default implementation of the various renderer interfaces. This renderer is used for all Protege widget rendering. This ensures a uniform look when a frame is displayed in a tree, a list, and a table. This renderer also handles the drag over feedback needed to supplement Java's pitiful drag and drop support.

Author:
  Ray Fergerson
See Also:
  Serialized Form

Nested Class Summary

Nested classes/interfaces inherited from class javax.swing.JComponent
`JComponent.AccessibleJComponent`

Nested classes/interfaces inherited from class java.awt.Container
`Container.AccessibleAWTContainer`

Nested classes/interfaces inherited from class java.awt.Component
`Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy`

Field Summary
`protected Color` | `_backgroundNormalColor`
`protected Color` | `_backgroundSelectionColor`
`protected Color` | `_backgroundSelectionColorOverride`
`protected LookAndFeel` | `_cachedLookAndFeel`
`protected Object` | `_dropTargetArea`
`protected Color` | `_dropTargetLineColor`
`protected List` | `_elements`
`protected Color` | `_focusRectColor`
`protected FontMetrics` | `_fontMetrics`
`protected Color` | `_foregroundNormalColor`
`protected Color` | `_foregroundSelectionColor`
`protected boolean` | `_grayedSecondaryText`
`protected boolean` | `_grayedText`
`protected boolean` | `_hasFocus`
`protected boolean` | `_isSelected`
`protected int` | `_row`
`protected JTree` | `_tree`
`protected Color` | `_treeBackgroundNormalColor`
`protected Color` | `_treeBackgroundSelectionColor`
`protected Color` | `_treeForegroundNormalColor`
`protected Color` | `_treeForegroundSelectionColor`
`protected Object` | `_value`
`static Object` | `DROP_TARGET`
`static Object` | `DROP_TARGET_AREA`
`static Object` | `DROP_TARGET_AREA_ABOVE`
`static Object` | `DROP_TARGET_AREA_BELOW`
`static Object` | `DROP_TARGET_AREA_ON`

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.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
`DefaultRenderer()`

Method Summary
`void` | `addIcon(Icon icon)`
`void` | `addText(String text)`
`void` | `appendIcon(Icon icon)`
`void` | `appendText(String text)`
`protected void` | `checkDropTarget(Component component, Object value)`
`void` | `clear()`
`static boolean` | `equals(Object o1, Object o2)`
`void` | `firePropertyChange(String propertyName, boolean oldValue, boolean newValue)`
`void` | `firePropertyChange(String propertyName, byte oldValue, byte newValue)`
`void` | `firePropertyChange(String propertyName, char oldValue, char newValue)`
`void` | `firePropertyChange(String propertyName, double oldValue, double newValue)`
`void` | `firePropertyChange(String propertyName, float oldValue, float newValue)`
`void` | `firePropertyChange(String propertyName, int oldValue, int newValue)`
`void` | `firePropertyChange(String propertyName, long oldValue, long newValue)`
`void` | `firePropertyChange(String propertyName, Object oldValue, Object newValue)`
`void` | `firePropertyChange(String propertyName, short oldValue, short newValue)`
`protected Color` | `getBackgroundColor()`
`protected Color` | `getBackgroundSelectionColor()`
`Object` | `getFirst(Class clas)`
`int` | `getIconIconGap()`
`int` | `getIconTextGap()`
`Component` | `getListCellRendererComponent(JList list, Object value, int row, boolean selected, boolean hasFocus)`
`Icon` | `getMainIcon()`
`String` | `getMainText()`
`Dimension` | `getPreferredSize()`
`Component` | `getTableCellRendererComponent(JTable table, Object value, boolean selected, boolean hasFocus, int row, int col)`
`protected Color` | `getTextColor()`
`int` | `getTextIconGap()`
`int` | `getTextTextGap()`
`Component` | `getTreeCellRendererComponent(JTree tree, Object value, boolean selected, boolean expanded, boolean leaf, int row, boolean hasFocus)`
`protected Object` | `getValue()`
`void` | `invalidate()`
`boolean` | `isOpaque()`
`void` | `load(Object o)`
`protected void` | `loadDuplicate(Object o)`
`void` | `loadNull()`
`protected void` | `loadTreeColors()`
`void` | `paint(Graphics graphics)`
`protected void` | `paintIcon(Graphics graphics, Icon icon, Point position, Dimension size)`
`protected void` | `paintString(Graphics graphics, String text, Point position, Color color, Dimension size)`
`protected void` | `paintString(Graphics graphics, String text, Point position, Dimension size)`
`void` | `repaint()`
`void` | `repaint(int x, int y, int w, int h)`
`void` | `repaint(Rectangle r)`
`void` | `revalidate()`
`void` | `setBackgroundSelectionColor(Color color)`
`protected void` | `setFontStyle(int style)`
`void` | `setForegroundColorOverride(Color color)`
`void` | `setGrayedSecondaryText(boolean b)`
`void` | `setGrayedText(boolean b)`
`void` | `setInvalid()`
`void` | `setMainIcon(Icon icon)`
`void` | `setMainText(String text)`
`void` | `setNormalForegroundColor(Color color)`
`protected Component` | `setup(Component c, Object value, boolean hasFocus, boolean isSelected)`
`void` | `validate()`

Methods inherited from class javax.swing.JComponent
`addAncestorListener, addNotify, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, fireVetoableChange, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getUIClassID, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removeVetoableChangeListener, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update, updateUI`

Methods inherited from class java.awt.Container
`add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, 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, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, 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

### DROP_TARGET

    public static final Object DROP_TARGET

### DROP_TARGET_AREA

    public static final Object DROP_TARGET_AREA

### DROP_TARGET_AREA_ON

    public static final Object DROP_TARGET_AREA_ON

### DROP_TARGET_AREA_BELOW

    public static final Object DROP_TARGET_AREA_BELOW

### DROP_TARGET_AREA_ABOVE

    public static final Object DROP_TARGET_AREA_ABOVE

### _backgroundNormalColor

    protected Color _backgroundNormalColor

### _foregroundNormalColor

    protected Color _foregroundNormalColor

### _backgroundSelectionColor

    protected Color _backgroundSelectionColor

### _foregroundSelectionColor

    protected Color _foregroundSelectionColor

### _backgroundSelectionColorOverride

    protected Color _backgroundSelectionColorOverride

### _fontMetrics

    protected FontMetrics _fontMetrics

### _cachedLookAndFeel

    protected LookAndFeel _cachedLookAndFeel

### _hasFocus

    protected boolean _hasFocus

### _isSelected

    protected boolean _isSelected

### _grayedText

    protected boolean _grayedText

### _grayedSecondaryText

    protected boolean _grayedSecondaryText

### _focusRectColor

    protected Color _focusRectColor

### _elements

    protected List _elements

### _dropTargetArea

    protected Object _dropTargetArea

### _dropTargetLineColor

    protected Color _dropTargetLineColor

### _treeForegroundSelectionColor

    protected Color _treeForegroundSelectionColor

### _treeBackgroundSelectionColor

    protected Color _treeBackgroundSelectionColor

### _treeForegroundNormalColor

    protected Color _treeForegroundNormalColor

### _treeBackgroundNormalColor

    protected Color _treeBackgroundNormalColor

### _tree

    protected JTree _tree

### _row

    protected int _row

### _value

    protected Object _value

Constructor Detail

### DefaultRenderer

    public DefaultRenderer()

Method Detail

### setBackgroundSelectionColor

    public void setBackgroundSelectionColor(Color color)

### checkDropTarget

    protected void checkDropTarget(Component component,
                                   Object value)

### getValue

    protected Object getValue()

### setFontStyle

    protected void setFontStyle(int style)

### getBackgroundColor

    protected Color getBackgroundColor()

### getBackgroundSelectionColor

    protected Color getBackgroundSelectionColor()

### getListCellRendererComponent

    public Component getListCellRendererComponent(JList list,
                                                  Object value,
                                                  int row,
                                                  boolean selected,
                                                  boolean hasFocus)

  Specified by:
    `getListCellRendererComponent` in interface `ListCellRenderer`

### getPreferredSize

    public Dimension getPreferredSize()

  Overrides:
    `getPreferredSize` in class `JComponent`

### getTableCellRendererComponent

    public Component getTableCellRendererComponent(JTable table,
                                                   Object value,
                                                   boolean selected,
                                                   boolean hasFocus,
                                                   int row,
                                                   int col)

  Specified by:
    `getTableCellRendererComponent` in interface `TableCellRenderer`

### getTextColor

    protected Color getTextColor()

### getTreeCellRendererComponent

    public Component getTreeCellRendererComponent(JTree tree,
                                                  Object value,
                                                  boolean selected,
                                                  boolean expanded,
                                                  boolean leaf,
                                                  int row,
                                                  boolean hasFocus)

  Specified by:
    `getTreeCellRendererComponent` in interface `TreeCellRenderer`

### load

    public void load(Object o)

### loadNull

    public void loadNull()

### loadTreeColors

    protected void loadTreeColors()

### paint

    public void paint(Graphics graphics)

  Overrides:
    `paint` in class `JComponent`

### paintIcon

    protected void paintIcon(Graphics graphics,
                             Icon icon,
                             Point position,
                             Dimension size)

### paintString

    protected void paintString(Graphics graphics,
                               String text,
                               Point position,
                               Dimension size)

### paintString

    protected void paintString(Graphics graphics,
                               String text,
                               Point position,
                               Color color,
                               Dimension size)

### setForegroundColorOverride

    public void setForegroundColorOverride(Color color)

### setGrayedText

    public void setGrayedText(boolean b)

### setGrayedSecondaryText

    public void setGrayedSecondaryText(boolean b)

### setInvalid

    public void setInvalid()

### getMainText

    public String getMainText()

### getMainIcon

    public Icon getMainIcon()

### getIconTextGap

    public int getIconTextGap()

### getTextIconGap

    public int getTextIconGap()

### getTextTextGap

    public int getTextTextGap()

### getIconIconGap

    public int getIconIconGap()

### getFirst

    public Object getFirst(Class clas)

### setMainIcon

    public void setMainIcon(Icon icon)

### setMainText

    public void setMainText(String text)

### appendIcon

    public void appendIcon(Icon icon)

### appendText

    public void appendText(String text)

### addIcon

    public void addIcon(Icon icon)

### addText

    public void addText(String text)

### setNormalForegroundColor

    public void setNormalForegroundColor(Color color)

### loadDuplicate

    protected void loadDuplicate(Object o)

### setup

    protected Component setup(Component c,
                              Object value,
                              boolean hasFocus,
                              boolean isSelected)

### clear

    public void clear()

### equals

    public static boolean equals(Object o1,
                                 Object o2)

### isOpaque

    public boolean isOpaque()

  Overrides:
    `isOpaque` in class `JComponent`

### validate

    public void validate()

  Overrides:
    `validate` in class `Container`

### revalidate

    public void revalidate()

  Overrides:
    `revalidate` in class `JComponent`

### invalidate

    public void invalidate()

  Overrides:
    `invalidate` in class `Container`

### repaint

    public void repaint()

  Overrides:
    `repaint` in class `Component`

### repaint

    public void repaint(int x,
                        int y,
                        int w,
                        int h)

  Overrides:
    `repaint` in class `Component`

### repaint

    public void repaint(Rectangle r)

  Overrides:
    `repaint` in class `JComponent`

### firePropertyChange

    public void firePropertyChange(String propertyName,
                                   boolean oldValue,
                                   boolean newValue)

  Overrides:
    `firePropertyChange` in class `JComponent`

### firePropertyChange

    public void firePropertyChange(String propertyName,
                                   byte oldValue,
                                   byte newValue)

  Overrides:
    `firePropertyChange` in class `Component`

### firePropertyChange

    public void firePropertyChange(String propertyName,
                                   char oldValue,
                                   char newValue)

  Overrides:
    `firePropertyChange` in class `JComponent`

### firePropertyChange

    public void firePropertyChange(String propertyName,
                                   double oldValue,
                                   double newValue)

  Overrides:
    `firePropertyChange` in class `Component`

### firePropertyChange

    public void firePropertyChange(String propertyName,
                                   float oldValue,
                                   float newValue)

  Overrides:
    `firePropertyChange` in class `Component`

### firePropertyChange

    public void firePropertyChange(String propertyName,
                                   int oldValue,
                                   int newValue)

  Overrides:
    `firePropertyChange` in class `JComponent`

### firePropertyChange

    public void firePropertyChange(String propertyName,
                                   long oldValue,
                                   long newValue)

  Overrides:
    `firePropertyChange` in class `Component`

### firePropertyChange

    public void firePropertyChange(String propertyName,
                                   short oldValue,
                                   short newValue)

  Overrides:
    `firePropertyChange` in class `Component`

### firePropertyChange

    public void firePropertyChange(String propertyName,
                                   Object oldValue,
                                   Object newValue)

  Overrides:
    `firePropertyChange` in class `Component`

Overview | Package | Class | Tree | Deprecated | Index | Help
| Protege 3.5 alpha
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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