|
||||||||
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(java.awt.Point uLeft,
int theWidth,
java.awt.Point tEnd,
java.lang.String theMessage)
Constructor that takes the upper left, width, tail end, and message to display |
Method Summary | |
---|---|
void |
draw(java.awt.Graphics g)
Method to draw the text ballon using the passed graphics context |
protected void |
drawBalloon(int ellipseHeight,
java.awt.Color fillColor,
java.awt.Color outlineColor,
java.awt.Graphics2D g2)
Method to draw the speech balloon |
protected abstract void |
drawTail(int ellipseHeight,
java.awt.Color fillColor,
java.awt.Color outlineColor,
java.awt.Graphics2D g2)
Method to draw the tail of the balloon |
protected void |
drawText(java.awt.font.LineBreakMeasurer measurer,
java.awt.Color textColor,
java.awt.Graphics2D g2)
Method to draw the text in the balloon |
protected java.text.AttributedCharacterIterator |
getAttrIterator()
Method to get the attributed character iterator used to display the text |
java.awt.Font |
getFont()
Method to get the font used to display the message |
int |
getHeight(java.awt.Graphics2D g2,
java.text.AttributedCharacterIterator attrCharIter)
Method to get the height of the balloon |
int |
getMargin()
Method to get the margin |
java.lang.String |
getMessage()
Method to get the message that is displayed in the balloon |
int |
getNumLines()
Method to get the number of lines of text. |
java.awt.Point |
getTailEnd()
Method to get the point that is the end of the tail that indicates who is speaking |
java.awt.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(java.awt.Font theFont)
Method to set the font used to display the balloon |
void |
setMargin(int theMargin)
Method to set the margin |
void |
setMessage(java.lang.String theMessage)
Method to set the message that is displayed in the balloon |
void |
setTailEnd(java.awt.Point p)
Method to set the end point of the tail which indicates who is speaking |
void |
setUpperLeft(java.awt.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(java.awt.Point uLeft, int theWidth, java.awt.Point tEnd, java.lang.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 displayMethod Detail |
---|
public java.awt.Point getUpperLeft()
public void setUpperLeft(java.awt.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 java.awt.Point getTailEnd()
public void setTailEnd(java.awt.Point p)
p
- the end point to usepublic java.lang.String getMessage()
public void setMessage(java.lang.String theMessage)
theMessage
- the message to usepublic java.awt.Font getFont()
public void setFont(java.awt.Font theFont)
theFont
- the font to usepublic int getNumLines()
public int getHeight(java.awt.Graphics2D g2, java.text.AttributedCharacterIterator attrCharIter)
g2
- the grahics 2d context to draw inattrCharIter
- the attributed character iterator
that is used to display the text
protected java.text.AttributedCharacterIterator getAttrIterator()
protected void drawBalloon(int ellipseHeight, java.awt.Color fillColor, java.awt.Color outlineColor, java.awt.Graphics2D g2)
ellipseHeight
- the height of the ellipsefillColor
- the color to fill withoutlineColor
- the color to outline withg2
- the 2d graphics contextprotected void drawText(java.awt.font.LineBreakMeasurer measurer, java.awt.Color textColor, java.awt.Graphics2D g2)
measurer
- the line break measurertextColor
- the color to draw the text ing2
- the 2d graphics contextprotected abstract void drawTail(int ellipseHeight, java.awt.Color fillColor, java.awt.Color outlineColor, java.awt.Graphics2D g2)
public void draw(java.awt.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 |