This Package  Previous  Next  Index

Class CoffeeTable.Grid.GridPanel

java.lang.Object
   |
   +----java.awt.Component
           |
           +----java.awt.Container
                   |
                   +----java.awt.Panel
                           |
                           +----CoffeeTable.Grid.GridPanel

public class GridPanel
extends Panel
GridPanel is a UI component for a generic grid object. It takes care of drawing it's cells, alongwith row and column headers, provides row/column/cell selection, column resizing, and scrolling support. GridAttributes can be set for the grid, the row and column headers and individual rows and columns. The simplest way to use it is to pass it a two dimensional array of strings which will provide the text data for the grid to display. In addition certain methods can be overidden to customize it's performance.

Version:
1.2.10 of September 15, 1999 Copyright © 1996-1999 3magic
Author:
Anil Bajaj

Variable Index

 o ALWAYS
ScrollBar display policy to always display the scrollBar.
 o AUTO_RESIZE_COLS
Automatically resize columns proportionally to fit.
 o AUTO_RESIZE_ROWS
Automatically resize rows to display wrapped text.
 o CELL_SELECTION
Enable cell selection flag.
 o COL_LINES
Display column lines flag.
 o COL_RESIZE_ALL
Resize all other columns in the Grid proportionally when the user changes the size of any column in the Grid, if automatic column resizing is enabled.
 o COL_RESIZE_LAST
Resize last column in the Grid automatically when the user changes the size of any column in the Grid, if automatic column resizing is enabled.
 o COL_RESIZE_NEXT
Resize the column right next to the column being sized by the user automatically if automatic column resizing is enabled.
 o COL_SELECTION
Enable column selection flag.
 o DEMO_TEXT
Display Demo text in grid if no text available.
 o DOUBLE_BUFFERING
Use double buffering while drawing flag.
 o DRAG_SELECT
Enable drag selection flag.
 o EDIT_TEXT
Editable text cell type attribute.
 o FORCE_H_SCROLL
Force horizontal scrollbar flag.
 o FORCE_V_SCROLL
Force vertical scrollbar flag.
 o H_SCROLL
Create horizontal scrollbar (if needed) flag.
 o IF_NEEDED
ScrollBar display policy to display the scrollBar only if needed.
 o IMAGE
Image cell type attribute.
 o JUST_CENTER
Center justification attribute.
 o JUST_DEFAULT
Default (left) justification attribute.
 o JUST_LEFT
Left justification attribute.
 o JUST_RIGHT
Right justification attribute.
 o MAIL
Mail address cell type attribute.
 o MULTIPLE_SELECTION
Enable multiple selection flag.
 o NEVER
ScrollBar display policy to never display the scrollBar.
 o NO_SELECTION
Disable selections flag.
 o RESIZE_COL_HEADERS
Enable resize column headers flag.
 o RESIZE_COLUMNS
Enable resize columns flag.
 o RESIZE_MULTIPLE
Resize multiple rows or columns if selected.
 o RESIZE_ROW_HEADERS
Enable resize row headers flag.
 o RESIZE_ROWS
Enable resize rows flag.
 o ROW_LINES
Display row lines flag.
 o ROW_NUMBERS
Display row numbers in the row headers.
 o ROW_SELECTION
Enable row selection flag.
 o SORT_ASCENDING
Sort the column data in ascending order.
 o SORT_ATTRIBUTES
Move row attributes and size around while sorting.
 o SORT_DESCENDING
Sort the column data in descending order.
 o SORT_ROW_HEADERS
Move row header data with row data while sorting.
 o TEXT
Read-only text cell type attribute.
 o THREED_BORDER
Draw a one pixel 3D rectangle around the grid.
 o TRUNC_STRING
Truncate string (with ellipsis) text attribute.
 o URL
HTTP URL cell type attribute.
 o V_SCROLL
Create vertical scrollbar (if needed) flag.
 o WORD_WRAP
Word wrapping text attribute.

Constructor Index

 o GridPanel()
Constructs and creates a new GridPanel Object.
 o GridPanel(int)
Constructs and creates a new GridPanel Object.
 o GridPanel(int, int)
Constructs and creates a new GridPanel Object.
 o GridPanel(int, int, int)
Constructs and creates a new GridPanel Object.
 o GridPanel(int, int, int, int, int, int[], GridAttributes, GridAttributes, Color, int)
Constructs and creates a new GridPanel Object using the passed in parameters.

Method Index

 o addNotify()
Notifies the Component of it's being added to a panel.
 o autoResizeRow(int, boolean)
Resize this row to display entire text in cells with WORD_WRAP enabled.
 o autoResizeRows(boolean)
Resize all the rows to display entire text in cells with WORD_WRAP enabled.
 o cellToRect(Point)
Returns the rectangle for the specified cell.
 o colHeaderToRect(int)
Returns the rectangle for the specified column's header.
 o colToRect(int)
Returns the rectangle for the specified column.
 o createEditor(int, int)
Returns an editor component for the cell being edited.
 o createGridData()
Allocates a new GridData object to store the data for the grid.
 o deleteCol(int)
Delete the specified column.
 o deleteCols(int, int)
Deletes a specified number of columns, starting from a given column.
 o deleteRow(int)
Delete the specified row.
 o deleteRows(int, int)
Deletes a specified number of rows, starting from a given row.
 o deselectAll(boolean)
Deselect all the cells in the grid.
 o deselectCell(int, int, boolean)
Deselect the specified cell in the grid.
 o deselectCol(int, boolean)
Deselect the all the cells in a column in the grid.
 o deselectRow(int, boolean)
Deselect the all the cells in a row in the grid.
 o disposeGridData()
Deallocates the GridData object that stores the data for the grid.
 o doKeySelect(Event)
Selects a cell, row or column based on the arrows keys and the selection mode.
 o drawCell(Graphics, Point, Rectangle, boolean)
Draw a cell in the GridPanel.
 o drawCellImage(Graphics, Image, Point, Rectangle)
Draw an image in the specified cell.
 o drawHeaderCol(Graphics, int, Rectangle)
Draw the header for a column.
 o drawHeaderRow(Graphics, int, Rectangle)
Draw the header for a row.
 o drawIntersection(Graphics, Rectangle)
Draw the area in the intersection between the row and column headers.
 o drawJustString(Graphics, String, Rectangle, int, FontMetrics, int)
Draw the string using the specified justification style.
 o drawString(Graphics, String, Rectangle, int, FontMetrics)
Draw a String in the specified rectangle.
 o drawText(Graphics, String, Rectangle, int, FontMetrics)
Draw the string using the specified justification style, with word wrapping.
 o drawTruncString(Graphics, String, Rectangle, int, FontMetrics, int)
Draw the string using the specified justification style, truncating the string if necessary.
 o endEdit(boolean)
Deactivates editing, and updates the cell's text by calling the setCellText() method if needed.
 o getApplet()
Return the applet that this component is contained in.
 o getCellAttributes(int, int)
Return the drawing attributes for a cell.
 o getCellData(int, int)
