public class IlvJTable extends JTable implements IlvVerticalExpandable
IlvJTable
is a Swing JTable
subclass that
is designed specifically to integrate easily with the Gantt framework.
It can be added to a Gantt configuration as an expandable slave
component by invoking anIlvGanttConfiguration.addVerticalExpandable(anIlvJTable)
.
The table is initially created without any columns.
IlvJTableColumn
s are added to the table by using
addColumn(anIlvJTableColumn)
. Note
that Swing TableColumn
s cannot be added directly to an
IlvJTable
. Each IlvJTableColumn
encapsulates
access to the Gantt data model and has an internal
TableColumn
that controls the visual representation of
the data.
Modifier and Type | Class and Description |
---|---|
static class |
IlvJTable.DefaultToolTipPolicy
The
DefaultToolTipPolicy implements a default tooltip
strategy for a JTable . |
static interface |
IlvJTable.ToolTipPolicy
The
ToolTipPolicy defines the strategy that a
JTable uses to compute the text and positioning of its
tooltips. |
JTable.AccessibleJTable, JTable.DropLocation, JTable.PrintMode
JComponent.AccessibleJComponent
Container.AccessibleAWTContainer
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy
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
listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW
accessibleContext, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
Constructor and Description |
---|
IlvJTable()
Constructs a new
IlvJTable . |
Modifier and Type | Method and Description |
---|---|
void |
addColumn(IlvJTableColumn column)
Appends the specified column definition as the last column in the
table.
|
void |
addColumn(TableColumn aColumn)
This method is overridden to unconditionally throw an
UnsupportedOperationException . |
protected void |
baseTextDirectionChanged()
This method is invoked when the effective base text direction has changed.
|
void |
cellUpdated(IlvHierarchyNode row,
int modelColumnIndex)
Invoke this method to notify the table that the representation of the
cell at the intersection of the specified row and column has changed.
|
protected void |
columnBaseTextDirectionChanged(IlvJTableColumn column)
This method is invoked when the effective base text direction for a column
has changed.
|
void |
columnHeaderUpdated(int modelColumnIndex)
Invoke this method to notify the table that the representation of a
column header has changed.
|
void |
columnUpdated(int modelColumnIndex)
Invoke this method to notify the table that the representation of a
column has changed.
|
protected void |
componentOrientationChanged(ComponentOrientation oldOrientation,
ComponentOrientation newOrientation)
This method is invoked when the component orientation of this table has
changed.
|
protected ListSelectionModel |
createDefaultSelectionModel()
Creates and returns a default selection model for this table.
|
protected JTableHeader |
createDefaultTableHeader()
Returns the default header component for the table.
|
boolean |
editCellAt(int row,
int column)
Starts editing the cell at
row and column ,
if the cell is editable. |
boolean |
editCellAt(int row,
int column,
EventObject e)
Starts editing the cell at row and column , if the cell is editable.
|
void |
ganttModelChanged(GanttModelChangedEvent event)
Invoked by the Gantt configuration when the data model has been
replaced.
|
int |
getBaseTextDirection()
Returns the base text direction for this table.
|
TableColumn |
getColumn(IlvJTableColumn column)
Returns the
TableColumn object that is rendering the
data in the specified IlvJTableColumn . |
TableColumn |
getColumn(int viewColumnIndex)
Returns the
TableColumn object that is rendering the
data in the column at viewColumnIndex in the display. |
int |
getColumnBaseTextDirection(IlvJTableColumn column)
Returns the base text direction for a column.
|
int |
getColumnBaseTextDirection(int viewColumnIndex)
Returns the base text direction for a column.
|
int |
getColumnIndex(IlvJTableColumn column)
Returns the index of the column in the view that is displaying the
data from column.
|
int |
getColumnIndex(Object identifier)
Returns the index of the first column in the view whose identifier is
equal to identifier, when compared using
equals() . |
int |
getColumnIndex(TableColumn column)
Returns the index of the column in the view that is displaying the
data from column.
|
int |
getEditingRow()
Workaround for the
BasicTableUI anomaly. |
IlvJTableHeader |
getHeader()
Returns the header component used by the table.
|
Dimension |
getMaximumSize()
Returns the maximum allowed size of this table.
|
Dimension |
getMinimumSize()
Returns the minimum size of this table.
|
IlvHierarchyNode |
getNode(int rowIndex)
Gets the row that is visible on the specified row index.
|
int |
getParentBaseTextDirection()
Returns the base text direction that this table considers as coming
from its parent component.
|
Dimension |
getPreferredSize()
Returns the preferred size of this table.
|
int |
getResolvedBaseTextDirection()
Returns the resolved base text direction.
|
int |
getResolvedColumnBaseTextDirection(IlvJTableColumn column)
Returns the resolved base text direction of a column.
|
int |
getResolvedColumnBaseTextDirection(int viewColumnIndex)
Returns the resolved base text direction of a column.
|
IlvJTableColumn |
getTableColumn(int viewColumnIndex)
Returns the
IlvJTableColumn whose data is being rendered in
the column at viewColumnIndex in the display. |
IlvJTableColumn |
getTableColumn(Object identifier)
Returns the first
IlvJTableColumn in the view whose identifier
is equal to identifier , when compared using
equals() . |
IlvJTableColumn |
getTableColumn(TableColumn column)
Returns the
IlvJTableColumn whose data is being rendered by
the specified column . |
Point |
getToolTipLocation(MouseEvent event)
Returns the tooltip location in the coordinate system of the table.
|
IlvJTable.ToolTipPolicy |
getToolTipPolicy()
Returns the table tooltip policy.
|
String |
getToolTipText(MouseEvent event)
Returns the string to be used as the tooltip for the specified mouse
event.
|
IlvTreeColumn |
getTreeColumn(int viewColumnIndex)
Returns the
IlvTreeColumn whose data is being rendered in the
column at viewColumnIndex in the display. |
IlvTreeColumn |
getTreeColumn(Object identifier)
Returns the first
IlvTreeColumn in the view whose identifier
is equal to identifier , when compared using
equals() . |
IlvTreeColumn |
getTreeColumn(TableColumn column)
Returns the
IlvTreeColumn whose data is being rendered by the
specified column . |
com.ibm.icu.util.ULocale |
getULocale()
Returns the locale of this table.
|
void |
paintComponent(Graphics g)
Paints the contents of this table.
|
Component |
prepareEditor(TableCellEditor editor,
int row,
int column)
Prepares the editor by querying the data model for the value and
selection state of the cell at
row ,
column . |
Component |
prepareRenderer(TableCellRenderer renderer,
int row,
int column)
Prepares the renderer by querying the data model for the value and
selection state of the cell at
row ,
column . |
protected boolean |
processKeyBinding(KeyStroke ks,
KeyEvent e,
int condition,
boolean pressed)
This method is invoked to process the key bindings for
ks
as the result of the KeyEvent e . |
protected void |
processKeyEvent(KeyEvent e)
Processes key events occurring on this table.
|
protected void |
processMouseEvent(MouseEvent e)
Processes mouse events occurring on this table.
|
void |
removeColumn(IlvJTableColumn column)
Removes
column from the table. |
void |
removeColumn(Object identifier)
Removes the first column from the table whose identifier is equal to
identifier, when compared using
equals() . |
void |
removeColumn(TableColumn column)
Removes
column from the table. |
void |
removeEditor()
Discards the editor object and frees the real estate it used for
cell rendering.
|
void |
rootRowVisibilityChanged(RootRowVisibilityChangedEvent event)
This method is invoked by the
Gantt configuration when
the visibility of the root row has been changed. |
void |
rowCollapsed(RowCollapsedEvent event)
Invoked by the Gantt configuration when a node has been collapsed in
the data tree.
|
void |
rowExpanded(RowExpandedEvent event)
Invoked by the Gantt configuration when a node has been expanded in
the data tree.
|
void |
rowHeightChanged(RowHeightChangedEvent event)
This method is invoked by the
Gantt
configuration when the row height has been changed. |
void |
rowMoved(RowMovedEvent event)
Invoked by the Gantt configuration when a node has been moved within
the data tree.
|
void |
rowsInserted(RowsInsertedEvent event)
Invoked by the Gantt configuration when children have been inserted
into a common parent node in the data tree.
|
void |
rowsRemoved(RowsRemovedEvent event)
Invoked by the Gantt configuration when children have been removed
from a common parent node in the data tree.
|
void |
rowUpdated(IlvHierarchyNode row)
Invoke this method to notify the table that the representation of a
row has changed.
|
void |
setBaseTextDirection(int btd)
Sets the base text direction for this table.
|
void |
setColumnBaseTextDirection(IlvJTableColumn column,
int btd)
Sets the base text direction for a column.
|
void |
setColumnBaseTextDirection(int viewColumnIndex,
int btd)
Sets the base text direction for a column.
|
void |
setComponentOrientation(ComponentOrientation o)
Sets the component orientation of this table.
|
void |
setExpandableGanttConfigurationImpl(IlvGanttConfiguration ganttConfig)
Sets the Gantt configuration that this UI component is coordinating
with.
|
void |
setLocale(Locale locale)
Sets the locale of this component.
|
void |
setParentBaseTextDirection(int btd)
Sets the base text direction that this table considers as coming
from its parent component.
|
void |
setToolTipPolicy(IlvJTable.ToolTipPolicy policy)
Sets the table tooltip policy.
|
void |
setULocale(com.ibm.icu.util.ULocale locale)
Sets the locale of this component.
|
void |
updateUI()
This method is a notification that the L&F has changed and is
overridden to forward the message to all columns in the table.
|
void |
validateRowHeights()
Ensures that the heights of all rows are up-to-date.
|
addColumnSelectionInterval, addNotify, addRowSelectionInterval, changeSelection, clearSelection, columnAdded, columnAtPoint, columnMarginChanged, columnMoved, columnRemoved, columnSelectionChanged, configureEnclosingScrollPane, convertColumnIndexToModel, convertColumnIndexToView, convertRowIndexToModel, convertRowIndexToView, createDefaultColumnModel, createDefaultColumnsFromModel, createDefaultDataModel, createDefaultEditors, createDefaultRenderers, createScrollPaneForTable, doLayout, editingCanceled, editingStopped, getAccessibleContext, getAutoCreateColumnsFromModel, getAutoCreateRowSorter, getAutoResizeMode, getCellEditor, getCellEditor, getCellRect, getCellRenderer, getCellSelectionEnabled, getColumn, getColumnClass, getColumnCount, getColumnModel, getColumnName, getColumnSelectionAllowed, getDefaultEditor, getDefaultRenderer, getDragEnabled, getDropLocation, getDropMode, getEditingColumn, getEditorComponent, getFillsViewportHeight, getGridColor, getIntercellSpacing, getModel, getPreferredScrollableViewportSize, getPrintable, getRowCount, getRowHeight, getRowHeight, getRowMargin, getRowSelectionAllowed, getRowSorter, getScrollableBlockIncrement, getScrollableTracksViewportHeight, getScrollableTracksViewportWidth, getScrollableUnitIncrement, getSelectedColumn, getSelectedColumnCount, getSelectedColumns, getSelectedRow, getSelectedRowCount, getSelectedRows, getSelectionBackground, getSelectionForeground, getSelectionModel, getShowHorizontalLines, getShowVerticalLines, getSurrendersFocusOnKeystroke, getTableHeader, getUI, getUIClassID, getUpdateSelectionOnSort, getValueAt, initializeLocalVars, isCellEditable, isCellSelected, isColumnSelected, isEditing, isRowSelected, moveColumn, paramString, print, print, print, print, print, removeColumnSelectionInterval, removeNotify, removeRowSelectionInterval, resizeAndRepaint, rowAtPoint, selectAll, setAutoCreateColumnsFromModel, setAutoCreateRowSorter, setAutoResizeMode, setCellEditor, setCellSelectionEnabled, setColumnModel, setColumnSelectionAllowed, setColumnSelectionInterval, setDefaultEditor, setDefaultRenderer, setDragEnabled, setDropMode, setEditingColumn, setEditingRow, setFillsViewportHeight, setGridColor, setIntercellSpacing, setModel, setPreferredScrollableViewportSize, setRowHeight, setRowHeight, setRowMargin, setRowSelectionAllowed, setRowSelectionInterval, setRowSorter, setSelectionBackground, setSelectionForeground, setSelectionMode, setSelectionModel, setShowGrid, setShowHorizontalLines, setShowVerticalLines, setSurrendersFocusOnKeystroke, setTableHeader, setUI, setUpdateSelectionOnSort, setValueAt, sizeColumnsToFit, sizeColumnsToFit, sorterChanged, tableChanged, unconfigureEnclosingScrollPane, valueChanged
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, hide, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isOptimizedDrawingEnabled, isPaintingForPrint, isPaintingOrigin, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, 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
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, transferFocusDownCycle, validate, validateTree
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, 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, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusBackward, transferFocusUpCycle
public int getColumnIndex(Object identifier)
equals()
.identifier
- The column identifier object.IllegalArgumentException
- if identifier is
null
or no column has this identifier.public int getColumnIndex(TableColumn column)
column
- The column.public int getColumnIndex(IlvJTableColumn column)
column
- The column.public TableColumn getColumn(int viewColumnIndex)
TableColumn
object that is rendering the
data in the column at viewColumnIndex in the display.viewColumnIndex
- The column index, an integer in the range
0 .. getColumnCount()-1
.public TableColumn getColumn(IlvJTableColumn column)
TableColumn
object that is rendering the
data in the specified IlvJTableColumn
. This method is
equivalent to column.getColumn()
.column
- The column.public IlvJTableColumn getTableColumn(int viewColumnIndex)
IlvJTableColumn
whose data is being rendered in
the column at viewColumnIndex in the display.viewColumnIndex
- The column index, an integer in the range
0 .. getColumnCount()-1
.public IlvJTableColumn getTableColumn(Object identifier)
IlvJTableColumn
in the view whose identifier
is equal to identifier , when compared using
equals()
.identifier
- The column identifier object.IllegalArgumentException
- if identifier is
null
or no column has this identifier.public IlvJTableColumn getTableColumn(TableColumn column)
IlvJTableColumn
whose data is being rendered by
the specified column .column
- The column.public IlvTreeColumn getTreeColumn(int viewColumnIndex)
IlvTreeColumn
whose data is being rendered in the
column at viewColumnIndex in the display.viewColumnIndex
- The column index, an integer in the range
0 .. getColumnCount()-1
.null
if the column at viewColumnIndex
is not rendered as a tree.public IlvTreeColumn getTreeColumn(Object identifier)
IlvTreeColumn
in the view whose identifier
is equal to identifier , when compared using
equals()
.identifier
- The column identifier object.null
if the specified column is not a tree
column.IllegalArgumentException
- if identifier is
null
or no column has this identifier.public IlvTreeColumn getTreeColumn(TableColumn column)
IlvTreeColumn
whose data is being rendered by the
specified column .column
- The column.null
if the column is not a
tree column.public void addColumn(TableColumn aColumn)
UnsupportedOperationException
. Directly adding a
TableColumn
to an IlvJTable
is not
supported. Use addColumn(IlvJTableColumn)
instead.addColumn
in class JTable
UnsupportedOperationException
public void addColumn(IlvJTableColumn column)
column
- The column definition.public void removeColumn(TableColumn column)
column
from the table. This method is
overridden to properly remove column
's corresponding
IlvJTableColumn
as well.removeColumn
in class JTable
column
- The TableColumn
to be removed.public void removeColumn(IlvJTableColumn column)
column
from the table.column
- The IlvJTableColumn
to be removed.public void removeColumn(Object identifier)
equals()
.identifier
- The column identifier object.IllegalArgumentException
- if identifier is
null
or no column has this identifier.public com.ibm.icu.util.ULocale getULocale()
ULocale
.setULocale(ULocale)
public void setULocale(com.ibm.icu.util.ULocale locale)
locale
- An ICU ULocale
, or null
if this
component shall inherit its locale from the parent component.getULocale()
,
setLocale(Locale)
public void setLocale(Locale locale)
setLocale
in class Component
locale
- An Locale
, or null
if this
component shall inherit its locale from the parent component.setULocale(ULocale)
public void setComponentOrientation(ComponentOrientation o)
setComponentOrientation
in class Component
o
- The orientation for this table.protected void componentOrientationChanged(ComponentOrientation oldOrientation, ComponentOrientation newOrientation)
oldOrientation
- The component orientation before the change.newOrientation
- The component orientation after the change.Component.getComponentOrientation()
,
setComponentOrientation(ComponentOrientation)
public final int getBaseTextDirection()
The base text direction influences the display of text strings that are composed of segments that are read from left to right as well as of segments that are read from right to left. It determines the order of these segments.
IlvBidiUtil.COMPONENT_DIRECTION
,
IlvBidiUtil.CONTEXTUAL_DIRECTION
,
IlvBidiUtil.LEFT_TO_RIGHT
,
IlvBidiUtil.RIGHT_TO_LEFT
,
IlvBidiUtil.INHERITED_DIRECTION
.setBaseTextDirection(int)
,
getResolvedBaseTextDirection()
public void setBaseTextDirection(int btd)
The base text direction influences the display of text strings that are composed of segments that are read from left to right as well as of segments that are read from right to left. It determines the order of these segments.
Possible values are:
IlvBidiUtil.COMPONENT_DIRECTION
,
IlvBidiUtil.CONTEXTUAL_DIRECTION
,
IlvBidiUtil.LEFT_TO_RIGHT
, IlvBidiUtil.RIGHT_TO_LEFT
,
and IlvBidiUtil.INHERITED_DIRECTION
.
btd
- The base text direction.getBaseTextDirection()
public final int getParentBaseTextDirection()
This method exists for internal purposes. You should not invoke it directly.
IlvBidiUtil.COMPONENT_DIRECTION
,
IlvBidiUtil.CONTEXTUAL_DIRECTION
,
IlvBidiUtil.LEFT_TO_RIGHT
,
IlvBidiUtil.RIGHT_TO_LEFT
.setParentBaseTextDirection(int)
,
getResolvedBaseTextDirection()
public void setParentBaseTextDirection(int btd)
This method exists for internal purposes. You should not invoke it directly.
Possible values are:
IlvBidiUtil.COMPONENT_DIRECTION
,
IlvBidiUtil.CONTEXTUAL_DIRECTION
,
IlvBidiUtil.LEFT_TO_RIGHT
, and IlvBidiUtil.RIGHT_TO_LEFT
.
btd
- The base text direction of the parent component.getParentBaseTextDirection()
public int getResolvedBaseTextDirection()
The base text direction influences the display of text strings that are composed of segments that are read from left to right as well as of segments that are read from right to left. It determines the order of these segments.
This method is based on getBaseTextDirection()
but determines
the value when it is inherited from a parent component
(IlvBidiUtil.INHERITED_DIRECTION
) or dependent on
the component orientation (IlvBidiUtil.COMPONENT_DIRECTION
).
IlvBidiUtil.CONTEXTUAL_DIRECTION
,
IlvBidiUtil.LEFT_TO_RIGHT
,
IlvBidiUtil.RIGHT_TO_LEFT
.protected void baseTextDirectionChanged()
getResolvedBaseTextDirection()
has
changed, orgetComponentOrientation()
has changed
and the value of getResolvedBaseTextDirection()
is
IlvBidiUtil.CONTEXTUAL_DIRECTION
.public int getColumnBaseTextDirection(IlvJTableColumn column)
The base text direction influences the display of text strings that are composed of segments that are read from left to right as well as of segments that are read from right to left. It determines the order of these segments.
This implementation works for columns that are instances of
IlvAbstractJTableColumn
.
column
- A column of this table.IlvBidiUtil.COMPONENT_DIRECTION
,
IlvBidiUtil.CONTEXTUAL_DIRECTION
,
IlvBidiUtil.LEFT_TO_RIGHT
,
IlvBidiUtil.RIGHT_TO_LEFT
,
IlvBidiUtil.INHERITED_DIRECTION
.getColumnBaseTextDirection(int)
,
setColumnBaseTextDirection(IlvJTableColumn, int)
,
getResolvedColumnBaseTextDirection(IlvJTableColumn)
public final int getColumnBaseTextDirection(int viewColumnIndex)
The base text direction influences the display of text strings that are composed of segments that are read from left to right as well as of segments that are read from right to left. It determines the order of these segments.
This implementation works for columns that are instances of
IlvAbstractJTableColumn
.
viewColumnIndex
- A column index, an integer in the range
0 .. getColumnCount()-1
.IlvBidiUtil.COMPONENT_DIRECTION
,
IlvBidiUtil.CONTEXTUAL_DIRECTION
,
IlvBidiUtil.LEFT_TO_RIGHT
,
IlvBidiUtil.RIGHT_TO_LEFT
,
IlvBidiUtil.INHERITED_DIRECTION
.getColumnBaseTextDirection(IlvJTableColumn)
,
setColumnBaseTextDirection(int, int)
,
getResolvedColumnBaseTextDirection(int)
public void setColumnBaseTextDirection(IlvJTableColumn column, int btd)
The base text direction influences the display of text strings that are composed of segments that are read from left to right as well as of segments that are read from right to left. It determines the order of these segments.
Possible values are:
IlvBidiUtil.COMPONENT_DIRECTION
,
IlvBidiUtil.CONTEXTUAL_DIRECTION
,
IlvBidiUtil.LEFT_TO_RIGHT
, IlvBidiUtil.RIGHT_TO_LEFT
,
and IlvBidiUtil.INHERITED_DIRECTION
.
IlvBidiUtil.INHERITED_DIRECTION
means that the column independent
base text direction of this table will be used.
This implementation works for columns that are instances of
IlvAbstractJTableColumn
. Otherwise this method does nothing.
column
- A column of this table.btd
- The base text direction.setColumnBaseTextDirection(int, int)
,
getColumnBaseTextDirection(IlvJTableColumn)
public void setColumnBaseTextDirection(int viewColumnIndex, int btd)
The base text direction influences the display of text strings that are composed of segments that are read from left to right as well as of segments that are read from right to left. It determines the order of these segments.
Possible values are:
IlvBidiUtil.COMPONENT_DIRECTION
,
IlvBidiUtil.CONTEXTUAL_DIRECTION
,
IlvBidiUtil.LEFT_TO_RIGHT
, IlvBidiUtil.RIGHT_TO_LEFT
,
and IlvBidiUtil.INHERITED_DIRECTION
.
IlvBidiUtil.INHERITED_DIRECTION
means that the column independent
base text direction of this table will be used.
This implementation works for columns that are instances of
IlvAbstractJTableColumn
. Otherwise this method does nothing.
viewColumnIndex
- A column index, an integer in the range
0 .. getColumnCount()-1
.btd
- The base text direction.setColumnBaseTextDirection(IlvJTableColumn, int)
,
getColumnBaseTextDirection(int)
public int getResolvedColumnBaseTextDirection(IlvJTableColumn column)
The base text direction influences the display of text strings that are composed of segments that are read from left to right as well as of segments that are read from right to left. It determines the order of these segments.
This method is based on getColumnBaseTextDirection(int)
but
determines the value when it is inherited from the table
(IlvBidiUtil.INHERITED_DIRECTION
) or dependent on
the component orientation (IlvBidiUtil.COMPONENT_DIRECTION
).
column
- A column of this table.IlvBidiUtil.CONTEXTUAL_DIRECTION
,
IlvBidiUtil.LEFT_TO_RIGHT
,
IlvBidiUtil.RIGHT_TO_LEFT
.public int getResolvedColumnBaseTextDirection(int viewColumnIndex)
The base text direction influences the display of text strings that are composed of segments that are read from left to right as well as of segments that are read from right to left. It determines the order of these segments.
This method is based on getColumnBaseTextDirection(int)
but
determines the value when it is inherited from the table
(IlvBidiUtil.INHERITED_DIRECTION
) or dependent on
the component orientation (IlvBidiUtil.COMPONENT_DIRECTION
).
viewColumnIndex
- A column index, an integer in the range
0 .. getColumnCount()-1
.IlvBidiUtil.CONTEXTUAL_DIRECTION
,
IlvBidiUtil.LEFT_TO_RIGHT
,
IlvBidiUtil.RIGHT_TO_LEFT
.protected void columnBaseTextDirectionChanged(IlvJTableColumn column)
getResolvedColumnBaseTextDirection(viewColumnIndex)
has
changed, orgetComponentOrientation()
has changed
and the value of
getResolvedColumnBaseTextDirection(viewColumnIndex)
is
IlvBidiUtil.CONTEXTUAL_DIRECTION
.column
- A column of this table.protected void processKeyEvent(KeyEvent e)
KEY_TYPED
events being generated for certain ALT and CTRL key combinations.
These keystrokes generate the appropriate KEY_PRESSED
and KEY_RELEASED
events, but should not generate
KEY_TYPED
events since they do not represent normal,
alphanumeric characters. In JDKs prior to v1.3, JTable
initiates cell editing whenever a KEY_TYPED
event
occurs. Therefore, the effect of this bug on JTable
is
that keystrokes potentially associated with accelerators or keyboard
actions will also be entered into the current cell editor.
This method works around this bug by consuming all
KEY_TYPED
events that have either an ALT or CTRL
modifier. It then invokes super
for all other key
events. This succeeds because JComponent.processKeyEvent
handles key events in the following sequence. Once the event is
handled and consumed it is not dispatched to objects further down the
list:
KeyListeners
registered with the component are
given a chance to handle the event next. In the case of
JTable
prior to JDK 1.3, its BasicTableUI
delegate installs a key listener that converts all
KEY_TYPED
events into potential cell editing actions.
If editing is not currently occurring, the key listener asks the cell
editor whether editing can begin. Unfortunately, it passes
null
as the event argument to
TableCellEditor.isCellEditable(event)
. This means that
we cannot modify the cell editor to selectively enable editing only
upon alphanumeric keystrokes.processComponentKeyEvent
method is
invoked next. In the case of JTable
, this method does
nothing.KEY_PRESSED
and KEY_RELEASED
events
only. Therefore, if we consume an ALT or CTRL KEY_TYPED
event, its corresponding KEY_PRESSED
and
KEY_RELEASED
events will still be handled as an
accelerator.processKeyEvent
in class JComponent
e
- The key event.protected boolean processKeyBinding(KeyStroke ks, KeyEvent e, int condition, boolean pressed)
ks
as the result of the KeyEvent
e
. This
method is overridden to workaround JavaSoft bug #4353669, which says
that JTable.processKeyBinding
does not pass the key
event to the editCellAt(int,int)
method and then to the
TableCellEditor
'sisCellEditable
method.processKeyBinding
in class JTable
ks
- The keystroke.e
- The key event.condition
- One of the following values:
JComponent.WHEN_FOCUSED
JComponent.WHEN_ANCESTOR_OF_FOCUSED_COMPONENT
JComponent.WHEN_IN_FOCUSED_WINDOW
pressed
- Indicates whether the key is pressed.true
if there was a binding to an action and
the action was enabled.public boolean editCellAt(int row, int column)
row
and column
,
if the cell is editable. This method is overridden to workaround
JavaSoft bug #4353669, which says that
JTable.processKeyBinding
does not pass the
key event to this method and then to the TableCellEditor
'sisCellEditable
method.editCellAt
in class JTable
row
- The row to be edited.column
- The column to be edited.public boolean editCellAt(int row, int column, EventObject e)
editCellAt
in class JTable
row
- The row to be edited.column
- The column to be edited.e
- The event to pass into shouldSelectCell
.false
if for any reason the cell cannot be edited.public void removeEditor()
removeEditor
in class JTable
public Component prepareRenderer(TableCellRenderer renderer, int row, int column)
row
,
column
. This method is overridden to set the component
orientation of the renderer to meet the base text direction of the
table or to match the component orientation of the table.prepareRenderer
in class JTable
renderer
- The TableCellRenderer
to prepare.row
- The row of the cell to render.column
- The column of the cell to render.public Component prepareEditor(TableCellEditor editor, int row, int column)
row
,
column
. This method is overridden to set the component
orientation of the editor to meet the base text direction of the
table or to match the component orientation of the table.prepareEditor
in class JTable
editor
- The TableCellEditor
to prepare.row
- The row of the cell to edit.column
- The column of the cell to edit.protected ListSelectionModel createDefaultSelectionModel()
DefaultSelectionModel
inner class. The purpose of this
special selection model is to not extend the selection when rows are
inserted adjacent to an already selected row, which is the behavior of
the Swing DefaultListSelectionModel
code.createDefaultSelectionModel
in class JTable
public int getEditingRow()
BasicTableUI
anomaly. Make sure the
UI never tries to paint the editor. The UI currently uses different
techniques to paint the renderers and editors and overriding
setBounds()
is not the right thing to do for an editor.
Returning -1 for the editing row in this case, ensures the editor is
never painted.getEditingRow
in class JTable
public void updateUI()
public IlvJTableHeader getHeader()
protected JTableHeader createDefaultTableHeader()
IlvJTableHeader
.createDefaultTableHeader
in class JTable
public IlvJTable.ToolTipPolicy getToolTipPolicy()
null
, then the
standard JTable
policy for displaying tooltips is used.
That is, the getToolTipText
method of the cell renderer
is called if it is a Swing component. If the cell renderer has no
tooltip, then any tooltip that has been globally set on the table by
calling its setToolTipText
method is returned. The
position of the tooltip in this case will be determined by the Swing
ToolTipManager
.
The default value is an instance of IlvJTable.DefaultToolTipPolicy
.
setToolTipPolicy(ilog.views.gantt.swing.IlvJTable.ToolTipPolicy)
public void setToolTipPolicy(IlvJTable.ToolTipPolicy policy)
policy
- The tooltip policy. If null
, then the
standard JTable
policy for displaying tooltips
is used. That is, the getToolTipText
method of
the the cell render is called if it is a Swing component. If
the cell renderer has no tooltip, then any tooltip that has
been globally set on the table by calling its
setToolTipText
method is returned. The
position of the tooltip in this case will be determined by
the Swing ToolTipManager
.getToolTipPolicy()
public String getToolTipText(MouseEvent event)
JTable
policy for displaying tooltips is used. That is, the
getToolTipText
method of the cell renderer is called if
it is a Swing component. If the cell renderer has no tooltip, then any
tooltip that has been globally set on the table by calling its
setToolTipText
method is returned. The position of the
tooltip in this case will be determined by the Swing
ToolTipManager
.getToolTipText
in class JTable
event
- The mouse event that caused the
ToolTipManager
to show the tooltip.public Point getToolTipLocation(MouseEvent event)
JTable
policy for
displaying tooltips is used. That is, the position of the tooltip will
be determined by the Swing ToolTipManager
.getToolTipLocation
in class JComponent
event
- The mouse event that caused the
ToolTipManager
to show the tooltip.public void cellUpdated(IlvHierarchyNode row, int modelColumnIndex)
row
- The row of the cell for which the visual representation has
changed.modelColumnIndex
- The column index within the data model of the
cell for which the visual representation has changed.public void columnHeaderUpdated(int modelColumnIndex)
modelColumnIndex
- The index within the data model of the column
for which the header has changed.public void columnUpdated(int modelColumnIndex)
modelColumnIndex
- The index within the data model of the column
for which the visual representation has changed.public void rowUpdated(IlvHierarchyNode row)
row
- The row for which the visual representation has changed.public void setExpandableGanttConfigurationImpl(IlvGanttConfiguration ganttConfig)
addVerticalExpandable()
method. The expandable component should initially synchronize its
display with the Gantt configuration at this point. Note, however,
that the Gantt configuration may or may not have a valid data model at
this time and this must be taken into account. The expandable will be
subsequently informed when a data model is set or replaced through the
ganttModelChanged
event.
Warning: This method is considered to be part of an
IlvVerticalExpandable
's internal implementation and is
not a public API. Only the Gantt configuration should invoke this
method.
setExpandableGanttConfigurationImpl
in interface IlvVerticalExpandable
ganttConfig
- The Gantt configuration that this component is
being added to, or null
if this component is
being removed from its Gantt configuration.IlvGanttConfiguration.addVerticalExpandable(ilog.views.gantt.IlvVerticalExpandable)
public void ganttModelChanged(GanttModelChangedEvent event)
null
root
node). However, separate rowsInserted
or
rowsRemoved
events will not be invoked by
the Gantt configuration as a result of the data model change being
reported.ganttModelChanged
in interface IlvVerticalExpandable
event
- The event.public void validateRowHeights()
validateRowHeights
in interface IlvVerticalExpandable
public Dimension getPreferredSize()
getPreferredSize
in class JComponent
public Dimension getMinimumSize()
getMinimumSize
in class JComponent
public Dimension getMaximumSize()
getMaximumSize
in class JComponent
public void paintComponent(Graphics g)
paintComponent
in class JComponent
public void rowsInserted(RowsInsertedEvent event)
ActivitiesInsertedEvent
or
ResourcesInsertedEvent
, but with additional visibility
information about the inserted nodes. All, some, or none of the newly
inserted nodes into the data model may actually be visible.rowsInserted
in interface VerticalExpansionListener
event
- The event.ActivitiesInsertedEvent
,
ResourcesInsertedEvent
public void rowsRemoved(RowsRemovedEvent event)
ActivitiesRemovedEvent
or
ResourcesRemovedEvent
, but with additional visibility
information about the deleted nodes. All, some, or none of the nodes
removed from the data model may have been visible.rowsRemoved
in interface VerticalExpansionListener
event
- The event.ActivitiesRemovedEvent
,
ResourcesRemovedEvent
public void rowMoved(RowMovedEvent event)
ActivityMovedEvent
or ResourceMovedEvent
, but with additional visibility
information about the node that was moved.rowMoved
in interface VerticalExpansionListener
event
- The event.ActivityMovedEvent
,
ResourceMovedEvent
public void rowExpanded(RowExpandedEvent event)
rowExpanded
in interface VerticalExpansionListener
event
- The event.public void rowCollapsed(RowCollapsedEvent event)
rowCollapsed
in interface VerticalExpansionListener
event
- The event.public void rowHeightChanged(RowHeightChangedEvent event)
Gantt
configuration
when the row height has been changed.rowHeightChanged
in interface VerticalExpansionListener
event
- The event.public void rootRowVisibilityChanged(RootRowVisibilityChangedEvent event)
Gantt configuration
when
the visibility of the root row has been changed.rootRowVisibilityChanged
in interface VerticalExpansionListener2
event
- The event.public IlvHierarchyNode getNode(int rowIndex)
null
is returnedrowIndex
- The row index.null
if
rowIndex < 0
or rowIndex >=
getRowCount()
.protected void processMouseEvent(MouseEvent e)
processMouseEvent
in class JComponent
e
- the mouse event© Copyright 2024 Rogue Wave Software, Inc., a Perforce company.. All Rights Reserved.