ilog.cpl.table
Class IlpJTable

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JTable
                  extended by ilog.cpl.table.IlpJTable
All Implemented Interfaces:
ImageObserver, MenuContainer, Serializable, EventListener, Accessible, CellEditorListener, ListSelectionListener, TableColumnModelListener, TableModelListener, Scrollable

public class IlpJTable
extends JTable

Derived from JTable to delegate selection management to the IlpTableView which contains this JTable. This class also uses a specific UI class.

Since:
JTGO 3.0
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class javax.swing.JTable
JTable.AccessibleJTable, JTable.PrintMode
 
Nested classes/interfaces inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
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
 
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
IlpJTable(IlpTableView tableView)
          Constructs an IlpJTable.
 
Method Summary
 void changeSelection(int rowIndex, int columnIndex, boolean toggle, boolean extend)
          Redefined here to forward selection to the IlpTableView containing this JTable.
 void columnAdded(TableColumnModelEvent e)
          Invoked when a column is added to the table column model.
 void columnMarginChanged(ChangeEvent e)
          Invoked when a column is moved due to a margin change.
 void columnRemoved(TableColumnModelEvent tableColumnModelEvent)
          Invoked when a column is removed from the table column model.
 TableCellEditor getCellEditor(int row, int column)
          Redefined here to delegate to the table view.
 TableCellRenderer getCellRenderer(int row, int column)
          Redefined here to delegate to the table view.
 int getColumnIndexInView(int columnIndex)
          Returns the column index in the table view column system.
 IlpTableView getIlpTableView()
          Returns the IlpTableView which uses this IlpJTable.
 String getUIClassID()
          Returns the name of the look-and-feel class that renders this component.
 boolean isCellSelected(int row, int column)
          Redefined here to delegate the selection management to the IlpTableView containing this JTable.
 boolean isRowHeaderTable()
          Returns true is this table is a row header table.
 Component prepareRenderer(TableCellRenderer renderer, int row, int column)
          Redefined here to delegate the selection management to the IlpTableView containing this JTable.
 void scrollRectToVisible(Rectangle aRect)
          Forwards the scrollRectToVisible() message to the table if it is a row header table.
 void setRowHeaderTable(boolean flag)
          Tell the table if it is a row header table or not.
 void sizeColumnsToFit(int resizingColumn)
          Resizes one or more of the columns in the table so that the total width of all of this JTable's columns is equal to the width of the table.
 void valueChanged(ListSelectionEvent e)
          Redefined here to delegate the selection management to the IlpTableView containing this JTable.
 
Methods inherited from class javax.swing.JTable
addColumn, addColumnSelectionInterval, addNotify, addRowSelectionInterval, clearSelection, columnAtPoint, columnMoved, columnSelectionChanged, configureEnclosingScrollPane, convertColumnIndexToModel, convertColumnIndexToView, createDefaultColumnModel, createDefaultColumnsFromModel, createDefaultDataModel, createDefaultEditors, createDefaultRenderers, createDefaultSelectionModel, createDefaultTableHeader, createScrollPaneForTable, doLayout, editCellAt, editCellAt, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoResizeMode, getCellEditor, getCellRect, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getEditingColumn, getEditingRow, getEditorComponent, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getPrintable, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getToolTipText, getUI, getValueAt, initializeLocalVars, isCellEditable, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, prepareEditor, print, print, print, print, 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, setUI, setValueAt, sizeColumnsToFit, tableChanged, unconfigureEnclosingScrollPane, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, 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, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, 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, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, 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, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, 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
 

Constructor Detail

IlpJTable

public IlpJTable(IlpTableView tableView)
Constructs an IlpJTable.

Method Detail

getUIClassID

public String getUIClassID()
Returns the name of the look-and-feel class that renders this component.

Overrides:
getUIClassID in class JTable
Returns:
IlpTableUI (which is associated with ilog.cpl.table.IlpBasicTableUI in the UIManager).
See Also:
JComponent.getUIClassID(), UIDefaults.getUI(javax.swing.JComponent)

getIlpTableView

public IlpTableView getIlpTableView()
Returns the IlpTableView which uses this IlpJTable.

Returns:
The IlpTableView using this IlpJTable.
Internal method or field: do not use!

isRowHeaderTable

public boolean isRowHeaderTable()
Returns true is this table is a row header table.

Internal method or field: do not use!

setRowHeaderTable

public void setRowHeaderTable(boolean flag)
Tell the table if it is a row header table or not. This information is useful when the size of a column is changed.

See Also:
columnMarginChanged(javax.swing.event.ChangeEvent)
Internal method or field: do not use!

columnMarginChanged

public void columnMarginChanged(ChangeEvent e)
Invoked when a column is moved due to a margin change. If a cell is being edited, then editing is stopped and the cell is redrawn.

Specified by:
columnMarginChanged in interface TableColumnModelListener
Overrides:
columnMarginChanged in class JTable

getColumnIndexInView

public int getColumnIndexInView(int columnIndex)
Returns the column index in the table view column system.

Internal method or field: do not use!

changeSelection

public void changeSelection(int rowIndex,
                            int columnIndex,
                            boolean toggle,
                            boolean extend)
Redefined here to forward selection to the IlpTableView containing this JTable.

Overrides:
changeSelection in class JTable
See Also:
JTable.changeSelection(int, int, boolean, boolean)

isCellSelected

public boolean isCellSelected(int row,
                              int column)
Redefined here to delegate the selection management to the IlpTableView containing this JTable.

Overrides:
isCellSelected in class JTable
See Also:
JTable.isCellSelected(int, int)

getCellRenderer

public TableCellRenderer getCellRenderer(int row,
                                         int column)
Redefined here to delegate to the table view.

Overrides:
getCellRenderer in class JTable

getCellEditor

public TableCellEditor getCellEditor(int row,
                                     int column)
Redefined here to delegate to the table view.

Overrides:
getCellEditor in class JTable

prepareRenderer

public Component prepareRenderer(TableCellRenderer renderer,
                                 int row,
                                 int column)
Redefined here to delegate the selection management to the IlpTableView containing this JTable.

Overrides:
prepareRenderer in class JTable
See Also:
JTable.isCellSelected(int, int)

valueChanged

public void valueChanged(ListSelectionEvent e)
Redefined here to delegate the selection management to the IlpTableView containing this JTable. This method is invoked when the row selection changes -- repaints to show the new selection.

The application code does not use these methods explicitly, they are used internally by JTable.

Specified by:
valueChanged in interface ListSelectionListener
Overrides:
valueChanged in class JTable
Parameters:
e - The event received.
See Also:
JTable.valueChanged(javax.swing.event.ListSelectionEvent)

columnAdded

public void columnAdded(TableColumnModelEvent e)
Invoked when a column is added to the table column model.

Application code will not use these methods explicitly, they are used internally by JTable. Redefined here to make a little space for the new column inserted at the end of the table when auto resize mode is AUTO_RESIZE_LAST_COLUMN.

Specified by:
columnAdded in interface TableColumnModelListener
Overrides:
columnAdded in class JTable
See Also:
TableColumnModelListener

columnRemoved

public void columnRemoved(TableColumnModelEvent tableColumnModelEvent)
Invoked when a column is removed from the table column model.

Application code will not use these methods explicitly, they are used internally by JTable. Redefined to resize the fixed column table if necessary

Specified by:
columnRemoved in interface TableColumnModelListener
Overrides:
columnRemoved in class JTable
See Also:
TableColumnModelListener

sizeColumnsToFit

public void sizeColumnsToFit(int resizingColumn)
Resizes one or more of the columns in the table so that the total width of all of this JTable's columns is equal to the width of the table. See JTable.sizeColumnsToFit(boolean) for more information.

The method is redefined here to resize only the last column if auto resize mode is AUTO_RESIZE_LAST_COLUMN even when resizeColumn is equal to -1.

Overrides:
sizeColumnsToFit in class JTable
Parameters:
resizingColumn - the column whose resizing made this adjustment necessary or -1 if there is no such column
See Also:
TableColumn.setWidth(int)

scrollRectToVisible

public void scrollRectToVisible(Rectangle aRect)
Forwards the scrollRectToVisible() message to the table if it is a row header table. This fixes Sun's bug 4202002 : JScrollPane: row header autoscrolling not reflected in content.

Overrides:
scrollRectToVisible in class JComponent
Parameters:
aRect - the visible Rectangle