net.sf.jeppers.grid
Class JGrid

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--net.sf.jeppers.grid.JGrid
All Implemented Interfaces:
CellEditorListener, EventListener, GridModelListener, ImageObserver, MenuContainer, Scrollable, Serializable
Direct Known Subclasses:
JGridHeader

public class JGrid
extends JComponent
implements Scrollable, CellEditorListener, GridModelListener

The JGrid is used to display and edit regular two-dimensional grid of cells. Unlike JTable which is fundamentally vertical in that the structure is determined in the columns, while the rows contain the data. JGrid is symmetrical with respect to the vertical and the horizontal orientations. JGrid also allows for cells to be merged into bigger rectangular arrays, called spans.

Author:
Cameron Zemek
See Also:
Serialized Form

Field Summary
protected  GridCellEditor cellEditor
          The object that overwrites the screen real estate occupied by the current cell and allows the user to change its contents.
protected  RulerModel columnModel
           
protected static int DEFAULT_COLUMN_WIDTH
           
protected static int DEFAULT_ROW_HEIGHT
           
protected  int editingColumn
          Identifies the column of the cell being edited.
protected  int editingRow
          Identifies the row of the cell being edited.
protected  Component editorComp
          If editing, the Component that is handling the editing.
protected  GridModel gridModel
           
protected  Dimension preferredViewportSize
          Used by the Scrollable interface to determine the initial visible area.
protected  GridRepaintManager repaintMgr
           
protected  RulerModel rowModel
           
protected  SelectionModel selectionModel
           
protected  SpanModel spanModel
           
protected  StyleModel styleModel
           
 
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
JGrid()
           
JGrid(GridModel gridModel, SpanModel spanModel, StyleModel styleModel)
           
JGrid(int rows, int columns)
           
 
Method Summary
 void changeSelection(int row, int column, boolean toggle, boolean extend)
           
 int columnAtPoint(Point point)
          Return the column at the specified point
protected  void create(GridModel gridModel, SpanModel spanModel, StyleModel styleModel, RulerModel rowModel, RulerModel columnModel, SelectionModel selectionModel)
           
 boolean editCellAt(int row, int column)
           
 boolean editCellAt(int row, int column, EventObject e)
          Programmatically starts editing the cell at row and column, if the cell is editable.
 void editingCanceled(ChangeEvent e)
          Invoked when editing is canceled.
 void editingStopped(ChangeEvent e)
          Invoked when editing is finished.
 void ensureCellInVisibleRect(int row, int column)
           
 Rectangle getCellBounds(int row, int column)
          Get cell bounds of (row, column)
 GridCellEditor getCellEditor(int row, int column)
           
 GridCellRenderer getCellRenderer(int row, int column)
           
 int getColumnCount()
          Returns the number of columns in this grid's model.
 RulerModel getColumnModel()
           
 int getColumnPosition(int column)
          Return the left horizontal coordinate (in pixels) of column
 int getColumnWidth(int column)
          Returns the width (in pixels) of column.
 GridCellEditor getCurrentCellEditor()
          Return the current cell editor
 int getEditingColumn()
          Returns the index of the column that contains the cell currently being edited.
 int getEditingRow()
          Returns the index of the row that contains the cell currently being edited.
 Component getEditorComponent()
          Returns the component that is handling the editing session.
 Color getFocusBackgroundColor()
          Returns the background color for cells with focus.
 Color getFocusForegroundColor()
          Returns the foreground color for cells with focus.
 Color getGridColor()
          Returns the color used to draw grid lines.
 GridModel getGridModel()
           
 Dimension getPreferredScrollableViewportSize()
          Returns the preferred size of the viewport for this table.
 int getRowCount()
          Returns the number of rows in this grid's model.
 int getRowHeight(int row)
          Returns the height (in pixels) of row.
 RulerModel getRowModel()
           
 int getRowPosition(int row)
          Return the top vertical coordinate (in pixels) of row
 int getScrollableBlockIncrement(Rectangle visibleRect, int orientation, int direction)
          Returns visibleRect.height or visibleRect.width, depending on this spreadsheet's orientation.
 boolean getScrollableTracksViewportHeight()
          Returns false to indicate that the height of the viewport does not determine the height of the spreadsheet.
 boolean getScrollableTracksViewportWidth()
          Returns false to indicate that the width of the viewport does not determine the width of the spreadsheet.
 int getScrollableUnitIncrement(Rectangle visibleRect, int orientation, int direction)
          Returns the scroll increment (in pixels) that completely exposes one new row or column (depending on the orientation).
 Color getSelectionBackgroundColor()
          Returns the background color for selected cells.
 Color getSelectionForegroundColor()
          Returns the foreground color for selected cells.
 SelectionModel getSelectionModel()
           
 boolean getShowGrid()
          Returns true if the grid draws grid lines.
 SpanModel getSpanModel()
           
 StyleModel getStyleModel()
           
 GridUI getUI()
          Returns the L&F object that renders this component.
 String getUIClassID()
          Returns a string that specifies the name of the l&f class that renders this component.
 Object getValueAt(int row, int column)
           
 void gridChanged(GridModelEvent event)
          Sync row and column sizes between models
 boolean isCellSpan(int row, int column)
           
 boolean isEditing()
          Returns true if a cell is being edited.
 boolean isSelected(int row, int column)
           
 Component prepareEditor(GridCellEditor editor, int row, int column)
          Prepares the editor for cell(row, column)
 Component prepareRenderer(GridCellRenderer renderer, int row, int column)
          Prepares the renderer for painting cell(row,column)
