📄 shadowlabel.html
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><!--NewPage--><html><head><!-- Generated by javadoc on Tue Nov 03 15:31:36 EST 1998 --><title> Class ShadowLabel</title></head><body><a name="_top_"></a><h1> Class ShadowLabel</h1><pre>java.lang.Object | +----ShadowLabel</pre><hr><dl> <dt> public class <b>ShadowLabel</b> <dt> extends Object <dt> implements <a href="DrawingObj.html#_top_">DrawingObj</a></dl>This is another example implementation of the <code>DrawingObj</code> interface. This particular class enables a test string to be displayed on the drawing panel with a shadowing effect. For example, the following lines initializes an instance of this class and display a text string "Hello" on the drawing panel with blue text color and gray shadow at position (100, 100): <code><pre> ShadowLabel helloLabel = new ShadowLabel("Hello"); drawingPanel.addDrawingObj(helloLabel); helloLabel.move(100, 100); helloLabel.setColor(Color.blue); drawingPanel.redraw(); </pre></code> This object can be removed from the drawing panel by using the <code>removeObj</code> method from <code>DrawingPanel</code>.<p><dl> <dt> <b>See Also:</b> <dd> <a href="DrawingPanel.html#removeObj">removeObj</a></dl><hr><a name="index"></a><h2> <img src="images/constructor-index.gif" width=275 height=38 alt="Constructor Index"></h2><dl> <dt> <img src="images/yellow-ball-small.gif" width=6 height=6 alt=" o "> <a href="#ShadowLabel(java.lang.String)"><b>ShadowLabel</b></a>(String) <dd> Construct a new shadow label with the initial text string as specified by the parameter.</dl><h2> <img src="images/method-index.gif" width=207 height=38 alt="Method Index"></h2><dl> <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#draw(java.awt.Graphics)"><b>draw</b></a>(Graphics) <dd> Draw the text string with a gray label. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getText()"><b>getText</b></a>() <dd> Get the text string for this label object. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getX()"><b>getX</b></a>() <dd> Get the left most positionn of the shadow label. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#getY()"><b>getY</b></a>() <dd> Get the bottom most positionn of the shadow label. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#move(int, int)"><b>move</b></a>(int, int) <dd> Move this shadow label to the new position with its bottom left corner specified by the paramters. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setColor(java.awt.Color)"><b>setColor</b></a>(Color) <dd> Set the text color of the drawing object. <dt> <img src="images/red-ball-small.gif" width=6 height=6 alt=" o "> <a href="#setText(java.lang.String)"><b>setText</b></a>(String) <dd> Set the text string for this drawing object.</dl><a name="constructors"></a><h2> <img src="images/constructors.gif" width=231 height=38 alt="Constructors"></h2><a name="ShadowLabel"></a><a name="ShadowLabel(java.lang.String)"><img src="images/yellow-ball.gif" width=12 height=12 alt=" o "></a><b>ShadowLabel</b><pre> public ShadowLabel(String str)</pre><dl> <dd> Construct a new shadow label with the initial text string as specified by the parameter.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> str - The initial text string for this shadow label. </dl></dd></dl><a name="methods"></a><h2> <img src="images/methods.gif" width=151 height=38 alt="Methods"></h2><a name="setColor(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 col)</pre><dl> <dd> Set the text color of the drawing object.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> col - The new text color of the object. </dl></dd></dl><a name="setText(java.lang.String)"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="setText"><b>setText</b></a><pre> public void setText(String str)</pre><dl> <dd> Set the text string for this drawing object.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> str - The new text string for label object. </dl></dd></dl><a name="getText()"><img src="images/red-ball.gif" width=12 height=12 alt=" o "></a><a name="getText"><b>getText</b></a><pre> public String getText()</pre><dl> <dd> Get the text string for this label object.<p> <dd><dl> <dt> <b>Returns:</b> <dd> the text string for this label object. </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 positionn of the shadow label.<p> <dd><dl> <dt> <b>Returns:</b> <dd> the x-coordinate of the bottom left corner of the shadow label. </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 bottom most positionn of the shadow label.<p> <dd><dl> <dt> <b>Returns:</b> <dd> the y-coordinate of the bottom left corner of the shadow label. </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 this shadow label to the new position with its bottom left corner specified by the paramters.<p> <dd><dl> <dt> <b>Parameters:</b> <dd> x - The left most position of the shadow label. <dd> y - The bottom most position of the shadow label. </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> Draw the text string with a gray label. This method is normally called from the drawing panel paint method.<p></dl></body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -