ciips.animation
Class ShadowLabel

java.lang.Object
  extended byciips.animation.Drawable
      extended byciips.animation.ShadowLabel
All Implemented Interfaces:
DrawingObj

public class ShadowLabel
extends Drawable

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)

Field Summary
 
Fields inherited from class ciips.animation.Drawable
colour, DEFAULT_START, grey, highlight, label, x, y
 
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.
 void setColor(java.awt.Color col)
          Set the text color of the drawing object.
 
Methods inherited from class ciips.animation.Drawable
getCurrentColour, getX, getY, move, setGrey, setHighlight, setText
 
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.

getText

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

Returns:
the text string for this label object.

getFont

public java.awt.Font getFont()

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
Specified by:
draw in class Drawable