home *** CD-ROM | disk | FTP | other *** search
/ The Best of Windows 95.com 1996 September / WIN95_09961.iso / java / mojo1-2e.exe / MOJODISK / DATA.4 / plugins / gridwrap.def < prev    next >
Encoding:
Text File  |  1996-07-01  |  17.5 KB  |  447 lines

  1. DEF_COMPONENTNAME
  2. MicrolineGrid
  3. DEF_SUPERCLASS
  4. MlGrid
  5. DEF_SUPERCOMPONENT
  6.  
  7. DEF_PACKAGE
  8. plugins
  9. grids
  10. DEF_ENDLIST
  11. DEF_SUBCOMPONENTLIST
  12. DEF_ENDLIST
  13. DEF_SUBCOMPONENTCLASSLIST
  14. DEF_ENDLIST
  15. DEF_CATEGORY
  16. MicroLine
  17. DEF_BITMAP
  18. gridm.bmp
  19. DEF_THUMBNAIL_UP
  20. mlgrid.bmp
  21. DEF_THUMBNAIL_DOWN
  22. 2-mlgrid.bmp
  23. DEF_VISUAL
  24. DEF_TOOL
  25. DEF_IMPORTS
  26. DEF_ENDLIST
  27. DEF_REQUIRES
  28. DEF_ENDLIST
  29. DEF_IMPLEMENTS
  30. DEF_ENDLIST
  31. DEF_DECLARATION
  32. // A class that produces a grid.
  33. // This component has much more functionality which is described in
  34. // the included Microline documentation in /docs/microline.
  35. // This third party component was created by MicroLine.  They can be contacted at:
  36. // http://www.mlsoft.com
  37. //  Variable Declarations
  38.   MlResources res;
  39.   int columns;
  40.   int rows;
  41.  
  42. DEF_ENDLIST
  43. DEF_METHOD
  44. void initialize() {
  45.     //This is just an example of how to use the grid.
  46.     //Please refer to the included documentation.
  47.     Dimension prefSize;
  48.     res  = new MlResources();
  49.  
  50.     res.add("columns", columns);
  51.     res.add("simpleWidths", "20c 20c 20c");
  52.     res.add("horizontalSizePolicy", "SIZE_TO_FIT");
  53.     res.add("rows", rows);
  54.     res.add("visibleRows", 6);
  55.     res.add("vsbDisplayPolicy", "DISPLAY_ALWAYS");
  56.     setValues(res);
  57.  
  58.     prefSize = preferredSize();
  59.     reshape(0, 0, prefSize.width, prefSize.height);
  60.     }
  61. DEF_ENDLIST
  62. DEF_METHOD
  63. public void setColumns(int columnparameter) {
  64.     columns = columnparameter;     
  65. }
  66. DEF_ENDLIST
  67. DEF_METHOD
  68. public void setRows(int rowparameter) {
  69.     rows = rowparameter;     
  70. }
  71. DEF_ENDLIST
  72. DEF_PROPERTY
  73. Columns
  74. int
  75. setColumns(AVALUE);
  76. AVALUE = AVALUE;
  77. 3
  78. DEF_ENDLIST
  79. DEF_PROPERTY
  80. Rows
  81. int
  82. setRows(AVALUE);
  83. AVALUE = AVALUE;
  84. 3
  85. DEF_ENDLIST
  86. DEF_PROPERTY
  87. Top
  88. int
  89. move(bounds().x, AVALUE);
  90. AVALUE = bounds().y;
  91. 0
  92. DEF_ENDLIST
  93. DEF_PROPERTY
  94. Left
  95. int
  96. move(AVALUE, bounds().y);
  97. AVALUE = bounds().x;
  98. 0
  99. DEF_ENDLIST
  100. DEF_PROPERTY
  101. Height
  102. int
  103. resize(bounds().width, AVALUE);
  104. AVALUE = bounds().height;
  105. 145
  106. DEF_ENDLIST
  107. DEF_PROPERTY
  108. Width
  109. int
  110. resize(AVALUE, bounds().height);
  111. AVALUE = bounds().width;
  112. 265
  113. DEF_ENDLIST
  114. DEF_ENDCOMPONENT
  115. DEF_COMPONENTNAME
  116. MlGrid
  117. DEF_SUPERCLASS
  118. Panel
  119. DEF_SUPERCOMPONENT
  120.  
  121. DEF_PACKAGE
  122. plugins
  123. microline
  124. DEF_ENDLIST
  125. DEF_SUBCOMPONENTLIST
  126. DEF_ENDLIST
  127. DEF_SUBCOMPONENTCLASSLIST
  128. DEF_ENDLIST
  129. DEF_CATEGORY
  130.  
  131. DEF_BITMAP
  132.  
  133. DEF_THUMBNAIL_UP
  134.  
  135. DEF_THUMBNAIL_DOWN
  136.  
  137. DEF_BASE
  138. DEF_IMPORTS
  139. DEF_ENDLIST
  140. DEF_REQUIRES
  141. DEF_ENDLIST
  142. DEF_IMPLEMENTS
  143. DEF_ENDLIST
  144. DEF_DECLARATION
  145. DEF_ENDLIST
  146. DEF_METHOD
  147. public void addColumns(int count)
  148. // Adds count content columns.
  149. DEF_ENDLIST
  150. DEF_METHOD
  151. public void addColumns(int type, int position, int count)
  152. // Adds count columns of the given type at the specified position. A position of 0 indicates the first
  153. // column of the given type. A position of -1 specifies after the last position of that column type. The
  154. // Grid will remain scrolled to the column scrolled to prior to the addition of columns, and focus will
  155. // remain in the column which had focus prior to the addition of the columns. 
  156. DEF_ENDLIST
  157. DEF_METHOD
  158. public void addRows(int count)
  159. // Adds count content rows. 
  160. DEF_ENDLIST
  161. DEF_METHOD
  162. public void addRows(int type, int position, int count)
  163. // Adds count rows of the given type at the specified position. A position of 0 indicates the first row
  164. // of the given type. A position of -1 specifies after the last position of that row type. The Grid will
  165. // remain scrolled to the row scrolled to prior to the addition of rows, and focus will remain in the row
  166. // which had focus prior to the addition of the rows. 
  167. DEF_ENDLIST
  168. DEF_METHOD
  169. public boolean columnIsVisible(int column)
  170. // Determines visibility of a content column. Returns true if any part of the content column given is
  171. // visible to the user, and false otherwise. 
  172. DEF_ENDLIST
  173. DEF_METHOD
  174. public void deleteAllColumns()
  175. // Deletes all content columns. 
  176. DEF_ENDLIST
  177. DEF_METHOD
  178. public void deleteAllColumns(int type)
  179. // Deletes all columns of the given type. 
  180. DEF_ENDLIST
  181. DEF_METHOD
  182. public void deleteAllRows()
  183. // Deletes all content rows. 
  184. DEF_ENDLIST
  185. DEF_METHOD
  186. public void deleteAllRows(int type)
  187. // Deletes all rows of the given type. 
  188. DEF_ENDLIST
  189. DEF_METHOD
  190. public void deleteColumns(int type, int position, int count)
  191. // Deletes count columns of the given type in the Grid at the specified position. A position of 0
  192. // indicates the first column of the given type. If possible, the focus will remain in the column which had
  193. // focus prior to the deletion of columns. If the cell which has focus is in one of the columns deleted, the
  194. // Grid will generate a CELL_FOCUS_OUT event before that column is deleted. If a cell in one of the
  195. // columns is currently being edited, the Grid will generate an EDIT_CANCEL event before that
  196. // column is deleted. 
  197. DEF_ENDLIST
  198. DEF_METHOD
  199. public void deleteRows(int type, int position, int count)
  200. // Deletes count rows of the given type in the Grid at the specified position. A position of 0 indicates
  201. // the first row of the given type. If possible, the focus will remain in the row which had focus prior to
  202. // the deletion of rows. If the cell which has focus is in one of the rows deleted, the Grid will generate a
  203. // CELL_FOCUS_OUT event before that row is deleted. If a cell in one of the rows is currently being
  204. // edited, the Grid will generate an EDIT_CANCEL event before that row is deleted. 
  205. DEF_ENDLIST
  206. DEF_METHOD
  207. public void deselectAllCells(boolean notify)
  208. // Deselects all content cells in the Grid. If notify is true, the Grid will generate DESELECT_CELL
  209. // events for each cell deselected. 
  210. DEF_ENDLIST
  211. DEF_METHOD
  212. public void deselectAllColumns(boolean notify)
  213. // Deselects all content columns in the Grid. If notify is true, the Grid will generate
  214. // DESELECT_COLUMN events for each column deselected. 
  215. DEF_ENDLIST
  216. DEF_METHOD
  217. public void deselectAllRows(boolean notify)
  218. // Deselects all content rows in the Grid. If notify is true, the Grid will generate DESELECT_ROW
  219. // events for each row deselected. 
  220. DEF_ENDLIST
  221. DEF_METHOD
  222. public void deselectCell(int row, int column, boolean notify)
  223. // Deselects the cell in the Grid at the content row and content column specified. If notify is true and
  224. // the cell is currently selected, the Grid will generate a DESELECT_CELL event. 
  225. DEF_ENDLIST
  226. DEF_METHOD
  227. public void deselectColumn(int column, boolean notify)
  228. //Deselects the specified content column in the Grid. If notify is true and the column is currently
  229. //selected, the Grid will generate a DESELECT_COLUMN event. 
  230. DEF_ENDLIST
  231. DEF_METHOD
  232. public void deselectRow(int row, boolean notify)
  233. // Deselects the specified content row in the Grid. If notify is true and the row is currently selected, the
  234. // Grid will generate a DESELECT_ROW event. 
  235. DEF_ENDLIST
  236. DEF_METHOD
  237. public boolean editBegin(boolean insert, int row, int column)
  238. // Begin editing a cell at the given content row and content column. If insert is true, the edit will begin
  239. // with the text field containing the existing cell contents. If false, the text field will be cleared when the
  240. // edit begins. If the method is successful, the Grid will generate an EDIT_BEGIN or EDIT_INSERT
  241. // event. If the cell position specified is invalid or the cell can not be edited, false will be returned. A
  242. // value of true is returned if this method is successful. 
  243. DEF_ENDLIST
  244. DEF_METHOD
  245. public void editCancel()
  246. // Cancels a cell edit which is in progress. If a cell is being edited, the Grid will generate an
  247. //EDIT_CANCEL event. 
  248. DEF_ENDLIST
  249. DEF_METHOD
  250. public void editComplete()
  251. // Completes a cell edit which is in progress. If a cell is being edited, the Grid will generate an
  252. // EDIT_COMPLETE event. 
  253. DEF_ENDLIST
  254. DEF_METHOD
  255. public Object getCellValue(int row, int column, String name)
  256. // Returns the value of the the cell resource given by name at the given content row and column. The
  257. // type of the value returned is determined by the resource. Integer values will return as Integer objects,
  258. // boolean values as Boolean objects, etc. 
  259. DEF_ENDLIST
  260. DEF_METHOD
  261. public Object getCellValue(int rowType, int row, int columnType, int column, String name)
  262. // Returns the value of the the cell resource given by name at the given row of type rowType and
  263. // column of type columnType. The type of the value returned is determined by the resource. Integer
  264. // values will return as Integer objects, boolean values as Boolean objects, etc. 
  265. DEF_ENDLIST
  266. DEF_METHOD
  267. public MlGridColumn getColumn(int columnType, int column)
  268. // Returns a reference to the column at position column of type type or null if the location is invalid. 
  269. DEF_ENDLIST
  270. DEF_METHOD
  271. public Object getColumnValue(int column, String name)
  272. // Returns the value of the the column resource given by name at the given content column. The type
  273. // of the value returned is determined by the resource. Integer values will return as Integer objects,
  274. // boolean values as Boolean objects, etc. 
  275. DEF_ENDLIST
  276. DEF_METHOD
  277. public Object getColumnValue(int columnType, int column, String name)
  278. // Returns the value of the the column resource given by name at the given column of type
  279. // columnType. The type of the value returned is determined by the resource. Integer values will return
  280. // as Integer objects, boolean values as Boolean objects, etc. 
  281. DEF_ENDLIST
  282. DEF_METHOD
  283. public boolean getFocusIn()
  284. // Returns true if the Grid currently has focus. 
  285. DEF_ENDLIST
  286. DEF_METHOD
  287. public MlGridPos getFocusPos()
  288. // Returns a position object containing the content row and column which currently has focus. You may
  289. // use the method getFocusIn() to determine if the Grid has focus. The row or column in the position
  290. // returned may be set to -1 which indicates that no cell in the Grid has focus. 
  291. DEF_ENDLIST
  292. DEF_METHOD
  293. public MlGridRow getRow(int rowType, int row)
  294. // Returns a reference to the row at position row of type type or null if the location is invalid; 
  295. DEF_ENDLIST
  296. DEF_METHOD
  297. public Object getRowValue(int row, String name)
  298. // Returns the value of the the row resource given by name at the given content row. The type of the
  299. // value returned is determined by the resource. Integer values will return as Integer objects, boolean
  300. // values as Boolean objects, etc. 
  301. DEF_ENDLIST
  302. DEF_METHOD
  303. public Object getRowValue(int rowType, int row, String name)
  304. // Returns the value of the the row resource given by name at the given row of type rowType. The
  305. // type of the value returned is determined by the resource. Integer values will return as Integer objects,
  306. // boolean values as Boolean objects, etc. 
  307. DEF_ENDLIST
  308. DEF_METHOD
  309. public MlGridPos []getSelectedCells()
  310. // Returns an array of position objects containing the locations of the currently selected cells. The length
  311. // of the array is the number of currently selected cells. This method returns null if there are no currently
  312. // selected cells. Row, column and cell selections are independent. For example, if you have a single
  313. // row selected in the Grid and no cells selected, a call to this method would return null. 
  314. DEF_ENDLIST
  315. DEF_METHOD
  316. public int []getSelectedColumns()
  317. // Returns an integer array containing the positions of the currently selected content columns. The length
  318. // of the array is the number of selected columns. This method returns null if there are no columns
  319. // selected. 
  320. DEF_ENDLIST
  321. DEF_METHOD
  322. public int getSelectedRow()
  323. // Returns the position of the selected content row. If no row is selected, this method returns -1. 
  324. DEF_ENDLIST
  325. DEF_METHOD
  326. public int []getSelectedRows()
  327. // Returns an integer array containing the positions of the currently selected content rows. The length of
  328. // the array is the number of selected rows. This method returns null if there are no rows selected. 
  329. DEF_ENDLIST
  330. DEF_METHOD
  331. public void moveColumns(int newPosition, int position, int count)
  332. // Moves count content columns at position to newPosition. 
  333. DEF_ENDLIST
  334. DEF_METHOD
  335. public void moveRows(int newPosition, int position, int count)
  336. // Moves count content rows at position to newPosition. 
  337. DEF_ENDLIST
  338. DEF_METHOD
  339. public void redrawAll()
  340. // Redraws all the cells in a Grid. This method is normally only used to redraw a Grid subclass which
  341. // performs drawing using a customized drawCell() method. 
  342. DEF_ENDLIST
  343. DEF_METHOD
  344. public void redrawCell(int rowType, int row, int columnType, int column)
  345. // Redraws the cell at the column of type columnType and row of type rowType. This method is
  346. // normally only used to redraw a Grid subclass which performs drawing using a customized drawCell()
  347. // method. 
  348. DEF_ENDLIST
  349. DEF_METHOD
  350. public void redrawColumn(int type, int column)
  351. // Redraws the column at position column of type type. This method is normally only used to redraw a
  352. // Grid subclass which performs drawing using a customized drawCell() method. 
  353. DEF_ENDLIST
  354. DEF_METHOD
  355. public void redrawRow(int type, int row)
  356. Redraws the row at position row of type type. This method is normally only used to redraw a Grid
  357. subclass which performs drawing using a customized drawCell() method. 
  358. DEF_ENDLIST
  359. DEF_METHOD
  360. public void reorderColumns(int position, int newPositions[])
  361. // Changes the positions of content columns starting at position to the positions specified in the
  362. // newPositions array. 
  363. DEF_ENDLIST
  364. DEF_METHOD
  365. public void reorderRows(int position, int newPositions[])
  366. // Changes the positions of content rows starting at position to the positions specified in the
  367. // newPositions array. 
  368. DEF_ENDLIST
  369. DEF_METHOD
  370. public Rectangle rowColumnToXY(int rowType, int row, int columnType, int column,
  371. boolean clipped)
  372. // Returns the current coordinates of the cell specified by the row of type rowType and column of
  373. // type columnType. If clipped is true, the rectangle returned will be the cell's rectangle clipped to the
  374. // current viewing area. If clipped is false, the rectangle returned will be the cell's unclipped rectangle, a
  375. // rectangle with the full width and height of the cell, not clipped to the viewport. The unclipped cell
  376. // rectangle is usually used to determine positioning based on cell alignment. This method will return null
  377. // if the position given is invalid or if the cell is not currently visible. 
  378. DEF_ENDLIST
  379. DEF_METHOD
  380. public boolean rowIsVisible(int row)
  381. // Returns true if any part of the content row given is visible to the user, and false otherwise. 
  382. DEF_ENDLIST
  383. DEF_METHOD
  384. public void selectAllCells(boolean notify)
  385. // Selects all content cells in the Grid. If notify is true, the Grid will generate SELECT_CELL events
  386. // for each cell selected. 
  387. DEF_ENDLIST
  388. DEF_METHOD
  389. public void selectAllColumns(boolean notify)
  390. // Selects all content columns in the Grid. If notify is true, the Grid will generate SELECT_COLUMN
  391. // events for each column selected. 
  392. DEF_ENDLIST
  393. DEF_METHOD
  394. public void selectAllRows(boolean notify)
  395. // Selects all content rows in the Grid. If notify is true, the Grid will generate SELECT_ROW events
  396. // for each row selected. 
  397. DEF_ENDLIST
  398. DEF_METHOD
  399. public void selectCell(int row, int column, boolean notify)
  400. // Selects the cell at the specified content row and column. If notify is true and the cell is currently
  401. // deselected, the Grid will generate a SELECT_CELL event. 
  402. DEF_ENDLIST
  403. DEF_METHOD
  404. public void selectColumn(int column, boolean notify)
  405. // Selects the specified content column. If notify is true and the column is currently deselected, the
  406. // Grid will generate a SELECT_COLUMN event. 
  407. DEF_ENDLIST
  408. DEF_METHOD
  409. public void selectRow(int row, boolean notify)
  410. // Selects the specified content row. If notify is true and the row is currently deselected, the Grid will
  411. // generate a SELECT_ROW event. 
  412. DEF_ENDLIST
  413. DEF_METHOD
  414. public boolean setFocus(int row, int column)
  415. // Set focus to the cell at the given content row and column. Upon success, true will be returned. A
  416. // value of false will be returned if the cell position specified is invalid or the cell can not accept focus. 
  417. DEF_ENDLIST
  418. DEF_METHOD
  419. public int setStrings(String data)
  420. // Sets cell strings in the Grid starting at the top left cell with the strings contained in data. The string
  421. // data should be in pipe-separated format where pipes signify the start of a new column and new-lines
  422. // signify the start of new rows. The rows and columns set must exist at the time of this call. Returns the
  423. // number of cells which had values set by this method. 
  424. DEF_ENDLIST
  425. DEF_METHOD
  426. public int setStrings(int row, String data)
  427. // Sets cell strings in the Grid starting at the left-most cell of the given content row with the strings
  428. // contained in data. The string data should be in pipe-separated format where pipes signify the start of
  429. // new columns. The rows and columns set must exist at the time of this call. Returns the number of
  430. // cells which had values set by this method. 
  431. DEF_ENDLIST
  432. DEF_METHOD
  433. public int setStrings(int rowType, int row, int columnType, int column, String data)
  434. // Sets cell strings in the Grid with the strings contained in data, starting at the row and column
  435. // specified by the given rowType, row, columnType, and column. The string data should be in
  436. // pipe-separated format where pipes signify the start of a new column and new-lines signify the start of
  437. // new rows. The rows and columns set must exist at the time of this call. Returns the number of cells
  438. // which had values set by this method. 
  439. DEF_ENDLIST
  440. DEF_METHOD
  441. public MlGridPos XYToRowColumn(int x, int y)
  442. // Returns the position of the cell at (containing) the x and y coordinates specified. Upon success, a
  443. // position object containing the rowType, row, columnType and column of the cell is returned. If no
  444. // cell exists at the location specified, null will be returned. 
  445. DEF_ENDLIST
  446. DEF_ENDCOMPONENT
  447.