Copyright © 2005 Scientific Applications. All Rights Reserved.

com.sciapp.table
Class WrapperCellRendererPane

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.CellRendererPane
              extended by com.sciapp.table.WrapperCellRendererPane
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, Accessible
Direct Known Subclasses:
DefaultFilterRenderer, DefaultTreeTableHeaderRenderer

public class WrapperCellRendererPane
extends CellRendererPane

WrapperCellRendererPane is a specialized CellRendererPane that translates and resizes its children accordingly. A WrapperCellRendererPane is most usually returned by a TableCellRendererWrapper.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.CellRendererPane
CellRendererPane.AccessibleCellRendererPane
 
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  boolean opaqueFalse
          flag that is true if JComponent children's opaque property is temporarily set to false before painting
 
Fields inherited from class javax.swing.CellRendererPane
accessibleContext
 
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
protected WrapperCellRendererPane()
          Constructs a WrapperCellRendererPane.
protected WrapperCellRendererPane(boolean opaqueFalse)
          Constructs a WrapperCellRendererPane.
 
Method Summary
 Component getMainComponent()
          Returns the main wrapped component.
static Component getMainComponent(Component c)
          Returns the main component of the wrapper.
 String getToolTipText(MouseEvent event)
          Returns the string to be used as the tooltip for event.
 void paint(Graphics g)
          Paints its children according to their size and location.
 void paintComponent(Graphics g, Component c, Container p, int x, int y, int w, int h, boolean shouldValidate)
          Paint a cell renderer component c on graphics object g.
 
Methods inherited from class javax.swing.CellRendererPane
addImpl, getAccessibleContext, invalidate, paintComponent, paintComponent, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getPreferredSize, insets, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, paramString, preferredSize, print, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, removeNotify, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFont, 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, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, disableEvents, dispatchEvent, enable, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isOpaque, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, reshape, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, 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

opaqueFalse

protected boolean opaqueFalse
flag that is true if JComponent children's opaque property is temporarily set to false before painting

Constructor Detail

WrapperCellRendererPane

protected WrapperCellRendererPane()
Constructs a WrapperCellRendererPane.


WrapperCellRendererPane

protected WrapperCellRendererPane(boolean opaqueFalse)
Constructs a WrapperCellRendererPane.

Parameters:
opaqueFalse - true if JComponent children's opaque property is temporarily set to false before painting
Method Detail

getMainComponent

public Component getMainComponent()
Returns the main wrapped component. By default, this is returned.

Returns:
the wrapped component

getMainComponent

public static Component getMainComponent(Component c)
Returns the main component of the wrapper. This method can be used in order to get the actual component that is drawn within the wrapper.

Parameters:
c - the possible wrapper component
Returns:
the wrapped component

getToolTipText

public String getToolTipText(MouseEvent event)
Returns the string to be used as the tooltip for event.

Parameters:
event - the mouse event producing the tooltip
Returns:
the tooltip's text

paint

public void paint(Graphics g)
Paints its children according to their size and location.

Overrides:
paint in class CellRendererPane
Parameters:
g - the graphics component to use
See Also:
Component.update(Graphics)

paintComponent

public void paintComponent(Graphics g,
                           Component c,
                           Container p,
                           int x,
                           int y,
                           int w,
                           int h,
                           boolean shouldValidate)
Paint a cell renderer component c on graphics object g. Before the component is drawn it's reparented to this (if that's necessary), it's bounds are set to w,h and the graphics object is (effectively) translated to x,y. If it's a JComponent, double buffering is temporarily turned off. After the component is painted it's bounds are reset to -w, -h, 0, 0 so that, if it's the last renderer component painted, it will not start consuming input. The Container p is the component we're actually drawing on, typically it's equal to this.getParent(). If shouldValidate is true the component c will be validated before painted.

Overrides:
paintComponent in class CellRendererPane

Copyright © 2005 Scientific Applications. All Rights Reserved.