protected  boolean processKeyBinding(KeyStroke keyStroke, KeyEvent keyEvent, int condition, boolean pressed)
           
 void removeEditor()
          Discards the editor object and frees the real estate it used for cell rendering.
 void resizeAndRepaint()
           
 int rowAtPoint(Point point)
          Return the row at the specified point
 void setColumnWidth(int column, int width)
          Sets the width for column to width.
 void setEditingColumn(int aColumn)
          Sets the editingColumn variable.
 void setEditingRow(int aRow)
          Sets the editingRow variable.
 void setFocusBackgroundColor(Color focusBackgroundColor)
          Sets the background color for cells with focus.
 void setFocusForegroundColor(Color focusForegroundColor)
          Sets the foreground color for cells with focus.
 void setGridColor(Color gridColor)
          Sets the color used to draw grid lines.
 void setGridModel(GridModel model)
           
 void setPreferredScrollableViewportSize(Dimension size)
          Sets the preferred size of the viewport for this table.
 void setRowHeight(int row, int height)
          Sets the height for row to height.
 void setSelectionBackgroundColor(Color selectionBackgroundColor)
          Sets the background color for selected cells.
 void setSelectionForegroundColor(Color selectionForegroundColor)
          Sets the foreground color for selected cells.
 void setSelectionModel(SelectionModel model)
           
 void setShowGrid(boolean show)
          Sets wether grid lines should be drawn.
 void setSpanModel(SpanModel model)
           
 void setStyleModel(StyleModel model)
           
 void setUI(GridUI ui)
          Sets the L&F object that renders this component.
 void setValueAt(Object value, int row, int column)
           
protected  void updateRepaintManager()
           
 void updateUI()
          Notification from the UIFactory that the L&F has changed.
 
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, getAccessibleContext, 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, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, 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, 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, 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

DEFAULT_ROW_HEIGHT

protected static final int DEFAULT_ROW_HEIGHT
See Also:
Constant Field Values

DEFAULT_COLUMN_WIDTH

protected static final int DEFAULT_COLUMN_WIDTH
See Also:
Constant Field Values

rowModel

protected RulerModel rowModel

columnModel

protected RulerModel columnModel

gridModel

protected GridModel gridModel

selectionModel

protected SelectionModel selectionModel

spanModel

protected SpanModel spanModel

styleModel

protected StyleModel styleModel

repaintMgr

protected GridRepaintManager repaintMgr

preferredViewportSize

