borland.jbcl Packages borland.jbcl Class Hierarchy borland.jbcl.view
java.lang.Object +----java.awt.Component +----java.awt.Container +----java.awt.ScrollPane +----borland.jbcl.view.ScrollPaneGridView
Variables Constructors Properties Methods Event Listeners
Implements MatrixView, Scroller, MenuContainer, ImageObserver, Serializable
The ScrollPaneGridView component is a scrollable view of matrix data. It is composed of a ScrollPane.
protected Dimension prefSize
public ScrollPaneGridView()
public boolean isAlwaysEdit() public void setAlwaysEdit(boolean alwaysEdit)Controls whether or not the grid automatically starts an edit session when subfocus moves to a new cell. By default, this property is set to false, and a user must type a key, double-click, or hit F2 to edit a cell's value. If true, moving subfocus always starts an edit session of the cell.
public boolean isAutoEdit() public void setAutoEdit(boolean autoEdit)Determines whether cell editing is automatic in the grid. By default, this property is true, and a user can edit values in any cell on the grid by typing a character on the keyboard. If false, the user must hit F2, Ctrl+Enter, or double click to start an edit session.
public boolean isBatchMode() public void setBatchMode(boolean batchMode)Determines whether all painting in the grid is enabled or disabled. This is useful when performing large-scale programmatic updates to the grid's model, selection, subfocus, and so on where you want to suppress the repaint messages until the updates have completed.
public SizeVector getColumnSizes() public void setColumnSizes(borland.jbcl.view.SizeVector newSizes)Defines a SizeVector to manage the column widths in the grid. The SizeVector is an interface that has two 'common' implementations: FixedSizeVector, and VariableSizeVector. The FixedSizeVector class keeps all the column widths identical. A VariableSizeVector, the default for this property, allows a different size for each column.
See also: resyncEditor()
public ColumnView[] getColumnViews() public void setColumnViews(borland.jbcl.view.ColumnView[] columnViews)Specifies the borland.jbcl.view.ColumnView class object that defines the view state information for a particular column in the grid. The ColumnView class defines such properties as background, foreground, font, and so on. Every Column displayed in the grid has an associated ColumnView component. Individual ColumnView components can be set using this property as well as the entire set of ColumnView components.
public Component getCoreComponent()Returns the core object as a Component.
public int getDefaultColumnWidth() public void setDefaultColumnWidth(int defaultWidth)The column width used for new columns inserted into the grid. The default is 100 pixels.
public boolean isDoubleBuffer() public void setDoubleBuffer(boolean doubleBuffer)Enables or disables the double-buffered screen painting built into the grid. The default value is true, meaning that the grid paints all of the visible cells onto an off-screen image before blitting (block transferring) the image onto the screen (to prevent flicker). Setting doubleBuffer to false disables this functionality, and all ItemPainters then paint directly to the screen. This property is set to false when a user is placing a grid onto a Panel (or some container) that has its own double-buffering, or if flickering is not a problem.
public boolean isDragSubfocus() public void setDragSubfocus(boolean dragSubfocus)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)Enables or disables cell editing in the grid. By default, this property is true, meaning a user can edit values in any cell on the grid. If set to false, the matrix data cannot be modified by the user - except through programmatic access to the grid's model.
public boolean isEditing()Read-only property that returns true if a cell is currently being edited in the grid.
public Color getGridLineColor() public void setGridLineColor(java.awt.Color gridLineColor)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)Shows or hides the grid lines. The default is true.
public void setIncrements(java.awt.Point p)
public Dimension getMinimumSize()
public MatrixModel getModel() public void setModel(borland.jbcl.model.MatrixModel model)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 the getWriteModel() method.
public boolean isPostOnEndEdit() public void setPostOnEndEdit(boolean post)Controls whether or not the grid posts changes to a cell back to the model when the user clicks or tabs off of the cell. If false, the new edited value in a cell is not saved unless committed by hitting the Enter key. Clicking anywhere off the cell being edited reverts the cell's value back to its original state. By default, this property is set to true.
public Dimension getPreferredSize() public void setPreferredSize(java.awt.Dimension prefSize)
public boolean isReadOnly() public void setReadOnly(boolean ro)Determines whether the model is treated as a read-only model or not. Used when the model property is actually a WritableMatrixModel, but you want 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 SizeVector getRowSizes() public void setRowSizes(borland.jbcl.view.SizeVector newSizes)Defines a SizeVector to manage the row heights in the grid. The SizeVector object is an interface that has two 'common' implementations: FixedSizeVector, and VariableSizeVector. The FixedSizeVector class, the default for rowSizes, keeps all the row sizes identical. The VariableSizeVector class allows a different size for each row.
See also: resyncEditor()
public int getScrollUnits()
public WritableMatrixSelection getSelection() public void setSelection(borland.jbcl.model.WritableMatrixSelection wms)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. Users can therefore plug in their own implemention of a selection manager to have custom selection behavior.
public boolean isShowFocus() public void setShowFocus(boolean visible)Enables or disables the painting of the focus rectangle on the current subfocus cell. In reality, the showFocus property toggles the FOCUSED bit in the state information that is passed to the ItemPainter when a cell is painted. In cases where an ItemPainter that is plugged into the grid ignores the FOCUSED bit, this property has no effect. This property defaults to true.
public boolean isSnapOrigin() public void setSnapOrigin(boolean snapOrigin)Controls whether or not the grid automatically snaps the scroll position to align the top-left cell with the edges of the grid. If set to false, the grid does not snap the scroll position, and it scrolls smoothly with changes to the subfocus cell. This property defaults to true.
public MatrixLocation getSubfocus() public void setSubfocus(borland.jbcl.model.MatrixLocation newSubfocus)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)Defines the MatrixViewManager that brokers the ItemPainter and ItemEditor classes to this grid. If a ColumnView has a defined ItemPainter and/or ItemEditor for a particular Column, those will be used. If not (the more common case), the ItemPainter and ItemViewer objects are obtained from this ViewManager. The ViewManager is esentially a back-stop for the grid.
public WritableMatrixModel getWriteModel()
public void endEdit()Ends the current edit session (if any). If the value has been modified, it is posted if postOnEndEdit is set to true (the default). If postOnEndEdit is false, the edit session is terminated without saving the changes made to the cell's value.
public void endEdit(boolean post)Ends the current edit session (if any). If the value has been modified, it is posted if the post parameter is set to true. If post is false, the edit session is terminated without saving the changes to the cell's value.
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 the getScrollPosition() and getViewportSize() methods to calculate relative point positions to external components.
Parameters:
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 the getScrollPosition() and getViewportSize() methods to calculate relative point positions to external components.
Parameters:
public ColumnView getColumnView(int index)
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 ScrollPaneGridView. Use the getScrollPosition() and getViewportSize() methods to calculate relative point positions to external components. This method returns the hit MatrixLocation (row,column), or null if nothing was hit.
Parameters:
public void repaintCell(borland.jbcl.model.MatrixLocation cell)Repaints the cell at the specified 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 ScrollPaneGridView has been externally manipulated. This method is used by subclasses or consumers that are manipulating the rowSizes and columnSizes properties while the grid is in an edit session.
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 component defines such properties as background, foreground, font, and so on. Every Column displayed in the grid has an associated ColumnView and individual ColumnView components can be set using this indexed ColumnView property. The entire set of ColumnView components can be set using the columnViews property.
public void setColumnWidth(int column, int width)Individual column widths can be modified using the columnWidth (indexed) property. Column widths are controlled by a SizeVector, which, by default, is a VariableSizeVector. If you want all columns to match widths, see the columnSizes property to plug in a FixedSizeVector.
public void setRowHeight(int row, int height)Individual row heights can be modified using the rowHeight (indexed) property. Row heights are controlled by a SizeVector, which, by default, is a FixedSizeVector. A FixedSizeVector sets ALL the row heights to the setting that is passed, regardless of the row index passed. See the rowSizes property to plug in a VariableSizeVector if you want to modify individual row heights.
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 the editInPlace property is false or if readOnly is true, this method does nothing.
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 l) public void removeFocusListener(java.awt.event.FocusListener l)
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 removeMotionMouseListener(java.awt.event.MouseMotionListener l)
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 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)