Return the data Object for a cell.
 o getCellInset()
Return the cell inset.
 o getCellText(int, int)
Return the text for a cell.
 o getColHeaderAttributes(int)
Returns the drawing attributes for the column headers.
 o getColHeaderHeight()
Returns the height for the column headers.
 o getColHeaderRect()
Return the area taken up by the column headers.
 o getColHeaderText(int)
Returns the text for the column header for a specified column.
 o getColWidth(int)
Returns the width for the specified column.
 o getColWidths(int, int)
Returns the total width for a range of columns.
 o getEditCell()
Return the cell being edited.
 o getEditor()
Return the editor component for the cell being edited.
 o getEditTextField()
Deprecated. Note: getEditTextField() is deprecated. As of version 1.2.2, use getEditor().
 o getFirstSelectedCell()
Returns the first selected cell in the grid.
 o getFirstSelectedCol()
Returns the first selected column in the grid.
 o getFirstSelectedRow()
Returns the first selected row in the grid.
 o getFirstVisibleCell()
Returns the cell at the top-left corner of the grid.
 o getFlags()
Returns the Grid's current feature flags
 o getGridAttributes()
Returns the drawing attributes for the entire grid.
 o getGridData()
Returns the GridData object for this grid.
 o getHeaderAttributes()
Returns the drawing attributes for the row and column headers.
 o getHighlightColor()
Return the highlight color.
 o getHighlightTextColor()
Return the highlight text color.
 o getHScrollAmount()
Returns the number of pixels the grid is scrolled horizontally each time the scrollbar arrows are clicked.
 o getLastSelectedCell()
Returns the last selected cell in the grid.
 o getLastSelectedCol()
Returns the last selected column in the grid.
 o getLastSelectedRow()
Returns the last selected row in the grid.
 o getLastVisibleCell()
Returns the cell at the bottom-right corner of the grid.
 o getNumCols()
Returns the number of columns in the grid.
 o getNumRows()
Returns the number of rows in the grid.
 o getRowHeaderAttributes(int)
Returns the drawing attributes for the row headers.
 o getRowHeaderRect()
Return the area taken up by the row headers.
 o getRowHeaderText(int)
Returns the text for the row header for a specified column.
 o getRowHeaderWidth()
Returns the width for the row headers.
 o getRowHeight(int)
Returns the height for the specified row.
 o getRowHeights(int, int)
Returns the total height for a range of rows.
 o getRowTag(int)
Return the tag object for the row.
 o getScrollOffset()
Returns vertical and horizontal pixel offset that the Grid is currently scrolled by.
 o getSelBounds()
Returns the boundary of the current selection.
 o getSelectedCells()
Returns a list of the currently selected cells.
 o getSelectedCols()
Returns a list of the currently selected columns.
 o getSelectedRows()
Returns a list of the currently selected rows.
 o getSortColumn()
Return the current sort column.
 o getSortColumnColor()
Return the background color for cells in the column that the grid data is sorted on.
 o getSortEnable(int)
Check if sorting is enabled for this column.
 o getVersionString()
Return the current version of the component.
 o getVScrollAmount()
Returns the number of pixels the grid is scrolled vertically each time the scrollbar arrows are clicked.
 o goToURL(String)
Called by the handleURLClick() method in response to the user clicking in a cell containing a URL.
 o handleCellClick(Event, int, int)
Called if the user clicks in the grid area.
 o handleDoubleClick(Event, int, int)
Called if the user double clicks in the grid area.
 o handleEditClick(Event, int, int)
Activates editing in a cell.
 o handleEvent(Event)
Handles the event.
 o handleMailClick(Event, int, int)
Called if the user clicks in a URL cell.
 o handleMouseDown(Event, int, int)
Called if the user clicks in the grid area.
 o handleScrollEvent(Event)
Handles all scrollbar events for the GridPanel.
 o handleURLClick(Event, int, int)
Called if the user clicks in a URL cell.
 o headerColToRect(int)
Returns the rectangle for the column header.
 o highlightCell(Graphics, Point, Rectangle, boolean)
Highlight a cell in the GridPanel.
 o insertCol(int)
Insert a new column at the specified location.
 o insertCols(int, int)
Insert a number of columns at the specified location.
 o insertRow(int)
Insert a new row at the specified location.
 o insertRows(int, int)
Insert a number of rows at the specified location.
 o isCellSelected(int, int)
Check if the specified cell is selected.
 o isColSelected(int)
Check if the all the cells in the specified column are selected.
 o isInited()
Checks if this GridPanel has been successfully initialized.
 o isRowSelected(int)
Check if the all the cells in the specified row are selected.
 o keyDown(Event, int)
Called if a character is pressed.
 o minimumSize()
Returns the preferred size of this component.
 o mouseDown(Event, int, int)
Called if the mouse is down.
 o mouseExit(Event, int, int)
Called when the mouse exits the GridPanel.
 o paint(Graphics)
Paints the GridPanel.
 o preferredSize()
Returns the preferred size of this component.
 o recalcColumnWidths()
Recalculate the column widths and size them proportionally so that they all fit in the GridPanel's displayarea without requiring a horizontal scrollbar.
 o refresh()
Causes the offscreen image to be purged if double-buffering is enabled.
 o repaint(long, int, int, int, int)
Repaints part of the component.
 o repaintCell(Point)
Repaint the specified cell.
 o repaintCol(int)
Repaint the specified column.
 o repaintColHeader(int)
Repaint the header for the specified column.
 o repaintRow(int)
Repaint the specified row.
 o repaintRowHeader(int)
Repaint the header for the specified row.
 o reshape(int, int, int, int)
Reshapes the GridPanel to the specified bounding box.
 o resize(int, int)
Resizes the GridPanel to the specified width and height.
 o revealCell(int, int)
Scroll the specified cell into view.
 o revealCol(int)
Scroll the specified column into view.
 o revealRow(int)
Scroll the specified row into view.
 o rowHeaderToRect(int)
Returns the rectangle for the specified row's header.
 o rowToRect(int)
Returns the rectangle for the specified row.
 o selectAll(boolean)
Select all the cells in the grid.
 o selectCell(int, int, boolean)
Select the specified cell in the grid.
 o selectCol(int, boolean)
Select all the cells in the specified column.
 o selectRange(Point, Point, boolean, boolean)
Select a rectangular range of cells.
 o selectRow(int, boolean)
Select all the cells in the specified row.
 o setApplet(Applet)
Set the applet that this component is contained in.
 o setAutoResizeColumns(boolean)
Enable or disable the feature to size columns proportionally to fit in the GridPanel.
 o setAutoResizeRows(boolean)
Enable or disable the feature to automatically resize rows.
 o setCellAttributes(int, int, GridAttributes, boolean)
Specify the drawing attributes for a cell.
 o setCellData(int, int, Object, boolean)
Set the cell's data object.
 o setCellInset(Point)
Set the cell inset.
 o setCellSelection(boolean)
Enable or disable cell selection.
 o setCellText(int, int, String, boolean)
