⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 intmatrix.html

📁 算法集合,说明java 中的各种算法的应用,带有源代码,可运行调试
💻 HTML
📖 第 1 页 / 共 2 页
字号:
</pre><dl>  <dd> Assign a value to all elements to the left hand side of the main diagonal (exclusive).<p>  <dd><dl>    <dt> <b>Parameters:</b>    <dd> value - The value to be assigned to the elements.  </dl></dd></dl><a name="printMatrix()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="printMatrix"><b>printMatrix</b></a><pre> public void printMatrix()</pre><dl>  <dd> Print out the contents of the matrix to the stdout. MAX_VALUE is represented by #. This method is only used during the diagnostic of the class.<p></dl><a name="setHighlight(int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="setHighlight"><b>setHighlight</b></a><pre> public void setHighlight(int j,                          int k)</pre><dl>  <dd> Highlight an element of the matrix, colouring it to black.<p>  <dd><dl>    <dt> <b>Parameters:</b>    <dd> j - The column of the element to be highlighted.    <dd> k - The row of the element to be highlighted.  </dl></dd></dl><a name="setHighlight2(int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="setHighlight2"><b>setHighlight2</b></a><pre> public void setHighlight2(int j,                           int k)</pre><dl>  <dd> Highlight an element of the matrix, colouring it to gray.<p>  <dd><dl>    <dt> <b>Parameters:</b>    <dd> j - The column of the element to be highlighted.    <dd> k - The row of the element to be highlighted.  </dl></dd></dl><a name="restoreHighlight(int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="restoreHighlight"><b>restoreHighlight</b></a><pre> public void restoreHighlight(int j,                              int k)</pre><dl>  <dd> Restore the element which was highlighted using Color.black.<p>  <dd><dl>    <dt> <b>Parameters:</b>    <dd> j - The column of the element to be restored.    <dd> k - The row of the element to be restored.  </dl></dd></dl><a name="restoreHighlight2(int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="restoreHighlight2"><b>restoreHighlight2</b></a><pre> public void restoreHighlight2(int j,                               int k)</pre><dl>  <dd> Restore the element which was highlighted using Color.gray.<p>  <dd><dl>    <dt> <b>Parameters:</b>    <dd> j - The column of the element to be restored.    <dd> k - The row of the element to be restored.  </dl></dd></dl><a name="restoreAll()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="restoreAll"><b>restoreAll</b></a><pre> public void restoreAll()</pre><dl>  <dd> Restore all previously highlighted element of the matrix (black and  gray).<p></dl><a name="setTitle(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="setTitle"><b>setTitle</b></a><pre> public void setTitle(String title)</pre><dl>  <dd> Set a title to the matrix.<p>  <dd><dl>    <dt> <b>Parameters:</b>    <dd> title - The new title of the matrix.  </dl></dd></dl><a name="setRowLabels(java.lang.String[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="setRowLabels"><b>setRowLabels</b></a><pre> public void setRowLabels(String strs[])</pre><dl>  <dd> Set a label to each row of the matrix based on the array of String passed in as the parameter.<p>  <dd><dl>    <dt> <b>Parameters:</b>    <dd> strs - The array of String which holds the new label for each 	row of the matrix. The length of the array must be equal to the	number of rows of the matrix.  </dl></dd></dl><a name="setColLabels(java.lang.String[])"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="setColLabels"><b>setColLabels</b></a><pre> public void setColLabels(String strs[])</pre><dl>  <dd> Set a label to each column of the matrix based on the array of String passed in as the parameter.<p>  <dd><dl>    <dt> <b>Parameters:</b>    <dd> strs - The array of String which holds the new label for each 	column of the matrix. The length of the array must be equal to the	number of columns of the matrix.  </dl></dd></dl><a name="drawBox(java.awt.Graphics, int, int, java.lang.String, java.awt.Color, java.awt.Color, java.awt.Font)"><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,                     Font font)</pre><dl>  <dd> This method is used to draw each element of the matrix. It is only called from the <code>draw</code> method of this class.<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 text to be displayed in the box.    <dd> fg - Foreground color (text color) of the box.    <dd> bg - Background color of the box.    <dd> font - A fixed font, in particular size 12 plain courier.	This font instance is passed in to avoid font initialization every	repaint.  </dl></dd></dl><a name="move(int, int)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="move"><b>move</b></a><pre> public void move(int x,                  int y)</pre><dl>  <dd> Move the matrix to the position specified with reference to the top left corner.<p>  <dd><dl>    <dt> <b>Parameters:</b>    <dd> x - The left most position of the matrix.    <dd> y - The top most position of the matrix.  </dl></dd></dl><a name="getX()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="getX"><b>getX</b></a><pre> public int getX()</pre><dl>  <dd> Get the left most position of the matrix.<p>  <dd><dl>    <dt> <b>Returns:</b>    <dd> The x-coordinate of the topleft corner of the matrix.  </dl></dd></dl><a name="getY()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="getY"><b>getY</b></a><pre> public int getY()</pre><dl>  <dd> Get the top most position of the matrix.<p>  <dd><dl>    <dt> <b>Returns:</b>    <dd> The y-coordinate of the topleft corner of the matrix.  </dl></dd></dl><a name="setColor(java.awt.Color, java.awt.Color)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="setColor"><b>setColor</b></a><pre> public void setColor(Color fg,                      Color bg)</pre><dl>  <dd> Set the foreground and background color for each element of the matrix. The row and column labels are displayed in the inverse color mode.<p>  <dd><dl>    <dt> <b>Parameters:</b>    <dd> fg - The new foreground color.    <dd> bg - The new background color.  </dl></dd></dl><a name="draw(java.awt.Graphics)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="draw"><b>draw</b></a><pre> public void draw(Graphics g)</pre><dl>  <dd> This method has to be defined to fully implement the DrawingObj interface. It calls the <code>drawMatrix</code> method which draws the matrix based on the position and color previously set.<p>  <dd><dl>    <dt> <b>See Also:</b>    <dd> <a href="#drawMatrix">drawMatrix</a>  </dl></dd></dl><a name="drawMatrix(java.awt.Graphics, int, int, java.awt.Color, java.awt.Color)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="drawMatrix"><b>drawMatrix</b></a><pre> public void drawMatrix(Graphics g,                        int x,                        int y,                        Color fg,                        Color bg)</pre><dl>  <dd> This method is only called from the <code>draw</code> method which in turn is called from the drawing panel to draw the matrix based on the position and color previously set.<p>  <dd><dl>    <dt> <b>Parameters:</b>    <dd> g - graphical context.    <dd> x - The left most position of the matrix.    <dd> y - The top most position of the matrix.    <dd> fg - Foreground (text) color for each element.    <dd> bg - Background color for each element.  </dl></dd></dl></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -