edu.utk.cs.icl.rest.swing
Class LocCellRenderer

java.lang.Object
  extended byjava.awt.Component
      extended byjava.awt.Container
          extended byjavax.swing.JComponent
              extended byjavax.swing.JLabel
                  extended byedu.utk.cs.icl.rest.swing.LocCellRenderer
All Implemented Interfaces:
Accessible, ImageObserver, ListCellRenderer, MenuContainer, Serializable, SwingConstants
Direct Known Subclasses:
LocCellRenderer.UIResource

public class LocCellRenderer
extends JLabel
implements ListCellRenderer

List cell renderer for LocInfo objects. Displays the tiny icon with the name displayed to the right as the list row.

Since:
1.0
Version:
$Revision: 1.27 $ $Date: 2005/01/31 19:14:55 $
Author:
Eric Meek (meek@cs.utk.edu)
See Also:
Serialized Form

Nested Class Summary
static class LocCellRenderer.UIResource
          UI Resource class for LocCellRenderer, nothing special done so implemented here
 
Nested classes inherited from class javax.swing.JLabel
JLabel.AccessibleJLabel
 
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
protected static Border noFocusBorder
          Border of the Cell
 
Fields inherited from class javax.swing.JLabel
labelFor
 
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 javax.swing.SwingConstants
BOTTOM, CENTER, EAST, HORIZONTAL, LEADING, LEFT, NEXT, NORTH, NORTH_EAST, NORTH_WEST, PREVIOUS, RIGHT, SOUTH, SOUTH_EAST, SOUTH_WEST, TOP, TRAILING, VERTICAL, WEST
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
LocCellRenderer()
          Constructs a new list cell renderer for a LocInfo
 
Method Summary
 void firePropertyChange(String propertyName, boolean oldValue, boolean newValue)
          Performance improvment here to do nothing.
 void firePropertyChange(String propertyName, byte oldValue, byte newValue)
          Performance improvment here to do nothing.
 void firePropertyChange(String propertyName, char oldValue, char newValue)
          Performance improvment here to do nothing.
 void firePropertyChange(String propertyName, double oldValue, double newValue)
          Performance improvment here to do nothing.
 void firePropertyChange(String propertyName, float oldValue, float newValue)
          Performance improvment here to do nothing.
 void firePropertyChange(String propertyName, int oldValue, int newValue)
          Performance improvment here to do nothing.
 void firePropertyChange(String propertyName, long oldValue, long newValue)
          Performance improvment here to do nothing.
protected  void firePropertyChange(String propertyName, Object oldValue, Object newValue)
          Performance improvment here to do nothing except if propertyName is text then passes the call to super
 void firePropertyChange(String propertyName, short oldValue, short newValue)
          Performance improvment here to do nothing.
 Component getListCellRendererComponent(JList list, Object value, int index, boolean isSelected, boolean cellHasFocus)
          Custom renderer returning the appropriate component for the passed values
 void repaint(long tm, int x, int y, int width, int height)
          Performance improvment here to do nothing.
 void repaint(Rectangle r)
          Performance improvment here to do nothing.
 void revalidate()
          Performance improvment here to do nothing.
 void setCurrentGrp(String group)
          Deprecated. Works correctly, however it make is more difficult to maintain the appropriate assocations between lists.
 void validate()
          Performance improvment here to do nothing.
 
Methods inherited from class javax.swing.JLabel
checkHorizontalKey, checkVerticalKey, getAccessibleContext, getDisabledIcon, getDisplayedMnemonic, getDisplayedMnemonicIndex, getHorizontalAlignment, getHorizontalTextPosition, getIcon, getIconTextGap, getLabelFor, getText, getUI, getUIClassID, getVerticalAlignment, getVerticalTextPosition, imageUpdate, paramString, setDisabledIcon, setDisplayedMnemonic, setDisplayedMnemonic, setDisplayedMnemonicIndex, setHorizontalAlignment, setHorizontalTextPosition, setIcon, setIconTextGap, setLabelFor, setText, setUI, setVerticalAlignment, setVerticalTextPosition, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, 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, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, 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, 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, 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

