de.matthiasmann.twl
Class TableBase.StringCellRenderer

java.lang.Object
  extended by de.matthiasmann.twl.Widget
      extended by de.matthiasmann.twl.TextWidget
          extended by de.matthiasmann.twl.TableBase.StringCellRenderer
All Implemented Interfaces:
TableBase.CellRenderer
Enclosing class:
TableBase

public static class TableBase.StringCellRenderer
extends TextWidget
implements TableBase.CellRenderer


Nested Class Summary
 
Nested classes/interfaces inherited from class de.matthiasmann.twl.Widget
Widget.OffscreenMouseAdjustments, Widget.RenderOffscreen
 
Field Summary
 
Fields inherited from class de.matthiasmann.twl.TextWidget
STATE_HOVER, STATE_TEXT_CHANGED, STATE_TEXT_SELECTION
 
Fields inherited from class de.matthiasmann.twl.Widget
STATE_DISABLED, STATE_HAS_FOCUSED_CHILD, STATE_HAS_OPEN_POPUPS, STATE_KEYBOARD_FOCUS
 
Constructor Summary
TableBase.StringCellRenderer()
           
 
Method Summary
 void applyTheme(ThemeInfo themeInfo)
          Apply the given theme.
 Widget getCellRenderWidget(int x, int y, int width, int height, boolean isSelected)
          Returns the widget used to render the cell or null if no rendering should happen.
 int getColumnSpan()
          Returns how many columns this cell spans.
 void setCellData(int row, int column, java.lang.Object data)
          This method sets the row, column and the cell data.
protected  void sizeChanged()
          Called when the size of this widget has changed.
 
Methods inherited from class de.matthiasmann.twl.TextWidget
applyThemeTextWidget, computeRelativeCursorPositionX, computeRelativeCursorPositionX, computeTextHeight, computeTextWidth, computeTextX, computeTextY, destroy, getAlignment, getCharSequence, getFont, getNumTextLines, getPreferredInnerHeight, getPreferredInnerWidth, handleMouseHover, hasText, isCache, isMultilineText, paintLabelText, paintTextAt, paintWidget, paintWithSelection, paintWithSelection, setAlignment, setCache, setCharSequence, setFont
 
Methods inherited from class de.matthiasmann.twl.Widget
add, addActionMapping, addPropertyChangeListener, addPropertyChangeListener, adjustSize, afterAddToGUI, allChildrenRemoved, applyThemeBackground, applyThemeBorder, applyThemeInputMap, applyThemeMaxSize, applyThemeMinSize, applyThemeMouseCursor, applyThemeOffscreenExtra, applyThemeOverlay, applyThemeTooltip, beforeRemoveFromGUI, borderChanged, canAcceptKeyboardFocus, childAdded, childInvalidateLayout, childRemoved, childVisibilityChanged, computeSize, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, focusFirstChild, focusLastChild, focusNextChild, focusPrevChild, getActionMap, getAnimationState, getBackground, getBorderBottom, getBorderHorizontal, getBorderLeft, getBorderRight, getBorderTop, getBorderVertical, getBottom, getChild, getChildAt, getChildIndex, getGUI, getHeight, getInnerBottom, getInnerHeight, getInnerRight, getInnerWidth, getInnerX, getInnerY, getInputMap, getKeyboardFocusOrder, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getMouseCursor, getMouseCursor, getNumChildren, getOffscreenExtraBottom, getOffscreenExtraLeft, getOffscreenExtraRight, getOffscreenExtraTop, getOrCreateActionMap, getOverlay, getParent, getPreferredHeight, getPreferredWidth, getRenderOffscreen, getRight, getRootWidget, getTheme, getThemePath, getThemeTooltipContent, getTintAnimator, getTooltipContent, getTooltipContentAt, getWidgetAt, getWidth, getX, getY, giveupKeyboardFocus, handleEvent, handleKeyStrokeAction, hasKeyboardFocus, hasOpenPopups, hasSharedAnimationState, insertChild, invalidateLayout, invalidateLayoutLocally, isAbsoluteTheme, isClip, isDepthFocusTraversal, isEnabled, isFocusKeyEnabled, isInside, isLocallyEnabled, isMouseInside, isVisible, keyboardFocusChildChanged, keyboardFocusGained, keyboardFocusGained, keyboardFocusLost, layout, layoutChildFullInnerArea, layoutChildrenFullInnerArea, moveChild, paint, paintBackground, paintChild, paintChildren, paintDragOverlay, paintOverlay, positionChanged, reapplyTheme, removeAllChildren, removeChild, removeChild, removePropertyChangeListener, removePropertyChangeListener, requestKeyboardFocus, requestKeyboardFocus, resetTooltip, setActionMap, setBackground, setBorderSize, setBorderSize, setBorderSize, setBorderSize, setCanAcceptKeyboardFocus, setClip, setDepthFocusTraversal, setEnabled, setFocusKeyEnabled, setInnerSize, setInputMap, setMaxSize, setMinSize, setMouseCursor, setOffscreenExtra, setOffscreenExtra, setOverlay, setPosition, setRenderOffscreen, setSize, setTheme, setTintAnimator, setTooltipContent, setVisible, updateTintAnimation, updateTooltip, validateLayout, widgetDisabled
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface de.matthiasmann.twl.TableBase.CellRenderer
getPreferredHeight, getTheme
 

Constructor Detail

TableBase.StringCellRenderer

public TableBase.StringCellRenderer()
Method Detail

applyTheme

public void applyTheme(ThemeInfo themeInfo)
Description copied from class: Widget
Apply the given theme. This method also calls invalidateLayout()

Specified by:
applyTheme in interface TableBase.CellRenderer
Overrides:
applyTheme in class TextWidget
Parameters:
themeInfo - The theme info for this widget

setCellData

public void setCellData(int row,
                        int column,
                        java.lang.Object data)
Description copied from interface: TableBase.CellRenderer
This method sets the row, column and the cell data. It is called before any other cell related method is called.

Specified by:
setCellData in interface TableBase.CellRenderer
Parameters:
row - the table row
column - the table column
data - the cell data

getColumnSpan

public int getColumnSpan()
Description copied from interface: TableBase.CellRenderer
Returns how many columns this cell spans. Must be >= 1. Is called after setCellData.

Specified by:
getColumnSpan in interface TableBase.CellRenderer
Returns:
the column span.
See Also:
TableBase.CellRenderer.setCellData(int, int, java.lang.Object)

sizeChanged

protected void sizeChanged()
Description copied from class: Widget
Called when the size of this widget has changed. The default implementation calls invalidateLayoutLocally. As size changes are normally the result of the parent's layout() function.

Overrides:
sizeChanged in class Widget
See Also:
Widget.invalidateLayoutLocally()

getCellRenderWidget

public Widget getCellRenderWidget(int x,
                                  int y,
                                  int width,
                                  int height,
                                  boolean isSelected)
Description copied from interface: TableBase.CellRenderer
Returns the widget used to render the cell or null if no rendering should happen. This widget should not be added to any widget. It will be managed by the Table. TableBase uses a stamping approch for cell rendering. This method must not create a new widget each time. This method is responsible to call setPosition and setSize on the returned widget.

Specified by:
getCellRenderWidget in interface TableBase.CellRenderer
Parameters:
x - the left edge of the cell
y - the top edge of the cell
width - the width of the cell
height - the height of the cell
isSelected - the selected state of this cell
Returns:
the widget used for cell rendering or null.
See Also:
TableBase.CellRenderer.setCellData(int, int, java.lang.Object)