📄 tablecanvas.html
字号:
</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> Obtain 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. </dl></dd></dl><a name="full()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="full"><b>full</b></a><pre> public boolean full()</pre><dl> <dd> Check if the table has been fully filled up.<p> <dd><dl> <dt> <b>Returns:</b> <dd> TRUE if all entries in the table is non-null object; FALSE otherwise. </dl></dd></dl><a name="numOccupied()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="numOccupied"><b>numOccupied</b></a><pre> public int numOccupied()</pre><dl> <dd> Get the number of rows in the table where the contents are non-null object.<p> <dd><dl> <dt> <b>Returns:</b> <dd> The number of non-null object in the table. </dl></dd></dl><a name="occupied(int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="occupied"><b>occupied</b></a><pre> public boolean occupied(int i)</pre><dl> <dd> Check 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. </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> 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> <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. </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> 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. </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> Get the maximum size of the table (including all null and non-null objects).<p> <dd><dl> <dt> <b>Returns:</b> <dd> The maximum size of the table. </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> Check if the table contains a certain object specified by the parameter.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> obj - The object which is going to be checked for existence. <dt> <b>Returns:</b> <dd> TRUE if the object exists; FALSE otherwise. </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> Get 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 -1 if the object does not exist within the current table. </dl></dd></dl><a name="preferredSize()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="preferredSize"><b>preferredSize</b></a><pre> public Dimension preferredSize()</pre><dl> <dd> Define the default size of the table.<p> <dd><dl> <dt> <b>Returns:</b> <dd> The dimension of the table. By default is: 480x320. <dt> <b>Overrides:</b> <dd> <a href="java.awt.Container.html#preferredSize()">preferredSize</a> in class Container </dl></dd></dl><a name="update(java.awt.Graphics)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="update"><b>update</b></a><pre> public void update(Graphics g)</pre><dl> <dd> This method is invoked by the display manager when the <code>repaint()</code> method of the panel is called. This method is overridden here to eliminate the flashing characteristic during the panel update.<p> <dd><dl> <dt> <b>Overrides:</b> <dd> <a href="java.awt.Container.html#update(java.awt.Graphics)">update</a> in class Container </dl></dd></dl><a name="paint(java.awt.Graphics)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="paint"><b>paint</b></a><pre> public void paint(Graphics g)</pre><dl> <dd> Method to draw the table canvas.<p> <dd><dl> <dt> <b>Overrides:</b> <dd> <a href="java.awt.Container.html#paint(java.awt.Graphics)">paint</a> in class Container </dl></dd></dl><a name="drawBox(java.awt.Graphics, int, int, java.lang.String, java.awt.Color, java.awt.Color, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="drawBox"><b>drawBox</b></a><pre> public void drawBox(Graphics g, int x, int y, String str, Color fg, Color bg, int max_length)</pre><dl> <dd> This method is only called by the <code>paint()</code> method to draw each entry of the table as a box.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> g - Graphical context. <dd> x - The left most position of the box. <dd> y - The top most position of the box. <dd> str - The String object to be drawn inside the box. <dd> fg - Foreground color (i.e. the text color) of the box. <dd> bg - Background color of the box. <dd> max_length - The max_length of the string to be displayed in the box. </dl></dd></dl></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -