Class ThoughtBalloon
java.lang.Object
TextBalloon
ThoughtBalloon
public class ThoughtBalloon
- extends TextBalloon
ThoughtBalloon: this is used to
represent objects
in comic strips which are used to show
what a character is thinking. The tip of
tail points to the character who is
doing the thinking
- Author:
- Barb Ericson ericson@cc.gatech.edu
Copyright 2005
Constructor Summary |
ThoughtBalloon(Point uLeft,
int theWidth,
Point tEnd,
String theMessage)
Constructor that takes the upper left, width,
tail end, and message to display |
Method Summary |
Point |
drawCircle(Point circleTop,
double heading,
double width,
double distance,
Point startPoint,
Color fillColor,
Color outlineColor,
Graphics2D g2)
Method to draw a circle of a given width |
protected void |
drawTail(int ellipseHeight,
Color fillColor,
Color outlineColor,
Graphics2D g2)
Method to draw the thought
ballon using the passed graphics
context |
static void |
main(String[] args)
|
Methods inherited from class TextBalloon |
draw, drawBalloon, drawText, getAttrIterator, getFont, getHeight, getMargin, getMessage, getNumLines, getTailEnd, getUpperLeft, getWidth, setFont, setMargin, setMessage, setTailEnd, setUpperLeft, setWidth |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ThoughtBalloon
public ThoughtBalloon(Point uLeft,
int theWidth,
Point tEnd,
String theMessage)
- Constructor that takes the upper left, width,
tail end, and message to display
- Parameters:
uLeft
- the upper left corner of a rectangle
enclosing the balloontheWidth
- the width of the enclosing rectangletEnd
- the point which is the end of the tail
that shows who is speakingtheMessage
- the message to display
drawCircle
public Point drawCircle(Point circleTop,
double heading,
double width,
double distance,
Point startPoint,
Color fillColor,
Color outlineColor,
Graphics2D g2)
- Method to draw a circle of a given width
- Parameters:
circleTop
- the top point on the circleheading
- the heading in degrees with 0
being northwidth
- the width of the circledistance
- the distance from the start pointstartPoint
- the point to start the distance
fromg2
- the 2d graphics context used for drawing
- Returns:
- a point on the circle at the given distance
away from the start point
drawTail
protected void drawTail(int ellipseHeight,
Color fillColor,
Color outlineColor,
Graphics2D g2)
- Method to draw the thought
ballon using the passed graphics
context
- Specified by:
drawTail
in class TextBalloon
- Parameters:
ellipseHeight
- the height of
the ellipsefillColor
- the color to fill the tail
withoutlineColor
- the color to outline
the tail withg2
- the 2D graphics context
main
public static void main(String[] args)