noFocusBorder

protected static Border noFocusBorder
Border of the Cell

Constructor Detail

LocCellRenderer

public LocCellRenderer()
Constructs a new list cell renderer for a LocInfo

Since:
1.0
Method Detail

setCurrentGrp

public void setCurrentGrp(String group)
Deprecated. Works correctly, however it make is more difficult to maintain the appropriate assocations between lists.

Set the current group to display in the list

Parameters:
group - Group to diplay
Since:
1.0

getListCellRendererComponent

public Component getListCellRendererComponent(JList list,
                                              Object value,
                                              int index,
                                              boolean isSelected,
                                              boolean cellHasFocus)
Custom renderer returning the appropriate component for the passed values

Specified by:
getListCellRendererComponent in interface ListCellRenderer
Parameters:
list - Used to match the component with the current lists default values, such as the default backgroud and selection background colors.
value - Object to display in the list. Supported objects are String and LocInfo. LocInfo displayed with Icon and then text while text is just displayed.
index - Index of the object in the list. Can be used to alternate the colors and other such things.
isSelected - Used to change the display values of the object
cellHasFocus - Again used to change the display attributes of the object
Returns:
returns this object as the custom cell renderer
Since:
1.0

firePropertyChange

public void firePropertyChange(String propertyName,
                               byte oldValue,
                               byte newValue)
Performance improvment here to do nothing.

Parameters:
propertyName - none necessary
oldValue - none necessary
newValue - none necessary

firePropertyChange

public void firePropertyChange(String propertyName,
                               char oldValue,
                               char newValue)
Performance improvment here to do nothing.

Parameters:
propertyName - none necessary
oldValue - none necessary
newValue - none necessary

firePropertyChange

public void firePropertyChange(String propertyName,
                               short oldValue,
                               short newValue)
Performance improvment here to do nothing.

Parameters:
propertyName - none necessary
oldValue - none necessary
newValue - none necessary

firePropertyChange

public void firePropertyChange(String propertyName,
                               int oldValue,
                               int newValue)
Performance improvment here to do nothing.

Parameters:
propertyName - none necessary
oldValue - none necessary
newValue - none necessary

firePropertyChange

public void firePropertyChange(String propertyName,
                               long oldValue,
                               long newValue)
Performance improvment here to do nothing.

Parameters:
propertyName - none necessary
oldValue - none necessary
newValue - none necessary

firePropertyChange

public void firePropertyChange(String propertyName,
                               float oldValue,
                               float newValue)
Performance improvment here to do nothing.

Parameters:
propertyName - none necessary
oldValue - none necessary
newValue - none necessary

firePropertyChange

public void firePropertyChange(String propertyName,
                               double oldValue,
                               double newValue)
Performance improvment here to do nothing.

Parameters:
propertyName - none necessary
oldValue - none necessary
newValue - none necessary

firePropertyChange

public void firePropertyChange(String propertyName,
                               boolean oldValue,
                               boolean newValue)
Performance improvment here to do nothing.

Parameters:
propertyName - none necessary
oldValue - none necessary
newValue - none necessary

repaint

public void repaint(long tm,
                    int x,
                    int y,
                    int width,
                    int height)
Performance improvment here to do nothing.

Parameters:
tm - none necessary
x - none necessary
y - none necessary
width - none necessary
height - none necessary

repaint

public void repaint(Rectangle r)
Performance improvment here to do nothing.

Parameters:
r - none necessary

revalidate

public void revalidate()
Performance improvment here to do nothing.


validate

public void validate()
Performance improvment here to do nothing.


firePropertyChange

protected void firePropertyChange(String propertyName,
                                  Object oldValue,
                                  Object newValue)
Performance improvment here to do nothing except if propertyName is text then passes the call to super

Parameters:
propertyName - none necessary
oldValue - none necessary
newValue - none necessary