|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--irc.style.FormattedStringDrawer
The formatted string drawer.
Field Summary | |
static int |
BOTTOM
|
static int |
LEFT
|
static int |
RIGHT
|
static int |
TOP
|
Constructor Summary | |
FormattedStringDrawer(java.awt.Font fnt,
IRCConfiguration config,
ColorContext context)
Create a new FormattedStringDrawer. |
Method Summary | |
DecodedLine |
decodeLine(java.lang.String str)
Prepare a line for display. |
void |
draw(DecodedLine str,
java.awt.Graphics g,
int left,
int right,
int y,
int clipxl,
int clipxr,
boolean analyse,
boolean wrap,
DrawResult res)
Draw the given prepared line. |
java.awt.Color |
getColor(int i)
Get the current color at index i. |
java.awt.Font |
getFont()
Get the used font. |
int |
getHeight(DecodedLine str,
java.awt.FontMetrics fm)
Get the given string width, in pixel. |
int |
getHeight(DecodedLine str,
java.awt.Graphics g,
int x,
int wmax,
boolean wrap)
|
int |
getHorizontalDirection()
|
java.lang.String |
getStripped(java.lang.String str)
Strip a line from all its color and special codes. |
int |
getVerticalDirection()
|
int |
getWidth(DecodedLine str,
java.awt.FontMetrics fm)
Get the given string height, in pixel. |
void |
setColorContext(ColorContext context)
Set the color context to use. |
void |
setColors(java.awt.Color[] cols)
Set the colors to use, overriding current colors from color context. |
void |
setFont(java.awt.Font fnt)
Set the font to use. |
void |
setHorizontalDirection(int dir)
|
void |
setVerticalDirection(int dir)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int BOTTOM
public static final int TOP
public static final int LEFT
public static final int RIGHT
Constructor Detail |
public FormattedStringDrawer(java.awt.Font fnt, IRCConfiguration config, ColorContext context)
fnt
- fonts to use.config
- the global configuration.context
- the color context to use.Method Detail |
public void setVerticalDirection(int dir)
public int getVerticalDirection()
public void setHorizontalDirection(int dir)
public int getHorizontalDirection()
public void setColorContext(ColorContext context)
context
- new color context.public DecodedLine decodeLine(java.lang.String str)
str
- line to prepare.
public int getHeight(DecodedLine str, java.awt.FontMetrics fm)
str
- the prepared line.fm
- the FontMetrics that will be used on display.
public int getWidth(DecodedLine str, java.awt.FontMetrics fm)
str
- the prepared line.fm
- the FontMetrics that will be used on display.
public void setColors(java.awt.Color[] cols)
cols
- colors to use.public java.awt.Color getColor(int i)
i
- color index.
public void setFont(java.awt.Font fnt)
fnt
- the font to be used.public java.awt.Font getFont()
public java.lang.String getStripped(java.lang.String str)
str
- string to strip.
public int getHeight(DecodedLine str, java.awt.Graphics g, int x, int wmax, boolean wrap)
public void draw(DecodedLine str, java.awt.Graphics g, int left, int right, int y, int clipxl, int clipxr, boolean analyse, boolean wrap, DrawResult res)
str
- the prepared line to draw.g
- the graphics where to draw.left
- left margin.right
- right margin.y
- y position.clipxl
- left clip position : drawing doesn't have to be complete left to this position.clipxr
- right clip position : drawing doens't have to be complete right to this position.analyse
- true if word per word analyse must be performed, false otherwise. If not
analyse is requested, the DrawResultItem array in res will be zero-sized.wrap
- true is wrapping must be done, false otherwise.res
- analyse report destination for the drawed line.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |