📄 tablepanel.html
字号:
<dd> Pass the method call to the corresponding <code>TableCanvas</code>, which checks if a particular row in the table has a non-null object.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> i - The row number of the table to be checked. <dt> <b>Returns:</b> <dd> TRUE if the row specified by the parameter is occupied. <dt> <b>See Also:</b> <dd> <a href="TableCanvas.html#occupied">occupied</a> </dl></dd></dl><a name="drawClusters(java.awt.Graphics, int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="drawClusters"><b>drawClusters</b></a><pre> public void drawClusters(Graphics g, int x, int y)</pre><dl> <dd> Pass the method call to the corresponding <code>TableCanvas</code>. Display a status summary of the table regarding the percentage of the table being occupied, the number of clusters in the table, and a rough idea of the location of the table being occupied. <p> This method should be called from the <code>draw</code> method of one of the drawing object, which has been added to the drawing panel. For example, if an object class <code>Eg</code> has been defined to implement the <code>DrawingObj</code> interface, such that: <code><pre> class Eg implements DrawingObj { TablePanel table; .... public Eg(TablePanel table, ... ) { .... this.table = table; } .... public void draw(Graphics g) { .... if (table != null) table.drawClusters(g, x, y); } } </pre></code> Adding an instance of this <code>Eg</code> class into the drawing panel (by using <code>addDrawingObj</code>) should result in drawing of the table status summary in the drawing panel with its top left corner at position <code>(x, y)</code>.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> g - Graphical context of the drawing panel where the status information is going to be shown. <dd> x - The left most position of the status information display. <dd> y - The top most position of the status information display. <dt> <b>See Also:</b> <dd> TableCanvas@drawClusters </dl></dd></dl><a name="contains(java.lang.Object)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="contains"><b>contains</b></a><pre> public boolean contains(Object obj)</pre><dl> <dd> Pass the method call to the corresponding <code>TableCanvas</code>, which checks if the table contains a certain object specified by the parameter.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> obj - The object that is going to be checked for existence. <dt> <b>Returns:</b> <dd> TRUE if the object exists; FALSE otherwise. <dt> <b>See Also:</b> <dd> <a href="TableCanvas.html#contains">contains</a> </dl></dd></dl><a name="indexOf(java.lang.Object)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="indexOf"><b>indexOf</b></a><pre> public int indexOf(Object obj)</pre><dl> <dd> Pass the method call to the corresponding <code>TableCanvas</code>, which gets the location of an object in the table.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> obj - The object which location is being checked. <dt> <b>Returns:</b> <dd> The row number of the object passed in as the parameter. This method will return a -1 if the object does not exist. <dt> <b>See Also:</b> <dd> <a href="TableCanvas.html#indexOf">indexOf</a> </dl></dd></dl><a name="addTableEntry(java.lang.Object, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="addTableEntry"><b>addTableEntry</b></a><pre> public void addTableEntry(Object obj, int posn)</pre><dl> <dd> Pass the method call to the corresponding <code>TableCanvas</code>, which add an entry to the table and push the existing entries after this newly added object one position down.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> obj - The new object to be added to the table. <dd> posn - The position in the table (row) where the new object is to be added. <dt> <b>See Also:</b> <dd> <a href="TableCanvas.html#addTableEntry">addTableEntry</a> </dl></dd></dl><a name="scroll2posn(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="scroll2posn"><b>scroll2posn</b></a><pre> public void scroll2posn(int posn)</pre><dl> <dd> Scroll the display window of the table to shown the row specified by the parameter. If the parameter indicates a row that has already been in the current view window, nothing will happen.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> posn - The row number of the table that will be displayed. </dl></dd></dl><a name="getTableEntryAt(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="getTableEntryAt"><b>getTableEntryAt</b></a><pre> public Object getTableEntryAt(int posn)</pre><dl> <dd> Pass the method call to the corresponding <code>TableCanvas</code>, which obtains the object placed at the table row specified by the parameter.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> posn - Table row where the object is to be obtained. <dt> <b>Returns:</b> <dd> The table object at the row specified by the parameter. <dt> <b>See Also:</b> <dd> <a href="TableCanvas.html#getTableEntryAt">getTableEntryAt</a> </dl></dd></dl><a name="setTableEntry(java.lang.Object, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="setTableEntry"><b>setTableEntry</b></a><pre> public void setTableEntry(Object obj, int posn)</pre><dl> <dd> Pass the method call to the corresponding <code>TableCanvas</code>, which sets the object specified by the first parameter to the table row defined by the second parameter. The display window will scroll to include the row that has been newly added.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> obj - The object to be added to the table. <dd> posn - The row number where the object is going to be added. <dt> <b>See Also:</b> <dd> <a href="TableCanvas.html#setTableEntry">setTableEntry</a> </dl></dd></dl><a name="setTableSize(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="setTableSize"><b>setTableSize</b></a><pre> public void setTableSize(int i)</pre><dl> <dd> Pass the method call to the corresponding <code>TableCanvas</code>, which sets the size of the table and hence rescale the scrollbar.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> size - The new size of this table. <dt> <b>See Also:</b> <dd> <a href="TableCanvas.html#setTableSize">setTableSize</a> </dl></dd></dl><a name="tableSize()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="tableSize"><b>tableSize</b></a><pre> public int tableSize()</pre><dl> <dd> Pass the method call to the corresponding <code>TableCanvas</code>, which gets the maximum size of the table.<p> <dd><dl> <dt> <b>Returns:</b> <dd> The maximum size of the table. <dt> <b>See Also:</b> <dd> <a href="TableCanvas.html#tableSize">tableSize</a> </dl></dd></dl><a name="highlightRow(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="highlightRow"><b>highlightRow</b></a><pre> public void highlightRow(int i)</pre><dl> <dd> Pass the method call to the corresponding <code>TableCanvas</code>, which highlights the table entry with the row specified by the parameter. There can only be one row highlighted at any one time.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> i - The row to be highlighted. <dt> <b>See Also:</b> <dd> <a href="TableCanvas.html#highlightRow">highlightRow</a> </dl></dd></dl><a name="restoreRow()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="restoreRow"><b>restoreRow</b></a><pre> public void restoreRow()</pre><dl> <dd> Pass the method call to the corresponding <code>TableCanvas</code>, which restores any highlighted row.<p> <dd><dl> <dt> <b>See Also:</b> <dd> <a href="TableCanvas.html#restoreRow">restoreRow</a> </dl></dd></dl><a name="setDrawingPanel(DrawingPanel)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="setDrawingPanel"><b>setDrawingPanel</b></a><pre> public void setDrawingPanel(<a href="DrawingPanel.html#_top_">DrawingPanel</a> dpanel)</pre><dl> <dd> Set the parent panel where this table panel is going to reside.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> dpanel - The parent drawing panel which this table panel resides. </dl></dd></dl><a name="handleEvent(java.awt.Event)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="handleEvent"><b>handleEvent</b></a><pre> public boolean handleEvent(Event event)</pre><dl> <dd> The main purpose of this method is to handle the scrollbar event. The position of the scrollbar is obtained and used to position the view window of the table canvas.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> event - The event captured. <dt> <b>Overrides:</b> <dd> <a href="java.awt.Component.html#handleEvent(java.awt.Event)">handleEvent</a> in class Component </dl></dd></dl><a name="delay()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="delay"><b>delay</b></a><pre> public void delay()</pre><dl> <dd> This method causes a delay of 200msec.<p></dl></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -