JClass DesktopViews 6.3.0 API
Documentation

com.klg.jclass.table
Class JCTable

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Container
              |
              +--javax.swing.JComponent
                    |
                    +--com.klg.jclass.table.JCTable
All Implemented Interfaces:
ActionListener, EventListener, FocusListener, ImageObserver, MenuContainer, Serializable
Direct Known Subclasses:
JCListTable, JCPrintTable, LiveTable, Table

public class JCTable
extends JComponent
implements ActionListener, FocusListener

The core JClass LiveTable class; JCTable is the base class for all the Beans, and contains the majority of the programmatic API for JClass LiveTable.

See Also:
Serialized Form

Nested Class Summary
 
Nested classes inherited from class javax.swing.JComponent
JComponent.AccessibleJComponent
 
Nested classes inherited from class java.awt.Container
Container.AccessibleAWTContainer
 
Nested classes inherited from class java.awt.Component
Component.AccessibleAWTComponent, Component.BltBufferStrategy, Component.FlipBufferStrategy
 
Field Summary
protected  Vector actions
           
protected  com.klg.jclass.table.AdjustmentHandler adjustmentHandler
           
protected  int allow_cell_resize
           
protected  int allow_resize_by
           
protected  boolean auto_edit
           
protected  int auto_scroll
           
protected  int cell_border_width
           
protected  com.klg.jclass.table.CellAreaHandler cellAreaHandler
           
protected  com.klg.jclass.util.JCListenerList cellDisplayListeners
           
protected  com.klg.jclass.table.CellLayoutModel cellLayout
           
protected  CellRendererPane cellRendererPane
           
protected  com.klg.jclass.table.SeriesModel cellStyles
           
protected  boolean column_label_display
           
protected  int column_label_offset
           
protected  int column_label_placement
           
protected  com.klg.jclass.table.RowColumnSeriesModel columnWidths
           
protected  int component_border_width
           
protected  int current_column
           
protected  int current_row
           
protected  com.klg.jclass.table.DataViewModel dataView
           
protected  com.klg.jclass.table.CellStyleModel default_cell_style
           
protected  com.klg.jclass.table.CellStyleModel default_label_style
           
protected  int edit_height_policy
           
protected  int edit_width_policy
           
protected  com.klg.jclass.util.JCListenerList editCellListeners
           
protected  Color focus_color
           
protected  int focus_indicator
           
protected  com.klg.jclass.table.FocusModel focusManager
           
protected  com.klg.jclass.table.CellBorderModel frame_border
           
protected  int frame_border_width
           
protected  int frozen_column_placement
           
protected  int frozen_columns
           
protected  int frozen_row_placement
           
protected  int frozen_rows
           
protected  JScrollBar hsb
           
protected  int hsb_attach
           
protected  int hsb_display
           
protected  int hsb_offset
           
protected  int hsb_position
           
protected  int hsb_track
           
protected  int hsb_track_row
           
protected  boolean ignore_container_size
           
protected  int jump_mode
           
protected  com.klg.jclass.table.KeyInputHandler keyHandler
           
protected  int left_column
           
protected  int margin_height
           
protected  int margin_width
           
protected  int min_cell_visibility
           
protected  com.klg.jclass.table.MouseInputHandler mouseHandler
           
protected  Object mouseWheelListener
           
protected  Vector moveables
           
protected  boolean needs_initial_set_left_check
           
protected  boolean needs_initial_set_top_check
           
protected  boolean needs_initial_traverse
           
protected  Component oldFocusOwner
           
protected  com.klg.jclass.util.JCListenerList paintListeners
           
protected  boolean pointer_traverse_forces_edit
           
protected  com.klg.jclass.table.TablePopupMenu popupMenu
           
protected  boolean popupMenuEnabled
           
protected  boolean repaint_enabled
           
protected  boolean resize_even
           
protected  boolean resize_interactive
           
protected  com.klg.jclass.util.JCListenerList resizeListeners
           
protected  com.klg.jclass.util.JCListenerList resizeMotionListeners
           
protected  boolean row_label_display
           
protected  int row_label_offset
           
protected  int row_label_placement
           
protected  com.klg.jclass.table.RowColumnSeriesModel rowHeights
           
protected  boolean scrolling
           
protected  com.klg.jclass.util.JCListenerList scrollListeners
           
protected  boolean select_include_labels
           
protected  Color selected_background
           
protected  int selected_background_mode
           
protected  Color selected_foreground
           
protected  int selected_foreground_mode
           
protected  com.klg.jclass.table.SelectionModel selectionHandler
           
protected  com.klg.jclass.util.JCListenerList selectListeners
           
protected  boolean set_initial_left
           
protected  boolean set_initial_top
           
protected  boolean set_left_column
           
protected  boolean set_top_row
           
protected  int sort_column
           
protected  int sort_direction
           
protected  boolean sort_series
           
protected  com.klg.jclass.util.JCListenerList sortListeners
           
protected  com.klg.jclass.table.SpanHandler spanHandler
           
protected  Image store_image
           
protected  boolean store_image_enabled
           
protected  Point store_origin
           
protected  com.klg.jclass.table.TableChangeHandler tableChangeHandler
           
protected  com.klg.jclass.table.TableLayout tableLayout
           
protected  int top_row
           
protected  Color track_background
           
protected  boolean track_cursor
           
protected  Color track_foreground
           
protected  Dimension track_size
           
protected  boolean traverse_cycle
           
protected  com.klg.jclass.util.JCListenerList traverseListeners
           
protected  com.klg.jclass.table.SeriesModel userData
           
protected  int variable_estimate_count
           
protected  int visible_columns
           
protected  int visible_rows
           
protected  JScrollBar vsb
           
protected  int vsb_attach
           
protected  int vsb_display
           
protected  int vsb_offset
           
protected  int vsb_position
           
protected  int vsb_track
           
protected  int vsb_track_column
           
 
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
JCTable()
           
 
Method Summary
 void actionPerformed(ActionEvent event)
          Processes table popup menu actions.
 void addAction(com.klg.jclass.table.ActionInitiator initiator, int action)
          Adds an ActionInitiator/action pair to table (stored in a TableAction).
 void addAction(com.klg.jclass.table.TableAction tableAction)
          Adds a TableAction to table.
 void addCellDisplayListener(com.klg.jclass.table.JCCellDisplayListener l)
          Adds the specified listener to receive instances of JCCellDisplayEvent objects.
 boolean addColumnSelection(int start_column, int end_column)
          Adds a range of columns to the current selection.
 void addEditCellListener(com.klg.jclass.table.JCEditCellListener l)
          Adds the specified listener to receive instances of JCEditCellEvent objects.
 void addNotify()
           
 void addPaintListener(com.klg.jclass.table.JCPaintListener l)
          Adds the specified listener to receive instances of JCPaintEvent objects.
 void addResizeCellListener(com.klg.jclass.table.JCResizeCellListener l)
          Adds the specified listener to receive instances of JCResizeCellEvent objects.
 void addResizeCellMotionListener(com.klg.jclass.table.JCResizeCellMotionListener l)
          Adds the specified listener to receive instances of JCResizeCellEvent objects during the resize drag process.
 boolean addRowSelection(int start_row, int end_row)
          Adds a range of rows to the current selection.
 void addScrollListener(com.klg.jclass.table.JCScrollListener l)
          Adds the specified listener to receive instances of JCScrollEvent objects.
 boolean addSelection(int start_row, int start_column, int end_row, int end_column)
          Adds a range of cells to the current selection.
 void addSelectListener(com.klg.jclass.table.JCSelectListener l)
          Adds the specified listener to receive instances of JCSelectEvent objects.
 void addSortListener(com.klg.jclass.table.JCSortListener l)
          Adds the specified listener to receive instances of JCSortEvent objects.
 void addSpannedRange(com.klg.jclass.table.JCCellRange cr)
          Adds a JCCellRange as a new spanned region.
 void addTableMouseWheelListener(Object listener)
          Adds the given MouseWheelListener to the table.
protected  void addToMoveables(Object newMoveable, Object oldMoveable)
          Adds to the moveables collection.
 void addTraverseCellListener(com.klg.jclass.table.JCTraverseCellListener l)
          Adds the specified listener to receive instances of JCTraverseCellEvent objects.
 boolean beginEdit(int row, int column)
          Initiates edit for the given cell, if the cell is editable.
 boolean cancelEdit(boolean hide)
          Cancels interactive editing of a cell and, as an option, hides the cell editor.
 void clearSelectedCells()
          Deselects all selected cells.
 void clearSelection()
          Clears all selections.
 void clearSpannedRanges()
          Removes all spanned cell ranges.
 com.klg.jclass.table.SeriesModel cloneCellStyles()
          If possible, creates a clone of the cell style container stored in this table object and returns them to the caller.
 boolean commitEdit(boolean hide)
          Commits interactive cell editing internally, saving any changes made by the user.
protected  com.klg.jclass.table.CellStyleModel createCellStyle()
          Creates a new cell style object.
protected  void createDefaultCellLayout()
          Creates the default CellLayoutModel manager.
protected  void createDefaultCellStyleSeries()
          Creates the default CellStyleModel series object.
protected  void createDefaultColumnWidthSeries()
          Creates the default column width series.
protected  void createDefaultDataSource()
          Creates the default data source with 10 rows and 5 columns.
protected  void createDefaultDataView()
          Creates the default data view manager.
protected  void createDefaultRowHeightSeries()
          Creates the default row height series.
protected  void createDefaultSelectionModel()
          Creates the default SelectionModel manager.
protected  void createDefaultSpanHandler()
          Creates the default span manager.
protected  void createDefaultUserDataSeries()
          Creates the default UserData series object.
protected  com.klg.jclass.table.TablePopupMenu createPopupMenu()
          Creates a new popup menu.
 void dispose()
          Ensures that JCTable can be disposed.
 void doLayout()
           
protected  com.klg.jclass.table.JCResizeCellEvent doResizeEvents(int row, int column, int oldWidth, int oldHeight, int newWidth, int newHeight)
          Convenience method for firing BEFORE_RESIZE and AFTER_RESIZE events.
 boolean dragColumn(int column1, int column2)
          Allows users to drag a column and drop it into a new location by remapping the internal order of columns.
 boolean dragRow(int row1, int row2)
          Allows users to drag a row and drop it into a new location by remapping the internal order of rows.
protected  Method findMethod(Class c, String methodString)
          Does passed in class have the given method name? If so, returns it.
protected  void fireJCCellDisplayEvent(com.klg.jclass.table.JCCellDisplayEvent event)
          Convenience method for firing JCCellDisplayEvents.
protected  void fireJCEditCellEvent(com.klg.jclass.table.JCEditCellEvent event)
          Convenience method for firing JCEditCellEvents.
protected  void fireJCPaintEvent(com.klg.jclass.table.JCPaintEvent event)
          Convenience method for firing JCPaintEvents.
protected  void fireJCResizeCellEvent(com.klg.jclass.table.JCResizeCellEvent event)
          Convenience method for firing JCResizeCellEvents.
protected  void fireJCResizeCellMotionEvent(com.klg.jclass.table.JCResizeCellEvent event)
          Convenience method for firing JCResizeCellEvents to JCResizeCellMotionListeners.
protected  void fireJCScrollEvent(com.klg.jclass.table.JCScrollEvent event)
          Convenience method for firing JCScrollEvents.
protected  void fireJCSelectEvent(com.klg.jclass.table.JCSelectEvent event)
          Convenience method for firing JCSelectEvents.
protected  void fireJCSortEvent(com.klg.jclass.table.JCSortEvent event)
          Convenience method for firing JCSortEvents.
protected  void fireJCTraverseCellEvent(com.klg.jclass.table.JCTraverseCellEvent event)
          Convenience method for firing JCTraverseCellEvents.
 void focusGained(FocusEvent event)
          This method gets called when table gains focus.
 void focusLost(FocusEvent event)
          This method gets called when table loses focus.
 int getAction(AWTEvent event, int row, int column)
          Returns the action mapped to the given event.
 int getAllowCellResize()
          Gets the table's AllowCellResize value.
 int getAllowResizeBy()
          Gets the table's AllowResizeBy value to determine whether row height and column width can be resized by labels, cells, or both.
 int getAutoScroll()
          Gets the table's AutoScroll value.
 com.klg.jclass.table.CellAreaHandler getCellAreaHandler()
          Returns the CellArea handler, which manages the creation and removal of CellAreas within the table.
 int getCellBorderWidth()
          Gets the table's CellBorderWidth value.
 Rectangle getCellBounds(int row, int column)
          Returns the bounds of a cell.
 com.klg.jclass.table.CellLayoutModel getCellLayout()
          Returns the CellLayout manager.
 Point getCellPosition(int row, int column)
          Returns the position of the top-left corner of a cell.
 com.klg.jclass.table.CellStyleModel getCellStyle(int row, int column)
          Gets the cell's CellStyleModel value.
 Collection getCellStyleRanges(com.klg.jclass.table.CellStyleModel style)
          Returns a Collection of JCCellRanges that use the given CellStyleModel.
 Collection getCellStyles()
          Returns a unique Collection of CellStyleModel instances used in table.
 List getCellStyleValues()
          Returns a list of CellStyle series values.
 int getCharHeight(int row)
          Returns the CharHeight value for a row.
 int getCharWidth(int column)
          Returns the CharWidth value for a column.
protected  com.klg.jclass.table.CellSize getColumnCellSize(int column)
          Returns the CellSize object for a column.
protected  Class getColumnClass(int column)
          Databound subclasses of table can override this method to return the correct datatype for the column.
 int getColumnLabelOffset()
          Gets the table's ColumnLabelOffset value.
 int getColumnLabelPlacement()
          Gets the table's ColumnLabelPlacement value.
 int getColumnPixelWidth(int column)
          Returns the actual pixel width for a column.
 List getColumnWidthValues()
          Returns a list of column width series values.
 Component getComponent(int row, int column)
          Gets the Component located at the given cell.
 int getComponentBorderWidth()
          Returns the spacing between the border of a cell and a cell component.
protected  com.klg.jclass.table.ComponentModel getComponentModel()
          Returns the component handler which manages components in cells.
 com.klg.jclass.table.JCCellPosition getCurrentCell()
          Gets the current cell in the table.
 int getCurrentColumn()
          Gets the current column in the table.
 int getCurrentRow()
          Gets the current row in the table.
 com.klg.jclass.table.TableDataModel getDataSource()
          Returns the table data source.
 com.klg.jclass.table.DataViewModel getDataView()
          Returns the data view which controls access to data and table notification when data changes.
 com.klg.jclass.table.CellStyleModel getDefaultCellStyle()
          Returns the default cell style, if set.
 com.klg.jclass.table.CellStyleModel getDefaultLabelStyle()
          Returns the default label style, if set.
 int getEditHeightPolicy()
          Returns the vertical sizing policy for cell editors.
 Component getEditingComponent()
          Gets the component associated with the currently displayed editor.
 com.klg.jclass.table.EditTraverseHandler getEditTraverseHandler()
          Returns the edit handler for the table, which manages editors within cells.
 int getEditWidthPolicy()
          Returns the horizontal sizing policy for cell editors.
 Color getFocusColor()
          Returns the focus color.
 int getFocusIndicator()
          Returns the focus indicator type.
 com.klg.jclass.table.FocusModel getFocusManager()
          Returns the current FocusManager.
 com.klg.jclass.table.CellBorderModel getFrameBorder()
          Gets the table's FrameBorderWidth value as a CellBorderModel.
 int getFrameBorderWidth()
          Gets the table's FrameBorderWidth value.
 int getFrozenColumnPlacement()
          Gets the table's FrozenColumnPlacement value.
 int getFrozenColumns()
          Gets the table's FrozenColumns value.
 int getFrozenRowPlacement()
          Gets the table's FrozenRowPlacement value.
 int getFrozenRows()
          Gets the table's FrozenRows value.
 JScrollBar getHorizSB()
          Gets the horizontal scrollbar.
 int getHorizSBAttachment()
          Gets the tables HorizSBAttachment value.
 int getHorizSBDisplay()
          Gets the table's HorizSBDisplay value to determine when to display scrollbars.
 int getHorizSBOffset()
          Gets the table's HorizSBOffset value.
 int getHorizSBPosition()
          Gets the table's HorizSBPosition value.
 int getHorizSBTrack()
          Gets the table's HorizSBTrack value.
 int getHorizSBTrackRow()
          Gets the row number that determines the text to display when the track indicator is displayed.
 int getJumpScroll()
          Gets the table's JumpScroll value.
 com.klg.jclass.table.KeyInputHandler getKeyInputHandler()
          Returns the key input manager for the table.
 int getLeftColumn()
          Gets the table's LeftColumn value.
 String getLicense()
           
 int getMarginHeight()
          Gets the table's MarginHeight value.
 int getMarginWidth()
          Gets the table's MarginWidth value.
 int getMaxHeight(int row)
          Returns the MaxHeight value for a row.
 int getMaxWidth(int column)
          Returns the MaxWidth value for a column.
 int getMinCellVisibility()
          Gets the table's MinCellVisibility value.
 int getMinHeight(int row)
          Returns the MinHeight value for a row.
 Dimension getMinimumSize()
           
 int getMinWidth(int column)
          Returns the MinWidth value for a column.
 com.klg.jclass.table.MouseInputHandler getMouseInputHandler()
          Returns the mouse input manager for the table.
 int getNumColumns()
          Gets the number of columns in the table from the data source.
 int getNumRows()
          Gets the number of rows in the table from the data source.
 int getNumVisibleColumns()
          Gets the number of visible columns.
 int getNumVisibleRows()
          Gets the number of visible rows.
 int getPixelHeight(int row)
          Returns the PixelHeight value for a row, previous set using setPixelHeight.
 int getPixelWidth(int column)
          Returns the PixelWidth value for a column, previously set using setPixelWidth.
 boolean getPointerTraverseForcesEdit()
          Gets the value of the PointerTraverseForcesEdit property.
 com.klg.jclass.table.JCCellPosition getPosition(Component c)
          Returns the JCCellPosition of the given component in table.
 Dimension getPreferredSize()
           