Set the cell's text.
 o setColAttributes(int, GridAttributes, boolean)
Specify the drawing attributes for all the cells in a column.
 o setColHeaderAttributes(GridAttributes, boolean)
Set the drawing attributes for column headers.
 o setColHeaderAttributes(int, GridAttributes, boolean)
Set the drawing attributes for a specific column of the column headers.
 o setColHeaderHeight(int)
Set the height of the column headers.
 o setColHeaderHeight(int, boolean)
Set the column header height.
 o setColHeaderText(int, String, boolean)
Set the column header text for the specified column.
 o setColLines(boolean)
Enable or disable column lines.
 o setColResizeMode(int)
Set the column resize mode.
 o setColSelection(boolean)
Enable or disable column selection.
 o setColWidth(int, int, boolean, boolean)
Set the column width.
 o setColWidths(int[], boolean, boolean)
Set the column widths for all the column in the grid.
 o setColWidths(String)
Set the column widths for all the column in the grid.
 o setColWidths(String, boolean, boolean)
Set the column widths for all the column in the grid.
 o setDemoText(boolean)
Enable or disable drawing demo text in empty cells.
 o setDoubleBuffering(boolean)
Enable or disable double buffering.
 o setDragSelect(boolean)
Enable or disable drag selection.
 o setFlags(int)
Set the Grid's feature flags.
 o setGridAttributes(GridAttributes, boolean)
Set the drawing attributes for the entire grid.
 o setGridBackground(Color)
Set the grid's background color.
 o setGridData(GridData, boolean)
Specify a preallocated instance of a GridData object to store the data for the grid.
 o setGridFont(Font)
Set the grid's text font.
 o setGridJustification(int)
Set the grid's justification style.
 o setGridTextColor(Color)
Set the grid's text color.
 o setHeaderAttributes(GridAttributes, boolean)
Set the drawing attributes for row and column headers.
 o setHeaderBackground(Color)
Set the grid header's background color.
 o setHeaderFont(Font)
Set the grid header's text font.
 o setHeaderJustification(int)
Set the grid header's justification.
 o setHeaderTextColor(Color)
Set the grid header's text color.
 o setHighlightColor(Color)
Set the highlight color.
 o setHighlightTextColor(Color)
Set the highlight text color.
 o setHScroll(int)
Set the horizontal scroll bar display policy.
 o setHScrollAmount(int)
Set the number of pixels the grid is scrolled horizontally each time the scrollbar arrows are clicked.
 o setLineColor(Color)
Set the row and column line colors.
 o setLineColor(Color, boolean)
Set the line color.
 o setMultipleSelection(boolean)
Enable or disable multiple selections.
 o setNumCols(int)
Set the number of columns in the grid.
 o setNumCols(int, boolean)
Set the number of columns in the grid.
 o setNumCols(int, int, boolean)
Set the number of columns in the grid.
 o setNumCols(int, int[], boolean)
Set the number of columns in the grid, including the column widths.
 o setNumCols(int, String, boolean)
Set the number of columns in the grid, including the column widths.
 o setNumRows(int)
Set the number of rows in the grid.
 o setNumRows(int, boolean)
Set the number of rows in the grid.
 o setPreferredSize(Dimension)
Deprecated. Note: setPreferredSize() is deprecated. As of version 1.2.2, use Component.resize().
 o setResizeColHeaders(boolean)
Enable or disable column header resizing.
 o setResizeColumns(boolean)
Enable or disable column resizing.
 o setResizeMultiple(boolean)
Enable or disable resizing of multiple rows or columns if selected.
 o setResizeRowHeaders(boolean)
Enable or disable row header resizing.
 o setResizeRows(boolean)
Enable or disable row resizing.
 o setRowAttributes(int, GridAttributes, boolean)
Specify the drawing attributes for all the cells in a row.
 o setRowHeaderAttributes(GridAttributes, boolean)
Set the drawing attributes for row headers.
 o setRowHeaderAttributes(int, GridAttributes, boolean)
Set the drawing attributes for a specific row of the row headers.
 o setRowHeaderText(int, String, boolean)
Set the row header text for the specified row.
 o setRowHeaderWidth(int)
Set the width of the row headers.
 o setRowHeaderWidth(int, boolean)
Set the row header width.
 o setRowHeight(int)
Set the row height for all the rows.
 o setRowHeight(int, int, boolean, boolean)
Set the height of the specified row.
 o setRowLines(boolean)
Enable or disable row lines.
 o setRowNumbers(boolean)
Enable or disable drawing row numbers in the row headers.
 o setRowSelection(boolean)
Enable or disable row selection.
 o setRowTag(int, Object)
Set the tag object for the row.
 o setSortAttributes(boolean)
Enable or disable moving the attributes with the rows while sorting.
 o setSortColumn(int, boolean)
Set the sort column, and sort the data based on the contents of this column.
 o setSortColumn(int, boolean, int)
Set the sort column, and sort the data based on the contents of this column.
 o setSortColumnColor(Color)
Set the background color for cells in the column that the grid data is sorted on.
 o setSortEnable(boolean)
Set the flag to enable or disable sorting for all the columns in the grid.
 o setSortEnable(int, boolean)
Set the flag to enable or disable sorting for a column.
 o setSortRowHeaders(boolean)
Enable or disable moving the row header data with the rows while sorting.
 o setThreeDBorder(boolean)
Enable or disable drawing a ThreeD border around the grid.
 o setVScroll(int)
Set the vertical scroll bar display policy.
 o setVScrollAmount(int)
Set the number of pixels the grid is scrolled vertically each time the scrollbar arrows are clicked.
 o sortRows(int)
Sort the rows based on the values in the specified column.
 o sortRows(int, int)
Sort the rows based on the values in the specified column.
 o startEdit(int, int)
Activates editing in a cell.
 o validate(String, Point)
Validate the text in a cell after editing.
 o xToCol(int)
Map the x coordinate to a column in the grid.
 o xyToCell(int, int)
Map a point to a cell in the grid.
 o yToRow(int)
Map the y coordinate to a row in the grid.

Variables

 o NO_SELECTION
 public static final int NO_SELECTION
Disable selections flag.

 o CELL_SELECTION
 public static final int CELL_SELECTION
Enable cell selection flag. You can use this in combination with the other selection flags.

 o ROW_SELECTION
 public static final int ROW_SELECTION
Enable row selection flag. You can use this in combination with the other selection flags.

 o COL_SELECTION
 public static final int COL_SELECTION
Enable column selection flag. You can use this in combination with the other selection flags.

 o MULTIPLE_SELECTION
 public static final int MULTIPLE_SELECTION
Enable multiple selection flag. You can use this in combination with the other selection flags.

 o RESIZE_COLUMNS
 public static final int RESIZE_COLUMNS
Enable resize columns flag.

 o RESIZE_ROWS
 public static final int RESIZE_ROWS
Enable resize rows flag.

 o RESIZE_COL_HEADERS
 public static final int RESIZE_COL_HEADERS
Enable resize column headers flag.

 o RESIZE_ROW_HEADERS
 public static final int RESIZE_ROW_HEADERS
Enable resize row headers flag.

 o ROW_LINES
 public static final int ROW_LINES
Display row lines flag.

 o COL_LINES
 public static final int COL_LINES
Display column lines flag.

 o H_SCROLL
 public static final int H_SCROLL
Create horizontal scrollbar (if needed) flag. Setting this flag will display horizontal scrollbars only if needed.

 o V_SCROLL
 public static final int V_SCROLL
Create vertical scrollbar (if needed) flag. Setting this flag will display vertical scrollbars only if needed.

 o FORCE_H_SCROLL
 public static final int FORCE_H_SCROLL
Force horizontal scrollbar flag. Setting this flag will always display horizontal scrollbars.

 o FORCE_V_SCROLL
 public static final int FORCE_V_SCROLL
Force vertical scrollbar flag. Setting this flag will always display vertical scrollbars.

 o DOUBLE_BUFFERING
 public static final int DOUBLE_BUFFERING
Use double buffering while drawing flag.

 o DRAG_SELECT
 public static final int DRAG_SELECT
Enable drag selection flag. This will allow the user to continue selecting/deselecting cells as long as he drags with the mouse button depressed.

 o THREED_BORDER
 public static final int THREED_BORDER
Draw a one pixel 3D rectangle around the grid.

 o SORT_ATTRIBUTES
 public static final int SORT_ATTRIBUTES
Move row attributes and size around while sorting. You this flag if you want individual rows to retain their attributes and height when they're moved during sorting.

 o DEMO_TEXT
 public static final int DEMO_TEXT
Display Demo text in grid if no text available. Setting this flag displays the row and column numbers in the cells.

 o ROW_NUMBERS
 public static final int ROW_NUMBERS
Display row numbers in the row headers. Setting this flag causes row headers to display the row numbers.

 o RESIZE_MULTIPLE
 public static final int RESIZE_MULTIPLE
Resize multiple rows or columns if selected. Setting this flag resizes multiple selected rows or columns to the same height or width simultaneously (spreadsheet like functionality).

 o AUTO_RESIZE_ROWS
 public static final int AUTO_RESIZE_ROWS
Automatically resize rows to display wrapped text.

 o AUTO_RESIZE_COLS
 public static final int AUTO_RESIZE_COLS
Automatically resize columns proportionally to fit. When the user resizes any of the columns, the grid resizes other columns in the Grid based on the colResizeMode setting.

 o SORT_ROW_HEADERS
 public static final int SORT_ROW_HEADERS
Move row header data with row data while sorting. Set this flag if you want individual rows to retain their row header data when they're moved during sorting.

 o JUST_DEFAULT
 public static final int JUST_DEFAULT
Default (left) justification attribute. This constant is one of the possible values for the GridAttribute's justification field.

 o JUST_LEFT
 public static final int JUST_LEFT
Left justification attribute. This constant is one of the possible values for the GridAttribute's justification field.

 o JUST_CENTER
 public static final int JUST_CENTER
Center justification attribute. This constant is one of the possible values for the GridAttribute's justification field.

 o JUST_RIGHT
 public static final int JUST_RIGHT
Right justification attribute. This constant is one of the possible values for the GridAttribute's justification field.

 o WORD_WRAP
 public static final int WORD_WRAP
Word wrapping text attribute. Setting this causes the text to be drawn over multiple lines with wrapping between words or line endings. This constant is one of the possible values for the GridAttribute's justification field which should be OR'd with JUST_LEFT, JUST_RIGHT or JUST_CENTER.

 o TRUNC_STRING
 public static final int TRUNC_STRING
Truncate string (with ellipsis) text attribute. Setting this causes the text to be drawn with "..." at the end of the text if it doesn't fit within the cells boundaries. This constant is one of the possible values for the GridAttribute's justification field which should be OR'd with JUST_LEFT, JUST_RIGHT or JUST_CENTER.

 o TEXT
 public static final int TEXT
Read-only text cell type attribute. This is the default cell type and cell is drawn with no special behaviour. This constant is one of the possible values for the GridAttribute's cell type field.

 o EDIT_TEXT
 public static final int EDIT_TEXT
Editable text cell type attribute. Use this type to designate the cells as being editable. Double clicking on any cell with this flag will activate editing in that cell. This constant is one of the possible values for the GridAttribute's cell type field.

 o URL
 public static final int URL
HTTP URL cell type attribute. Use this type to designate the cells as URLs. The text is underlined, and clicking in this cell causes the browser to display the page pointed by the URL, if supported by the browser. The text can be either web address "www.3magic.com", a URL "http://www.3magic.com" or a description text and an address "3magic Software Web Site". This constant is one of the possible values for the GridAttribute's cell type field.

 o MAIL
 public static final int MAIL
Mail address cell type attribute. Use this type to designate the cells as mail address. The text is underlined, and clicking in this cell causes the browser to create a blank email form with the specified address, if supported by the browser. The text can be either web address "sales@3magic.com", a URL "mailto:sales@3magic.com" or a description text and an address "Mail 3magic". This constant is one of the possible values for the GridAttribute's cell type field.

 o IMAGE
 public static final int IMAGE
Image cell type attribute. Use this type to designate the cells as an Image cell. If the cell's data is an Image, the Image will be drawing in the cell. This constant is one of the possible values for the GridAttribute's cell type field.

 o NEVER
 public static final int NEVER
ScrollBar display policy to never display the scrollBar. Use this value in setHScroll() or setVScroll() to change the scrollBar display option after the grid has been created. These values are not Grid flags but rather cause the H_SCROLL, V_SCROLL, FORCE_H_SCROLL or FORCE_V_SCROLL flags to be set.

 o IF_NEEDED
 public static final int IF_NEEDED
ScrollBar display policy to display the scrollBar only if needed. Use this value in setHScroll() or setVScroll() to change the scrollBar display option after the grid has been created. These values are not Grid flags but rather cause the H_SCROLL, V_SCROLL, FORCE_H_SCROLL or FORCE_V_SCROLL flags to be set.

 o ALWAYS
 public static final int ALWAYS
ScrollBar display policy to always display the scrollBar. Use this value in setHScroll() or setVScroll() to change the scrollBar display option after the grid has been created. These values are not Grid flags but rather cause the H_SCROLL, V_SCROLL, FORCE_H_SCROLL or FORCE_V_SCROLL flags to be set.

 o SORT_ASCENDING
 public static final int SORT_ASCENDING
Sort the column data in ascending order.

 o SORT_DESCENDING
 public static final int SORT_DESCENDING
Sort the column data in descending order.

 o COL_RESIZE_NEXT
 public static final int COL_RESIZE_NEXT
Resize the column right next to the column being sized by the user automatically if automatic column resizing is enabled.

 o COL_RESIZE_LAST
 public static final int COL_RESIZE_LAST
Resize last column in the Grid automatically when the user changes the size of any column in the Grid, if automatic column resizing is enabled.

 o COL_RESIZE_ALL
 public static final int COL_RESIZE_ALL
Resize all other columns in the Grid proportionally when the user changes the size of any column in the Grid, if automatic column resizing is enabled.

Constructors

 o GridPanel
 public GridPanel()
Constructs and creates a new GridPanel Object. This creates a grid with 0 rows and columns, and other defaults like cell selection, row and column headers, row and column lines enabled and with scrollbars. After creating a Grid, you should first set the Grid and Header attributes, if needed, before any other operations, since these attributes are used in most calculations.

 o GridPanel
 public GridPanel(int flags)
Constructs and creates a new GridPanel Object. This creates a grid with 0 rows and columns, and other defaults like cell selection, row and column headers, row and column lines enabled and with scrollbars. After creating a Grid, you should first set the Grid and Header attributes, if needed, before any other operations, since these attributes are used in most calculations.

Parameters:
flags - flags to control the grid features
 o GridPanel
 public GridPanel(int numRows,
                  int numCols)
Constructs and creates a new GridPanel Object. This creates a grid with the specified rows and columns, and other defaults like cell selection, row and column headers, row and column lines enabled and with scrollbars. After creating a Grid, you should first set the Grid and Header attributes, if needed, before any other operations, since these attributes are used in most calculations.

Parameters:
numRows - the number of rows
numCols - the number of columns
 o GridPanel
 public GridPanel(int numRows,
                  int numCols,
                  int flags)
Constructs and creates a new GridPanel Object. This creates a grid with the specified rows and columns, and other defaults like cell selection, row and column headers, row and column lines enabled and with scrollbars. After creating a Grid, you should first set the Grid and Header attributes, if needed, before any other operations, since these attributes are used in most calculations.

Parameters:
numRows - the number of rows
numCols - the number of columns
flags - flags to control the grid features
 o GridPanel
 public GridPanel(int numRows,
                  int numCols,
                  int rowHeight,
                  int rowHeaderWidth,
                  int colHeaderHeight,
                  int colWidths[],
                  GridAttributes gridAttributes,
                  GridAttributes headerAttributes,
                  Color lineColor,
                  int flags)
Constructs and creates a new GridPanel Object using the passed in parameters. It also creates the scrollbars for the grid. The flags are used to enable certain features. The grid and header attributes must be fully populated i.e. all the attributes (Font, textColor, backColor and justification) must be set. You can use a layout manager to layout the grid or use reshape() to specify its size and location.

Parameters:
numRows - the number of rows
numCols - the number of columns
rowHeight - the height of each row, -1 to use the font height
rowHeaderWidth - the width of the row header, 0 if no row header desired
colHeaderHeight - the height of the column header, 0 if no column header desired or -1 to use the font height
colWidths - an array specifying the width for each column
gridAttributes - the attributes (Font, textColor, backgroundColor, justification) for the cells in the grid
headerAttributes - the attributes for the cells in the grid header
lineColor - the color for row and column lines
flags - flags to control the grid features
See Also:
GridAttributes

Methods

 o resize
 public void resize(int width,
                    int height)
Resizes the GridPanel to the specified width and height. Adjust the scrollbars if present.

Parameters:
width - the width of the component
height - the height of the component
Overrides:
resize in class Component
 o reshape
 public void reshape(int x,
                     int y,
                     int width,
                     int height)
Reshapes the GridPanel to the specified bounding box. Adjust the scrollbars if present.

Parameters:
x - the x coordinate
y - the y coordinate
width - the width of the component
height - the height of the component
Overrides:
reshape in class Component
 o addNotify
 public void addNotify()
Notifies the Component of it's being added to a panel. This method is used internally by the GridPanel and you don't need to call it.

Overrides:
addNotify in class Panel
 o setApplet
 public void setApplet(Applet applet)
Set the applet that this component is contained in. This method is used to get the Applet's context which is used when the user clicks in the MAIL or URL cell types. This applet reference should be provided if you are planning to use any URL or MAIL cell types in the grid.

Parameters:
applet - the Applet that this GridPanel is contained in
 o getApplet
 public Applet getApplet()
Return the applet that this component is contained in. This reference to the Applet is used to get the Applet's context which is used when the user clicks in the MAIL or URL cell types. If the applet is specified (using the setApplet() method), it's reference is returned, otherwise the parent frame for the component is returned if it's an Applet.

Returns:
the Applet that this GridPanel is contained in
 o isInited
 public boolean isInited()
Checks if this GridPanel has been successfully initialized.

 o minimumSize
 public Dimension minimumSize()
Returns the preferred size of this component. This method returns the size by calling the size() method.

Overrides:
minimumSize in class Container
 o preferredSize
 public Dimension preferredSize()
Returns the preferred size of this component. This method returns the size by calling the size() method.

Overrides:
preferredSize in class Container
 o setPreferredSize
 public void setPreferredSize(Dimension newSize)
Deprecated. Note: setPreferredSize() is deprecated. As of version 1.2.2, use Component.resize().

 o paint
 public synchronized void paint(Graphics g)
Paints the GridPanel.

Parameters:
g - the specified Graphics window
Overrides:
paint in class Container
 o handleEvent
 public boolean handleEvent(Event evt)
Handles the event. Returns true if the event is handled and should not be passed to the parent of this component. This method dispatches all scrollbar events to the handleScrollEvent() method.

Parameters:
evt - the event object
Overrides:
handleEvent in class Component
See Also:
handleScrollEvent
 o handleScrollEvent
 public boolean handleScrollEvent(Event evt)
Handles all scrollbar events for the GridPanel. You may override this method to provide any additional functional, but you will need to call super.handleScrollEvent() if you do so.

Parameters:
evt - the event object
 o mouseDown
 public boolean mouseDown(Event evt,
                          int x,
                          int y)
Called if the mouse is down. This method dispatches to the handleMouseDown and handleDoubleClick method to handle selections and double clicks in the GridPanel.

Parameters:
evt - the event
x - the x coordinate
y - the y coordinate
Overrides:
mouseDown in class Component
See Also:
handleMouseDown, handleDoubleClick
 o mouseExit
 public boolean mouseExit(Event evt,
                          int x,
                          int y)
Called when the mouse exits the GridPanel. This method is used internally by the GridPanel and you don't need to call it.

Overrides:
mouseExit in class Component
 o keyDown
 public boolean keyDown(Event evt,
                        int key)
Called if a character is pressed. This method checks the HOME, END, PAGE-UP, PAGE-DOWN, UP, DOWN, LEFT and RIGHT arrow keys to handle scrolling and selection, deactivating editing id needed. Editing is also deactivated if the or key is typed.

Parameters:
evt - the event
key - the key that's pressed
Overrides:
keyDown in class Component
 o createGridData
 public void createGridData()
Allocates a new GridData object to store the data for the grid. This method is called by the GridPanel constructor. When allocated, this object is used by the default implementations of getCellText(), setCellText(), get/setColHeaderText(), get/setRowHeaderText() to get/set the grid data. Once created, the GridPanel manages growing and shrinking the GridData object by resizing it when needed.

See Also:
getCellText, setCellText, getColHeaderText, setColHeaderText, getRowHeaderText, setRowHeaderText
 o headerColToRect
 public Rectangle headerColToRect(int col)
Returns the rectangle for the column header.

Parameters:
col - the column
Returns:
the rectangle for the column header area for the specified column
 o cellToRect
 public Rectangle cellToRect(Point cell)
Returns the rectangle for the specified cell. The rectangle returned is in absolute coordinates, so you may need to translate it by the scroll offset.

Parameters:
cell - the cell
Returns:
the rectangle for the specified cell
 o colToRect
 public Rectangle colToRect(int col)
Returns the rectangle for the specified column. The rectangle returned is in absolute coordinates, so you may need to translate it by the scroll offset.

Parameters:
col - the column
Returns:
the rectangle for the specified column
 o rowToRect
 public Rectangle rowToRect(int row)
Returns the rectangle for the specified row. The rectangle returned is in absolute coordinates, so you may need to translate it by the scroll offset.

Parameters:
row - the row
Returns:
the rectangle for the specified row
 o colHeaderToRect
 public Rectangle colHeaderToRect(int col)
Returns the rectangle for the specified column's header. The rectangle returned is in absolute coordinates, so you may need to translate it by the scroll offset.

Parameters:
col - the column
Returns:
the rectangle for the specified column's header
 o rowHeaderToRect
 public Rectangle rowHeaderToRect(int row)
Returns the rectangle for the specified row's header. The rectangle returned is in absolute coordinates, so you may need to translate it by the scroll offset.

Parameters:
row - the row
Returns:
the rectangle for the specified row's header
 o getColHeaderRect
 public Rectangle getColHeaderRect()
Return the area taken up by the column headers.

Returns:
the rectangle for the column headers
 o getRowHeaderRect
 public Rectangle getRowHeaderRect()
Return the area taken up by the row headers.

Returns:
the rectangle for the row headers
 o deselectAll
 public void deselectAll(boolean repaint)
Deselect all the cells in the grid.

Parameters:
repaint - redraw the grid after the operation.
 o revealCell
 public void revealCell(int col,
                        int row)
Scroll the specified cell into view.

Parameters:
col - the column index
row - the row index
 o revealRow
 public void revealRow(int row)
Scroll the specified row into view.

Parameters:
row - the row
 o revealCol
 public void revealCol(int col)
Scroll the specified column into view.

Parameters:
col - the column
 o deselectCell
 public void deselectCell(int x,
                          int y,
                          boolean repaint)
Deselect the specified cell in the grid.

Parameters:
x - the horizontal coordinate for the cell
y - the vertical coordinate for the cell
repaint - redraw the grid after the operation.
 o deselectCol
 public void deselectCol(int col,
                         boolean repaint)
Deselect the all the cells in a column in the grid.

Parameters:
col - the column
repaint - redraw the grid after the operation.
 o deselectRow
 public void deselectRow(int row,
                         boolean repaint)
Deselect the all the cells in a row in the grid.

Parameters:
row - the row
repaint - redraw the grid after the operation.
 o disposeGridData
 public void disposeGridData()
Deallocates the GridData object that stores the data for the grid.

See Also:
createGridData, setGridData
 o doKeySelect
 public final void doKeySelect(Event evt)
Selects a cell, row or column based on the arrows keys and the selection mode. This method will cause the grid to scroll if necessary.

 o drawJustString
 public void drawJustString(Graphics g,
                            String aString,
                            Rectangle aRect,
                            int justification,
                            FontMetrics aFontMetrics,
                            int baseLine)
Draw the string using the specified justification style. This method draws the string in the provided Rectangle (aligned from the top) using the specified justification style. You need to set your clipping rectangle, the Font and the Color etc. before calling this method.

Parameters:
g - the Graphics object
aString - the String to be drawn
aRect - the Rectangle in which to draw the string
justification - the justification style (JUST_LEFT, JUST_CENTER, JUST_RIGHT)
aFontMetrics - the FontMetrics record for the Font being used
baseLine - the baseLine for the text
 o drawText
 public void drawText(Graphics g,
                      String aString,
                      Rectangle aRect,
                      int justification,
                      FontMetrics aFontMetrics)
Draw the string using the specified justification style, with word wrapping. This method draws the string in the provided Rectangle (aligned from the top) using the specified justification style, while breaking the lines on spaces and new lines. If there is only one word in a line and it doesn't fit, then the word is automatically broken. You need to set your clipping rectangle, the Font and the Color etc. before calling this method.

Parameters:
g - the Graphics object
aString - the String to be drawn
aRect - the Rectangle in which to draw the string
justification - the justification style (JUST_LEFT, JUST_CENTER, JUST_RIGHT)
aFontMetrics - the FontMetrics record for the Font being used
 o drawTruncString
 public void drawTruncString(Graphics g,
                             String aString,
                             Rectangle aRect,
                             int justification,
                             FontMetrics aFontMetrics,
                             int baseLine)
Draw the string using the specified justification style, truncating the string if necessary. This rountine enures that the string fits the width of the passed in rectangle by truncating the string. If truncation occurs, this method ends the string with ellipsis.

Parameters:
g - the Graphics object
aString - the String to be drawn
aRect - the Rectangle in which to draw the string
justification - the justification style (JUST_LEFT, JUST_CENTER, JUST_RIGHT)
aFontMetrics - the FontMetrics record for the Font being used
baseLine - distance from the top of the Rect to the text baseline
 o drawCell
 public void drawCell(Graphics g,
                      Point cell,
                      Rectangle aRect,
                      boolean highlight)
Draw a cell in the GridPanel. The default implementation of this method draws the text for the cell in the specified rectangle. It gets the text for the cell by calling getCellText and the drawing attributes by calling getCellAttributes. The drawing is clipped to the passed in rectangle. If the highlight parameter is true, the cell is drawn using the highlight color and the highlight text color. This method can be overidden to customize drawing.

Parameters:
g - the specified Graphics object
cell - the cell being drawn
aRect - the area in which the cell is drawn
highlight - whether or not the cell being drawn is highlighted
 o getVersionString
 public final String getVersionString()
Return the current version of the component.

Returns:
a String specifying the current version number
 o drawCellImage
 public void drawCellImage(Graphics g,
                           Image im,
                           Point cell,
                           Rectangle aRect)
Draw an image in the specified cell. The default implementation of this method draws the specified image in the passed in rectangle. This method is called by drawCell() if the cell type is IMAGE and the cell data is an Image object.

Parameters:
g - the specified Graphics object
im - the Image to be drawn
cell - the cell being drawn
aRect - the Rectangle in which to draw the string
 o drawString
 public final void drawString(Graphics g,
                              String aString,
                              Rectangle aRect,
                              int justification,
                              FontMetrics aFontMetrics)
Draw a String in the specified rectangle. The default implementation of this method draws the string using the justification parameter to either word wrap or truncate if needed.

