Overview | Package | Class | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.smardec.asc.spantable
Class JSpanTable

    java.lang.Object
      |
      +--java.awt.Component
            |
            +--java.awt.Container
                  |
                  +--javax.swing.JComponent
                        |
                        +--javax.swing.JTable
                              |
                              +--com.smardec.asc.spantable.JSpanTable

All Implemented Interfaces:
  javax.accessibility.Accessible, javax.swing.event.CellEditorListener, java.util.EventListener, java.awt.image.ImageObserver, javax.swing.event.ListSelectionListener, java.awt.MenuContainer, javax.swing.Scrollable, java.io.Serializable, javax.swing.event.TableColumnModelListener, javax.swing.event.TableModelListener

public class JSpanTable
extends javax.swing.JTable

`JSpanTable` Swing component. It extends `JTable` and provides api to create cells span.

Field Summary
`protected java.util.Hashtable` | `defaultCellRenderersByCellClass`

Fields inherited from class javax.swing.JTable
`AUTO_RESIZE_ALL_COLUMNS, AUTO_RESIZE_LAST_COLUMN, AUTO_RESIZE_NEXT_COLUMN, AUTO_RESIZE_OFF, AUTO_RESIZE_SUBSEQUENT_COLUMNS, autoCreateColumnsFromModel, autoResizeMode, cellEditor, cellSelectionEnabled, columnModel, dataModel, defaultEditorsByColumnClass, defaultRenderersByColumnClass, editingColumn, editingRow, editorComp, gridColor, preferredViewportSize, rowHeight, rowMargin, rowSelectionAllowed, selectionBackground, selectionForeground, selectionModel, showHorizontalLines, showVerticalLines, tableHeader`

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
`JSpanTable(DefaultSpanTableModel defaultSpanTableModel)` Creates `JSpanTable` object with the specified model.

Method Summary
`void` | `createSpan(int rowStart, int columnStart, int rowSpan, int columnSpan)` Create cells span using cell at [`rowStart`, `columnStart`] as anchor.
`void` | `destroySpan(int rowIndex, int columnIndex)` Destroy cells span.
`javax.swing.table.TableCellRenderer` | `getCellRenderer(int row, int column)` Returns an appropriate renderer for the cell specified by this row and column.
`javax.swing.table.TableCellRenderer` | `getDefaultCellRenderer(java.lang.Class cellClass)` Returns an appropriate renderer for the cell which object is instance of `cellClass`.
`TableCell` | `getTableCell(int rowIndex, int columnIndex)` Returns table cell at specified row and column.
`void` | `setDefaultCellRenderer(java.lang.Class cellClass, javax.swing.table.TableCellRenderer renderer)` Specifies cell renderer that is used when cell object is instance of `cellClass`.
`void` | `setUI(javax.swing.plaf.TableUI ui)` Sets the L&F object that renders this span table and repaints it.

Methods inherited from class javax.swing.JTable
`addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, clearSelection, columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, configureEnclosingScrollPane, convertColumnIndexToModel, convertColumnIndexToView, createDefaultColumnModel, createDefaultColumnsFromModel, createDefaultDataModel, createDefaultEditors, createDefaultRenderers, createDefaultSelectionModel, createDefaultTableHeader, createScrollPaneForTable, doLayout, editCellAt, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoResizeMode, getCellEditor, getCellEditor, getCellRect, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getEditingColumn, getEditingRow, getEditorComponent, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getToolTipText, getUI, getUIClassID, getValueAt, initializeLocalVars, isCellEditable, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, prepareRenderer, processKeyBinding, removeColumn, removeColumnSelectionInterval, removeEditor, removeNotify, removeRowSelectionInterval, resizeAndRepaint, rowAtPoint, selectAll, setAutoCreateColumnsFromModel, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setEditingColumn, setEditingRow, setGridColor, setIntercellSpacing, setModel, setPreferredScrollableViewportSize, setRowHeight, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setValueAt, sizeColumnsToFit, sizeColumnsToFit, tableChanged, unconfigureEnclosingScrollPane, updateUI, valueChanged`