protected  com.klg.jclass.table.CellSize getRowCellSize(int row)
          Returns copy of the CellSize object for a row.
 List getRowHeightValues()
          Returns a list of row height series values.
 int getRowLabelOffset()
          Gets the table's RowLabelOffset value.
 int getRowLabelPlacement()
          Gets the table's RowLabelPlacement value.
 int getRowPixelHeight(int row)
          Returns the actual pixel height for a row.
 Color getSelectedBackground()
          Gets the table's SelectedBackground value.
 int getSelectedBackgroundMode()
          Gets the table's SelectedBackgroundMode value.
 Collection getSelectedCells()
          Gets the table's SelectedCells value.
 Color getSelectedForeground()
          Gets the table's SelectedForeground value.
 int getSelectedForegroundMode()
          Gets the table's SelectedForegroundMode value.
 boolean getSelectIncludeLabels()
          Gets the table's SelectIncludeLabels value.
 com.klg.jclass.table.SelectionModel getSelectionModel()
          Returns the SelectionModel manager.
 int getSelectionPolicy()
          Gets the table's SelectionPolicy value.
 com.klg.jclass.table.SpanHandler getSpanHandler()
          Returns the span manager.
 com.klg.jclass.table.JCCellRange getSpannedRange(int row, int column)
          Returns a JCCellRange that represents that the spanned region contains the given row and column.
 Collection getSpannedRanges()
          Returns a Collection containing all of the spanned cell ranges.
 com.klg.jclass.table.TableLayout getTableLayout()
          Returns the TableLayout manager.
protected  int getTextHeightOffset()
          Returns the vertical offset of cell text based on the margin and border.
protected  int getTextWidthOffset()
          Returns the horizontal offset of cell text based on the margin and border.
 int getTopRow()
          Gets the table's TopRow value.
 Color getTrackBackground()
          Returns the background color of the track component.
 Color getTrackForeground()
          Returns the foreground color of the track component.
 Dimension getTrackSize()
          Returns the dimensions of the component that tracks horizontal or vertical scrollbar info.
 com.klg.jclass.table.JCTableUI getUI()
          Returns the UI for JCTable.
 String getUIClassID()
          Returns the UIClass ID for JCTable.
 com.klg.jclass.table.CellStyleModel getUniqueCellStyle(int row, int column)
          Gets a unique instance of the cell's CellStyleModel value.
 Object getUserData(int row, int column)
          Gets the cell's UserData value.
 int getVariableEstimateCount()
          Returns the number of cells to use in estimating variable pixel calculations.
 JScrollBar getVertSB()
          Gets the vertical scrollbar.
 int getVertSBAttachment()
          Gets the tables VertSBAttachment value.
 int getVertSBDisplay()
          Gets the table's VertSBDisplay value to determine when to display scrollbars.
 int getVertSBOffset()
          Gets the table's VertSBOffset value.
 int getVertSBPosition()
          Gets the table's VertSBPosition value.
 int getVertSBTrack()
          Gets the table's VertSBTrack value.
 int getVertSBTrackColumn()
          Gets the column number that determines the text to display when the track indicator is displayed.
 com.klg.jclass.table.JCCellRange getVisibleCells()
          Returns the range of scrollable cells that are currently visible.
 int getVisibleColumns()
          Gets the number of non-frozen columns visible in the table.
 int getVisibleRows()
          Gets the number of non-frozen rows visible in the table.
protected  void goToRow()
          Displays a dialog box to select a row to traverse to.
 boolean hasComponent(int row, int column)
          Returns true if the cell contains a component.
 boolean hasComponents()
          Returns true if there are components in table.
protected  void hideShowColumns(boolean hide)
          Displays a dialog box to select columns to show or hide.
 boolean isAutoEdit()
          Gets the table's AutoEdit value.
static boolean isCell(int row, int column)
          Returns true if the row and column consititute a valid cell.
 boolean isCellVisible(int row, int column)
          Returns true if the given cell is visible.
 boolean isColumnHidden(int column)
          Returns true if the column is hidden.
static boolean isColumnLabel(int row, int column)
          Returns true if the row and column consititute a valid column label.
 boolean isColumnLabelDisplay()
          Gets the table's ColumnLabelDisplay value.
 boolean isColumnVisible(int column)
          Returns true if the given column is visible.
 boolean isContentClipped(int row, int column)
          Returns true if the full content of the cell is not displayed because of the size of the cell.
 boolean isCurrentCell(int row, int column)
          Returns true if the given row and column is the current cell.
 boolean isEditable(int row, int column)
          Returns true if the given cell is editable.
 boolean isFocusTraversable()
          Overrides JComponent.isFocusTraversable and returns true, indicating that the table is a focusable component.
 boolean isIgnoreContainerSize()
          Gets the table's IgnoreContainerSize value.
static boolean isLabel(int row, int column)
          Returns true if the row and column constitute a valid label.
 boolean isPopupMenuEnabled()
          Gets the table's PopupMenuEnabled value.
protected  boolean isRecalcRequired()
          Returns true if a recalc is required.
protected  boolean isRelayoutRequired()
          Returns true if a relayout is required.
 boolean isRepaintEnabled()
          Gets the table's RepaintEnabled value.
protected  boolean isRepaintRequired()
          Returns true if repaint is required.
 boolean isResizable(int row, int column)
           
 boolean isResizeEven()
          Gets the table's ResizeEven value to determine whether all column widths or row heights are resized to the same value.
 boolean isResizeInteractive()
          Gets the table's ResizeInteractive value to determine whether table repaints during the resize of a column or row.
 boolean isRowHidden(int row)
          Returns true if the row is hidden.
static boolean isRowLabel(int row, int column)
          Returns true if the row and column constitute a valid row label.
 boolean isRowLabelDisplay()
          Gets the table's RowLabelDisplay value.
 boolean isRowVisible(int row)
          Returns true if the given row is visible.
 boolean isSelected(int row, int column)
          Determines whether the cell is selected.
 boolean isSeriesDataSorted()
          Returns true if series data (styles, cell dimensions, and so on) are maintained in sync with data when it is sorted.
 boolean isStoreImageEnabled()
          Returns true if an image of table is maintained offscreen.
 boolean isTrackCursor()
          Gets the table's TrackCursor value to determine whether the mouse pointer is being tracked as the user moves the mouse.
 boolean isTracking()
          Returns the scrollbar tracking state.
 boolean isTraversable(int row, int column)
          Returns true if the given cell is traversable.
 boolean isTraverseCycle()
          Returns the TraverseCycle value for the table.
protected  boolean isValidCell(int row, int column)
          Returns true if the given cell is valid.
 void keyPressed(KeyEvent e)
           
 void keyReleased(KeyEvent e)
           
 void keyTyped(KeyEvent e)
           
 void layoutAreas()
           
 boolean makeColumnVisible(int column)
          Scrolls a column so it is visible on the screen.
 boolean makeRowVisible(int row)
          Scrolls a row so it is visible on the screen.
 boolean makeVisible(int row, int column)
          Scrolls a frozen or non-frozen cell or label so it is visible on the screen.
 void mouseClicked(MouseEvent e)
           
 void mouseDragged(MouseEvent e)
           
 void mouseEntered(MouseEvent e)
           
 void mouseExited(MouseEvent e)
           
 void mouseMoved(MouseEvent e)
           
 void mousePressed(MouseEvent e)
           
 void mouseReleased(MouseEvent e)
           
 void paintComponent(Graphics gc)
           
protected  void processKeyEvent(KeyEvent e)
           
protected  void processMouseEvent(MouseEvent e)
           
protected  void processMouseMotionEvent(MouseEvent e)
           
 void removeAction(com.klg.jclass.table.ActionInitiator initiator, int action)
          Removes an ActionInitiator/action pair from table.
 void removeAction(int action)
          Removes any ActionInitiator set for the given action type.
 void removeAction(com.klg.jclass.table.TableAction tableAction)
          Removes an action from table.
 void removeAllActions()
          Removes all actions from table.
 void removeCellDisplayListener(com.klg.jclass.table.JCCellDisplayListener l)
          Removes the specified listener so it no longer receives JCCellDisplayEvent objects.
 void removeEditCellListener(com.klg.jclass.table.JCEditCellListener l)
          Removes the specified listener so it no longer receives JCEditCellEvent objects.
 void removePaintListener(com.klg.jclass.table.JCPaintListener l)
          Removes the specified listener so it no longer receives JCPaintEvent objects.
 void removeResizeCellListener(com.klg.jclass.table.JCResizeCellListener l)
          Removes the specified listener so it no longer receives JCResizeCellListener objects.
 void removeResizeCellMotionListener(com.klg.jclass.table.JCResizeCellMotionListener l)
          Removes the specified listener so it no longer receives JCResizeCellMotionListener objects.
 void removeScrollListener(com.klg.jclass.table.JCScrollListener l)
          Removes the specified listener so it no longer receives JCScrollListener objects.
 void removeSelectListener(com.klg.jclass.table.JCSelectListener l)
          Removes the specified listener so it no longer receives JCSelectEvent objects.
 void removeSortListener(com.klg.jclass.table.JCSortListener l)
          Removes the specified listener so it no longer receives JCSortListener objects.
 void removeSpannedRange(com.klg.jclass.table.JCCellRange cr)
          Removes a cell range for the list of spanned ranges.
 void removeTableMouseWheelListener()
          Removes the current mouse wheel listener.
 void removeTraverseCellListener(com.klg.jclass.table.JCTraverseCellListener l)
          Removes the specified listener so it no longer receives JCTraverseCellListener objects.
 void repaintSelected()
           
protected  void requestChange(int flags)
          Sends a request to process a change.
protected  void requestChange(int flags, int row, int column)
          Sends a request to process a change for the given row and column.
protected  void requestChange(int flags, com.klg.jclass.table.JCCellRange cr)
          Sends a request to process a change for a range of cells.
 void requestFocus()
          Overridden to record the old focus owner when table requests focus.
 void resetSortedRows()
          Resets the internal row mapping array used for sorted rows.
 void resetSwappedColumns()
          Resets the internal column mapping array.
 void resetSwappedRows()
          Resets the internal row mapping array.
 void reshape(int x, int y, int width, int height)
           
 boolean selectAll()
          Selects all cells.
 void setAllowCellResize(int value)
          Sets how an end-user can interactively resize rows/columns.
 void setAllowResizeBy(int value)
          If set to JCTableEnum.RESIZE_BY_LABELS, a user can only resize the column widths and row heights by resizing the respective row or column's label.
 void setAutoEdit(boolean value)
          If true, the table automatically displays an editor when a cell is entered.
 void setAutoScroll(int value)
          Sets how the table scrolls when the user selects cells or drags the mouse past the bounds of the table.
 void setCellBorderWidth(int value)
          Sets the width of the borders surrounding each cell and label (default is 1).
 void setCellEditor(Class cellType, Class editor)
          Creates a mapping between a cell type (for example, class) and an editing object.
 void setCellEditor(Class cellType, com.klg.jclass.cell.JCCellEditor editor)
          Creates a mapping between a cell type and an instance of an editing object.
protected  void setCellEditorMapping(Class cellType, Object editor)
          Creates a mapping between a cell type and an editor object or instance of an editing object.
 void setCellLayout(com.klg.jclass.table.CellLayoutModel cellLayout)
          Sets the CellLayout manager.
 void setCellRenderer(Class cellType, Class renderer)
          Creates a mapping between a cell type and an renderering object.
 void setCellRenderer(Class cellType, com.klg.jclass.cell.JCCellRenderer renderer)
          Creates a mapping between a cell type and an instance of a renderering object.
protected  void setCellRendererMapping(Class cellType, Object renderer)
          Creates a mapping between a cell type and an renderer object or instance of an renderering object.
 void setCellStyle(int row, int column, com.klg.jclass.table.CellStyleModel style)
          Sets the style for a cell (or list of cells).
 void setCellStyle(com.klg.jclass.table.JCCellRange cr, com.klg.jclass.table.CellStyleModel style)
          Sets the style for a range of cells.
 void setCellStyles(com.klg.jclass.table.SeriesModel sm)
          Replaces the cell style container with the one provided.
 void setCharHeight(int row, int value)
          Sets the number of lines of text that a row can display (default is 1).
 void setCharWidth(int column, int value)
          Sets the number of characters of text that a column can display (default is 10).
protected  void setColumnCellSize(int column, com.klg.jclass.table.CellSize value)
          Sets the CellSize object for a column.
 void setColumnHidden(int column, boolean value)
          Hides or shows a given column.
 void setColumnLabelDisplay(boolean value)
          Determines whether column labels are displayed.
 void setColumnLabelOffset(int value)
          Sets the spacing between the column labels and the cell area in pixels (default is 0).
 void setColumnLabelPlacement(int value)
          Sets the position of the column labels relative to the cells.
 boolean setColumnSelection(int start_column, int end_column)
          Selects a range of columns.
protected  void setColumnWidthChanged(int column)
          Forces required calculations based on a change in the width for a column.
 void setComponent(int row, int column, Component component)
          Sets a Component for the contents of the given cell.
 void setComponent(com.klg.jclass.table.JCCellRange cr, Component component)
          Sets a JComponent to span a range of cells.
 void setComponentBorderWidth(int value)
          Sets the spacing between the border of a cell and a cell component.
 void setCurrentCell(int row, int column)
          Sets the current cell in the table given a row and column.
protected  void setCurrentCell(int row, int column, int direction)
          Sets the current cell in the table given a row and column.
 void setCurrentCell(com.klg.jclass.table.JCCellPosition cell)
          Sets the current cell in the table.
 void setCursor(int type)
          Sets the global cursor when cursor tracking is off.
 void setDataSource(com.klg.jclass.table.TableDataModel tableData)
          Sets the table data source.
 void setDataView(com.klg.jclass.table.DataViewModel dataView)
          Sets a new data view manager.
 void setEditHeightPolicy(int value)
          Specified how high the editing component of a cell should be when the user clicks on it.
 void setEditWidthPolicy(int value)
          Specifies how wide the editing component of a cell should be when the user clicks on it.
 void setFocusColor(Color value)
          Sets the focus color.
 void setFocusIndicator(int value)
          Sets the focus indicator.
 void setFocusManager(com.klg.jclass.table.FocusModel focusManager)
          Sets a new FocusManager.
 void setFrameBorder(com.klg.jclass.table.CellBorderModel value)
          Sets the CellBorder model of the borders surrounding cell and label areas (default is null).
 void setFrameBorderWidth(int value)
          Sets the width of the borders surrounding cell and label areas (default is 0).
 void setFrozenColumnPlacement(int value)
          Sets the location of all frozen columns within the component display.
 void setFrozenColumns(int value)
          Sets the number of columns from the start of the table that are not horizontally scrollable (default is 0).
 void setFrozenRowPlacement(int value)
          Sets the location of all frozen rows.
 void setFrozenRows(int value)
          Sets the number of rows from the start of the table that are not vertically scrollable (default is 0).
 void setHorizSB(JScrollBar value)
          Sets the horizontal scrollbar.
 void setHorizSBAttachment(int value)
          Sets how the end of the horizontal scrollbar is attached to the table.
 void setHorizSBDisplay(int value)
          Sets when to display the horizontal scrollbar.
 void setHorizSBOffset(int value)
          Sets the distance (in pixels) between the horizontal scrollbar and the table (default is 0).
 void setHorizSBPosition(int value)
          Sets how the horizontal scrollbar is attached to the table.
 void setHorizSBTrack(int value)
          Sets how the horizontal scrollbar works during tracking.
 void setHorizSBTrackRow(int value)
          Sets the row number that determines the text to display when the track indicator is displayed.
 void setIgnoreContainerSize(boolean value)
          Determines whether the size of the table is determined by its container.
 void setJumpScroll(int value)
          Sets the scrolling behavior of each scrollbar.
 void setLeftColumn(int value)
          Sets the non-frozen column at least partially visible at the left side of the window.
 void setLicense(String s)
           
 void setMarginHeight(int value)
          Sets the distance (in pixels) between the inside edge of the cell border and the top and bottom edge of the cell's contents (default it 2).
 void setMarginWidth(int value)
          Sets the distance (in pixels) between the inside edge of the cell border and the left/right edge of the cell's contents (default is 3).
 void setMaxHeight(int row, int value)
          Sets the maximmum number of pixels for a row.
 void setMaxWidth(int column, int value)
          Sets the maximmum number of pixels for a column.
 void setMinCellVisibility(int value)
          Sets the minimum amount of a cell that is made visible when edited.
 void setMinHeight(int row, int value)
          Sets the minimum number of pixels for a row.
 void setMinWidth(int column, int value)
          Sets the minimum number of pixels for a column.
 void setPixelHeight(int row, int value)
          Sets the height of a row in pixels.
 void setPixelWidth(int column, int value)
          Sets the width of a column in pixels.
 void setPointerTraverseForcesEdit(boolean nval)
          Sets the value of the PointerTraverseForcesEdit property.
 void setPopupMenuEnabled(boolean b)
          Sets the table's PopupMenuEnabled value.
protected  void setRecalcRequired(boolean value)
          If set to true, this method forces JClass LiveTable to recalculate all internal dimensions when setRepaintEnabled() is set back to true.
