|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.ObjectTextBalloon
public abstract class TextBalloon
TextBalloon: this is used to represent objects in comic strips which are used to show what a character is saying or thinking. The tip of tail points to the character who is talking or thinking the text
| Constructor Summary | |
|---|---|
TextBalloon(Point uLeft,
int theWidth,
Point tEnd,
String theMessage)
Constructor that takes the upper left, width, tail end, and message to display |
|
| Method Summary | |
|---|---|
void |
draw(Graphics g)
Method to draw the text ballon using the passed graphics context |
protected void |
drawBalloon(int ellipseHeight,
Color fillColor,
Color outlineColor,
Graphics2D g2)
Method to draw the speech balloon |
protected abstract void |
drawTail(int ellipseHeight,
Color fillColor,
Color outlineColor,
Graphics2D g2)
Method to draw the tail of the balloon |
protected void |
drawText(LineBreakMeasurer measurer,
Color textColor,
Graphics2D g2)
Method to draw the text in the balloon |
protected AttributedCharacterIterator |
getAttrIterator()
Method to get the attributed character iterator used to display the text |
Font |
getFont()
Method to get the font used to display the message |
int |
getHeight(Graphics2D g2,
AttributedCharacterIterator attrCharIter)
Method to get the height of the balloon |
int |
getMargin()
Method to get the margin |
String |
getMessage()
Method to get the message that is displayed in the balloon |
int |
getNumLines()
Method to get the number of lines of text. |
Point |
getTailEnd()
Method to get the point that is the end of the tail that indicates who is speaking |
Point |
getUpperLeft()
Method to get the upper left point of the rectangle that encloses the balloon |
int |
getWidth()
Method to get the width of the rectangle that encloses the balloon |
void |
setFont(Font theFont)
Method to set the font used to display the balloon |
void |
setMargin(int theMargin)
Method to set the margin |
void |
setMessage(String theMessage)
Method to set the message that is displayed in the balloon |
void |
setTailEnd(Point p)
Method to set the end point of the tail which indicates who is speaking |
void |
setUpperLeft(Point p)
Method to set the upper left point of the rectangle that encloses the balloon |
void |
setWidth(int theWidth)
Method to set the width of the rectangle that encloses the balloon |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TextBalloon(Point uLeft,
int theWidth,
Point tEnd,
String theMessage)
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 speaking or thinkingtheMessage - the message to display| Method Detail |
|---|
public Point getUpperLeft()
public void setUpperLeft(Point p)
p - the upper left point to usepublic int getWidth()
public void setWidth(int theWidth)
theWidth - the new width to usepublic int getMargin()
public void setMargin(int theMargin)
theMargin - the new margin to usepublic Point getTailEnd()
public void setTailEnd(Point p)
p - the end point to usepublic String getMessage()
public void setMessage(String theMessage)
theMessage - the message to usepublic Font getFont()
public void setFont(Font theFont)
theFont - the font to usepublic int getNumLines()
public int getHeight(Graphics2D g2,
AttributedCharacterIterator attrCharIter)
g2 - the grahics 2d context to draw inattrCharIter - the attributed character iterator
that is used to display the text
protected AttributedCharacterIterator getAttrIterator()
protected void drawBalloon(int ellipseHeight,
Color fillColor,
Color outlineColor,
Graphics2D g2)
ellipseHeight - the height of the ellipsefillColor - the color to fill withoutlineColor - the color to outline withg2 - the 2d graphics context
protected void drawText(LineBreakMeasurer measurer,
Color textColor,
Graphics2D g2)
measurer - the line break measurertextColor - the color to draw the text ing2 - the 2d graphics context
protected abstract void drawTail(int ellipseHeight,
Color fillColor,
Color outlineColor,
Graphics2D g2)
public void draw(Graphics g)
g - the graphics context to draw on
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||