public class TextFormatter extends DataObject
Modifier and Type | Field and Description |
---|---|
Color |
backgroundColor |
int |
borderWidth |
static Object |
CIRCLE |
Color |
color
If this is not null then the text will be redrawn in this color if the FONT_CHANGE
flag is set in fontFlags.
|
int |
cursor |
Object |
data |
static Object |
DIAMOND |
int |
endCharacter
The index of the last character in the last line being covered by the formatter.
|
static int |
FONT_CHANGE
This is a fontFlag.
|
static int |
FONT_FREEZE |
int |
fontFlags
This can be a combination of FONT_CHANGE along with Font.BOLD, Font.UNDERLINE and Font.ITALIC.
|
String |
fontName
The name of the new font to use (FONT_CHANGE must be set).
|
int |
fontSize
The amount to change the font to (FONT_CHANGE must be set).
|
int |
fontSizeChange
The amount to change the font size by (FONT_CHANGE must be set).
|
int |
groupID
The ID of the group this formatter belongs to.
|
int |
groupIndex
The index of this formatter in the group this formatter belongs to.
|
int |
hSpace |
IImage |
image |
int |
imageChar
The character that comes after the image.
|
int |
imageLine
The line that the image is actually on.
|
int |
imageX |
int |
imageY |
String |
label |
int |
leftMarginShift |
static int |
LINE_ADD_FIRST_LINE_HEADER
This is a possible lineFlag.
|
static int |
LINE_ALIGN_NOW
This is a possible lineFlag.
|
static int |
LINE_BACKGROUND_COLOR_CHANGE
This is a possible lineFlag.
|
static int |
LINE_CANCEL_ALIGNMENTS
This is a possible lineFlag.
|
static int |
LINE_CENTERED
This is a possible lineFlag.
|
static int |
LINE_DRAW_RULE
This is a possible lineFlag.
|
static int |
LINE_HEADER_RIGHT_ALIGN
This is a possible lineFlag.
|
static int |
LINE_LEFT_MARGIN_SHIFT_IS_CHARACTERS
This is a possible lineFlag.
|
static int |
LINE_RESPLIT
This is a possible lineFlag.
|
static int |
LINE_RIGHT_ALIGNED
This is a possible lineFlag.
|
int |
lineFlags
This can be a combination of the LINE_XXX values.
|
TextFormatter |
linkedTo |
Font |
newFont
If you set this to a Font, the fontFlags, fontSizeChange and fontName values are ignored
and this is used instead.
|
boolean |
notUsed |
int |
numLines
The number of lines covered by the formatter. - if it is greater than 1, then this is
a block level formatter and the "character" and "length" members are not used.
|
int |
resplitWidthChange |
static Object |
SOLID_CIRCLE |
int |
startCharacter
The first character in the line being covered by the formatter.
|
int |
startLine
The first line of text covered by the formatter - where 0 indicates the first line of
the display.
|
Object |
toolTip |
int |
vSpace |
Constructor and Description |
---|
TextFormatter() |
TextFormatter(int line,
int character,
int length) |
TextFormatter(int startLine,
int numLines,
int fontFlags,
int lineFlags) |
TextFormatter(int line,
int character,
int length,
int fontFlags,
int lineFlags) |
Modifier and Type | Method and Description |
---|---|
boolean |
applyAfter()
Returns if this need to be applied at the end of the line.
|
boolean |
applyBefore()
Returns if this need to be applied at the start or during the line.
|
protected void |
applySpecialFormat(TextPad source,
int lineIndex,
DisplayLine theLine,
FormattedTextSpecs format) |
DisplayLine |
creatingFor(TextPad pad,
DisplayLine firstLine,
int numLines,
int lineIndex)
This gives the TextFormatter the chance to actually alter the lines being displayed.
|
protected void |
drawSpecialFormat(TextPad source,
int lineIndex,
DisplayLine theLine,
FormattedTextSpecs format,
Graphics g,
Color background) |
static IImage |
getBrokenImage() |
Range |
getCharRange(int lineIndex,
DisplayLine theLine,
Range dest) |
TextFormatter |
getEndFormatter(TextFormatter dest) |
Font |
getFont(Font baseFont,
int useSize) |
protected FontMetrics |
getFontMetrics(TextPad pad,
FontMetrics baseFont) |
TextFormatter |
getStartFormatter(TextFormatter dest) |
Object |
getToolTip() |
static IImage |
getUnknownImage() |
boolean |
isOnImage(TextPad source,
int xPosition,
FormattedTextSpecs specs) |
String |
rangeToString() |
void |
repaint(TextPad pad,
Graphics gr) |
protected void |
replace(TextPad pad,
DisplayLine firstLine,
int numLines,
DisplayLine newLines) |
protected DisplayLine |
resplit(TextPad pad,
DisplayLine firstLine,
int numLines,
int forWidth,
String newText) |
String |
toString()
Return a String representation of this object.
|
_getFieldType, _getSetField, cache, compareTo, copied, copyFrom, equals, getCopy, getDeclaredField, getDeclaredFieldValue, getMyFieldList, getNew
public int startLine
public int numLines
public int startCharacter
public int endCharacter
public Color color
public static final int FONT_CHANGE
public static final int FONT_FREEZE
public int fontFlags
public int lineFlags
public static final int LINE_CENTERED
public static final int LINE_RIGHT_ALIGNED
public static final int LINE_RESPLIT
public static final int LINE_ADD_FIRST_LINE_HEADER
public static final int LINE_LEFT_MARGIN_SHIFT_IS_CHARACTERS
public static final int LINE_HEADER_RIGHT_ALIGN
public static final int LINE_DRAW_RULE
public static final int LINE_ALIGN_NOW
public static final int LINE_CANCEL_ALIGNMENTS
public static final int LINE_BACKGROUND_COLOR_CHANGE
public Color backgroundColor
public Object data
public Object toolTip
public int cursor
public int leftMarginShift
public int resplitWidthChange
public String label
public IImage image
public int imageLine
public int imageChar
public int imageX
public int imageY
public int hSpace
public int vSpace
public int borderWidth
public TextFormatter linkedTo
public boolean notUsed
public int fontSizeChange
public int fontSize
public String fontName
public Font newFont
public int groupID
public int groupIndex
public static final Object SOLID_CIRCLE
public static final Object CIRCLE
public static final Object DIAMOND
public TextFormatter()
public TextFormatter(int line, int character, int length)
public TextFormatter(int line, int character, int length, int fontFlags, int lineFlags)
public TextFormatter(int startLine, int numLines, int fontFlags, int lineFlags)
public boolean applyBefore()
public boolean applyAfter()
public TextFormatter getEndFormatter(TextFormatter dest)
public TextFormatter getStartFormatter(TextFormatter dest)
public static IImage getUnknownImage()
public static IImage getBrokenImage()
public String rangeToString()
public String toString()
Object
public Object getToolTip()
protected FontMetrics getFontMetrics(TextPad pad, FontMetrics baseFont)
public Range getCharRange(int lineIndex, DisplayLine theLine, Range dest)
protected void applySpecialFormat(TextPad source, int lineIndex, DisplayLine theLine, FormattedTextSpecs format)
public boolean isOnImage(TextPad source, int xPosition, FormattedTextSpecs specs)
protected void drawSpecialFormat(TextPad source, int lineIndex, DisplayLine theLine, FormattedTextSpecs format, Graphics g, Color background)
protected void replace(TextPad pad, DisplayLine firstLine, int numLines, DisplayLine newLines)
protected DisplayLine resplit(TextPad pad, DisplayLine firstLine, int numLines, int forWidth, String newText)
public DisplayLine creatingFor(TextPad pad, DisplayLine firstLine, int numLines, int lineIndex)