borland.jbcl Packages borland.jbcl Class Hierarchy borland.jbcl.view
java.lang.Object +----java.awt.Component +----java.awt.Container +----java.awt.Panel +----borland.jbcl.view.CompositeGridView
Variables Constructors Properties Methods Event Listeners
Implements HeaderListener, MatrixView, MenuContainer, ImageObserver, Serializable, EventListener
CompositeGridView is a scrollable view of matrix data with a row and column header. It uses a panel that contains the following:
This class delegates all the necessary methods to the non-public GridCore class, the public ScrollPaneGridView class, and the two public HeaderView classes for external users and its sub-classes.
See Overview of view package: Matrix, grid, and header classes.
protected ButtonView button
protected HeaderView columnHeader
protected int columnHeaderHeight
protected boolean columnHeaderVisible
protected ScrollPaneGridView grid
protected Dimension prefSize
protected HeaderView rowHeader
protected boolean rowHeaderVisible
protected int rowHeaderWidth
public CompositeGridView()Constructs a CompositeGridView with a visible row header and column header.
public boolean isAlwaysEdit() public void setAlwaysEdit(boolean alwaysEdit)The alwaysEdit property controls whether or not the grid will automatically start an edit session when subfocus moves to a new cell. By default, this is false, and a user must double-click, or press F2, to edit a cell's value. If true, moving subfocus will always start an edit session of the cell.
public boolean isAutoEdit() public void setAutoEdit(boolean autoEdit)The autoEdit property enables or disables automatic cell editing in the grid. By default, this property is true, and the user can initiate editing the value in any cell of the grid by typing a character from the keyboard. If set to false, the user must press F2, press Ctrl+Enter, or double-click to start an edit session. By default, this property is true.
public boolean isBatchMode() public void setBatchMode(boolean batchMode)The batchMode property enables or disables all painting in the grid. This is used for programmatic mass updates to the grid's model, selection, subfocus, or other related elements, without triggering repaint messages.
public int getColumnHeaderHeight() public void setColumnHeaderHeight(int height)The columnHeaderHeight property defines the height of the column header in pixels.
public HeaderView getColumnHeaderView()The columnHeaderView property stores the contained HeaderView (public) class instance for the column header.
public boolean isColumnHeaderVisible() public void setColumnHeaderVisible(boolean visible)The columnHeaderVisible property controls whether or not the columnHeader is visible. The default is true.
public SizeVector getColumnSizes() public void setColumnSizes(borland.jbcl.view.SizeVector newSizes)The columnSizes property defines a SizeVector to manage the column widths in the grid. SizeVector is an interface that has two 'common' implementations: FixedSizeVector, and VariableSizeVector. FixedSizeVector keeps all the column widths identical. A VariableSizeVector (the default for columnSizes) allows a different size for each column.
public ColumnView[] getColumnViews() public void setColumnViews(borland.jbcl.view.ColumnView[] columnViews)The entire set of column views can be set using the columnViews property. A ColumnView defines the view state information for a particular column in the grid. The ColumnView class defines properties such as background, foreground, and font. Every column displayed in the grid has a ColumnView to go with it.
To set individual column views, use the indexed columnView property instead; see the getColumnView(int) method.
public Component getCoreComponent()The coreComponent property stores the contained GridCore (non-public) class instance and returns it as a Component.
public int getDefaultColumnWidth() public void setDefaultColumnWidth(int defaultWidth)The defaultColumnWidth property is the columnWidth used when a new column is inserted into the grid. The default is 100 pixels.
public boolean isDoubleBuffer() public void setDoubleBuffer(boolean doubleBuffer)The doubleBuffer property enables or disables the double-buffered screen painting built into the grid. The default is true, meaning that the grid paints all of the visible cells onto an off-screen image before blitting the image onto the screen (to prevent flicker). Setting doubleBuffer to false disables this functionality, making all ItemPainters paint directly to the screen. This property is set to false when a user is placing a grid onto a Panel (or other container) that has its own double-buffering, or if the user really likes things that flicker.
public boolean isDragSubfocus() public void setDragSubfocus(boolean dragSubfocus)The dragFocus property enables or disables dragging of the subfocus cell when dragging the mouse pointer over the grid (with the button depressed). By default this property is true.
public boolean isEditInPlace() public void setEditInPlace(boolean editInPlace)The editInPlace property enables or disables cell editing in the grid. By default, this property is true, meaning that the end user can edit values in any cell on the grid. If set to false, the matrix data cannot by modified by the user, but can only be modified through programmatic access to the grid's model.
public boolean isEditing()The editing property (read-only) returns true if a cell is currently being edited in the grid.
public Color getGridLineColor() public void setGridLineColor(java.awt.Color gridLineColor)The gridLineColor property defines the line color for the grid. The default color for the grid lines is SystemColor.control.
public boolean isGridVisible() public void setGridVisible(boolean visible)The gridVisible property shows or hides the grid lines. The default is true.
public Dimension getMinimumSize()The minimumSize property stores the minimum size that you will allow a layout manager to use to display the grid.
public MatrixModel getModel() public void setModel(borland.jbcl.model.MatrixModel model)The model property defines the MatrixModel that this grid is displaying data from. If the current model is an instance of WritableMatrixModel, an external user can get access to it using getWriteModel().
public boolean isPostOnEndEdit() public void setPostOnEndEdit(boolean post)The postOnEndEdit property controls whether or not the grid will post changes to a cell back to the model when the user clicks off of the cell or tabs off of the cell. By default, this property is set to true.
If false, editing a cell's value will not "stick" unless committed by pressing Enter; clicking off the cell that is being edited will revert the value back to its original state.
public Dimension getPreferredSize() public void setPreferredSize(java.awt.Dimension prefSize)The size that you prefer layout managers to use for the grid.
public boolean isReadOnly() public void setReadOnly(boolean ro)The readOnly property is used when the model property is actually a WritableMatrixModel, but the user wants it to be treated as a read-only model. This is commonly used to allow users to browse, but not edit, normally writable matricies of data.
public boolean isResizableColumns() public void setResizableColumns(boolean resizable)The resizableColumns property controls whether or not the grid columns are resizable by the user. The default is true, meaning that the columns can be resized, using the mouse.
public boolean isResizableRows() public void setResizableRows(boolean resizable)The resizableRows property controls whether or not the grid rows are resizable by the user. The default is true, meaning that the rows can be resized, using the mouse.
public HeaderView getRowHeaderView()Returns the contained HeaderView (public) class instance for the rowHeader.
public boolean isRowHeaderVisible() public void setRowHeaderVisible(boolean visible)The rowHeaderVisible property controls whether or not the rowHeader is visible. The default is true.
public int getRowHeaderWidth() public void setRowHeaderWidth(int width)The rowHeaderWidth property defines the width of the row header in pixels.
public SizeVector getRowSizes() public void setRowSizes(borland.jbcl.view.SizeVector newSizes)The rowSizes property defines a SizeVector to manage the row heights in the grid. SizeVector is an interface that has two common implementations: FixedSizeVector, and VariableSizeVector. FixedSizeVector (the default for rowSizes) keeps all the row sizes identical. VariableSizeVector allows a different size for each row.
public ScrollPaneGridView getScrollPaneGridView()Returns the contained ScrollPaneGridView (public) class instance.
public WritableMatrixSelection getSelection() public void setSelection(borland.jbcl.model.WritableMatrixSelection wms)The selection property defines a WritableMatrixSelection manager. This allows multiple matrix viewers to share the same selection pool - and for the grid to handle selection in a generic manner. This allows users to plug in their own implemention of a selection manager to have custom selection behavior.
public boolean isShowFocus() public void setShowFocus(boolean visible)The showFocus property enables or disables the painting of the focus rectangle on the current subfocus cell. In reality, the showFocus property turns on or off the FOCUSED bit in the state information that is passed to the ItemPainter when a cell is painted. If an ItemPainter plugged into the grid ignores the FOCUSED bit, this property will have no effect. By default, showFocus is true.
public boolean isSnapOrigin() public void setSnapOrigin(boolean snapOrigin)The snapOrigin property controls whether or not the grid will automatically snap the scroll position to align the top-left cell with the edges of the grid. If set to false, the grid will not snap the scroll position, and it will scroll smoothly with changes to the subfocus cell. By default, this property is true.
public MatrixLocation getSubfocus() public void setSubfocus(borland.jbcl.model.MatrixLocation newSubfocus)The subfocus property defines the 'current' cell (defined by a MatrixLocation) in the grid. This is the cell that is receiving keyboard input. The subfocus can be set using a MatrixLocation, or by specifying a row and column pair.
public MatrixViewManager getViewManager() public void setViewManager(borland.jbcl.model.MatrixViewManager viewManager)The viewManager property defines the MatrixViewManager that will "broker" ItemPainters and ItemEditors to this grid. If a ColumnView has a defined ItemPainter and/or ItemEditor for a particular column, those will be used. If not (typical), the ItemPainters and ItemViewers are obtained from this viewManager. The viewManager is esentially a back-stop for the grid.
public WritableMatrixModel getWriteModel()The writeModel property stores the WritableMatrixModel that is being used to store the data items for this grid.
protected void columnHeaderClicked(int index)
public void doLayout()Lays out the grid component.
Overrides: java.awt.Container.doLayout()
public void endEdit()Ends the current edit session (if any). If the value has been modified, it will be posted if postOnEndEdit is set to true (the default). If postOnEndEdit is false, the edit session will be terminated without saving the changes to the cell value.
public void endEdit(boolean post)Ends the current edit session (if any).
Parameters:
public Rectangle getCellRangeRect(borland.jbcl.model.MatrixLocation start, borland.jbcl.model.MatrixLocation end)Returns the Rectangle (in pixels) that bounds the range of cells at the specified locations. Coordinates are relative to the entire scrollable region inside of the ScrollPaneGridView. Use getScrollPosition() and getViewportSize() to calculate relative point positions to external components.
Parameters:
Returns:
public Rectangle getCellRect(borland.jbcl.model.MatrixLocation cell)Returns the Rectangle (in pixels) that bounds the cell at the specified location. Coordinates are relative to the entire scrollable region inside of the ScrollPaneGridView. Use getScrollPosition() and getViewportSize() to calculate relative point positions to external components.
Parameters:
Returns:
public ColumnView getColumnView(int index)A ColumnView defines the view state information for a particular column in the grid. The ColumnView class defines properties such as background, foreground, and font. Every column displayed in the grid has a ColumnView to go with it. Individual column views can be set using this indexed columnView property.
To set the entire set of column views, use the columnViews property instead.
public int getColumnWidth(int row)
public int getRowHeight(int row)
public MatrixLocation hitTest(int x, int y)Returns the address (MatrixLocation) of the cell at the coordinates specified. Coordinates are relative to the entire scrollable region inside of the CompositeGridView. Use getScrollPosition() and getViewportSize() to calculate relative point positions to external components.
Parameters:
Returns:
public void repaintCell(borland.jbcl.model.MatrixLocation cell)Repaints the cell at the passed location.
Parameters:
public void repaintCells()Repaints all the visible cells in the grid.
public void repaintCells(borland.jbcl.model.MatrixLocation start, borland.jbcl.model.MatrixLocation end)Repaints all the visible cells in the range between the start and end cell location.
Parameters:
public void requestFocus()
Overrides: java.awt.Component.requestFocus()
public void reset()Resets the scroll position, sets the subfocus back to (0,0), and makes sure the grid is properly sized and validated.
public void resyncEditor()Moves any embedded editor to its proper position (and size) if the CompositeGridView has been externally manipulated. This method is used by subclasses or consumers that are manipulating the rowSizes and columnSizes while the grid is in an edit session.
protected void rowHeaderClicked(int index)
public void setColumnView(int index, borland.jbcl.view.ColumnView col)A ColumnView defines the view state information for a particular column in the grid. The ColumnView class defines properties such as background, foreground, and font. Every column displayed in the grid has a ColumnView to go with it. Individual columnViews can be set using this indexed columnView property.
To set the entire set of columnViews, use the columnViews property.
public void setColumnWidth(int column, int width)Individual columnWidths can be modified using the columnWidth (indexed) property. Column widths are controlled by a SizeVector, which, by default, is a VariableSizeVector.
If you want the columns to all match widths, see the columnSizes property to plug in a FixedSizeVector.
public void setRowHeight(int row, int height)Individual rowHeights can be modified using the rowHeight (indexed) property. Row heights are controlled by a SizeVector, which, by default, is a FixedSizeVector. A FixedSizeVector will set ALL the row heights to the setting that is passed, regardless of the row index passed.
If you want to modify individual row heights, see the rowSizes property, to plug in a VariableSizeVector
public void setSubfocus(int row, int column)
public void startEdit(borland.jbcl.model.MatrixLocation cell)Starts an edit session at the cell location defined by cell. If editInPlace is false or if readOnly is true, this method is a no-op.
Parameters:
public void addActionListener(java.awt.event.ActionListener l) public void removeActionListener(java.awt.event.ActionListener l)
public synchronized void addComponentListener(java.awt.event.ComponentListener l) public synchronized void removeComponentListener(java.awt.event.ComponentListener l)
public synchronized void addContainerListener(java.awt.event.ContainerListener l) public void removeContainerListener(java.awt.event.ContainerListener l)
public void addFocusListener(java.awt.event.FocusListener listener) public void removeFocusListener(java.awt.event.FocusListener listener)
public void addKeyListener(java.awt.event.KeyListener l) public void removeKeyListener(java.awt.event.KeyListener l)
public void addModelListener(borland.jbcl.model.MatrixModelListener listener) public void removeModelListener(borland.jbcl.model.MatrixModelListener listener)
public void addMouseListener(java.awt.event.MouseListener l) public void removeMouseListener(java.awt.event.MouseListener l)
public void addMouseMotionListener(java.awt.event.MouseMotionListener l) public void removeMouseMotionListener(java.awt.event.MouseMotionListener l)
public void addSelectionListener(borland.jbcl.model.MatrixSelectionListener listener) public void removeSelectionListener(borland.jbcl.model.MatrixSelectionListener listener)
public void addSubfocusListener(borland.jbcl.model.MatrixSubfocusListener listener) public void removeSubfocusListener(borland.jbcl.model.MatrixSubfocusListener listener)