ciips.animation
Class ShadowLabel

java.lang.Object
  |
  +--ciips.animation.ShadowLabel
All Implemented Interfaces:
DrawingObj

public class ShadowLabel
extends java.lang.Object
implements DrawingObj

This is another example implementation of the DrawingObj 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):

	ShadowLabel helloLabel = new ShadowLabel("Hello");
	drawingPanel.addDrawingObj(helloLabel);
	helloLabel.move(100, 100);
	helloLabel.setColor(Color.blue);
	drawingPanel.redraw();
 
This object can be removed from the drawing panel by using the removeObj method from DrawingPanel.

See Also:
DrawingPanel.removeObj(ciips.animation.DrawingObj)

Constructor Summary
ShadowLabel(java.lang.String str)
          Construct a new shadow label with the initial text string as specified by the parameter.
 
Method Summary
 void draw(java.awt.Graphics g)
          Draw the text string with a gray label.
 java.awt.Font getFont()
           
 java.lang.String getText()
          Get the text string for this label object.
 int getX()
          Get the left most positionn of the shadow label.
 int getY()
          Get the bottom most positionn of the shadow label.
 void move(int x, int y)
          Move this shadow label to the new position with its bottom left corner specified by the paramters.
 void setColor(java.awt.Color col)
          Set the text color of the drawing object.
 void setText(java.lang.String str)
          Set the text string for this drawing object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShadowLabel

public ShadowLabel(java.lang.String str)
Construct a new shadow label with the initial text string as specified by the parameter.
Parameters:
str - The initial text string for this shadow label.
Method Detail

setColor

public void setColor(java.awt.Color col)
Set the text color of the drawing object.
Parameters:
col - The new text color of the object.

setText

public void setText(java.lang.String str)
Set the text string for this drawing object.
Parameters:
str - The new text string for label object.

getText

public java.lang.String getText()
Get the text string for this label object.
Returns:
the text string for this label object.

getX

public int getX()
Get the left most positionn of the shadow label.
Specified by:
getX in interface DrawingObj
Returns:
the x-coordinate of the bottom left corner of the shadow label.

getY

public int getY()
Get the bottom most positionn of the shadow label.
Specified by:
getY in interface DrawingObj
Returns:
the y-coordinate of the bottom left corner of the shadow label.

getFont

public java.awt.Font getFont()

move

public void move(int x,
                 int y)
Move this shadow label to the new position with its bottom left corner specified by the paramters.
Specified by:
move in interface DrawingObj
Parameters:
x - The left most position of the shadow label.
y - The bottom most position of the shadow label.

draw

public void draw(java.awt.Graphics g)
Draw the text string with a gray label. This method is normally called from the drawing panel paint method.
Specified by:
draw in interface DrawingObj
Following copied from interface: ciips.animation.DrawingObj
Parameters:
g - A reference to the graphical context.