protected  void setRelayoutRequired(boolean value)
          If set to true, this method forces JClass LiveTable to relayout its contents when setRepaintEnabled() is set back to true.
 void setRepaintEnabled(boolean value)
          Sets whether the table should be redrawn and recomputed whenever one of its properties is set (default is true).
protected  void setRepaintRequired(boolean value)
          If set to true, this method forces JClass LiveTable to repaint the entire contents when setRepaintEnabled() is set back to true.
 void setResizeEven(boolean value)
          If set to true, when a column width or row height is changed interactively, all columns or rows are resized to the same value.
 void setResizeInteractive(boolean value)
          If set to true, when a column width or row height is changed interactively, table is repainted to reflect the new value during the drag event.
protected  void setRowCellSize(int row, com.klg.jclass.table.CellSize value)
          Sets the CellSize object for a row.
protected  void setRowHeightChanged(int row)
          Forces required calculations based on a change in the height of a row.
 void setRowHidden(int row, boolean value)
          Hides or shows a given row.
 void setRowLabelDisplay(boolean value)
          Determines whether row labels are displayed.
 void setRowLabelOffset(int value)
          Sets the spacing between the row labels and the cell area in pixels (default is 0).
 void setRowLabelPlacement(int value)
          Sets the position of the row labels relative to the cells.
 boolean setRowSelection(int start_row, int end_row)
          Selects a range of rows.
 void setSelectedBackground(Color value)
          Sets the background color of user-selected cells (default is the cell's foreground color).
 void setSelectedBackgroundMode(int value)
          Sets the table's SelectedBackgroundMode.
 boolean setSelectedCells(Collection v)
          Sets the currently-selected ranges of cells.
 boolean setSelectedCells(com.klg.jclass.table.JCCellRange r)
          Sets a range of selected cells.
 void setSelectedForeground(Color value)
          Sets the foreground color of user-selected cells (default is the cell's background color).
 void setSelectedForegroundMode(int value)
          Sets the table's SelectedForegroundMode.
 void setSelectIncludeLabels(boolean value)
          Sets the selection behavior for row and column labels.
 boolean setSelection(int start_row, int start_column, int end_row, int end_column)
          Selects a range of cells.
 void setSelectionModel(com.klg.jclass.table.SelectionModel selectionHandler)
          Sets the SelectionModel manager.
 void setSelectionPolicy(int value)
          Sets the selection behavior allowed on the table, both by end-users and by the application.
 void setSeriesDataSorted(boolean value)
          Sets whether series data (styles, cell dimensions, and so on) are maintained in sync with data when it is sorted.
 void setSpanHandler(com.klg.jclass.table.SpanHandler spanHandler)
          Sets the span manager.
 void setSpannedRanges(Collection ranges)
          Sets the spanned cell ranges to a Collection of JCCellRanges.
 void setStoreImageEnabled(boolean value)
          Determines whether an image of table is maintained offscreen.
 void setTopRow(int value)
          Sets the non-frozen row at least partially visible at the top of the window.
 void setTrackBackground(Color value)
          Sets the background color of the component that displays horizontal or vertical scrollbar tracking info.
 void setTrackCursor(boolean value)
          Sets whether the mouse pointer should be tracked as a user moves the mouse across the table.
 void setTrackForeground(Color value)
          Sets the foreground color of the component that display horizontal or vertical scrollbar tracking info.
 void setTrackSize(Dimension value)
          Sets the dimensions of the component that tracks horizontal or vertical scrollbar info.
 void setTraverseCycle(boolean value)
          Determines whether table traverses to the opposite side when the left, top, right, or bottom cell is reached.
 void setUI(ComponentUI newUI)
          Sets the UI for JCTable.
 void setUserData(int row, int column, Object value)
          Sets the user data for a cell.
 void setUserData(com.klg.jclass.table.JCCellRange cr, Object value)
          Sets the user data for a range of cells.
 void setVariableEstimateCount(int value)
          Sets the number of cells to use in estimating variable pixel calculations.
 void setVertSB(JScrollBar value)
          Sets the vertical scrollbar.
 void setVertSBAttachment(int value)
          Sets how the end of the vertical scrollbar is attached to the table.
 void setVertSBDisplay(int value)
          Sets when to display the vertical scrollbar.
 void setVertSBOffset(int value)
          Sets the distance (in pixels) between the vertical scrollbar and the table (default is 0).
 void setVertSBPosition(int value)
          Sets how the vertical scrollbar is attached to the table.
 void setVertSBTrack(int value)
          Sets how the vertical scrollbar works during tracking.
 void setVertSBTrackColumn(int value)
          Sets the column number that determines the text to display when the track indicator is displayed.
 void setVisibleColumns(int value)
          Sets the number of non-frozen columns used to determine the preferred size of the table.
 void setVisibleRows(int value)
          Sets the number of non-frozen rows used to determine the preferred size of the table.
protected  boolean showPopupMenu(int x, int y)
          Displays the popup menu at the given coordinates.
 boolean sortByColumn(int[] column, int[] direction)
          Sorts the rows in a table based on multiple columns and direction.
 boolean sortByColumn(int[] column, int[] direction, int start_row, int end_row)
          Sorts a range of rows in the table based on multiple columns and directions.
 boolean sortByColumn(int column, int direction)
          Sorts the rows in the table based on a specified column and direction.
 boolean sortByColumn(int column, int direction, int start_row, int end_row)
          Sorts a range of rows in the table based on a specified column and direction.
 boolean swapColumns(int column1, int column2)
          Swaps two columns in the table without modifying the data source.
 boolean swapRows(int row1, int row2)
          Swaps two rows in the table without modifying the data source.
 boolean traverse(int direction)
          Attempts to move the current cell focus to a new location given a direction.
 boolean traverse(int row, int column, boolean show_editor, boolean select)
          Attempts to move the current cell focus to a new location.
 void updateUI()
          Updates the UI for JCTable.
protected  int XtoColumn(int x)
          Determines the column that contains the pixel position.
 com.klg.jclass.table.JCCellPosition XYToCell(int x, int y)
          Returns the cell located at the x, y position.
protected  int YtoRow(int y)
          Determines the row that contains the pixel position.
 
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, getAccessibleContext, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getGraphics, getHeight, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getNextFocusableComponent, 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, paintImmediately, paintImmediately, paramString, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setEnabled, setFont, setForeground, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, 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, 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, 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

adjustmentHandler

protected com.klg.jclass.table.AdjustmentHandler adjustmentHandler

cellAreaHandler

protected com.klg.jclass.table.CellAreaHandler cellAreaHandler

cellLayout

protected com.klg.jclass.table.CellLayoutModel cellLayout

cellRendererPane

protected CellRendererPane cellRendererPane

cellStyles

protected com.klg.jclass.table.SeriesModel cellStyles

columnWidths

protected com.klg.jclass.table.RowColumnSeriesModel columnWidths

dataView

protected com.klg.jclass.table.DataViewModel dataView

keyHandler

protected com.klg.jclass.table.KeyInputHandler keyHandler

mouseHandler

protected com.klg.jclass.table.MouseInputHandler mouseHandler

rowHeights

protected com.klg.jclass.table.RowColumnSeriesModel rowHeights

selectionHandler

protected com.klg.jclass.table.SelectionModel selectionHandler

spanHandler

protected com.klg.jclass.table.SpanHandler spanHandler

tableChangeHandler

protected com.klg.jclass.table.TableChangeHandler tableChangeHandler

tableLayout

protected com.klg.jclass.table.TableLayout tableLayout

userData

protected com.klg.jclass.table.SeriesModel userData

moveables

protected Vector moveables

hsb

protected JScrollBar hsb

vsb

protected JScrollBar vsb

allow_cell_resize

protected int allow_cell_resize

allow_resize_by

protected int allow_resize_by

auto_edit

protected boolean auto_edit

auto_scroll

protected int auto_scroll

cell_border_width

protected int cell_border_width

column_label_display

protected boolean column_label_display

column_label_placement

protected int column_label_placement

column_label_offset

protected int column_label_offset

component_border_width

protected int component_border_width

default_label_style

protected com.klg.jclass.table.CellStyleModel default_label_style

default_cell_style

protected com.klg.jclass.table.CellStyleModel default_cell_style

edit_height_policy

protected int edit_height_policy

edit_width_policy

protected int edit_width_policy

focus_color

protected Color focus_color

focusManager

protected com.klg.jclass.table.FocusModel focusManager

focus_indicator

protected int focus_indicator

frame_border

protected com.klg.jclass.table.CellBorderModel frame_border

frame_border_width

protected int frame_border_width

frozen_columns

protected int frozen_columns

frozen_column_placement

protected int frozen_column_placement

frozen_rows

protected int frozen_rows

frozen_row_placement

protected int frozen_row_placement

hsb_attach

protected int hsb_attach

hsb_display

protected int hsb_display

hsb_offset

protected int hsb_offset

hsb_position

protected int hsb_position

hsb_track

protected int hsb_track

hsb_track_row

protected int hsb_track_row

ignore_container_size

protected boolean ignore_container_size

jump_mode

protected int jump_mode

left_column

protected int left_column

margin_height

protected int margin_height

margin_width

protected int margin_width

min_cell_visibility

protected int min_cell_visibility

mouseWheelListener

protected Object mouseWheelListener

popupMenuEnabled

protected boolean popupMenuEnabled

repaint_enabled

protected boolean repaint_enabled

resize_even

protected boolean resize_even

resize_interactive

protected boolean resize_interactive

row_label_display

protected boolean row_label_display

row_label_placement

protected int row_label_placement

row_label_offset

protected int row_label_offset

select_include_labels

protected boolean select_include_labels

selected_background

protected Color selected_background

selected_background_mode

protected int selected_background_mode

selected_foreground

protected Color selected_foreground

selected_foreground_mode

protected int selected_foreground_mode

sort_series

protected boolean sort_series

store_image_enabled

protected boolean store_image_enabled

top_row

protected int top_row

track_background

protected Color track_background

track_foreground

protected Color track_foreground

track_size

protected Dimension track_size

track_cursor

protected boolean track_cursor

traverse_cycle

protected boolean traverse_cycle

variable_estimate_count

protected int variable_estimate_count

visible_columns

protected int visible_columns

visible_rows

protected int visible_rows

vsb_attach

protected int vsb_attach

vsb_display

protected int vsb_display

vsb_offset

protected int vsb_offset

vsb_position

protected int vsb_position

vsb_track

protected int vsb_track

vsb_track_column

protected int vsb_track_column

current_row

protected int current_row

current_column

protected int current_column

cellDisplayListeners

protected com.klg.jclass.util.JCListenerList cellDisplayListeners

editCellListeners

protected com.klg.jclass.util.JCListenerList editCellListeners

paintListeners

protected com.klg.jclass.util.JCListenerList paintListeners

resizeListeners

protected com.klg.jclass.util.JCListenerList resizeListeners

resizeMotionListeners

protected com.klg.jclass.util.JCListenerList resizeMotionListeners

scrollListeners

protected com.klg.jclass.util.JCListenerList scrollListeners

selectListeners

protected com.klg.jclass.util.JCListenerList selectListeners

sortListeners

protected com.klg.jclass.util.JCListenerList sortListeners

traverseListeners

protected com.klg.jclass.util.JCListenerList traverseListeners

actions

protected Vector actions

oldFocusOwner

protected Component oldFocusOwner

scrolling

protected boolean scrolling

set_initial_left

protected boolean set_initial_left

set_initial_top

protected boolean set_initial_top

set_left_column

protected boolean set_left_column

set_top_row

protected boolean set_top_row

sort_column

protected int sort_column

sort_direction

protected int sort_direction

store_image

protected transient Image store_image

store_origin

protected transient Point store_origin

needs_initial_traverse

protected boolean needs_initial_traverse

needs_initial_set_left_check

protected boolean needs_initial_set_left_check

needs_initial_set_top_check

protected boolean needs_initial_set_top_check

popupMenu

protected com.klg.jclass.table.TablePopupMenu popupMenu

pointer_traverse_forces_edit

protected boolean pointer_traverse_forces_edit
Constructor Detail

JCTable

public JCTable()
Method Detail

addNotify

public void addNotify()
Overrides:
addNotify in class JComponent

findMethod

protected Method findMethod(Class c,
                            String methodString)
Does passed in class have the given method name? If so, returns it.

Parameters:
c - the class in which the method is to be found
methodString - the name of the method
Returns:
the Method object from JCTable, based on the input String; if there is no such method, return null

addTableMouseWheelListener

public void addTableMouseWheelListener(Object listener)
Adds the given MouseWheelListener to the table.
Note: This will replace the current MouseWheelListener. This method will do nothing if the underlying JDK is pre 1.4.

Parameters:
listener - The new listener; this must be of type MouseWheelListener. If the value passed in is null, this method will add a new TableMouseWheelListener (which is the default listener).

removeTableMouseWheelListener

public void removeTableMouseWheelListener()
Removes the current mouse wheel listener. This method can be called to remove the default mouse wheel listener that is installed on startup if the underlying JDK is 1.4 or later (this method does nothing otherwise).


getMinimumSize

public Dimension getMinimumSize()
Overrides:
getMinimumSize in class JComponent

getPreferredSize

public Dimension getPreferredSize()
Overrides:
getPreferredSize in class JComponent

layoutAreas

public void layoutAreas()

doLayout

public void doLayout()
Overrides:
doLayout in class Container

getUI

public com.klg.jclass.table.JCTableUI getUI()
Returns the UI for JCTable.

Returns:
the UI for JCTable

setUI

public void setUI(ComponentUI newUI)
Sets the UI for JCTable.

Overrides:
setUI in class JComponent
Parameters:
newUI - the new UI for JCTable

updateUI

public void updateUI()
Updates the UI for JCTable.

Overrides:
updateUI in class JComponent

getUIClassID

public String getUIClassID()
Returns the UIClass ID for JCTable.

Overrides:
getUIClassID in class JComponent
Returns:
the UIClass ID for JCTable

getCellAreaHandler

public com.klg.jclass.table.CellAreaHandler getCellAreaHandler()
Returns the CellArea handler, which manages the creation and removal of CellAreas within the table.

Returns:
the CellArea handler

setCellEditor

public void setCellEditor(Class cellType,
                          Class editor)
Creates a mapping between a cell type (for example, class) and an editing object.

Parameters:
cellType - the class type of the object in a cell
editor - an editor (specified by class) specifically suited to edit objects of the given class

setCellEditor

public void setCellEditor(Class cellType,
                          com.klg.jclass.cell.JCCellEditor editor)
Creates a mapping between a cell type and an instance of an editing object.

Parameters:
cellType - the class type of the object in a cell
editor - an editor (specified by an object which implements the JCCellEditor interface) specifically suited to edit objects of the given class

setCellEditorMapping

protected void setCellEditorMapping(Class cellType,
                                    Object editor)
Creates a mapping between a cell type and an editor object or instance of an editing object.

Parameters:
cellType - the class type of the object in a cell
editor - an editor object specifically suited to edit objects of the given class

getCellLayout

public com.klg.jclass.table.CellLayoutModel getCellLayout()
Returns the CellLayout manager.

Returns:
the table's CellLayout manager

createDefaultCellLayout

protected void createDefaultCellLayout()
Creates the default CellLayoutModel manager.


setCellLayout

public void setCellLayout(com.klg.jclass.table.CellLayoutModel cellLayout)
Sets the CellLayout manager.

Parameters:
cellLayout - the new CellLayout manager

setCellRenderer

public void setCellRenderer(Class cellType,
                            Class renderer)
Creates a mapping between a cell type and an renderering object.

Parameters:
cellType - the class type of the object in a cell
renderer - a renderer (specified by class) specifically suited to render objects of the given class

setCellRenderer

public void setCellRenderer(Class cellType,
                            com.klg.jclass.cell.JCCellRenderer renderer)
Creates a mapping between a cell type and an instance of a renderering object.

Parameters:
cellType - the class type of the object in a cell
renderer - a renderer (specified by an object which implements the JCCellRenderer interface) specifically suited to render objects of the given class

setCellRendererMapping

protected void setCellRendererMapping(Class cellType,
                                      Object renderer)
Creates a mapping between a cell type and an renderer object or instance of an renderering object.

Parameters:
cellType - the class type of the object in a cell
renderer - a renderer specifically suited to render objects of the given class

addToMoveables

protected void addToMoveables(Object newMoveable,
                              Object oldMoveable)
Adds to the moveables collection.

Parameters:
newMoveable - the new moveable to be added
oldMoveable - the old moveable to be replaced

getCellStyle

public com.klg.jclass.table.CellStyleModel getCellStyle(int row,
                                                        int column)
Gets the cell's CellStyleModel value. The CellStyleModel object returned here may not be unique to the given row and column.

Parameters:
row - the row of the cell whose cellStyleModel is required
column - the column of the cell whose cellStyleModel is required
Returns:
a CellStyleModel object for the given row and column
See Also:
setCellStyle(int, int, com.klg.jclass.table.CellStyleModel)

getUniqueCellStyle

public com.klg.jclass.table.CellStyleModel getUniqueCellStyle(int row,
                                                              int column)
Gets a unique instance of the cell's CellStyleModel value. Because style instances can be applied to a range of cells, getCellStyle may not return an CellStyleModel object that is only used by the given cell. As a result, changing a property in the style may affect more than one cell when table display is updated.

Calling getUniqueCellStyle returns a clone of the cell style instance used for the cell. This instance is detached from the cell and must be set back using setCellStyle to change the cell.

JCTableEnum.ALL is an invalid value for the row and column parameters. Any call with the JCTableEnum.ALL parameter value causes it to be converted into JCTableEnum.ALLCELLS value.

Parameters:
row - the row of the cell for which a unique cell style is required
column - the column of the cell for which a unique cell style is required
Returns:
A unique CellStyleModel object for the given row and column

getCellStyles

public Collection getCellStyles()
Returns a unique Collection of CellStyleModel instances used in table.

Returns:
a Collection of unique instances of CellStyleModel objects

getCellStyleRanges

public Collection getCellStyleRanges(com.klg.jclass.table.CellStyleModel style)
Returns a Collection of JCCellRanges that use the given CellStyleModel.

Parameters:
style - the CellStyleModel whose ranges are required
Returns:
a Collection of JCCellRanges objects that use the given CellStyleModel

getCellStyleValues

public List getCellStyleValues()
Returns a list of CellStyle series values.

Returns:
a list of CellStyle series values

createCellStyle

protected com.klg.jclass.table.CellStyleModel createCellStyle()
Creates a new cell style object.

Returns:
a new CellStyleModel object

getDefaultLabelStyle

public com.klg.jclass.table.CellStyleModel getDefaultLabelStyle()
Returns the default label style, if set.

Returns:
the current default label style

getDefaultCellStyle

public com.klg.jclass.table.CellStyleModel getDefaultCellStyle()
Returns the default cell style, if set.

Returns:
the current default cell style

createDefaultCellStyleSeries

protected void createDefaultCellStyleSeries()
Creates the default CellStyleModel series object.


setCellStyle

public void setCellStyle(int row,
                         int column,
                         com.klg.jclass.table.CellStyleModel style)
Sets the style for a cell (or list of cells).

Parameters:
row - the row index of the cell
column - the column index of the cell
style - the new style for the given cell

setCellStyle

public void setCellStyle(com.klg.jclass.table.JCCellRange cr,
                         com.klg.jclass.table.CellStyleModel style)
Sets the style for a range of cells.

Parameters:
cr - the cell range
style - the new style for the given cell range

cloneCellStyles

public com.klg.jclass.table.SeriesModel cloneCellStyles()
                                                 throws CloneNotSupportedException
If possible, creates a clone of the cell style container stored in this table object and returns them to the caller. Use this method in conjunction with setCellStyles() if you want to save the current state of the styles, make a temporary change, then reverse the temporary change.

Returns:
a clone of the cell styles for this table
Throws:
CloneNotSupportedException

setCellStyles

public void setCellStyles(com.klg.jclass.table.SeriesModel sm)
Replaces the cell style container with the one provided. Use this method in conjunction with cloneCellStyles() for making and reversing temporary style changes in a convenient way.

Calling this method with null essentially resets the cell styles to initial state. The default cell and label styles are used.

It is recommended that the default cell and label styles not be changed. For most uses, this is fine. However, subclasses of JCTable may be tempted to set default_label_style and default_cell_style to new values. Unfortunately, we cannot detect these new defaults EXCEPT when this call is given a null.

Note: This method will force a table repaint, but not a relayout. In cases in which a relayout is required, the caller should force it by calling

   table.setRepaintEnabled(false); // disable repaint
   table.setCellStyles(oldStyles); // restore
   table.setRelayoutRequired(true); // force relayout
   table.setRepaintEnabled(true); // will force relayout and repaint.
 

Parameters:
sm - the new cell style container; if null, the cell styles are set to their default values

createDefaultColumnWidthSeries

protected void createDefaultColumnWidthSeries()
Creates the default column width series.


getColumnWidthValues

public List getColumnWidthValues()
Returns a list of column width series values.

Returns:
the current list of column width values

getComponentModel

protected com.klg.jclass.table.ComponentModel getComponentModel()
Returns the component handler which manages components in cells.
Note: This may be a different handler depending on the JRE (specifically 1.3 vs 1.4).

Returns:
the table's component handler

getDataSource

public com.klg.jclass.table.TableDataModel getDataSource()
Returns the table data source.

Returns:
the table's current data source
See Also:
setDataSource(com.klg.jclass.table.TableDataModel)

createDefaultDataSource

protected void createDefaultDataSource()
Creates the default data source with 10 rows and 5 columns.


setDataSource

public void setDataSource(com.klg.jclass.table.TableDataModel tableData)
Sets the table data source.

Parameters:
tableData - the new data source for this table

getDataView

public com.klg.jclass.table.DataViewModel getDataView()
Returns the data view which controls access to data and table notification when data changes.

Returns:
the current data view

createDefaultDataView

protected void createDefaultDataView()
Creates the default data view manager.


setDataView

public void setDataView(com.klg.jclass.table.DataViewModel dataView)
Sets a new data view manager.

Parameters:
dataView - the new data view

getEditTraverseHandler

public com.klg.jclass.table.EditTraverseHandler getEditTraverseHandler()
Returns the edit handler for the table, which manages editors within cells.

Returns:
the table's edit traverse handler; this could be different depending on the JRE (specifically 1.3 vs 1.4)

getKeyInputHandler

public com.klg.jclass.table.KeyInputHandler getKeyInputHandler()
Returns the key input manager for the table.

Returns:
the key input manager for the table

getMouseInputHandler

public com.klg.jclass.table.MouseInputHandler getMouseInputHandler()
Returns the mouse input manager for the table.

Returns:
the mouse input manager for the table

createDefaultRowHeightSeries

protected void createDefaultRowHeightSeries()
Creates the default row height series.


getRowHeightValues

public List getRowHeightValues()
Returns a list of row height series values.

Returns:
the current list of row height values

getTableLayout

public com.klg.jclass.table.TableLayout getTableLayout()
Returns the TableLayout manager.

Returns:
the table's layout manager

getUserData

public Object getUserData(int row,
                          int column)
Gets the cell's UserData value.

Parameters:
row - the row index of the cell
column - the column index of the cell
Returns:
the user data object for the cell
See Also:
setUserData(int, int, java.lang.Object)

createDefaultUserDataSeries

protected void createDefaultUserDataSeries()
Creates the default UserData series object.


setUserData

public void setUserData(int row,
                        int column,
                        Object value)
Sets the user data for a cell.

Parameters:
row - the row index of the cell
column - the column index of the cell
value - the user data object for the cell

setUserData

public void setUserData(com.klg.jclass.table.JCCellRange cr,
                        Object value)
Sets the user data for a range of cells.

Parameters:
cr - the cell range
value - the user data object for the cell range

getAllowCellResize

public int getAllowCellResize()
Gets the table's AllowCellResize value. This determines how an end-user can interactively resize rows/columns.

Returns:
the current AllowCellResize value; one of JCTableEnum.RESIZE_ALL (default), JCTableEnum.RESIZE_NONE, JCTableEnum.RESIZE_COLUMN, or JCTableEnum.RESIZE_ROW
See Also:
setAllowCellResize(int)

setAllowCellResize

public void setAllowCellResize(int value)
Sets how an end-user can interactively resize rows/columns. Valid values are:

Parameters:
value - the new AllowCellResize value; must be one of JCTableEnum.RESIZE_ALL (default), JCTableEnum.RESIZE_NONE, JCTableEnum.RESIZE_COLUMN, or JCTableEnum.RESIZE_ROW

getAllowResizeBy

public int getAllowResizeBy()
Gets the table's AllowResizeBy value to determine whether row height and column width can be resized by labels, cells, or both.

Returns:
The current table's AllowResizeBy value; one of JCTableEnum.RESIZE_BY_LABELS, JCTableEnum.RESIZE_BY_CELLS, or JCTableEnum.RESIZE_BY_ALL
See Also:
setAllowResizeBy(int)

setAllowResizeBy

public void setAllowResizeBy(int value)
If set to JCTableEnum.RESIZE_BY_LABELS, a user can only resize the column widths and row heights by resizing the respective row or column's label. Use JCTableEnum.RESIZE_BY_CELLS to allow cell resize but not label resize, and JCTableEnum.RESIZE_BY_ALL to allow label or cell resize.

Parameters:
value - the new AllowResizeBy value; one of JCTableEnum.RESIZE_BY_LABELS, JCTableEnum.RESIZE_BY_CELLS, or JCTableEnum.RESIZE_BY_ALL

isAutoEdit

public boolean isAutoEdit()
Gets the table's AutoEdit value.

Returns:
the table's current AutoEdit value
See Also:
setAutoEdit(boolean)

setAutoEdit

public void setAutoEdit(boolean value)
If true, the table automatically displays an editor when a cell is entered.

Parameters:
value - the new AutoEdit value

getAutoScroll

public int getAutoScroll()
Gets the table's AutoScroll value. This controls how the table scrolls when the user selects cells or drags the mouse past the bounds of the table.

Returns:
the table's current AutoScroll value; one of JCTblEnum.AUTO_SCROLL_NONE (default), JCTblEnum.AUTO_SCROLL_ROW, JCTblEnum.AUTO_SCROLL_COLUMN, or JCTblEnum.AUTO_SCROLL_BOTH
See Also:
setAutoScroll(int)

setAutoScroll

public void setAutoScroll(int value)
Sets how the table scrolls when the user selects cells or drags the mouse past the bounds of the table. Valid values are:

Parameters:
value - the new AutoScroll value; one of JCTblEnum.AUTO_SCROLL_NONE (default), JCTblEnum.AUTO_SCROLL_ROW, JCTblEnum.AUTO_SCROLL_COLUMN, or JCTblEnum.AUTO_SCROLL_BOTH

getCellBorderWidth

public int getCellBorderWidth()
Gets the table's CellBorderWidth value.

Returns:
the current CellBorderWidth value
See Also:
setCellBorderWidth(int)

setCellBorderWidth

public void setCellBorderWidth(int value)
Sets the width of the borders surrounding each cell and label (default is 1).

Parameters:
value - the new cell border width value

getCharHeight

public int getCharHeight(int row)
Returns the CharHeight value for a row.

Parameters:
row - the row whose height is to be returned
Returns:
the current CharHeight value for the specified row
See Also:
setCharHeight(int, int)

setCharHeight

public void setCharHeight(int row,
                          int value)
Sets the number of lines of text that a row can display (default is 1). Multiline cell values that do not fit in a cell or label are clipped. This property controls the height only if PixelHeight is JCTableEnum.NOVALUE.

This property works best with lists that use fixed-width fonts.

When a user interactively resizes a row, this property is overriden by the pixel heights.

Parameters:
row - row whose height is to be set; this may be a specified row, JCTableEnum.LABEL (for column labels), JCTableEnum.ALLCELLS (for all cells), or JCTableEnum.ALL (for all rows).
value - the new CharHeight value for the specified row

getCharWidth

public int getCharWidth(int column)
Returns the CharWidth value for a column.

Parameters:
column - the column whose width is to be returned
Returns:
the current CharWidth value for the specified column
See Also:
setCharWidth(int, int)

setCharWidth

public void setCharWidth(int column,
                         int value)
Sets the number of characters of text that a column can display (default is 10). Cell values that do not fit in a cell or label are clipped. This property controls the width only if PixelWidth is JCTableEnum.NOVALUE.

This property works best with lists that use fixed-width fonts.

When a user interactively resizes a column, this property is overriden by the pixel widths.

Parameters:
column - column whose width is to be set; this may be a specified column, JCTableEnum.LABEL (for row labels), JCTableEnum.ALLCELLS (for all cells), or JCTableEnum.ALL (for all columns)
value - the new CharWidth value for the specified column

isColumnHidden

public boolean isColumnHidden(int column)
Returns true if the column is hidden.

Parameters:
column - the column index
Returns:
Is the specified column hidden?
See Also:
setColumnHidden(int, boolean)

setColumnHidden

public void setColumnHidden(int column,
                            boolean value)
Hides or shows a given column.

Parameters:
column - the column index
value - if true, hide the specified column; if false, it is not hidden

isPopupMenuEnabled

public boolean isPopupMenuEnabled()
Gets the table's PopupMenuEnabled value.

Returns:
whether the popup menu is enabled
See Also:
setPopupMenuEnabled(boolean)

setPopupMenuEnabled

public void setPopupMenuEnabled(boolean b)
Sets the table's PopupMenuEnabled value.

Parameters:
b - if true, the popup menu is now enabled; if false, it is disabled
See Also:
isPopupMenuEnabled()

isColumnLabelDisplay

public boolean isColumnLabelDisplay()
Gets the table's ColumnLabelDisplay value.

Returns:
whether the column labels are displayed
See Also:
setColumnLabelDisplay(boolean)

setColumnLabelDisplay

public void setColumnLabelDisplay(boolean value)
Determines whether column labels are displayed. Default is true.

Parameters:
value - if true, column labels are displayed

getColumnLabelOffset

public int getColumnLabelOffset()
Gets the table's ColumnLabelOffset value.

Returns:
the spacing between the column labels and the cell area in pixels
See Also:
setColumnLabelOffset(int)

setColumnLabelOffset

public void setColumnLabelOffset(int value)
Sets the spacing between the column labels and the cell area in pixels (default is 0). If a negative value is specified, the labels will overlap the cell area.

Parameters:
value - the new column label offset

getColumnLabelPlacement

public int getColumnLabelPlacement()
Gets the table's ColumnLabelPlacement value.

Returns:
the current position of the column labels relative to the cells; one of JCTableEnum.PLACE_TOP (default) or JCTableEnum.PLACE_BOTTOM
See Also:
setColumnLabelPlacement(int)

setColumnLabelPlacement

public void setColumnLabelPlacement(int value)
Sets the position of the column labels relative to the cells. Valid values are:

Parameters:
value - the new column label placement value; one of JCTableEnum.PLACE_TOP (default) or JCTableEnum.PLACE_BOTTOM

getComponent

public Component getComponent(int row,
                              int column)
Gets the Component located at the given cell.

Parameters:
row - the row index of the cell
column - the column index of the cell
Returns:
the component, if any, at the given cell

hasComponent

public boolean hasComponent(int row,
                            int column)
Returns true if the cell contains a component.

Parameters:
row - the row index of the cell
column - the column index of the cell
Returns:
whether the cell at (row, column) contains a component

setComponent

public void setComponent(int row,
                         int column,
                         Component component)
Sets a Component for the contents of the given cell.

Parameters:
row - the row index of the cell
column - the column index of the cell
component - the new component for a cell

getComponentBorderWidth

public int getComponentBorderWidth()
Returns the spacing between the border of a cell and a cell component.

Returns:
the current component border width
See Also:
setComponentBorderWidth(int)

setComponentBorderWidth

public void setComponentBorderWidth(int value)
Sets the spacing between the border of a cell and a cell component. By default, the spacing is zero, resulting in components that exactly fit into the cell.

Parameters:
value - the new component border width

setComponent

public void setComponent(com.klg.jclass.table.JCCellRange cr,
                         Component component)
Sets a JComponent to span a range of cells. This is a convenience method which creates a span and then adds the component to it.

Parameters:
cr - the cell range which this component will span
component - the component which will span the range

setCursor

public void setCursor(int type)
Sets the global cursor when cursor tracking is off.

Parameters:
type - the java.awt.Cursor type (for example, Cursor.WAIT_CURSOR)
See Also:
setTrackCursor(boolean)

getEditHeightPolicy

public int getEditHeightPolicy()
Returns the vertical sizing policy for cell editors.

Returns:
the current vertical sizing policy for cell editors; one of JCTableEnum.EDIT_SIZE_TO_CELL, JCTableEnum.EDIT_ENSURE_MINIMUM_SIZE, or JCTableEnum.EDIT_ENSURE_PREFERRED_SIZE
See Also:
setEditHeightPolicy(int)

setEditHeightPolicy

public void setEditHeightPolicy(int value)
Specified how high the editing component of a cell should be when the user clicks on it. Valid values are:

Parameters:
value - the new vertical sizing policy for cell editors; one of JCTableEnum.EDIT_SIZE_TO_CELL, JCTableEnum.EDIT_ENSURE_MINIMUM_SIZE, or JCTableEnum.EDIT_ENSURE_PREFERRED_SIZE

getEditWidthPolicy

public int getEditWidthPolicy()
Returns the horizontal sizing policy for cell editors.

Returns:
the current horizontal sizing policy for cell editors; one of JCTableEnum.EDIT_SIZE_TO_CELL, JCTableEnum.EDIT_ENSURE_MINIMUM_SIZE, or JCTableEnum.EDIT_ENSURE_PREFERRED_SIZE
See Also:
setEditWidthPolicy(int)

setEditWidthPolicy

public void setEditWidthPolicy(int value)
Specifies how wide the editing component of a cell should be when the user clicks on it. Valid values are:

Parameters:
value - the new horizontal sizing policy for cell editors; one of JCTableEnum.EDIT_SIZE_TO_CELL, JCTableEnum.EDIT_ENSURE_MINIMUM_SIZE, or JCTableEnum.EDIT_ENSURE_PREFERRED_SIZE

getFocusColor

public Color getFocusColor()
Returns the focus color.

Returns:
the current focus color
See Also:
setFocusColor(java.awt.Color)

setFocusColor

public void setFocusColor(Color value)
Sets the focus color.

Parameters:
value - the new focus color

getFocusManager

public com.klg.jclass.table.FocusModel getFocusManager()
Returns the current FocusManager.

Returns:
the current FocusManager
See Also:
setFocusManager(com.klg.jclass.table.FocusModel)

setFocusManager

public void setFocusManager(com.klg.jclass.table.FocusModel focusManager)
Sets a new FocusManager.

Parameters:
focusManager - the new focus manager; null values are ignored

getFocusIndicator

public int getFocusIndicator()
Returns the focus indicator type.

Returns:
the current focus indicator type; one of JCTableEnum.FOCUS_NONE, JCTableEnum.FOCUS_HIGHLIGHT, JCTableEnum.FOCUS_RECTANGLE, JCTableEnum.FOCUS_THIN_RECTANGLE, or JCTableEnum.FOCUS_DASHED_RECTANGLE
See Also:
setFocusIndicator(int)

setFocusIndicator

public void setFocusIndicator(int value)
Sets the focus indicator. Valid indicators are: JCTableEnum.FOCUS_NONE, JCTableEnum.FOCUS_HIGHLIGHT, JCTableEnum.FOCUS_RECTANGLE, JCTableEnum.FOCUS_THIN_RECTANGLE, and JCTableEnum.FOCUS_DASHED_RECTANGLE.

Parameters:
value - the new focus indicator type; one of JCTableEnum.FOCUS_NONE, JCTableEnum.FOCUS_HIGHLIGHT, JCTableEnum.FOCUS_RECTANGLE, JCTableEnum.FOCUS_THIN_RECTANGLE, or JCTableEnum.FOCUS_DASHED_RECTANGLE

getFrameBorder

public com.klg.jclass.table.CellBorderModel getFrameBorder()
Gets the table's FrameBorderWidth value as a CellBorderModel.

Returns:
the current FrameBorderWidth CellBorderModel value
See Also:
setFrameBorderWidth(int)

setFrameBorder

public void setFrameBorder(com.klg.jclass.table.CellBorderModel value)
Sets the CellBorder model of the borders surrounding cell and label areas (default is null).

Parameters:
value - the new FrameBorderWidth value specified by CellBorderModel

getFrameBorderWidth

public int getFrameBorderWidth()
Gets the table's FrameBorderWidth value.

Returns:
the current FrameBorderWidth value
See Also:
setFrameBorderWidth(int)

setFrameBorderWidth

public void setFrameBorderWidth(int value)
Sets the width of the borders surrounding cell and label areas (default is 0).

Parameters:
value - the new FrameBorderWidth value

getFrozenColumnPlacement

public int getFrozenColumnPlacement()
Gets the table's FrozenColumnPlacement value.

Returns:
the current FrozenColumnPlacement value; one of JCTableEnum.PLACE_LEFT or JCTableEnum.PLACE_RIGHT
See Also:
setFrozenColumnPlacement(int)

setFrozenColumnPlacement

public void setFrozenColumnPlacement(int value)
Sets the location of all frozen columns within the component display. Changing the placement of frozen columns does not change the location of the columns in the table's internal CellValues. One of JCTableEnum.PLACE_LEFT or JCTableEnum.PLACE_RIGHT.

Parameters:
value - the new FrozenColumnPlacement value; one of JCTableEnum.PLACE_LEFT or JCTableEnum.PLACE_RIGHT

getFrozenColumns

public int getFrozenColumns()
Gets the table's FrozenColumns value.

Returns:
the current FrozenColumns value
See Also:
setFrozenColumns(int)

setFrozenColumns

public void setFrozenColumns(int value)
Sets the number of columns from the start of the table that are not horizontally scrollable (default is 0). Placement of the frozen columns on the screen is specified by FrozenColumnPlacement.

Parameters:
value - the new FrozenColumns value

getFrozenRowPlacement

public int getFrozenRowPlacement()
Gets the table's FrozenRowPlacement value.

Returns:
the current frozen row placement value; one of JCTableEnum.PLACE_TOP or JCTableEnum.PLACE_BOTTOM
See Also:
setFrozenRowPlacement(int)

setFrozenRowPlacement

public void setFrozenRowPlacement(int value)
Sets the location of all frozen rows. Changing the placement of frozen rows does not change the location of the rows in the table's internal CellValues. Valid values are: .

Parameters:
value - the new frozen row placement value; one of JCTableEnum.PLACE_TOP or JCTableEnum.PLACE_BOTTOM

getFrozenRows

public int getFrozenRows()
Gets the table's FrozenRows value.

Returns:
the current FrozenRows value
See Also:
setFrozenRows(int)

setFrozenRows

public void setFrozenRows(int value)
Sets the number of rows from the start of the table that are not vertically scrollable (default is 0). Placement of the frozen rows on the screen is specified by FrozenRowPlacement.

Parameters:
value - the new FrozenRows value

getHorizSB

public JScrollBar getHorizSB()
Gets the horizontal scrollbar.

Returns:
the current horizontal scrollbar component

setHorizSB

public void setHorizSB(JScrollBar value)
Sets the horizontal scrollbar.

Parameters:
value - the new horizontal scrollbar component

getHorizSBAttachment

public int getHorizSBAttachment()
Gets the tables HorizSBAttachment value.

Returns:
the current HorizSBAttachment value; one of JCTableEnum.SIZE_TO_CELLS or JCTableEnum.SIZE_TO_TABLE
See Also:
setHorizSBAttachment(int)

setHorizSBAttachment

public void setHorizSBAttachment(int value)
Sets how the end of the horizontal scrollbar is attached to the table. When set to JCTableEnum.SIZE_TO_CELLS (default), the scrollbar ends at the edge of the visible cells.

When set to JCTableEnum.SIZE_TO_TABLE, the scrollbar ends at the edge of the table. This setting should be used in conjunction with HorizSBPosition.

Parameters:
value - the new HorizSBAttachment value; one of JCTableEnum.SIZE_TO_CELLS or JCTableEnum.SIZE_TO_TABLE

getHorizSBDisplay

public int getHorizSBDisplay()
Gets the table's HorizSBDisplay value to determine when to display scrollbars.

Returns:
the current HorizSBDisplay value; one of JCTableEnum.SCROLLBAR_ALWAYS, JCTableEnum.SCROLLBAR_NEVER, or JCTableEnum.SCROLLBAR_AS_NEEDED
See Also:
setHorizSBDisplay(int)

setHorizSBDisplay

public void setHorizSBDisplay(int value)
Sets when to display the horizontal scrollbar. Valid values are:
 JCTableEnum.SCROLLBAR_ALWAYS        Always displayed
 JCTableEnum.SCROLLBAR_NEVER         Never displayed
 JCTableEnum.SCROLLBAR_AS_NEEDED     Displayed only when table
                                     area is larger than frame
 

Parameters:
value - The new HorizSBDisplay value; one of JCTableEnum.SCROLLBAR_ALWAYS, JCTableEnum.SCROLLBAR_NEVER, or JCTableEnum.SCROLLBAR_AS_NEEDED

getHorizSBOffset

public int getHorizSBOffset()
Gets the table's HorizSBOffset value.

Returns:
the current HorizSBOffset value
See Also:
setHorizSBOffset(int)

setHorizSBOffset

public void setHorizSBOffset(int value)
Sets the distance (in pixels) between the horizontal scrollbar and the table (default is 0).

Parameters:
value - the new HorizSBOffset value

getHorizSBPosition

public int getHorizSBPosition()
Gets the table's HorizSBPosition value.

Returns:
the current HorizSBPosition value; one of JCTableEnum.POSITION_BY_CELLS or JCTableEnum.POSITION_AT_SIDE
See Also:
setHorizSBPosition(int)

setHorizSBPosition

public void setHorizSBPosition(int value)
Sets how the horizontal scrollbar is attached to the table. When set to JCTableEnum.POSITION_BY_CELLS (default), the scrollbar is attached to the cell/labels.

When set to JCTableEnum.POSITION_AT_SIDE, the scrollbar is attached to the edge of the table within its container.

Parameters:
value - the new HorizSBPosition value; one of JCTableEnum.POSITION_BY_CELLS or JCTableEnum.POSITION_AT_SIDE
See Also:
setHorizSBPosition(int)

getHorizSBTrack

public int getHorizSBTrack()
Gets the table's HorizSBTrack value.

Returns:
the current HorizSBTrack value; one of JCTableEnum.TRACK_LIVE, JCTableEnum.TRACK_COLUMN_NUMBER, or JCTableEnum.TRACK_ROW
See Also:
setHorizSBTrack(int)

setHorizSBTrack

public void setHorizSBTrack(int value)
Sets how the horizontal scrollbar works during tracking. When set to JCTableEnum.TRACK_LIVE, table redisplays during scrollbar tracking. When set to JCTableEnum.TRACK_COLUMN_NUMBER, table redisplays after tracking completes and displays the number of the left column during the track. Use JCTableEnum.TRACK_ROW and setHorizSBTrackRow to specify a row number in order to use data from the column to indicate the left-most column.

Parameters:
value - the new HorizSBTrack value; one of JCTableEnum.TRACK_LIVE, JCTableEnum.TRACK_COLUMN_NUMBER, or JCTableEnum.TRACK_ROW

getHorizSBTrackRow

public int getHorizSBTrackRow()
Gets the row number that determines the text to display when the track indicator is displayed.

Returns:
the current row number to do the tracking
See Also:
setHorizSBTrackRow(int)

setHorizSBTrackRow

public void setHorizSBTrackRow(int value)
Sets the row number that determines the text to display when the track indicator is displayed. Use JCTableEnum.LABEL to display the data from the column label or a valid row number to display cell data.

Parameters:
value - the new row number to do the tracking

isIgnoreContainerSize

public boolean isIgnoreContainerSize()
Gets the table's IgnoreContainerSize value.

Note: JScrollPane contains table correctly without using this logic -- so this is not implemented anywhere.

Returns:
the current IgnoreContainerSize value
See Also:
setIgnoreContainerSize(boolean)

setIgnoreContainerSize

public void setIgnoreContainerSize(boolean value)
Determines whether the size of the table is determined by its container. This property should be set to true when the table is placed in a scrollpane so that table will take the maximum amount of space required to display all cells.

Parameters:
value - the new IgnoreContainerSize value

getJumpScroll

public int getJumpScroll()
Gets the table's JumpScroll value.

Returns:
the current JumpScroll value; one of JCTableEnum.JUMP_NONE, JCTableEnum.JUMP_HORIZONTAL, JCTableEnum.JUMP_VERTICAL, or JCTableEnum.JUMP_ALL
See Also:
setJumpScroll(int)

setJumpScroll

public void setJumpScroll(int value)
Sets the scrolling behavior of each scrollbar. Scrollbars can either scroll smoothly or "jump" scroll in whole row/column increments. When set to JCTableEnum.JUMP_NONE (default), both scrollbars will scroll smoothly. To enable jump scroll for the horizontal, vertical or both scrollbars, use JCTableEnum.JUMP_HORIZONTAL, JCTableEnum.JUMP_VERTICAL, or JCTableEnum.JUMP_ALL respectively.

Parameters:
value - the new JumpScroll value; one of JCTableEnum.JUMP_NONE, JCTableEnum.JUMP_HORIZONTAL, JCTableEnum.JUMP_VERTICAL, or JCTableEnum.JUMP_ALL

getLeftColumn

public int getLeftColumn()
Gets the table's LeftColumn value.

Returns:
the current LeftColumn value
See Also:
setLeftColumn(int)

setLeftColumn

public void setLeftColumn(int value)
Sets the non-frozen column at least partially visible at the left side of the window. This value is updated as a user scrolls through a table.

When set, the table scrolls to display the column at the left side of the window. This value is always larger or equal to the number of frozen columns.

Parameters:
value - the new LeftColumn value

getMarginHeight

public int getMarginHeight()
Gets the table's MarginHeight value.

Returns:
the current MarginHeight value
See Also:
setMarginHeight(int)

setMarginHeight

public void setMarginHeight(int value)
Sets the distance (in pixels) between the inside edge of the cell border and the top and bottom edge of the cell's contents (default it 2).

Parameters:
value - the new MarginHeight value

getMarginWidth

public int getMarginWidth()
Gets the table's MarginWidth value.

Returns:
the current MarginWidth value
See Also:
setMarginWidth(int)

setMarginWidth

public void setMarginWidth(int value)
Sets the distance (in pixels) between the inside edge of the cell border and the left/right edge of the cell's contents (default is 3). This property affects the entire table.

Parameters:
value - the new MarginWidth value

getMaxHeight

public int getMaxHeight(int row)
Returns the MaxHeight value for a row.

Parameters:
row - the row whose maximum height is to be returned
Returns:
the current MaxHeight value for a row
See Also:
setMaxHeight(int, int)

setMaxHeight

public void setMaxHeight(int row,
                         int value)
Sets the maximmum number of pixels for a row.

Parameters:
row - row whose maximum height is to be set; this may be a specified row, JCTableEnum.LABEL (for column labels), JCTableEnum.ALLCELLS (for all cells), or JCTableEnum.ALL (for all rows)
value - the new MaxHeight value for a row

getMaxWidth

public int getMaxWidth(int column)
Returns the MaxWidth value for a column.

Parameters:
column - the column whose maximum width is to be returned
Returns:
the current MaxWidth value for a column
See Also:
setMaxWidth(int, int)

setMaxWidth

public void setMaxWidth(int column,
                        int value)
Sets the maximmum number of pixels for a column.

Parameters:
column - column whose maximum width is to be set; this may be a specified column, JCTableEnum.LABEL (for row labels), JCTableEnum.ALLCELLS (for all cells), or JCTableEnum.ALL (for all columns)
value - the new MaxWidth value for a column

getMinCellVisibility

public int getMinCellVisibility()
Gets the table's MinCellVisibility value.

Returns:
the current MinCellVisibility value
See Also:
setMinCellVisibility(int)

setMinCellVisibility

public void setMinCellVisibility(int value)
Sets the minimum amount of a cell that is made visible when edited. When the table scrolls to edit a non-visible cell, this property determines the percentage of the cell that is scrolled into view.

When set to 100, the cell is made completely visible.

When set to 10, only 10% of the cell is made visible.

Parameters:
value - the new MinCellVisibility value

getMinHeight

public int getMinHeight(int row)
Returns the MinHeight value for a row.

Parameters:
row - the row whose minimum height is to be returned
Returns:
the current MinHeight value for a row
See Also:
setMinHeight(int, int)

setMinHeight

public void setMinHeight(int row,
                         int value)
Sets the minimum number of pixels for a row.

Parameters:
row - row whose minimum height is to be set; this may be a specified row, JCTableEnum.LABEL (for column labels), JCTableEnum.ALLCELLS (for all cells), or JCTableEnum.ALL (for all rows)
value - the new MinHeight value for a row

getMinWidth

public int getMinWidth(int column)
Returns the MinWidth value for a column.

Parameters:
column - the column whose minimum width is to be returned
Returns:
the current MinWidth value for a column
See Also:
setMinWidth(int, int)

setMinWidth

public void setMinWidth(int column,
                        int value)
Sets the minimum number of pixels for a column.

Parameters:
column - column whose minimum width is to be set; this may be a specified column, JCTableEnum.LABEL (for row labels), JCTableEnum.ALLCELLS (for all cells), or JCTableEnum.ALL (for all columns)
value - the new MinWidth value for a column

getPixelHeight

public int getPixelHeight(int row)
Returns the PixelHeight value for a row, previous set using setPixelHeight.

Parameters:
row - the row whose height is to be returned
Returns:
the current PixelHeight value for a row
See Also:
setPixelHeight(int, int)

setPixelHeight

public void setPixelHeight(int row,
                           int value)
Sets the height of a row in pixels. Use JCTableEnum.NOVALUE to control height by character value.

The following special values are valid:

JCTableEnum.NOVALUE            Use character setting to control
                               the size of a row
JCTableEnum.AS_IS              Do not change. Use to convert from
                               VARIABLE to fixed size
JCTableEnum.VARIABLE           Set to the highest value in the row
JCTableEnum.VARIABLE_ESTIMATE  Set to the highest value in the
                               first VariableCount cells
 

No pixel setting can violate the minimum and maximum values for a row.

Parameters:
row - the row whose height is being set
value - the new PixelHeight value for a row

getPixelWidth

public int getPixelWidth(int column)
Returns the PixelWidth value for a column, previously set using setPixelWidth.

Parameters:
column - the column whose width is to be returned
Returns:
the current PixelWidth value for a column
See Also:
setPixelWidth(int, int)

setPixelWidth

public void setPixelWidth(int column,
                          int value)
Sets the width of a column in pixels. Use JCTableEnum.NOVALUE to control width by character value.

The following special values are valid:

JCTableEnum.NOVALUE            Use character setting to control
                               the size of a column
JCTableEnum.AS_IS              Do not change. Use to convert from
                               VARIABLE to fixed size
JCTableEnum.VARIABLE           Set to the highest value in the column
JCTableEnum.VARIABLE_ESTIMATE  Set to the highest value in the
                               first VariableCount cells
 

No pixel setting can violate the minimum and maximum values for a column.

Parameters:
column - the column whose width is being set
value - the new PixelWidth value for a column

isRepaintEnabled

public boolean isRepaintEnabled()
Gets the table's RepaintEnabled value.

Returns:
the current RepaintEnabled value
See Also:
setRepaintEnabled(boolean)

setRepaintEnabled

public void setRepaintEnabled(boolean value)
Sets whether the table should be redrawn and recomputed whenever one of its properties is set (default is true). If false, setting a property will have no effect until RepaintEnabled is switched to true.

Parameters:
value - the new RepaintEnabled value

isResizeEven

public boolean isResizeEven()
Gets the table's ResizeEven value to determine whether all column widths or row heights are resized to the same value.

Returns:
the current ResizeEven value
See Also:
setResizeEven(boolean)

setResizeEven

public void setResizeEven(boolean value)
If set to true, when a column width or row height is changed interactively, all columns or rows are resized to the same value. Labels are not affected.

Parameters:
value - the new ResizeEven value

isResizeInteractive

public boolean isResizeInteractive()
Gets the table's ResizeInteractive value to determine whether table repaints during the resize of a column or row.

Returns:
the current ResizeInteractive value
See Also:
setResizeInteractive(boolean)

setResizeInteractive

public void setResizeInteractive(boolean value)
If set to true, when a column width or row height is changed interactively, table is repainted to reflect the new value during the drag event.

Parameters:
value - the new ResizeInteractive value

isRowHidden

public boolean isRowHidden(int row)
Returns true if the row is hidden.

Parameters:
row - the row index
Returns:
whether the specified row is hidden
See Also:
setRowHidden(int, boolean)

setRowHidden

public void setRowHidden(int row,
                         boolean value)
Hides or shows a given row.

Parameters:
row - the row index
value - if true, hide the specified row; if false, it is not hidden

isRowLabelDisplay

public boolean isRowLabelDisplay()
Gets the table's RowLabelDisplay value.

Returns:
the current RowLabelDisplay value
See Also:
setRowLabelDisplay(boolean)

setRowLabelDisplay

public void setRowLabelDisplay(boolean value)
Determines whether row labels are displayed. Default is true.

Parameters:
value - the new RowLabelDisplay value

getRowLabelOffset

public int getRowLabelOffset()
Gets the table's RowLabelOffset value.

Returns:
the current RowLabelOffset value which specifies the spacing between the row labels and the cell area in pixels
See Also:
setRowLabelOffset(int)

setRowLabelOffset

public void setRowLabelOffset(int value)
Sets the spacing between the row labels and the cell area in pixels (default is 0). If a negative value is specified, the labels will overlap the cell area.

Parameters:
value - the new RowLabelOffset value

getRowLabelPlacement

public int getRowLabelPlacement()
Gets the table's RowLabelPlacement value.

Returns:
the current RowLabelPlacement value; one of JCTableEnum.PLACE_LEFT or JCTableEnum.PLACE_RIGHT
See Also:
setRowLabelPlacement(int)

setRowLabelPlacement

public void setRowLabelPlacement(int value)
Sets the position of the row labels relative to the cells. Valid values are:

Parameters:
value - the current RowLabelPlacement value; one of JCTableEnum.PLACE_LEFT or JCTableEnum.PLACE_RIGHT

getSelectedBackground

public Color getSelectedBackground()
Gets the table's SelectedBackground value.

Returns:
the current SelectedBackground value
See Also:
setSelectedBackground(java.awt.Color)

setSelectedBackground

public void setSelectedBackground(Color value)
Sets the background color of user-selected cells (default is the cell's foreground color). Use SelectedBackgroundMode to determine how the selected background is determined.

Parameters:
value - the new SelectedBackground value
See Also:
setSelectedBackgroundMode(int)

getSelectedBackgroundMode

public int getSelectedBackgroundMode()
Gets the table's SelectedBackgroundMode value.

Returns:
the current SelectedBackgroundMode value; one of JCTableEnum.USE_SELECTED_BACKGROUND, JCTableEnum.USE_CELL_BACKGROUND, or JCTableEnum.USE_CELL_FOREGROUND
See Also:
setSelectedBackgroundMode(int)

setSelectedBackgroundMode

public void setSelectedBackgroundMode(int value)
Sets the table's SelectedBackgroundMode. If the mode is JCTableEnum.USE_SELECTED_BACKGROUND, the selected background color is determined by the SelectedBackground property. In order to keep the selected background identical to the cell background, use JCTableEnum.USE_CELL_BACKGROUND. To inverse the background/foreground colors, use JCTableEnum.USE_CELL_FOREGROUND.

Parameters:
value - the new SelectedBackgroundMode value; one of JCTableEnum.USE_SELECTED_BACKGROUND, JCTableEnum.USE_CELL_BACKGROUND, or JCTableEnum.USE_CELL_FOREGROUND

getSelectedForeground

public Color getSelectedForeground()
Gets the table's SelectedForeground value.

Returns:
the current SelectedForeground value
See Also:
setSelectedForeground(java.awt.Color)

setSelectedForeground

public void setSelectedForeground(Color value)
Sets the foreground color of user-selected cells (default is the cell's background color). Use SelectedForegroundMode to determine how the selected foreground is determined.

Parameters:
value - the new SelectedForeground value
See Also:
setSelectedForegroundMode(int)

getSelectedForegroundMode

public int getSelectedForegroundMode()
Gets the table's SelectedForegroundMode value.

Returns:
the current SelectedForegroundMode value; one of JCTableEnum.USE_SELECTED_FOREGROUND, JCTableEnum.USE_CELL_BACKGROUND, or JCTableEnum.USE_CELL_FOREGROUND
See Also:
setSelectedForegroundMode(int)

setSelectedForegroundMode

public void setSelectedForegroundMode(int value)
Sets the table's SelectedForegroundMode. If the mode is JCTableEnum.USE_SELECTED_FOREGROUND, the selected foreground color is determined by the SelectedForeground property. In order to keep the selected foreground identical to the cell foreground, use JCTableEnum.USE_CELL_FOREGROUND. To inverse the background/foreground colors, use JCTableEnum.USE_CELL_BACKGROUND.

Parameters:
value - the new SelectedForegroundMode value; one of JCTableEnum.USE_SELECTED_FOREGROUND, JCTableEnum.USE_CELL_BACKGROUND, or JCTableEnum.USE_CELL_FOREGROUND

getSelectIncludeLabels

public boolean getSelectIncludeLabels()
Gets the table's SelectIncludeLabels value.

Returns:
the current SelectIncludeLabels value
See Also:
setSelectIncludeLabels(boolean)

setSelectIncludeLabels

public void setSelectIncludeLabels(boolean value)
Sets the selection behavior for row and column labels. When SelectIncludeLabels is set, full row or column selection does not display labels as selected.

Parameters:
value - the new SelectIncludeLabels value

getSelectionPolicy

public int getSelectionPolicy()
Gets the table's SelectionPolicy value.

Returns:
the current SelectionPolicy value; one of JCTableEnum.SELECT_NONE, JCTableEnum.SELECT_SINGLE, JCTableEnum.SELECT_RANGE, or JCTableEnum.SELECT_MULTIRANGE
See Also:
setSelectionPolicy(int)

setSelectionPolicy

public void setSelectionPolicy(int value)
Sets the selection behavior allowed on the table, both by end-users and by the application. Valid values are:
 JCTableEnum.SELECT_NONE        No selection is allowed
 JCTableEnum.SELECT_SINGLE      Selection of only one cell allowed
 JCTableEnum.SELECT_RANGE       Selection of only one range of cells allowed
 JCTableEnum.SELECT_MULTIRANGE  Selection of multiple ranges of cells allowed
 
When SelectionPolicy is set to JCTableEnum.SELECT_NONE, SELECT events are not posted as a user edits or attempts to select cells. Setting this property clears the selected cell list.

Parameters:
value - the new SelectionPolicy value; one of JCTableEnum.SELECT_NONE, JCTableEnum.SELECT_SINGLE, JCTableEnum.SELECT_RANGE, or JCTableEnum.SELECT_MULTIRANGE

isSeriesDataSorted

public boolean isSeriesDataSorted()
Returns true if series data (styles, cell dimensions, and so on) are maintained in sync with data when it is sorted.

Returns:
whether series data is kept in sync with the data
See Also:
setSeriesDataSorted(boolean)

setSeriesDataSorted

public void setSeriesDataSorted(boolean value)
Sets whether series data (styles, cell dimensions, and so on) are maintained in sync with data when it is sorted.

Parameters:
value - if true, series data is kept in sync with the data

isStoreImageEnabled

public boolean isStoreImageEnabled()
Returns true if an image of table is maintained offscreen. Disabling StoreImage will affect scroll performance.

Returns:
whether an image of table is maintained offscreen

setStoreImageEnabled

public void setStoreImageEnabled(boolean value)
Determines whether an image of table is maintained offscreen. This is independent of JComponent's double buffering and is used to optimize scroll performance.

Parameters:
value - if true, an image of the table is maintained offscreen

getTopRow

public int getTopRow()
Gets the table's TopRow value.

Returns:
the current TopRow value
See Also:
setTopRow(int)

setTopRow

public void setTopRow(int value)
Sets the non-frozen row at least partially visible at the top of the window. This value is updated as a user scrolls through the table. When set, the table scrolls to display the row at the top of the window.

Parameters:
value - the new TopRow value

getTrackBackground

public Color getTrackBackground()
Returns the background color of the track component.

Returns:
the current background color of the track component
See Also:
setTrackBackground(java.awt.Color)

setTrackBackground

public void setTrackBackground(Color value)
Sets the background color of the component that displays horizontal or vertical scrollbar tracking info.

Parameters:
value - the new background color of the track component

getTrackForeground

public Color getTrackForeground()
Returns the foreground color of the track component.

Returns:
the current foreground color of the track component
See Also:
setTrackForeground(java.awt.Color)

setTrackForeground

public void setTrackForeground(Color value)
Sets the foreground color of the component that display horizontal or vertical scrollbar tracking info.

Parameters:
value - the new foreground color of the track component

getTrackSize

public Dimension getTrackSize()
Returns the dimensions of the component that tracks horizontal or vertical scrollbar info.

Returns:
the current dimensions of the component that tracks horizontal or vertical scrollbar info
See Also:
setTrackSize(java.awt.Dimension)

setTrackSize

public void setTrackSize(Dimension value)
Sets the dimensions of the component that tracks horizontal or vertical scrollbar info.

Parameters:
value - the new dimensions of the component that tracks horizontal or vertical scrollbar info

isTrackCursor

public boolean isTrackCursor()
Gets the table's TrackCursor value to determine whether the mouse pointer is being tracked as the user moves the mouse.

Returns:
whether the mouse pointer is being tracked as the user moves the mouse
See Also:
setTrackCursor(boolean)

setTrackCursor

public void setTrackCursor(boolean value)
Sets whether the mouse pointer should be tracked as a user moves the mouse across the table. When true, the JCTable tracks the mouse pointer and changes its shape to reflect the interactions available to the user at the location. When false, the table uses the application-defined pointer. Default is true.

Parameters:
value - if true, the mouse pointer will be tracked as the user moves the mouse

isTraverseCycle

public boolean isTraverseCycle()
Returns the TraverseCycle value for the table.

Returns:
whether the table traverses to the opposite side when the left, top, right, or bottom cell is reached
See Also:
setTraverseCycle(boolean)

setTraverseCycle

public void setTraverseCycle(boolean value)
Determines whether table traverses to the opposite side when the left, top, right, or bottom cell is reached. Default is true.

Parameters:
value - the new traverse cycle value

getVariableEstimateCount

public int getVariableEstimateCount()
Returns the number of cells to use in estimating variable pixel calculations.

The VariableEstimateCount variable is used when the setPixel[Height | Width](VARIABLE_ESTIMATE) method has been called. When that method is called with VARIABLE_ESTIMATE, it iterates over the variableEstimateCount number of rows in the table to determine the highest/widest cell contents in those rows. The method then uses this local maxima to set all row heights/widths for the table; that is, a given subset of table rows are sampled to estimate the height/width.

The default is to sample all rows, which is functionally equivalent to calling setPixel[Height | Width](VARIABLE).

Use JCTableEnum.ALL for all cells and labels (default), JCTableEnum.ALLCELLS for all cells, JCTableEnum.LABEL for labels only, or any other number to indicate the last row/column number to use (including the label).

Returns:
the current variable estimate count
See Also:
setVariableEstimateCount(int)

setVariableEstimateCount

public void setVariableEstimateCount(int value)
Sets the number of cells to use in estimating variable pixel calculations.

The VariableEstimateCount variable is used when the setPixel[Height | Width](VARIABLE_ESTIMATE) method has been called. When that method is called with VARIABLE_ESTIMATE, it iterates over the variableEstimateCount number of rows in the table to determine the highest/widest cell contents in those rows. The method then uses this local maxima to set all row heights/widths for the table, that is, a given subset of table rows are sampled to estimate the height/width.

The default is to sample all rows, which is functionally equivalent to calling setPixel[Height | Width](VARIABLE).

Use JCTableEnum.ALL for all cells and labels (default), JCTableEnum.ALLCELLS for all cells, JCTableEnum.LABEL for labels only, or any other number to indicate the last row/column number to use (including the label).

Parameters:
value - the new variable estimate count

getVertSB

public JScrollBar getVertSB()
Gets the vertical scrollbar.

Returns:
the current vertical scrollbar component

setVertSB

public void setVertSB(JScrollBar value)
Sets the vertical scrollbar.

Parameters:
value - the new vertical scrollbar component

getVertSBAttachment

public int getVertSBAttachment()
Gets the tables VertSBAttachment value.

Returns:
the current VertSBAttachment value; one of JCTableEnum.SIZE_TO_CELLS or JCTableEnum.SIZE_TO_TABLE
See Also:
setVertSBAttachment(int)

setVertSBAttachment

public void setVertSBAttachment(int value)
Sets how the end of the vertical scrollbar is attached to the table. When set to JCTableEnum.SIZE_TO_CELLS (default), the scrollbar ends at the edge of the visible cells.

When set to JCTableEnum.SIZE_TO_TABLE, the scrollbar ends at the edge of the table. This setting should be used in conjunction with HorizSBPosition.

Parameters:
value - the new VertSBAttachment value; one of JCTableEnum.SIZE_TO_CELLS or JCTableEnum.SIZE_TO_TABLE

getVertSBDisplay

public int getVertSBDisplay()
Gets the table's VertSBDisplay value to determine when to display scrollbars.

Returns:
the current VertSBDisplay value; one of JCTableEnum.SCROLLBAR_ALWAYS, JCTableEnum.SCROLLBAR_NEVER, or JCTableEnum.SCROLLBAR_AS_NEEDED
See Also:
setVertSBDisplay(int)

setVertSBDisplay

public void setVertSBDisplay(int value)
Sets when to display the vertical scrollbar. Valid values are:
 JCTableEnum.SCROLLBAR_ALWAYS        always displayed
 JCTableEnum.SCROLLBAR_NEVER         never displayed
 JCTableEnum.SCROLLBAR_AS_NEEDED     displayed when the rows or
                                   columns are not visible

Parameters:
value - the new VertSBDisplay value; one of JCTableEnum.SCROLLBAR_ALWAYS, JCTableEnum.SCROLLBAR_NEVER, or JCTableEnum.SCROLLBAR_AS_NEEDED

getVertSBOffset

public int getVertSBOffset()
Gets the table's VertSBOffset value.

Returns:
the current VertSBOffset value
See Also:
setVertSBOffset(int)

setVertSBOffset

public void setVertSBOffset(int value)
Sets the distance (in pixels) between the vertical scrollbar and the table (default is 0).

Parameters:
value - the new VertSBOffset value

getVertSBPosition

public int getVertSBPosition()
Gets the table's VertSBPosition value.

Returns:
the current VertSBPosition value; one of JCTableEnum.POSITION_BY_CELLS or JCTableEnum.POSITION_AT_SIDE
See Also:
setVertSBPosition(int)

setVertSBPosition

public void setVertSBPosition(int value)
Sets how the vertical scrollbar is attached to the table. When set to JCTableEnum.POSITION_BY_CELLS (default), the scrollbar is attached to the cell/labels.

When set to JCTableEnum.POSITION_AT_SIDE, the scrollbar is attached to the edge of the table within its container.

Parameters:
value - the new VertSBPosition value; one of JCTableEnum.POSITION_BY_CELLS or JCTableEnum.POSITION_AT_SIDE

getVertSBTrack

public int getVertSBTrack()
Gets the table's VertSBTrack value.

Returns:
the current VertSBTrack value; one of JCTableEnum.TRACK_LIVE, JCTableEnum.TRACK_ROW_NUMBER, or JCTableEnum.TRACK_COLUMN
See Also:
setVertSBTrack(int)

setVertSBTrack

public void setVertSBTrack(int value)
Sets how the vertical scrollbar works during tracking. When set to JCTableEnum.TRACK_LIVE, THE table redisplays during scrollbar tracking. When set to JCTableEnum.TRACK_ROW_NUMBER, the table redisplays after tracking completes and displays the number of the top row during the track. Use JCTableEnum.TRACK_COLUMN and setVertSBTrackColumn to specify a column number in order to use data from the row to indicate the top-most row.

Parameters:
value - the new VertSBTrack value; one of JCTableEnum.TRACK_LIVE, JCTableEnum.TRACK_ROW_NUMBER, or JCTableEnum.TRACK_COLUMN

getVertSBTrackColumn

public int getVertSBTrackColumn()
Gets the column number that determines the text to display when the track indicator is displayed.

Returns:
the current column number that determines the text to display when the track indicator is displayed
See Also:
setVertSBTrackColumn(int)

setVertSBTrackColumn

public void setVertSBTrackColumn(int value)
Sets the column number that determines the text to display when the track indicator is displayed. Use JCTableEnum.LABEL to display the data from the row label or a valid column number to display cell data.

Parameters:
value - the new column number that determines the text to display when the track indicator is displayed

getVisibleColumns

public int getVisibleColumns()
Gets the number of non-frozen columns visible in the table.

Returns:
the current number of non-frozen columns visible in the table
See Also:
setVisibleColumns(int)

setVisibleColumns

public void setVisibleColumns(int value)
Sets the number of non-frozen columns used to determine the preferred size of the table. This value is used in preferred size calculations and is not updated as the table is resized. Use getNumVisibleColumns to obtain the actual number currently visible.

Setting this property to JCTableEnum.NOVALUE causes the table to attempt to resize to make all columns visible.

Parameters:
value - the new number of non-frozen columns visible in the table

getVisibleRows

public int getVisibleRows()
Gets the number of non-frozen rows visible in the table.

Returns:
the current number of non-frozen rows visible in the table
See Also:
setVisibleRows(int)

setVisibleRows

public void setVisibleRows(int value)
Sets the number of non-frozen rows used to determine the preferred size of the table. This value is used in preferred size calculations and is not updated as the table is resized. Use getNumVisibleRows to obtain the actual number currently visible.

Setting this property to JCTableEnum.NOVALUE causes the table to attempt to resize to make all rows visible.

Parameters:
value - the new number of non-frozen rows visible in the table

beginEdit

public boolean beginEdit(int row,
                         int column)
Initiates edit for the given cell, if the cell is editable.

Parameters:
row - the row index of the cell
column - the column index of the cell
Returns:
false if edit is not possible because the cell is non-existant or not editable/traversable

cancelEdit

public boolean cancelEdit(boolean hide)
Cancels interactive editing of a cell and, as an option, hides the cell editor. Any text entered or changed in the current cell by the user is discarded.

Parameters:
hide - determines whether or not to hide the cell editor
Returns:
false if no edit is in progress

getCellBounds

public Rectangle getCellBounds(int row,
                               int column)
Returns the bounds of a cell.

Parameters:
row - the row index of the cell
column - the column index of the cell
Returns:
a rectangle which contains the bounds of the cell

getCellPosition

public Point getCellPosition(int row,
                             int column)
Returns the position of the top-left corner of a cell.

Parameters:
row - the row index of the cell
column - the column index of the cell
Returns:
a Point object which contains the position of the top-left corner of a cell

isCellVisible

public boolean isCellVisible(int row,
                             int column)
Returns true if the given cell is visible.

Parameters:
row - the row index of the cell
column - the column index of the cell
Returns:
true if the cell is visible

commitEdit

public boolean commitEdit(boolean hide)
Commits interactive cell editing internally, saving any changes made by the user.

Parameters:
hide - determines whether to hide the editor
Returns:
false if no edit is in progress or the commit is rejected

getColumnPixelWidth

public int getColumnPixelWidth(int column)
Returns the actual pixel width for a column.

Parameters:
column - the index of the column
Returns:
the pixel width for the given column

isColumnVisible

public boolean isColumnVisible(int column)
Returns true if the given column is visible.

Parameters:
column - the index of the column
Returns:
true if the given column is visible

isContentClipped

public boolean isContentClipped(int row,
                                int column)
Returns true if the full content of the cell is not displayed because of the size of the cell.

Parameters:
row - the row index of the cell
column - the column index of the cell
Returns:
true if the content of the cell is clipped

getCurrentCell

public com.klg.jclass.table.JCCellPosition getCurrentCell()
Gets the current cell in the table. See getCurrentRow and getCurrentColumn for the definition of current.

Returns:
the position of the current cell
See Also:
getCurrentRow(), getCurrentColumn()

isCurrentCell

public boolean isCurrentCell(int row,
                             int column)
Returns true if the given row and column is the current cell.

Parameters:
row - the row index of the cell
column - the column index of the cell
Returns:
true if the cell at (row, column) is the current cell

setCurrentCell

public void setCurrentCell(com.klg.jclass.table.JCCellPosition cell)
Sets the current cell in the table. If the cell is not traversable, the next traversable cell is set as current.

Parameters:
cell - the position of the cell to make current

setCurrentCell

public void setCurrentCell(int row,
                           int column)
Sets the current cell in the table given a row and column. If the cell is not traversable, the next traversable cell is set as current.

Parameters:
row - the row index of the cell
column - the column index of the cell

setCurrentCell

protected void setCurrentCell(int row,
                              int column,
                              int direction)
Sets the current cell in the table given a row and column. If the cell is not traversable, the next traversable cell in the given direction is set as current.

Parameters:
row - the row index of the cell
column - the column index of the cell
direction - the direction to go if the indicated cell is not traversable

getCurrentRow

public int getCurrentRow()
Gets the current row in the table. The current row is defined as: the row containing an editor, the row containing the focus rectangle, or the top row in the last selected region.

Returns:
the current row

getCurrentColumn

public int getCurrentColumn()
Gets the current column in the table. The current column is defined as: the column containing an editor, the column containing the focus rectangle, or the left column in the last selected region.

Returns:
the current column

getEditingComponent

public Component getEditingComponent()
Gets the component associated with the currently displayed editor. If no cell is being edited, getEditingComponent returns null.

Returns:
the currently displayed editor, if any

hasComponents

public boolean hasComponents()
Returns true if there are components in table.

Returns:
whether there are components in this table

isCell

public static final boolean isCell(int row,
                                   int column)
Returns true if the row and column consititute a valid cell.

Parameters:
row - the row index of the cell
column - the column index of the cell
Returns:
true if the row/column combination consititutes a valid cell

isColumnLabel

public static final boolean isColumnLabel(int row,
                                          int column)
Returns true if the row and column consititute a valid column label.

Parameters:
row - the row index of the cell
column - the column index of the cell
Returns:
true if the row/column combination consititutes a valid column label

dragColumn

public boolean dragColumn(int column1,
                          int column2)
Allows users to drag a column and drop it into a new location by remapping the internal order of columns. This method does not affect the data source. Use JCTableEnum.MAXINT as the end point in order to move the column to the end.

Parameters:
column1 - the original location of the column
column2 - the new location of the column
Returns:
an indication to whether the drag suceeded

dragRow

public boolean dragRow(int row1,
                       int row2)
Allows users to drag a row and drop it into a new location by remapping the internal order of rows. This method does not affect the data source. Use JCTableEnum.MAXINT as the end point in order to move the row to the end.

Parameters:
row1 - the original location of the row
row2 - the new location of the row
Returns:
an indication to whether the drag suceeded

isEditable

public boolean isEditable(int row,
                          int column)
Returns true if the given cell is editable.

Parameters:
row - the row index of the cell
column - the column index of the cell
Returns:
whether the cell at (row, column) is editable

isFocusTraversable

public boolean isFocusTraversable()
Overrides JComponent.isFocusTraversable and returns true, indicating that the table is a focusable component.

Overrides:
isFocusTraversable in class Component
Returns:
true

isLabel

public static final boolean isLabel(int row,
                                    int column)
Returns true if the row and column constitute a valid label.

Parameters:
row - the row index of the possible label
column - the column index of the possible label
Returns:
an indication of whether the row/column combination is a valid label

isRowLabel

public static final boolean isRowLabel(int row,
                                       int column)
Returns true if the row and column constitute a valid row label.

Parameters:
row - the row index of the possible label
column - the column index of the possible label
Returns:
an indication of whether the row/column combination is a valid label

makeVisible

public boolean makeVisible(int row,
                           int column)
Scrolls a frozen or non-frozen cell or label so it is visible on the screen.

Parameters:
row - the row index of the cell
column - the column index of the cell
Returns:
false if the position is invalid

makeColumnVisible

public boolean makeColumnVisible(int column)
Scrolls a column so it is visible on the screen.

Parameters:
column - the column index of the cell
Returns:
false if the column is invalid

makeRowVisible

public boolean makeRowVisible(int row)
Scrolls a row so it is visible on the screen.

Parameters:
row - the row index of the cell
Returns:
false if the row is invalid

isRowVisible

public boolean isRowVisible(int row)
Returns true if the given row is visible.

Parameters:
row - the row index of row whose visibility is required
Returns:
whether the given row is visible

getNumColumns

public int getNumColumns()
Gets the number of columns in the table from the data source.

Returns:
the current number of columns in the table's data source

getNumRows

public int getNumRows()
Gets the number of rows in the table from the data source.

Returns:
the current number of rows in the table's data source

getNumVisibleColumns

public int getNumVisibleColumns()
Gets the number of visible columns. This value reflects the number of scrollable columns that are currently visible.

Returns:
the current number of visible columns in the table

getNumVisibleRows

public int getNumVisibleRows()
Gets the number of visible rows. This value reflects the number of scrollable rows that are currently visible.

Returns:
the current number of visible rows in the table

getPosition

public com.klg.jclass.table.JCCellPosition getPosition(Component c)
Returns the JCCellPosition of the given component in table. Returns null if the component is not found.

Parameters:
c - the component whose position is required
Returns:
the cell position of the component

resetSwappedColumns

public void resetSwappedColumns()
Resets the internal column mapping array.


resetSwappedRows

public void resetSwappedRows()
Resets the internal row mapping array.


resetSortedRows

public void resetSortedRows()
Resets the internal row mapping array used for sorted rows. resetSwappedRows and resetSortedRows perform the same function.


isResizable

public boolean isResizable(int row,
                           int column)

getRowPixelHeight

public int getRowPixelHeight(int row)
Returns the actual pixel height for a row.

Parameters:
row - the index of the row whose pixel height is required
Returns:
the pixel height of the given row

sortByColumn

public boolean sortByColumn(int column,
                            int direction)
Sorts the rows in the table based on a specified column and direction. Sorting does not affect the datasource and requires a SortableDataViewModel.

Parameters:
column - the column on which to base the sort
direction - either Sort.ASCENDING or Sort.DESCENDING
Returns:
whether sort succeeded

sortByColumn

public boolean sortByColumn(int column,
                            int direction,
                            int start_row,
                            int end_row)
Sorts a range of rows in the table based on a specified column and direction. Sorting does not affect the datasource and requires a SortableDataViewModel.

Parameters:
column - the column on which to base the sort
direction - either Sort.ASCENDING or Sort.DESCENDING
start_row - the start row of the sort
end_row - the end row of the sort
Returns:
whether sort succeeded

sortByColumn

public boolean sortByColumn(int[] column,
                            int[] direction)
Sorts the rows in a table based on multiple columns and direction. Sorting does not affect the datasource and requires a SortableDataViewModel.

Parameters:
column - a list of columns by which to sort
direction - a corresponding list of directions to sort
Returns:
whether sort succeeded

sortByColumn

public boolean sortByColumn(int[] column,
                            int[] direction,
                            int start_row,
                            int end_row)
Sorts a range of rows in the table based on multiple columns and directions. Sorting does not affect the datasource and requires a SortableDataViewModel.

Parameters:
column - a list of columns by which to sort
direction - a corresponding list of directions to sort
start_row - the start row of the sort
end_row - the end row of the sort
Returns:
whether sort succeeded

swapColumns

public boolean swapColumns(int column1,
                           int column2)
Swaps two columns in the table without modifying the data source. The swapped columns retain their properties except for selected cells and spanned cells.

Parameters:
column1 - the first column to swap
column2 - the second column to swap
Returns:
whether swap succeeded

swapRows

public boolean swapRows(int row1,
                        int row2)
Swaps two rows in the table without modifying the data source. The swapped rows retain all their properties except spanned cells. If the selection policy is currently set to JCTblEnum.SELECT_MULTIRANGE, the selected cells follow the new row order.

Parameters:
row1 - the first row to swap
row2 - the second row to swap
Returns:
whether swap succeeded
See Also:
setSelectionPolicy(int)

traverse

public boolean traverse(int row,
                        int column,
                        boolean show_editor,
                        boolean select)
Attempts to move the current cell focus to a new location. commitEdit is first called to commit the edit in the current cell. If commitEdit returns false, traverse returns false and does not move the focus. If the cell is not traversable, the method returns false.

Parameters:
row - the row to traverse to
column - the column to traverse to
show_editor - if true, the editing component is displayed in the cell
select - if true and the SelectionPolicy allows it, the cell is selected
Returns:
whether traverse suceeded

traverse

public boolean traverse(int direction)
Attempts to move the current cell focus to a new location given a direction.

Parameters:
direction - the direction to traverse; one of JCTableEnum.TRAVERSE_DOWN, JCTableEnum.TRAVERSE_UP, JCTableEnum.TRAVERSE_LEFT, JCTableEnum.TRAVERSE_RIGHT, JCTableEnum.TRAVERSE_PAGEUP, JCTableEnum.TRAVERSE_PAGEDOWN, JCTableEnum.TRAVERSE_HOME, JCTableEnum.TRAVERSE_END, JCTableEnum.TRAVERSE_TOP, or JCTableEnum.TRAVERSE_BOTTOM
Returns:
whether traverse succeeded

isTraversable

public boolean isTraversable(int row,
                             int column)
Returns true if the given cell is traversable.

Parameters:
row - the row index of the cell
column - the column index of the cell
Returns:
whether the given cell is traversable

isValidCell

protected boolean isValidCell(int row,
                              int column)
Returns true if the given cell is valid.

Parameters:
row - the row index of the cell
column - the column index of the cell
Returns:
Is the given cell valid?

getVisibleCells

public com.klg.jclass.table.JCCellRange getVisibleCells()
Returns the range of scrollable cells that are currently visible.

Returns:
the range of scrollable cells that are currently visible

XYToCell

public com.klg.jclass.table.JCCellPosition XYToCell(int x,
                                                    int y)
Returns the cell located at the x, y position.

Parameters:
x - the x position
y - the y position
Returns:
the cell position of the cell located at (x, y)

isTracking

public boolean isTracking()
Returns the scrollbar tracking state. During the tracking the table does not adjust according to the scrollbar value, but redisplays after the tracking completes.

Returns:
the scrollbar tracking state

addAction

public void addAction(com.klg.jclass.table.ActionInitiator initiator,
                      int action)
Adds an ActionInitiator/action pair to table (stored in a TableAction).

Parameters:
initiator - the key or mouse event initiating the action
action - the action to add
See Also:
addAction(TableAction)

addAction

public void addAction(com.klg.jclass.table.TableAction tableAction)
Adds a TableAction to table. A TableAction maps an event to a particular action on table. Valid actions include:

Parameters:
tableAction - defines a mapping from a user event to an action performed on the table

getAction

public int getAction(AWTEvent event,
                     int row,
                     int column)
Returns the action mapped to the given event. If no action exists, JCTableEnum.NOVALUE is returned.

Parameters:
event - the event to which an action is to be mapped
row - the row on which the action is to be taken
column - the column on which the action is to be taken
Returns:
the action mapped to the event on the row/column

removeAction

public void removeAction(com.klg.jclass.table.TableAction tableAction)
Removes an action from table.

Parameters:
tableAction - the action to be removed

removeAction

public void removeAction(com.klg.jclass.table.ActionInitiator initiator,
                         int action)
Removes an ActionInitiator/action pair from table.

Parameters:
initiator - the key or mouse event initiating the action
action - the action to remove

removeAction

public void removeAction(int action)
Removes any ActionInitiator set for the given action type.

Parameters:
action - the action to be removed

removeAllActions

public void removeAllActions()
Removes all actions from table.


processMouseEvent

protected void processMouseEvent(MouseEvent e)
Overrides:
processMouseEvent in class Component

processMouseMotionEvent

protected void processMouseMotionEvent(MouseEvent e)
Overrides:
processMouseMotionEvent in class JComponent

processKeyEvent

protected void processKeyEvent(KeyEvent e)
Overrides:
processKeyEvent in class JComponent

mouseDragged

public void mouseDragged(MouseEvent e)

mouseMoved

public void mouseMoved(MouseEvent e)

mousePressed

public void mousePressed(MouseEvent e)

mouseReleased

public void mouseReleased(MouseEvent e)

mouseClicked

public void mouseClicked(MouseEvent e)

mouseEntered

public void mouseEntered(MouseEvent e)

mouseExited

public void mouseExited(MouseEvent e)

keyPressed

public void keyPressed(KeyEvent e)

keyReleased

public void keyReleased(KeyEvent e)

keyTyped

public void keyTyped(KeyEvent e)

getSelectionModel

public com.klg.jclass.table.SelectionModel getSelectionModel()
Returns the SelectionModel manager.

Returns:
the SelectionModel manager

createDefaultSelectionModel

protected void createDefaultSelectionModel()
Creates the default SelectionModel manager.


setSelectionModel

public void setSelectionModel(com.klg.jclass.table.SelectionModel selectionHandler)
Sets the SelectionModel manager.

Parameters:
selectionHandler - the new selection handler

setRowSelection

public boolean setRowSelection(int start_row,
                               int end_row)
Selects a range of rows.

Parameters:
start_row - the start row of the selection
end_row - the end row of the selection
Returns:
whether selection succeeded

setColumnSelection

public boolean setColumnSelection(int start_column,
                                  int end_column)
Selects a range of columns.

Parameters:
start_column - the start column of the selection
end_column - the end column of the selection
Returns:
whether selection succeeded

setSelection

public boolean setSelection(int start_row,
                            int start_column,
                            int end_row,
                            int end_column)
Selects a range of cells.

Parameters:
start_row - the start row of the selection
end_row - the end row of the selection
start_column - the start column of the selection
end_column - the end column of the selection
Returns:
whether selection succeeded

addRowSelection

public boolean addRowSelection(int start_row,
                               int end_row)
Adds a range of rows to the current selection.

Parameters:
start_row - the start row of the selection to add
end_row - the end row of the selection to add
Returns:
whether selection addition succeeded

addColumnSelection

public boolean addColumnSelection(int start_column,
                                  int end_column)
Adds a range of columns to the current selection.

Parameters:
start_column - the start column of the selection to add
end_column - the end column of the selection to add
Returns:
whether selection addition succeeded

addSelection

public boolean addSelection(int start_row,
                            int start_column,
                            int end_row,
                            int end_column)
Adds a range of cells to the current selection.

Parameters:
start_row - the start row of the selection to add
end_row - the end row of the selection to add
start_column - the start column of the selection to add
end_column - the end column of the selection to add
Returns:
whether selection addition succeeded

clearSelection

public void clearSelection()
Clears all selections.


selectAll

public boolean selectAll()
Selects all cells.

Returns:
whether selection succeeded

getSelectedCells

public Collection getSelectedCells()
Gets the table's SelectedCells value.

Returns:
collection of JCCellRange objects
See Also:
setSelectedCells(java.util.Collection)

clearSelectedCells

public void clearSelectedCells()
Deselects all selected cells.

See Also:
setSelectedCells(java.util.Collection)

setSelectedCells

public boolean setSelectedCells(Collection v)
Sets the currently-selected ranges of cells. Each element of the Collection is an instance of a JCCellRange.

Parameters:
v - the collection which contains a list of ranges to select
Returns:
whether selection succeeded

setSelectedCells

public boolean setSelectedCells(com.klg.jclass.table.JCCellRange r)
Sets a range of selected cells. To unselect all cells, call clearSelectedCells().

Parameters:
r - the range to select
Returns:
whether selection succeeded
See Also:
clearSelectedCells()

isSelected

public boolean isSelected(int row,
                          int column)
Determines whether the cell is selected.

Parameters:
row - the row index of the cell
column - the column index of the cell
Returns:
whether cell at (row, column) is selected

repaintSelected

public void repaintSelected()

getSpanHandler

public com.klg.jclass.table.SpanHandler getSpanHandler()
Returns the span manager.

Returns:
the span manager

createDefaultSpanHandler

protected void createDefaultSpanHandler()
Creates the default span manager.


setSpanHandler

public void setSpanHandler(com.klg.jclass.table.SpanHandler spanHandler)
Sets the span manager.

Parameters:
spanHandler - the new span manager

addSpannedRange

public void addSpannedRange(com.klg.jclass.table.JCCellRange cr)
                     throws IllegalArgumentException
Adds a JCCellRange as a new spanned region. An IllegalArgumentException is thrown if the JCCellRange is invalid or overlaps an existing spanned cell range.

Parameters:
cr - the range defining the new spanned region to add
Throws:
IllegalArgumentException - Thrown if a cell range overlaps an existing spanned cell range.

clearSpannedRanges

public void clearSpannedRanges()
Removes all spanned cell ranges.


getSpannedRanges

public Collection getSpannedRanges()
Returns a Collection containing all of the spanned cell ranges.

Returns:
Collection containing all of the spanned cell ranges

removeSpannedRange

public void removeSpannedRange(com.klg.jclass.table.JCCellRange cr)
Removes a cell range for the list of spanned ranges.

Parameters:
cr - the range to remove

setSpannedRanges

public void setSpannedRanges(Collection ranges)
                      throws IllegalArgumentException
Sets the spanned cell ranges to a Collection of JCCellRanges. Ranges are validated in order of iteration in the Collection.

Parameters:
ranges - the collection of ranges to which the spanned cell ranges are to be set
Throws:
IllegalArgumentException - Thrown if a cell range overlaps an existing spanned cell range.

getSpannedRange

public com.klg.jclass.table.JCCellRange getSpannedRange(int row,
                                                        int column)
Returns a JCCellRange that represents that the spanned region contains the given row and column. If the row and column aren't in a span, null is returned.

Parameters:
row - the row within the spanned range
column - the column within the spanned range
Returns:
the spanned range containing the row and column, if any

getPointerTraverseForcesEdit

public boolean getPointerTraverseForcesEdit()
Gets the value of the PointerTraverseForcesEdit property.

PointerTraverseForcesEdit is used to determine what happens when a user selects a new editable cell when another edit is active and the value in the editor cannot be committed. In JClass 4.0.1 and earlier, the only possible behaviour was to warn the user, cancel the edit and start editing in the new cell. This corresponds to a value of true for this property. If PointerTraverseForcesEdit is set to false, the current editor remains active, and traversal doesn't occur.

Returns:
whether pointer traversal forces an edit

setPointerTraverseForcesEdit

public void setPointerTraverseForcesEdit(boolean nval)
Sets the value of the PointerTraverseForcesEdit property.

PointerTraverseForcesEdit is used to determine what happens when a user selects a new editable cell when another edit is active and the value in the editor cannot be committed. In JClass 4.0.1 and earlier, the only possible behaviour was to warn the user, cancel the edit and start editing in the new cell. This corresponds to a value of true for this property. If PointerTraverseForcesEdit is set to false, the current editor remains active, and traversal doesn't occur.

Parameters:
nval - the new value of PointerTraverseForcesEdit

paintComponent

public void paintComponent(Graphics gc)
Overrides:
paintComponent in class JComponent

reshape

public void reshape(int x,
                    int y,
                    int width,
                    int height)
Overrides:
reshape in class JComponent

getRowCellSize

protected com.klg.jclass.table.CellSize getRowCellSize(int row)
Returns copy of the CellSize object for a row.

Parameters:
row - the index of the row
Returns:
a copy of the CellSize object for the given row
See Also:
setRowCellSize(int, com.klg.jclass.table.CellSize)

setRowCellSize

protected void setRowCellSize(int row,
                              com.klg.jclass.table.CellSize value)
Sets the CellSize object for a row.

Parameters:
row - the index of the row
value - the new CellSize value for the given row

getColumnCellSize

protected com.klg.jclass.table.CellSize getColumnCellSize(int column)
Returns the CellSize object for a column.

Parameters:
column - the index of the column
Returns:
a copy of the CellSize object for the given column
See Also:
setColumnCellSize(int, com.klg.jclass.table.CellSize)

setColumnCellSize

protected void setColumnCellSize(int column,
                                 com.klg.jclass.table.CellSize value)
Sets the CellSize object for a column.

Parameters:
column - the index of the column
value - the new CellSize value for the given column

setColumnWidthChanged

protected void setColumnWidthChanged(int column)
Forces required calculations based on a change in the width for a column.

Parameters:
column - the column to base changes on

isRelayoutRequired

protected boolean isRelayoutRequired()
Returns true if a relayout is required.

Returns:
whether a relayout is needed
See Also:
setRelayoutRequired(boolean)

setRelayoutRequired

protected void setRelayoutRequired(boolean value)
If set to true, this method forces JClass LiveTable to relayout its contents when setRepaintEnabled() is set back to true.

Parameters:
value - if true, a relayout will be done
See Also:
setRepaintEnabled(boolean), isRelayoutRequired(), setRecalcRequired(boolean)

isRecalcRequired

protected boolean isRecalcRequired()
Returns true if a recalc is required.

Returns:
Is a recalc needed?
See Also:
setRecalcRequired(boolean)

setRecalcRequired

protected void setRecalcRequired(boolean value)
If set to true, this method forces JClass LiveTable to recalculate all internal dimensions when setRepaintEnabled() is set back to true.

Parameters:
value - if true, a recalc will be done
See Also:
setRepaintEnabled(boolean)

isRepaintRequired

protected boolean isRepaintRequired()
Returns true if repaint is required.

Returns:
Is a repaint needed?
See Also:
setRepaintRequired(boolean)

setRepaintRequired

protected void setRepaintRequired(boolean value)
If set to true, this method forces JClass LiveTable to repaint the entire contents when setRepaintEnabled() is set back to true.

Parameters:
value - if true, a repaint will be done
See Also:
setRepaintEnabled(boolean)

setRowHeightChanged

protected void setRowHeightChanged(int row)
Forces required calculations based on a change in the height of a row.

Parameters:
row - the row to base the changes on

getTextHeightOffset

protected final int getTextHeightOffset()
Returns the vertical offset of cell text based on the margin and border.

Returns:
the vertical offset of cell text based on the margin and border

getTextWidthOffset

protected final int getTextWidthOffset()
Returns the horizontal offset of cell text based on the margin and border.

Returns:
the horizontal offset of cell text based on the margin and border

requestChange

protected void requestChange(int flags)
Sends a request to process a change. Valid change flags include:

Parameters:
flags - indicates the type of change(s)
See Also:
requestChange(int, int, int)

requestChange

protected void requestChange(int flags,
                             int row,
                             int column)
Sends a request to process a change for the given row and column. Valid change flags include:

Parameters:
flags - indicates the type of change(s)
row - the row index of the cell to be changed
column - the column index of the cell to be changed

requestChange

protected void requestChange(int flags,
                             com.klg.jclass.table.JCCellRange cr)
Sends a request to process a change for a range of cells.

Parameters:
flags - indicates the type of change(s)
cr - the range for which to process the change requests
See Also:
requestChange(int, int, int)

XtoColumn

protected int XtoColumn(int x)
Determines the column that contains the pixel position.

Parameters:
x - the x pixel position
Returns:
the column containing the x pixel position

YtoRow

protected int YtoRow(int y)
Determines the row that contains the pixel position.

Parameters:
y - the y pixel position
Returns:
the row containing the y pixel position

getColumnClass

protected Class getColumnClass(int column)
Databound subclasses of table can override this method to return the correct datatype for the column.

Parameters:
column - the column index of the column whose class is required
Returns:
the class of the given column

fireJCCellDisplayEvent

protected void fireJCCellDisplayEvent(com.klg.jclass.table.JCCellDisplayEvent event)
Convenience method for firing JCCellDisplayEvents.

Parameters:
event - the event to be fired

addCellDisplayListener

public void addCellDisplayListener(com.klg.jclass.table.JCCellDisplayListener l)
Adds the specified listener to receive instances of JCCellDisplayEvent objects.

Parameters:
l - the listener to be added
See Also:
JCCellDisplayEvent

removeCellDisplayListener

public void removeCellDisplayListener(com.klg.jclass.table.JCCellDisplayListener l)
Removes the specified listener so it no longer receives JCCellDisplayEvent objects.

Parameters:
l - the listener to be removed
See Also:
addCellDisplayListener(com.klg.jclass.table.JCCellDisplayListener)

fireJCEditCellEvent

protected void fireJCEditCellEvent(com.klg.jclass.table.JCEditCellEvent event)
Convenience method for firing JCEditCellEvents.

Parameters:
event - the event to be fired

addEditCellListener

public void addEditCellListener(com.klg.jclass.table.JCEditCellListener l)
Adds the specified listener to receive instances of JCEditCellEvent objects.

Parameters:
l - the listener to be added
See Also:
JCEditCellEvent

removeEditCellListener

public void removeEditCellListener(com.klg.jclass.table.JCEditCellListener l)
Removes the specified listener so it no longer receives JCEditCellEvent objects.

Parameters:
l - the listener to be removed
See Also:
addEditCellListener(com.klg.jclass.table.JCEditCellListener)

fireJCPaintEvent

protected void fireJCPaintEvent(com.klg.jclass.table.JCPaintEvent event)
Convenience method for firing JCPaintEvents.

Parameters:
event - the event to be fired

addPaintListener

public void addPaintListener(com.klg.jclass.table.JCPaintListener l)
Adds the specified listener to receive instances of JCPaintEvent objects.

Parameters:
l - the listener to be added
See Also:
JCPaintEvent

removePaintListener

public void removePaintListener(com.klg.jclass.table.JCPaintListener l)
Removes the specified listener so it no longer receives JCPaintEvent objects.

Parameters:
l - the listener to be removed
See Also:
addPaintListener(com.klg.jclass.table.JCPaintListener)

fireJCResizeCellEvent

protected void fireJCResizeCellEvent(com.klg.jclass.table.JCResizeCellEvent event)
Convenience method for firing JCResizeCellEvents.

Parameters:
event - the event to be fired

doResizeEvents

protected com.klg.jclass.table.JCResizeCellEvent doResizeEvents(int row,
                                                                int column,
                                                                int oldWidth,
                                                                int oldHeight,
                                                                int newWidth,
                                                                int newHeight)
Convenience method for firing BEFORE_RESIZE and AFTER_RESIZE events. Called by setChartWidth/Height, setPixelWidth/Height, and setMarginWidth/Height.

Parameters:
row - the row being resized
column - the column being resized
oldWidth - the original column width
oldHeight - the original row height
newWidth - the new column width
newHeight - the new row height
Returns:
the event

addResizeCellListener

public void addResizeCellListener(com.klg.jclass.table.JCResizeCellListener l)
Adds the specified listener to receive instances of JCResizeCellEvent objects.

Parameters:
l - the listener to be added
See Also:
JCResizeCellEvent

removeResizeCellListener

public void removeResizeCellListener(com.klg.jclass.table.JCResizeCellListener l)
Removes the specified listener so it no longer receives JCResizeCellListener objects.

Parameters:
l - the listener to be removed
See Also:
addResizeCellListener(com.klg.jclass.table.JCResizeCellListener)

fireJCResizeCellMotionEvent

protected void fireJCResizeCellMotionEvent(com.klg.jclass.table.JCResizeCellEvent event)
Convenience method for firing JCResizeCellEvents to JCResizeCellMotionListeners.

Parameters:
event - the event to be fired

addResizeCellMotionListener

public void addResizeCellMotionListener(com.klg.jclass.table.JCResizeCellMotionListener l)
Adds the specified listener to receive instances of JCResizeCellEvent objects during the resize drag process.

Parameters:
l - the listener to be added
See Also:
JCResizeCellEvent

removeResizeCellMotionListener

public void removeResizeCellMotionListener(com.klg.jclass.table.JCResizeCellMotionListener l)
Removes the specified listener so it no longer receives JCResizeCellMotionListener objects.

Parameters:
l - the listener to be removed
See Also:
addResizeCellMotionListener(com.klg.jclass.table.JCResizeCellMotionListener)

fireJCScrollEvent

protected void fireJCScrollEvent(com.klg.jclass.table.JCScrollEvent event)
Convenience method for firing JCScrollEvents.

Parameters:
event - the event to be fired

addScrollListener

public void addScrollListener(com.klg.jclass.table.JCScrollListener l)
Adds the specified listener to receive instances of JCScrollEvent objects.

Parameters:
l - the listener to be added
See Also:
JCScrollEvent

removeScrollListener

public void removeScrollListener(com.klg.jclass.table.JCScrollListener l)
Removes the specified listener so it no longer receives JCScrollListener objects.

Parameters:
l - the listener to be removed
See Also:
addScrollListener(com.klg.jclass.table.JCScrollListener)

fireJCSelectEvent

protected void fireJCSelectEvent(com.klg.jclass.table.JCSelectEvent event)
Convenience method for firing JCSelectEvents.

Parameters:
event - the event to be fired

addSelectListener

public void addSelectListener(com.klg.jclass.table.JCSelectListener l)
Adds the specified listener to receive instances of JCSelectEvent objects.

Parameters:
l - the listener to be added
See Also:
JCSelectEvent

removeSelectListener

public void removeSelectListener(com.klg.jclass.table.JCSelectListener l)
Removes the specified listener so it no longer receives JCSelectEvent objects.

Parameters:
l - the listener to be removed
See Also:
addSelectListener(com.klg.jclass.table.JCSelectListener)

fireJCSortEvent

protected void fireJCSortEvent(com.klg.jclass.table.JCSortEvent event)
Convenience method for firing JCSortEvents.

Parameters:
event - the event to be fired

addSortListener

public void addSortListener(com.klg.jclass.table.JCSortListener l)
Adds the specified listener to receive instances of JCSortEvent objects.

Parameters:
l - the listener to be added
See Also:
JCSortEvent

removeSortListener

public void removeSortListener(com.klg.jclass.table.JCSortListener l)
Removes the specified listener so it no longer receives JCSortListener objects.

Parameters:
l - the listener to be removed
See Also:
addSortListener(com.klg.jclass.table.JCSortListener)

fireJCTraverseCellEvent

protected void fireJCTraverseCellEvent(com.klg.jclass.table.JCTraverseCellEvent event)
Convenience method for firing JCTraverseCellEvents.

Parameters:
event - the event to be fired

addTraverseCellListener

public void addTraverseCellListener(com.klg.jclass.table.JCTraverseCellListener l)
Adds the specified listener to receive instances of JCTraverseCellEvent objects.

Parameters:
l - the listener to add
See Also:
JCTraverseCellEvent

removeTraverseCellListener

public void removeTraverseCellListener(com.klg.jclass.table.JCTraverseCellListener l)
Removes the specified listener so it no longer receives JCTraverseCellListener objects.

Parameters:
l - the listener to remove
See Also:
addTraverseCellListener(com.klg.jclass.table.JCTraverseCellListener)

dispose

public void dispose()
Ensures that JCTable can be disposed.


createPopupMenu

protected com.klg.jclass.table.TablePopupMenu createPopupMenu()
Creates a new popup menu.

Returns:
the new popup menu

showPopupMenu

protected boolean showPopupMenu(int x,
                                int y)
Displays the popup menu at the given coordinates.

Parameters:
x - the x position to place the popup menu
y - the y position to place the popup menu
Returns:
whether the popup succeeded

actionPerformed

public void actionPerformed(ActionEvent event)
Processes table popup menu actions.

Specified by:
actionPerformed in interface ActionListener
Parameters:
event - the event generated by the action

hideShowColumns

protected void hideShowColumns(boolean hide)
Displays a dialog box to select columns to show or hide.

Parameters:
hide - if true, hide columns; if false, show columns

goToRow

protected void goToRow()
Displays a dialog box to select a row to traverse to.


requestFocus

public void requestFocus()
Overridden to record the old focus owner when table requests focus. Not used in JDK 1.4 or later.

Overrides:
requestFocus in class JComponent

focusGained

public void focusGained(FocusEvent event)
This method gets called when table gains focus.

Specified by:
focusGained in interface FocusListener
Parameters:
event - the event generated when the table gains focus

focusLost

public void focusLost(FocusEvent event)
This method gets called when table loses focus.

Specified by:
focusLost in interface FocusListener
Parameters:
event - the event generated when the table loses focus

getLicense

public String getLicense()

setLicense

public void setLicense(String s)

Copyright © 2004 Quest Software Inc..
All rights reserved.