Methods inherited from class javax.swing.JComponent
`addAncestorListener, addPropertyChangeListener, addPropertyChangeListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, 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, 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, processKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, 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, 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

### defaultCellRenderersByCellClass

    protected transient java.util.Hashtable defaultCellRenderersByCellClass

Constructor Detail

### JSpanTable

    public JSpanTable(DefaultSpanTableModel defaultSpanTableModel)

  Creates `JSpanTable` object with the specified model.

Parameters:
  `defaultSpanTableModel` - data model for the span table

Method Detail

### createSpan

    public void createSpan(int rowStart,
                           int columnStart,
                           int rowSpan,
                           int columnSpan)

  Create cells span using cell at [`rowStart`, `columnStart`] as anchor. Number of rows and columns in span including anchor cell is equal to `rowSpan` and `columnSpan` respectively.

  Parameters:
    `rowStart` - row number of anchor cell
    `columnStart` - column number of anchor cell
    `rowSpan` - the number of rows the span holds
    `columnSpan` - the number of columns the span holds

### destroySpan

    public void destroySpan(int rowIndex,
                            int columnIndex)

  Destroy cells span. If cell[`rowIndex`, `columnIndex`] is contained in span then the span will be destroyed.

  Parameters:
    `rowIndex` - the row whose span is to be destroyed
    `columnIndex` - the column whose span is to be destroyed

### getTableCell

    public TableCell getTableCell(int rowIndex,
                                  int columnIndex)

  Returns table cell at specified row and column.

  Parameters:
    `rowIndex` - the row whose value is to be queried
    `columnIndex` - the column whose value is to be queried
  Returns:
    table cell at specified row and column.

### setDefaultCellRenderer

    public void setDefaultCellRenderer(java.lang.Class cellClass,
                                       javax.swing.table.TableCellRenderer renderer)

  Specifies cell renderer that is used when cell object is instance of `cellClass`. If renderer is `null`, removes the default renderer for this cell class.

  Parameters:
    `cellClass` - cell's object class
    `renderer` - cell renderer to be used for `cellClass`
  See Also:
    `getDefaultCellRenderer(Class)`, `getCellRenderer(int, int)`

### getDefaultCellRenderer

    public javax.swing.table.TableCellRenderer getDefaultCellRenderer(java.lang.Class cellClass)

  Returns an appropriate renderer for the cell which object is instance of `cellClass`.

  Parameters:
    `cellClass` - cell's object class
  Returns:
    renderer for the cell which object is instance of `cellClass`.
  See Also:
    `setDefaultCellRenderer(Class, javax.swing.table.TableCellRenderer)`, `getCellRenderer(int, int)`

### getCellRenderer

    public javax.swing.table.TableCellRenderer getCellRenderer(int row,
                                                               int column)

  Returns an appropriate renderer for the cell specified by this row and column. If non-null renderer is assigned for this cell's class by `setDefaultCellRenderer(Class, javax.swing.table.TableCellRenderer)`, returns that. If not, checks if the `TableColumn` for this column has a non-null renderer, returns that. If not, finds the class of the data in this column (using `getColumnClass`) and returns the default renderer for this type of data.

  Overrides:
    `getCellRenderer` in class `javax.swing.JTable`
  Parameters:
    `row` - the row of the cell to render, where 0 is the first row
    `column` - he column of the cell to render, where 0 is the first column
  Returns:
    the assigned renderer; if `null` returns the default renderer for this type of object
  See Also:
    `setDefaultCellRenderer(Class, javax.swing.table.TableCellRenderer)`, `getDefaultCellRenderer(Class)`, `DefaultTableCellRenderer`, `TableColumn.setCellRenderer(javax.swing.table.TableCellRenderer)`, `JTable.setDefaultRenderer(Class, javax.swing.table.TableCellRenderer)`

### setUI

    public void setUI(javax.swing.plaf.TableUI ui)

  Sets the L&F object that renders this span table and repaints it.
  Note:`ui` sets only if it is instance of SpanTableUI, otherwise default `SpanTableUI` is used.

  Overrides:
    `setUI` in class `javax.swing.JTable`
  Parameters:
    `ui` - SpanTableUI object

Overview | Package | Class | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2003-2006 Smardec. All Rights Reserved.