home *** CD-ROM | disk | FTP | other *** search
- DEF_COMPONENTNAME
- MicrolineGrid
- DEF_SUPERCLASS
- MlGrid
- DEF_SUPERCOMPONENT
-
- DEF_PACKAGE
- plugins
- grids
- DEF_ENDLIST
- DEF_SUBCOMPONENTLIST
- DEF_ENDLIST
- DEF_SUBCOMPONENTCLASSLIST
- DEF_ENDLIST
- DEF_CATEGORY
- MicroLine
- DEF_BITMAP
- gridm.bmp
- DEF_THUMBNAIL_UP
- mlgrid.bmp
- DEF_THUMBNAIL_DOWN
- 2-mlgrid.bmp
- DEF_VISUAL
- DEF_TOOL
- DEF_IMPORTS
- DEF_ENDLIST
- DEF_REQUIRES
- DEF_ENDLIST
- DEF_IMPLEMENTS
- DEF_ENDLIST
- DEF_DECLARATION
- // A class that produces a grid.
- // This component has much more functionality which is described in
- // the included Microline documentation in /docs/microline.
- // This third party component was created by MicroLine. They can be contacted at:
- // http://www.mlsoft.com
- // Variable Declarations
- MlResources res;
- int columns;
- int rows;
-
- DEF_ENDLIST
- DEF_METHOD
- void initialize() {
- //This is just an example of how to use the grid.
- //Please refer to the included documentation.
- Dimension prefSize;
- res = new MlResources();
-
- res.add("columns", columns);
- res.add("simpleWidths", "20c 20c 20c");
- res.add("horizontalSizePolicy", "SIZE_TO_FIT");
- res.add("rows", rows);
- res.add("visibleRows", 6);
- res.add("vsbDisplayPolicy", "DISPLAY_ALWAYS");
- setValues(res);
-
- prefSize = preferredSize();
- reshape(0, 0, prefSize.width, prefSize.height);
- }
- DEF_ENDLIST
- DEF_METHOD
- public void setColumns(int columnparameter) {
- columns = columnparameter;
- }
- DEF_ENDLIST
- DEF_METHOD
- public void setRows(int rowparameter) {
- rows = rowparameter;
- }
- DEF_ENDLIST
- DEF_PROPERTY
- Columns
- int
- setColumns(AVALUE);
- AVALUE = AVALUE;
- 3
- DEF_ENDLIST
- DEF_PROPERTY
- Rows
- int
- setRows(AVALUE);
- AVALUE = AVALUE;
- 3
- DEF_ENDLIST
- DEF_PROPERTY
- Top
- int
- move(bounds().x, AVALUE);
- AVALUE = bounds().y;
- 0
- DEF_ENDLIST
- DEF_PROPERTY
- Left
- int
- move(AVALUE, bounds().y);
- AVALUE = bounds().x;
- 0
- DEF_ENDLIST
- DEF_PROPERTY
- Height
- int
- resize(bounds().width, AVALUE);
- AVALUE = bounds().height;
- 145
- DEF_ENDLIST
- DEF_PROPERTY
- Width
- int
- resize(AVALUE, bounds().height);
- AVALUE = bounds().width;
- 265
- DEF_ENDLIST
- DEF_ENDCOMPONENT
- DEF_COMPONENTNAME
- MlGrid
- DEF_SUPERCLASS
- Panel
- DEF_SUPERCOMPONENT
-
- DEF_PACKAGE
- plugins
- microline
- DEF_ENDLIST
- DEF_SUBCOMPONENTLIST
- DEF_ENDLIST
- DEF_SUBCOMPONENTCLASSLIST
- DEF_ENDLIST
- DEF_CATEGORY
-
- DEF_BITMAP
-
- DEF_THUMBNAIL_UP
-
- DEF_THUMBNAIL_DOWN
-
- DEF_BASE
- DEF_IMPORTS
- DEF_ENDLIST
- DEF_REQUIRES
- DEF_ENDLIST
- DEF_IMPLEMENTS
- DEF_ENDLIST
- DEF_DECLARATION
- DEF_ENDLIST
- DEF_METHOD
- public void addColumns(int count)
- // Adds count content columns.
- DEF_ENDLIST
- DEF_METHOD
- public void addColumns(int type, int position, int count)
- // Adds count columns of the given type at the specified position. A position of 0 indicates the first
- // column of the given type. A position of -1 specifies after the last position of that column type. The
- // Grid will remain scrolled to the column scrolled to prior to the addition of columns, and focus will
- // remain in the column which had focus prior to the addition of the columns.
- DEF_ENDLIST
- DEF_METHOD
- public void addRows(int count)
- // Adds count content rows.
- DEF_ENDLIST
- DEF_METHOD
- public void addRows(int type, int position, int count)
- // Adds count rows of the given type at the specified position. A position of 0 indicates the first row
- // of the given type. A position of -1 specifies after the last position of that row type. The Grid will
- // remain scrolled to the row scrolled to prior to the addition of rows, and focus will remain in the row
- // which had focus prior to the addition of the rows.
- DEF_ENDLIST
- DEF_METHOD
- public boolean columnIsVisible(int column)
- // Determines visibility of a content column. Returns true if any part of the content column given is
- // visible to the user, and false otherwise.
- DEF_ENDLIST
- DEF_METHOD
- public void deleteAllColumns()
- // Deletes all content columns.
- DEF_ENDLIST
- DEF_METHOD
- public void deleteAllColumns(int type)
- // Deletes all columns of the given type.
- DEF_ENDLIST
- DEF_METHOD
- public void deleteAllRows()
- // Deletes all content rows.
- DEF_ENDLIST
- DEF_METHOD
- public void deleteAllRows(int type)
- // Deletes all rows of the given type.
- DEF_ENDLIST
- DEF_METHOD
- public void deleteColumns(int type, int position, int count)
- // Deletes count columns of the given type in the Grid at the specified position. A position of 0
- // indicates the first column of the given type. If possible, the focus will remain in the column which had
- // focus prior to the deletion of columns. If the cell which has focus is in one of the columns deleted, the
- // Grid will generate a CELL_FOCUS_OUT event before that column is deleted. If a cell in one of the
- // columns is currently being edited, the Grid will generate an EDIT_CANCEL event before that
- // column is deleted.
- DEF_ENDLIST
- DEF_METHOD
- public void deleteRows(int type, int position, int count)
- // Deletes count rows of the given type in the Grid at the specified position. A position of 0 indicates
- // the first row of the given type. If possible, the focus will remain in the row which had focus prior to
- // the deletion of rows. If the cell which has focus is in one of the rows deleted, the Grid will generate a
- // CELL_FOCUS_OUT event before that row is deleted. If a cell in one of the rows is currently being
- // edited, the Grid will generate an EDIT_CANCEL event before that row is deleted.
- DEF_ENDLIST
- DEF_METHOD
- public void deselectAllCells(boolean notify)
- // Deselects all content cells in the Grid. If notify is true, the Grid will generate DESELECT_CELL
- // events for each cell deselected.
- DEF_ENDLIST
- DEF_METHOD
- public void deselectAllColumns(boolean notify)
- // Deselects all content columns in the Grid. If notify is true, the Grid will generate
- // DESELECT_COLUMN events for each column deselected.
- DEF_ENDLIST
- DEF_METHOD
- public void deselectAllRows(boolean notify)
- // Deselects all content rows in the Grid. If notify is true, the Grid will generate DESELECT_ROW
- // events for each row deselected.
- DEF_ENDLIST
- DEF_METHOD
- public void deselectCell(int row, int column, boolean notify)
- // Deselects the cell in the Grid at the content row and content column specified. If notify is true and
- // the cell is currently selected, the Grid will generate a DESELECT_CELL event.
- DEF_ENDLIST
- DEF_METHOD
- public void deselectColumn(int column, boolean notify)
- //Deselects the specified content column in the Grid. If notify is true and the column is currently
- //selected, the Grid will generate a DESELECT_COLUMN event.
- DEF_ENDLIST
- DEF_METHOD
- public void deselectRow(int row, boolean notify)
- // Deselects the specified content row in the Grid. If notify is true and the row is currently selected, the
- // Grid will generate a DESELECT_ROW event.
- DEF_ENDLIST
- DEF_METHOD
- public boolean editBegin(boolean insert, int row, int column)
- // Begin editing a cell at the given content row and content column. If insert is true, the edit will begin
- // with the text field containing the existing cell contents. If false, the text field will be cleared when the
- // edit begins. If the method is successful, the Grid will generate an EDIT_BEGIN or EDIT_INSERT
- // event. If the cell position specified is invalid or the cell can not be edited, false will be returned. A
- // value of true is returned if this method is successful.
- DEF_ENDLIST
- DEF_METHOD
- public void editCancel()
- // Cancels a cell edit which is in progress. If a cell is being edited, the Grid will generate an
- //EDIT_CANCEL event.
- DEF_ENDLIST
- DEF_METHOD
- public void editComplete()
- // Completes a cell edit which is in progress. If a cell is being edited, the Grid will generate an
- // EDIT_COMPLETE event.
- DEF_ENDLIST
- DEF_METHOD
- public Object getCellValue(int row, int column, String name)
- // Returns the value of the the cell resource given by name at the given content row and column. The
- // type of the value returned is determined by the resource. Integer values will return as Integer objects,
- // boolean values as Boolean objects, etc.
- DEF_ENDLIST
- DEF_METHOD
- public Object getCellValue(int rowType, int row, int columnType, int column, String name)
- // Returns the value of the the cell resource given by name at the given row of type rowType and
- // column of type columnType. The type of the value returned is determined by the resource. Integer
- // values will return as Integer objects, boolean values as Boolean objects, etc.
- DEF_ENDLIST
- DEF_METHOD
- public MlGridColumn getColumn(int columnType, int column)
- // Returns a reference to the column at position column of type type or null if the location is invalid.
- DEF_ENDLIST
- DEF_METHOD
- public Object getColumnValue(int column, String name)
- // Returns the value of the the column resource given by name at the given content column. The type
- // of the value returned is determined by the resource. Integer values will return as Integer objects,
- // boolean values as Boolean objects, etc.
- DEF_ENDLIST
- DEF_METHOD
- public Object getColumnValue(int columnType, int column, String name)
- // Returns the value of the the column resource given by name at the given column of type
- // columnType. The type of the value returned is determined by the resource. Integer values will return
- // as Integer objects, boolean values as Boolean objects, etc.
- DEF_ENDLIST
- DEF_METHOD
- public boolean getFocusIn()
- // Returns true if the Grid currently has focus.
- DEF_ENDLIST
- DEF_METHOD
- public MlGridPos getFocusPos()
- // Returns a position object containing the content row and column which currently has focus. You may
- // use the method getFocusIn() to determine if the Grid has focus. The row or column in the position
- // returned may be set to -1 which indicates that no cell in the Grid has focus.
- DEF_ENDLIST
- DEF_METHOD
- public MlGridRow getRow(int rowType, int row)
- // Returns a reference to the row at position row of type type or null if the location is invalid;
- DEF_ENDLIST
- DEF_METHOD
- public Object getRowValue(int row, String name)
- // Returns the value of the the row resource given by name at the given content row. The type of the
- // value returned is determined by the resource. Integer values will return as Integer objects, boolean
- // values as Boolean objects, etc.
- DEF_ENDLIST
- DEF_METHOD
- public Object getRowValue(int rowType, int row, String name)
- // Returns the value of the the row resource given by name at the given row of type rowType. The
- // type of the value returned is determined by the resource. Integer values will return as Integer objects,
- // boolean values as Boolean objects, etc.
- DEF_ENDLIST
- DEF_METHOD
- public MlGridPos []getSelectedCells()
- // Returns an array of position objects containing the locations of the currently selected cells. The length
- // of the array is the number of currently selected cells. This method returns null if there are no currently
- // selected cells. Row, column and cell selections are independent. For example, if you have a single
- // row selected in the Grid and no cells selected, a call to this method would return null.
- DEF_ENDLIST
- DEF_METHOD
- public int []getSelectedColumns()
- // Returns an integer array containing the positions of the currently selected content columns. The length
- // of the array is the number of selected columns. This method returns null if there are no columns
- // selected.
- DEF_ENDLIST
- DEF_METHOD
- public int getSelectedRow()
- // Returns the position of the selected content row. If no row is selected, this method returns -1.
- DEF_ENDLIST
- DEF_METHOD
- public int []getSelectedRows()
- // Returns an integer array containing the positions of the currently selected content rows. The length of
- // the array is the number of selected rows. This method returns null if there are no rows selected.
- DEF_ENDLIST
- DEF_METHOD
- public void moveColumns(int newPosition, int position, int count)
- // Moves count content columns at position to newPosition.
- DEF_ENDLIST
- DEF_METHOD
- public void moveRows(int newPosition, int position, int count)
- // Moves count content rows at position to newPosition.
- DEF_ENDLIST
- DEF_METHOD
- public void redrawAll()
- // Redraws all the cells in a Grid. This method is normally only used to redraw a Grid subclass which
- // performs drawing using a customized drawCell() method.
- DEF_ENDLIST
- DEF_METHOD
- public void redrawCell(int rowType, int row, int columnType, int column)
- // Redraws the cell at the column of type columnType and row of type rowType. This method is
- // normally only used to redraw a Grid subclass which performs drawing using a customized drawCell()
- // method.
- DEF_ENDLIST
- DEF_METHOD
- public void redrawColumn(int type, int column)
- // Redraws the column at position column of type type. This method is normally only used to redraw a
- // Grid subclass which performs drawing using a customized drawCell() method.
- DEF_ENDLIST
- DEF_METHOD
- public void redrawRow(int type, int row)
- Redraws the row at position row of type type. This method is normally only used to redraw a Grid
- subclass which performs drawing using a customized drawCell() method.
- DEF_ENDLIST
- DEF_METHOD
- public void reorderColumns(int position, int newPositions[])
- // Changes the positions of content columns starting at position to the positions specified in the
- // newPositions array.
- DEF_ENDLIST
- DEF_METHOD
- public void reorderRows(int position, int newPositions[])
- // Changes the positions of content rows starting at position to the positions specified in the
- // newPositions array.
- DEF_ENDLIST
- DEF_METHOD
- public Rectangle rowColumnToXY(int rowType, int row, int columnType, int column,
- boolean clipped)
- // Returns the current coordinates of the cell specified by the row of type rowType and column of
- // type columnType. If clipped is true, the rectangle returned will be the cell's rectangle clipped to the
- // current viewing area. If clipped is false, the rectangle returned will be the cell's unclipped rectangle, a
- // rectangle with the full width and height of the cell, not clipped to the viewport. The unclipped cell
- // rectangle is usually used to determine positioning based on cell alignment. This method will return null
- // if the position given is invalid or if the cell is not currently visible.
- DEF_ENDLIST
- DEF_METHOD
- public boolean rowIsVisible(int row)
- // Returns true if any part of the content row given is visible to the user, and false otherwise.
- DEF_ENDLIST
- DEF_METHOD
- public void selectAllCells(boolean notify)
- // Selects all content cells in the Grid. If notify is true, the Grid will generate SELECT_CELL events
- // for each cell selected.
- DEF_ENDLIST
- DEF_METHOD
- public void selectAllColumns(boolean notify)
- // Selects all content columns in the Grid. If notify is true, the Grid will generate SELECT_COLUMN
- // events for each column selected.
- DEF_ENDLIST
- DEF_METHOD
- public void selectAllRows(boolean notify)
- // Selects all content rows in the Grid. If notify is true, the Grid will generate SELECT_ROW events
- // for each row selected.
- DEF_ENDLIST
- DEF_METHOD
- public void selectCell(int row, int column, boolean notify)
- // Selects the cell at the specified content row and column. If notify is true and the cell is currently
- // deselected, the Grid will generate a SELECT_CELL event.
- DEF_ENDLIST
- DEF_METHOD
- public void selectColumn(int column, boolean notify)
- // Selects the specified content column. If notify is true and the column is currently deselected, the
- // Grid will generate a SELECT_COLUMN event.
- DEF_ENDLIST
- DEF_METHOD
- public void selectRow(int row, boolean notify)
- // Selects the specified content row. If notify is true and the row is currently deselected, the Grid will
- // generate a SELECT_ROW event.
- DEF_ENDLIST
- DEF_METHOD
- public boolean setFocus(int row, int column)
- // Set focus to the cell at the given content row and column. Upon success, true will be returned. A
- // value of false will be returned if the cell position specified is invalid or the cell can not accept focus.
- DEF_ENDLIST
- DEF_METHOD
- public int setStrings(String data)
- // Sets cell strings in the Grid starting at the top left cell with the strings contained in data. The string
- // data should be in pipe-separated format where pipes signify the start of a new column and new-lines
- // signify the start of new rows. The rows and columns set must exist at the time of this call. Returns the
- // number of cells which had values set by this method.
- DEF_ENDLIST
- DEF_METHOD
- public int setStrings(int row, String data)
- // Sets cell strings in the Grid starting at the left-most cell of the given content row with the strings
- // contained in data. The string data should be in pipe-separated format where pipes signify the start of
- // new columns. The rows and columns set must exist at the time of this call. Returns the number of
- // cells which had values set by this method.
- DEF_ENDLIST
- DEF_METHOD
- public int setStrings(int rowType, int row, int columnType, int column, String data)
- // Sets cell strings in the Grid with the strings contained in data, starting at the row and column
- // specified by the given rowType, row, columnType, and column. The string data should be in
- // pipe-separated format where pipes signify the start of a new column and new-lines signify the start of
- // new rows. The rows and columns set must exist at the time of this call. Returns the number of cells
- // which had values set by this method.
- DEF_ENDLIST
- DEF_METHOD
- public MlGridPos XYToRowColumn(int x, int y)
- // Returns the position of the cell at (containing) the x and y coordinates specified. Upon success, a
- // position object containing the rowType, row, columnType and column of the cell is returned. If no
- // cell exists at the location specified, null will be returned.
- DEF_ENDLIST
- DEF_ENDCOMPONENT
-