Parameters:
g - the specified Graphics object
aString - the String to be drawn
aRect - the Rectangle in which to draw the string
justification - the justification style (JUST_LEFT, JUST_CENTER, JUST_RIGHT with WORD_WRAP or TRUNC_STRING OR'd to it)
aFontMetrics - the FontMetrics record for the Font being used
 o highlightCell
 public void highlightCell(Graphics g,
                           Point cell,
                           Rectangle aRect,
                           boolean highlight)
Highlight a cell in the GridPanel. The default implementation of this method draws the cell in a highlighted state to signify selection by simply calling the drawCell method with the highlight flag set. This method could be overridden to customize cell highlighting.

Parameters:
g - the specified Graphics window
cell - the cell being drawn
aRect - the area in which the cell is drawn
highlight - whether or not the cell being drawn is highlighted
See Also:
drawCell
 o drawHeaderCol
 public void drawHeaderCol(Graphics g,
                           int col,
                           Rectangle colRect)
Draw the header for a column. The default implementation of this method draws the column header for the specified column. It gets the text for the column header by calling getColHeaderText. The drawing is clipped to the passed in rectangle, and a 3D rectangle is drawn using the attributes for the grid header. This method can be overidden to customize drawing.

Parameters:
g - the specified Graphics window
col - the column being drawn
colRect - the area in which the column header is drawn
See Also:
getColHeaderText
 o drawIntersection
 public void drawIntersection(Graphics g,
                              Rectangle aRect)
Draw the area in the intersection between the row and column headers. The default implementation of this method draws the area that falls in the intersection between the row and column headers in the top-left corner of the GridPanel. The drawing is clipped to the passed in rectangle, and a 3D rectangle is drawn using the attributes for the grid header. This method can be overidden to customize drawing.

Parameters:
g - the specified Graphics window
aRect - the area in which the intersection is drawn
 o drawHeaderRow
 public void drawHeaderRow(Graphics g,
                           int row,
                           Rectangle rowRect)
Draw the header for a row. The default implementation of this method draws the row header for the specified row. It gets the text for the row header by calling getRowHeaderText. The drawing is clipped to the passed in rectangle, and a 3D rectangle is drawn using the attributes for the grid header. This method can be overidden to customize drawing.

Parameters:
g - the specified Graphics window
row - the row being drawn
rowRect - the area in which the row header is drawn
See Also:
getRowHeaderText
 o getCellAttributes
 public GridAttributes getCellAttributes(int col,
                                         int row)
Return the drawing attributes for a cell. The default implementation of this method checks the grid attributes and then the column and row attributes (if non-zero) to compute the cells attributes. This method should be overridden if you want to return any other attributes for the cell, row or column. You can pass in 0 for the row or column to not specify either i.e. to get the column attributes, pass in 0 for the row and vice versa.

Parameters:
col - the column
row - the row
Returns:
the drawing attributes object for the specified cell
See Also:
GridAttributes
 o getCellText
 public String getCellText(int x,
                           int y)
Return the text for a cell. The default implementation of this checks for the GridData object and if it exists, it retrieves the text for the specified cell by calling it's getCellText() method, otherwise it returns an empty string. This method is called by the default implementation of drawCell. This method can be overidden to get the cell text differently.

Parameters:
x - the horizontal coordinate
y - the vertical coordinate
Returns:
the text for a cell
See Also:
drawCell, getCellData, getCellText
 o getCellData
 public Object getCellData(int x,
                           int y)
Return the data Object for a cell. The default implementation of this checks for the GridData object and if it exists, it retrieves the data for the specified cell by calling it's getCellData() method, otherwise it returns null. This method just returns a refernce to the data object, if you wish to get the String representation of the data you should use getCellText().

Parameters:
x - the horizontal coordinate
y - the vertical coordinate
Returns:
the text for a cell
See Also:
drawCell, getCellText, getCellData
 o getCellInset
 public Point getCellInset()
Return the cell inset.

Returns:
a Point specifying the vertical and hroizontal insets for a cell.
 o setCellInset
 public void setCellInset(Point inset)
Set the cell inset.

Parameters:
inset - a Point specifying the vertical and hroizontal insets for a cell.
 o getEditCell
 public Point getEditCell()
Return the cell being edited.

Returns:
a Point specifying the cell being edited or null.
 o getEditor
 public Component getEditor()
Return the editor component for the cell being edited.

Returns:
the editor component
 o getEditTextField
 public TextField getEditTextField()
Deprecated. Note: getEditTextField() is deprecated. As of version 1.2.2, use getEditor().

 o getHighlightColor
 public Color getHighlightColor()
Return the highlight color. This is the background color used to draw any selected/highlighted cells.

Returns:
the highlight color for the grid.
 o getHighlightTextColor
 public Color getHighlightTextColor()
Return the highlight text color. This is the text color used to draw any selected/highlighted cells.

Returns:
the highlight text color for the grid.
 o getColHeaderHeight
 public int getColHeaderHeight()
Returns the height for the column headers.

Returns:
the column header height
 o getColHeaderText
 public String getColHeaderText(int col)
Returns the text for the column header for a specified column. The default implementation of this checks for the GridData object and if it exists, it retrieves the text for the column header by calling it's getColHeaderText() method, otherwise it returns an empty string. This method is called by the default implementation of drawHeaderCol() and can be overidden to return the column header text differently.

Parameters:
col - the column
Returns:
the text for a column header
See Also:
drawHeaderCol, getColHeaderText
 o getColWidth
 public int getColWidth(int col)
Returns the width for the specified column.

Parameters:
col - the column
Returns:
the column width
 o getColWidths
 public int getColWidths(int startCol,
                         int numCols)
Returns the total width for a range of columns.

Parameters:
startCol - the first column
numCols - the number of columns from startCol whose accumulated width is desired
Returns:
the total width for a range of columns
 o getFirstSelectedCell
 public Point getFirstSelectedCell()
Returns the first selected cell in the grid. This method searched for the cell by search row-wise first and then column-wise.

Returns:
the first selected cell in the grid
 o getLastSelectedCell
 public Point getLastSelectedCell()
Returns the last selected cell in the grid. This method searched for the cell by search row-wise first and then column-wise.

Returns:
the last selected cell in the grid
 o getSelectedCells
 public Vector getSelectedCells()
Returns a list of the currently selected cells. This method iterates through the cells and returns a list of all the selected cell indices.

Returns:
a Vector of Points containing the selected cells in the grid or null if no cells selected
 o getFirstSelectedCol
 public int getFirstSelectedCol()
Returns the first selected column in the grid. This method searches for the first column (from the left) where the entire column is selected.

Returns:
the first selected column in the grid
 o getLastSelectedCol
 public int getLastSelectedCol()
Returns the last selected column in the grid. This method searches for the last column (from the right) where the entire column is selected.

Returns:
the last selected column in the grid
 o getSelectedCols
 public Vector getSelectedCols()
Returns a list of the currently selected columns. This method iterates through the columns and returns a list of all the selected column indices.

Returns:
a Vector of Integers containing the selected columns in the grid or null if no columns are selected
 o getFirstSelectedRow
 public int getFirstSelectedRow()
Returns the first selected row in the grid. This method searches for the first row (from the top) where the entire row is selected.

Returns:
the first selected row in the grid
 o getLastSelectedRow
 public int getLastSelectedRow()
Returns the last selected row in the grid. This method searches for the last row (from the bottom) where the entire row is selected.

Returns:
the last selected row in the grid
 o getSelectedRows
 public Vector getSelectedRows()
Returns a list of the currently selected rows. This method iterates through the rows and returns a list of all the selected row indices.

Returns:
a Vector of Integers containing the selected rows in the grid or null if no rows are selected
 o getSelBounds
 public Rectangle getSelBounds()
Returns the boundary of the current selection. This method returns the smallest Rectangle that encloses the currently selected cells.

Returns:
a Rectangle enclosing the currently selected cells
 o getFirstVisibleCell
 public Point getFirstVisibleCell()
Returns the cell at the top-left corner of the grid.

Returns:
a point specifying the top-left cell
 o getLastVisibleCell
 public Point getLastVisibleCell()
Returns the cell at the bottom-right corner of the grid.

Returns:
a point specifying the bottom-right cell
 o getGridAttributes
 public GridAttributes getGridAttributes()
Returns the drawing attributes for the entire grid.

Returns:
the grid's drawing attributes
See Also:
GridAttributes
 o getGridData
 public GridData getGridData()
Returns the GridData object for this grid.

Returns:
the GridData object
 o getFlags
 public int getFlags()
Returns the Grid's current feature flags

Returns:
the Grid flags
 o setFlags
 public void setFlags(int flags)
Set the Grid's feature flags. These are the same as the flags parameter in the GridPanel's contructors.

Parameters:
flags - flags to control the grid features
 o setRowLines
 public void setRowLines(boolean state)
Enable or disable row lines. Setting this flag is equivalent to passing in the ROW_LINES flag in the flags parameter of the GridPanel constructor. This method repaints the grid if it's visible.

Parameters:
state - true to draw row lines
 o setColLines
 public void setColLines(boolean state)
Enable or disable column lines. Setting this flag is equivalent to passing in the COL_LINES flag in the flags parameter of the GridPanel constructor. This method repaints the grid if it's visible.

Parameters:
state - true to draw column lines
 o setResizeColumns
 public void setResizeColumns(boolean state)
Enable or disable column resizing. Setting this flag is equivalent to passing in the RESIZE_COLUMNS flag in the flags parameter of the GridPanel constructor.

Parameters:
state - true to enable column resizing
 o setResizeRows
 public void setResizeRows(boolean state)
Enable or disable row resizing. Setting this flag is equivalent to passing in the RESIZE_ROWS flag in the flags parameter of the GridPanel constructor.

Parameters:
state - true to enable row resizing
 o setThreeDBorder
 public void setThreeDBorder(boolean state)
Enable or disable drawing a ThreeD border around the grid. Setting this flag is equivalent to passing in the THREED_BORDER flag in the flags parameter of the GridPanel constructor.

Parameters:
state - true to enable a ThreeD border
 o setSortRowHeaders
 public void setSortRowHeaders(boolean state)
Enable or disable moving the row header data with the rows while sorting. Setting this flag is equivalent to passing in the SORT_ROW_HEADERS flag in the flags parameter of the GridPanel constructor.

Parameters:
state - true to move the row header data with rows while sorting
 o setSortAttributes
 public void setSortAttributes(boolean state)
Enable or disable moving the attributes with the rows while sorting. Setting this flag is equivalent to passing in the SORT_ATTRIBUTES flag in the flags parameter of the GridPanel constructor.

Parameters:
state - true move move attributes with rows while sorting
 o setResizeColHeaders
 public void setResizeColHeaders(boolean state)
Enable or disable column header resizing. Setting this flag is equivalent to passing in the RESIZE_COL_HEADERS flag in the flags parameter of the GridPanel constructor.

Parameters:
state - true to enable column header resizing
 o setResizeRowHeaders
 public void setResizeRowHeaders(boolean state)
Enable or disable row header resizing. Setting this flag is equivalent to passing in the RESIZE_ROW_HEADERS flag in the flags parameter of the GridPanel constructor.

Parameters:
state - true to enable row header resizing
 o setCellSelection
 public void setCellSelection(boolean state)
Enable or disable cell selection. Setting this flag is equivalent to passing in the CELL_SELECTION flag in the flags parameter of the GridPanel constructor.

Parameters:
state - true to enable cell selection
 o setRowSelection
 public void setRowSelection(boolean state)
Enable or disable row selection. Setting this flag is equivalent to passing in the ROW_SELECTION flag in the flags parameter of the GridPanel constructor.

Parameters:
state - true to enable row selection
 o setColSelection
 public void setColSelection(boolean state)
Enable or disable column selection. Setting this flag is equivalent to passing in the COL_SELECTION flag in the flags parameter of the GridPanel constructor.

Parameters:
state - true to enable column selection
 o setMultipleSelection
 public void setMultipleSelection(boolean state)
Enable or disable multiple selections. Setting this flag is equivalent to passing in the MULTIPLE_SELECTION flag in the flags parameter of the GridPanel constructor.

Parameters:
state - true to enable multiple selections
 o setResizeMultiple
 public void setResizeMultiple(boolean state)
Enable or disable resizing of multiple rows or columns if selected. Setting this flag is equivalent to passing in the RESIZE_MULTIPLE flag in the flags parameter of the GridPanel constructor.

Parameters:
state - true to enable multiple resizing
 o setRowNumbers
 public void setRowNumbers(boolean state)
Enable or disable drawing row numbers in the row headers. This is provided as a convenience if you just want row numbers to be drawing in the row headers. Setting this flag is equivalent to passing in the ROW_NUMBERS flag in the flags parameter of the GridPanel constructor. This method repaints the grid if it's visible.

Parameters:
state - true to draw row numbers
 o setDemoText
 public void setDemoText(boolean state)
Enable or disable drawing demo text in empty cells. Enabling this draws the Row and Column numbers in cells and headers in the form "Row y, Col x". Setting this flag is equivalent to passing in the DEMO_TEXT flag in the flags parameter of the GridPanel constructor. This method repaints the grid if it's visible.

Parameters:
state - true to draw demo text
 o setDoubleBuffering
 public void setDoubleBuffering(boolean state)
Enable or disable double buffering. Setting this flag is equivalent to passing in the DOUBLE_BUFFERING flag in the flags parameter of the GridPanel constructor.

Parameters:
state - true to enable double buffering
 o setDragSelect
 public void setDragSelect(boolean state)
Enable or disable drag selection. Setting this flag is equivalent to passing in the DRAG_SELECT flag in the flags parameter of the GridPanel constructor.

Parameters:
state - true to enable drag selection
 o setHScroll
 public void setHScroll(int scrollMode)
Set the horizontal scroll bar display policy. Calling this method sets the H_SCROLL and FORCE_H_SCROLL flags for the GridPanel.

Parameters:
scrollbarMode - the scrollbar display criteria