protected Dimension preferredViewportSize
Used by the Scrollable interface to determine the initial visible area.


editorComp

protected Component editorComp
If editing, the Component that is handling the editing.


cellEditor

protected GridCellEditor cellEditor
The object that overwrites the screen real estate occupied by the current cell and allows the user to change its contents.


editingColumn

protected int editingColumn
Identifies the column of the cell being edited.


editingRow

protected int editingRow
Identifies the row of the cell being edited.

Constructor Detail

JGrid

public JGrid()

JGrid

public JGrid(int rows,
             int columns)

JGrid

public JGrid(GridModel gridModel,
             SpanModel spanModel,
             StyleModel styleModel)
Method Detail

create

protected void create(GridModel gridModel,
                      SpanModel spanModel,
                      StyleModel styleModel,
                      RulerModel rowModel,
                      RulerModel columnModel,
                      SelectionModel selectionModel)

updateRepaintManager

protected void updateRepaintManager()

getFocusForegroundColor

public Color getFocusForegroundColor()
Returns the foreground color for cells with focus.

Returns:
the Color used for the foreground of focused cells

setFocusForegroundColor

public void setFocusForegroundColor(Color focusForegroundColor)
Sets the foreground color for cells with focus.

Parameters:
focusForegroundColor - the Color to use for foreground of focused cells

getFocusBackgroundColor

public Color getFocusBackgroundColor()
Returns the background color for cells with focus.

Returns:
the Color used for the background of focused cells

setFocusBackgroundColor

public void setFocusBackgroundColor(Color focusBackgroundColor)
Sets the background color for cells with focus.

Parameters:
focusBackgroundColor - the Color to use for background of focused cells

getSelectionForegroundColor

public Color getSelectionForegroundColor()
Returns the foreground color for selected cells.

Returns:
the Color used for the foreground of selected cells.

setSelectionForegroundColor

public void setSelectionForegroundColor(Color selectionForegroundColor)
Sets the foreground color for selected cells.

Parameters:
selectionForegroundColor - the Color used for the foreground of selected cells

getSelectionBackgroundColor

public Color getSelectionBackgroundColor()
Returns the background color for selected cells.

Returns:
the Color used for the background of selected cells.

setSelectionBackgroundColor

public void setSelectionBackgroundColor(Color selectionBackgroundColor)
Sets the background color for selected cells.

Parameters:
selectionBackgroundColor - the Color used for the background of selected cells

getGridColor

public Color getGridColor()
Returns the color used to draw grid lines.

Returns:
the Color used to draw grid lines

setGridColor

public void setGridColor(Color gridColor)
Sets the color used to draw grid lines.

Parameters:
gridColor - the new Color of the grid lines

getShowGrid

public boolean getShowGrid()
Returns true if the grid draws grid lines.

Returns:
true if the grid draws grid lines.

setShowGrid

public void setShowGrid(boolean show)
Sets wether grid lines should be drawn.


getRowCount

public int getRowCount()
Returns the number of rows in this grid's model.

Returns:
the number of rows in this grid's model.

getColumnCount

public int getColumnCount()
Returns the number of columns in this grid's model.

Returns:
the number of columns in this grid's model.

getRowHeight

public int getRowHeight(int row)
Returns the height (in pixels) of row.

Parameters:
row - the row whose height is to be returned
Returns:
the height (in pixels) of row

getColumnWidth

public int getColumnWidth(int column)
Returns the width (in pixels) of column.

Parameters:
column - the column whose width is to be returned
Returns:
the width (in pixels) of column

setRowHeight

public void setRowHeight(int row,
                         int height)
Sets the height for row to height.

Parameters:
row - the row whose height is to be changed
height - new row height (in pixels)

setColumnWidth

public void setColumnWidth(int column,
                           int width)
Sets the width for column to width.

Parameters:
column - the column whose width is to be changed
width - new column width (in pixels)

getRowPosition

public int getRowPosition(int row)
Return the top vertical coordinate (in pixels) of row


getColumnPosition

public int getColumnPosition(int column)
Return the left horizontal coordinate (in pixels) of column


getCellBounds

public Rectangle getCellBounds(int row,
                               int column)
Get cell bounds of (row, column)


rowAtPoint

public int rowAtPoint(Point point)
Return the row at the specified point


columnAtPoint

public int columnAtPoint(Point point)
Return the column at the specified point


isCellSpan

public boolean isCellSpan(int row,
                          int column)

getCellRenderer

public GridCellRenderer getCellRenderer(int row,
                                        int column)

getCellEditor

public GridCellEditor getCellEditor(int row,
                                    int column)

prepareRenderer

public Component prepareRenderer(GridCellRenderer renderer,
                                 int row,
                                 int column)
Prepares the renderer for painting cell(row,column)


prepareEditor

public Component prepareEditor(GridCellEditor editor,
                               int row,
                               int column)
Prepares the editor for cell(row, column)


isSelected

public boolean isSelected(int row,
                          int column)

ensureCellInVisibleRect

public void ensureCellInVisibleRect(int row,
                                    int column)

changeSelection

public void changeSelection(int row,
                            int column,
                            boolean toggle,
                            boolean extend)

getGridModel

public GridModel getGridModel()

setGridModel

public void setGridModel(GridModel model)

getSelectionModel

public SelectionModel getSelectionModel()

setSelectionModel

public void setSelectionModel(SelectionModel model)

getSpanModel

public SpanModel getSpanModel()

setSpanModel

public void setSpanModel(SpanModel model)

getStyleModel

public StyleModel getStyleModel()

setStyleModel

public void setStyleModel(StyleModel model)

getRowModel

public RulerModel getRowModel()

getColumnModel

public RulerModel getColumnModel()

gridChanged

public void gridChanged(GridModelEvent event)
Sync row and column sizes between models

Specified by:
gridChanged in interface GridModelListener

editCellAt

public boolean editCellAt(int row,
                          int column)

editCellAt

public boolean editCellAt(int row,
                          int column,
                          EventObject e)
Programmatically starts editing the cell at row and column, if the cell is editable.

Parameters:
row - the row to be edited
column - the column to be edited
e - event to pass into shouldSelectCell
Returns:
false if for any reason the cell cannot be edited
Throws:
IllegalArgumentException - If row or column is not in the valid range

removeEditor

public void removeEditor()
Discards the editor object and frees the real estate it used for cell rendering.


setEditingColumn

public void setEditingColumn(int aColumn)
Sets the editingColumn variable.

Parameters:
aColumn - the column of the cell to be edited
See Also:
editingColumn

setEditingRow

public void setEditingRow(int aRow)
Sets the editingRow variable.

Parameters:
aRow - the row of the cell to be edited
See Also:
editingRow

isEditing

public boolean isEditing()
Returns true if a cell is being edited.

Returns:
true if the table is editing a cell
See Also:
editingColumn, editingRow

getEditorComponent

public Component getEditorComponent()
Returns the component that is handling the editing session. If nothing is being edited, returns null.

Returns:
Component handling editing session

getEditingColumn

public int getEditingColumn()
Returns the index of the column that contains the cell currently being edited. If nothing is being edited, returns -1.

Returns:
the index of the column that contains the cell currently being edited; returns -1 if nothing being edited
See Also:
editingRow

getEditingRow

public int getEditingRow()
Returns the index of the row that contains the cell currently being edited. If nothing is being edited, returns -1.

Returns:
the index of the row that contains the cell currently being edited; returns -1 if nothing being edited
See Also:
editingColumn

getCurrentCellEditor

public GridCellEditor getCurrentCellEditor()
Return the current cell editor


editingStopped

public void editingStopped(ChangeEvent e)
Invoked when editing is finished. The changes are saved and the editor is discarded.

Application code will not use these methods explicitly, they are used internally by JSpread.

Specified by:
editingStopped in interface CellEditorListener
Parameters:
e - the event received
See Also:
CellEditorListener

editingCanceled

public void editingCanceled(ChangeEvent e)
Invoked when editing is canceled. The editor object is discarded and the cell is rendered once again. Application code will not use these methods explicitly, they are used internally by JSpread.

Specified by:
editingCanceled in interface CellEditorListener
Parameters:
e - the event received
See Also:
CellEditorListener

processKeyBinding

protected boolean processKeyBinding(KeyStroke keyStroke,
                                    KeyEvent keyEvent,
                                    int condition,
                                    boolean pressed)
Overrides:
processKeyBinding in class JComponent

setPreferredScrollableViewportSize

public void setPreferredScrollableViewportSize(Dimension size)
Sets the preferred size of the viewport for this table.

Parameters:
size - a Dimension object specifying the preferredSize of a JViewport whose view is this spreadsheet
See Also:
Scrollable.getPreferredScrollableViewportSize()

getPreferredScrollableViewportSize

public Dimension getPreferredScrollableViewportSize()
Returns the preferred size of the viewport for this table.

Specified by:
getPreferredScrollableViewportSize in interface Scrollable
Returns:
a Dimension object containing the preferredSize of the JViewport which displays this table
See Also:
Scrollable.getPreferredScrollableViewportSize()

getScrollableUnitIncrement

public int getScrollableUnitIncrement(Rectangle visibleRect,
                                      int orientation,
                                      int direction)
Returns the scroll increment (in pixels) that completely exposes one new row or column (depending on the orientation). This method is called each time the user requests a unit scroll.

Specified by:
getScrollableUnitIncrement in interface Scrollable
Parameters:
visibleRect - the view area visible within the viewport
orientation - either SwingConstants.VERTICAL or SwingConstants.HORIZONTAL
direction - less than zero to scroll up/left, greater than zero for down/right
Returns:
the "unit" increment for scrolling in the specified direction
See Also:
Scrollable.getScrollableUnitIncrement(java.awt.Rectangle, int, int)

getScrollableBlockIncrement

public int getScrollableBlockIncrement(Rectangle visibleRect,
                                       int orientation,
                                       int direction)
Returns visibleRect.height or visibleRect.width, depending on this spreadsheet's orientation.

Specified by:
getScrollableBlockIncrement in interface Scrollable
Returns:
visibleRect.height or visibleRect.width per the orientation
See Also:
Scrollable.getScrollableBlockIncrement(java.awt.Rectangle, int, int)

getScrollableTracksViewportWidth

public boolean getScrollableTracksViewportWidth()
Returns false to indicate that the width of the viewport does not determine the width of the spreadsheet.

Specified by:
getScrollableTracksViewportWidth in interface Scrollable
Returns:
false
See Also:
Scrollable.getScrollableTracksViewportWidth()

getScrollableTracksViewportHeight

public boolean getScrollableTracksViewportHeight()
Returns false to indicate that the height of the viewport does not determine the height of the spreadsheet.

Specified by:
getScrollableTracksViewportHeight in interface Scrollable
Returns:
false
See Also:
Scrollable.getScrollableTracksViewportHeight()

getUI

public GridUI getUI()
Returns the L&F object that renders this component.

Returns:
SpreadsheetUI object

setUI

public void setUI(GridUI ui)
Sets the L&F object that renders this component.

Parameters:
ui - the SpreadsheetUI L&F object
See Also:
UIDefaults.getUI(javax.swing.JComponent)

updateUI

public void updateUI()
Notification from the UIFactory that the L&F has changed.

Overrides:
updateUI in class JComponent
See Also:
JComponent.updateUI()

getUIClassID

public String getUIClassID()
Returns a string that specifies the name of the l&f class that renders this component.

Overrides:
getUIClassID in class JComponent
Returns:
String "SpreadsheetUI"
See Also:
JComponent.getUIClassID(), UIDefaults.getUI(javax.swing.JComponent)

resizeAndRepaint

public void resizeAndRepaint()

getValueAt

public Object getValueAt(int row,
                         int column)

setValueAt

public void setValueAt(Object value,
                       int row,
                       int column)