public class StyleRange
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
STYLE_DOTTED |
static int |
STYLE_DOUBLE_STRIKE_THROUGH |
static int |
STYLE_STRIKE_THROUGH |
static int |
STYLE_SUBSCRIPT |
static int |
STYLE_SUPERSCRIPT |
static int |
STYLE_UNDERLINED |
static int |
STYLE_WAVED |
Constructor and Description |
---|
StyleRange(java.awt.Color fontColor)
Creates a style range with a specified font color.
|
StyleRange(int fontStyle)
Creates a style range with a specified font style.
|
StyleRange(int fontStyle,
java.awt.Color fontColor)
Creates a style range with a specified font style and font color.
|
StyleRange(int fontStyle,
java.awt.Color fontColor,
java.awt.Color backgroundColor,
int additionalStyle,
java.awt.Color lineColor)
Creates a style range with a specified font style, font color, and additional style.
|
StyleRange(int fontStyle,
java.awt.Color fontColor,
int additionalStyle,
java.awt.Color lineColor)
Creates a style range with a specified font style, font color, and additional style.
|
StyleRange(int fontStyle,
java.awt.Color fontColor,
int additionalStyle,
java.awt.Color lineColor,
java.awt.Stroke lineStroke)
Creates a style range with a specified font style, font color, additional style, and line color.
|
StyleRange(int fontStyle,
int additionalStyle)
Creates a style range with a specified font style and additional style.
|
StyleRange(int start,
int length,
java.awt.Color fontColor)
Creates a style range with a specified font color and a range.
|
StyleRange(int fontStyle,
int additionalStyle,
float fontShrinkRatio)
Creates a style range with a specified font style and additional style.
|
StyleRange(int start,
int length,
int fontStyle)
Creates a style range with a specified font style and a range.
|
StyleRange(int start,
int length,
int fontStyle,
java.awt.Color fontColor)
Creates a style range with a specified font style, font color and a range.
|
StyleRange(int start,
int length,
int fontStyle,
java.awt.Color fontColor,
java.awt.Color backgroundColor,
int additionalStyle)
Creates a style range with a specified font style, font color, additional style and a range.
|
StyleRange(int start,
int length,
int fontStyle,
java.awt.Color fontColor,
java.awt.Color backgroundColor,
int additionalStyle,
java.awt.Color lineColor)
Creates a style range with a specified font style, font color, additional style, line color and a range.
|
StyleRange(int start,
int length,
int fontStyle,
java.awt.Color fontColor,
java.awt.Color backgroundColor,
int additionalStyle,
java.awt.Color lineColor,
java.awt.Stroke lineStroke)
Creates a style range with a specified font style, font color, additional style, line color, line stroke and a
range.
|
StyleRange(int start,
int length,
int fontStyle,
java.awt.Color fontColor,
java.awt.Color backgroundColor,
int additionalStyle,
java.awt.Color lineColor,
java.awt.Stroke lineStroke,
float fontShrinkRatio)
Creates a style range with a specified font style, font color, additional style, line color, line stroke and a
range.
|
StyleRange(int start,
int length,
int fontStyle,
java.awt.Color fontColor,
int additionalStyle)
Creates a style range with a specified font style, font color, additional style and a range.
|
StyleRange(int start,
int length,
int fontStyle,
java.awt.Color fontColor,
int additionalStyle,
java.awt.Color lineColor)
Creates a style range with a specified font style, font color, additional style, line color and a range.
|
StyleRange(int start,
int length,
int fontStyle,
java.awt.Color fontColor,
int additionalStyle,
java.awt.Color lineColor,
java.awt.Stroke lineStroke)
Creates a style range with a specified font style, font color, additional style, line color, line stroke and a
range.
|
StyleRange(int start,
int length,
int fontStyle,
java.awt.Color fontColor,
int additionalStyle,
java.awt.Color lineColor,
java.awt.Stroke lineStroke,
float fontShrinkRatio)
Creates a style range with a specified font style, font color, additional style, line color, line stroke and a
range.
|
StyleRange(int start,
int length,
int fontStyle,
int additionalStyle)
Creates a style range with a specified font style, additional style and a range.
|
StyleRange(int start,
int length,
int fontStyle,
int additionalStyle,
float fontShrinkRatio)
Creates a style range with a specified font style, additional style and a range.
|
Modifier and Type | Method and Description |
---|---|
int |
getAdditionalStyle()
Gets the additional style.
|
java.awt.Color |
getBackgroundColor()
Gets the background color.
|
java.awt.Color |
getFontColor()
Gets the font color.
|
float |
getFontShrinkRatio()
Gets the font shrink ratio for superscript and subscript.
|
int |
getFontStyle()
Gets the font style.
|
int |
getLength()
Gets the length of the range.
|
java.awt.Color |
getLineColor()
Gets the line color.
|
java.awt.Stroke |
getLineStroke()
Gets the line stroke.
|
int |
getStart()
Gets the start index of the range.
|
boolean |
isDotted()
Checks if the line has dotted style.
|
boolean |
isDoublestrikethrough()
Checks if the text has double strike through style.
|
boolean |
isStrikethrough()
Checks if the text has strike through style.
|
boolean |
isSubscript()
Checks if the text is subscript.
|
boolean |
isSuperscript()
Checks if the text is superscript.
|
boolean |
isUnderlined()
Checks if the text has underlined style.
|
boolean |
isWaved()
Checks if the line has waved style.
|
public static final int STYLE_STRIKE_THROUGH
public static final int STYLE_DOUBLE_STRIKE_THROUGH
public static final int STYLE_WAVED
public static final int STYLE_UNDERLINED
public static final int STYLE_DOTTED
public static final int STYLE_SUPERSCRIPT
public static final int STYLE_SUBSCRIPT
public StyleRange(int fontStyle)
fontStyle
- Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC.public StyleRange(java.awt.Color fontColor)
fontColor
- the color of the textpublic StyleRange(int fontStyle, java.awt.Color fontColor)
fontStyle
- Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC.fontColor
- the color of the textpublic StyleRange(int fontStyle, int additionalStyle)
fontStyle
- Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC.additionalStyle
- Valid additional styles are defined as constants in StyleRange
. The names begin
with STYLE_. You can also use any | to connect two or more styles as long as it makes
sense.public StyleRange(int fontStyle, int additionalStyle, float fontShrinkRatio)
fontStyle
- Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC.additionalStyle
- Valid additional styles are defined as constants in StyleRange
. The names begin
with STYLE_. You can also use any | to concat two or more styles as long as it makes
sense.fontShrinkRatio
- the ratio that regular font size divides by subscript or superscript font size.public StyleRange(int start, int length, int fontStyle)
start
- the start index of the range in a stringlength
- the length of the range.fontStyle
- Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC.public StyleRange(int start, int length, int fontStyle, java.awt.Color fontColor)
start
- the start index of the range in a stringlength
- the length of the range.fontStyle
- Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC.fontColor
- the color of the text.public StyleRange(int start, int length, java.awt.Color fontColor)
start
- the start index of the range in a stringlength
- the length of the range.fontColor
- the color of the text.public StyleRange(int start, int length, int fontStyle, int additionalStyle)
start
- the start index of the range in a stringlength
- the length of the range.fontStyle
- Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC.additionalStyle
- Valid additional styles are defined as constants in StyleRange
. The names begin
with STYLE_. You can also use any | to concat two or more styles as long as it makes
sense.public StyleRange(int start, int length, int fontStyle, int additionalStyle, float fontShrinkRatio)
start
- the start index of the range in a stringlength
- the length of the range.fontStyle
- Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC.additionalStyle
- Valid additional styles are defined as constants in StyleRange
. The names begin
with STYLE_. You can also use any | to concat two or more styles as long as it makes
sense.fontShrinkRatio
- the ratio that regular font size divides by subscript or superscript font size.public StyleRange(int fontStyle, java.awt.Color fontColor, int additionalStyle, java.awt.Color lineColor)
fontStyle
- Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC.fontColor
- the color of the text.additionalStyle
- Valid additional styles are defined as constants in StyleRange
. The names begin
with STYLE_. You can also use any | to concat two or more styles as long as it makes
sense.public StyleRange(int fontStyle, java.awt.Color fontColor, java.awt.Color backgroundColor, int additionalStyle, java.awt.Color lineColor)
fontStyle
- Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC.fontColor
- the color of the text.backgroundColor
- the background color of the text.additionalStyle
- Valid additional styles are defined as constants in StyleRange
. The names begin
with STYLE_. You can also use any | to concat two or more styles as long as it makes
sense.public StyleRange(int start, int length, int fontStyle, java.awt.Color fontColor, int additionalStyle)
start
- the start index of the range in a stringlength
- the length of the range.fontStyle
- Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC.fontColor
- the color of the text.additionalStyle
- Valid additional styles are defined as constants in StyleRange
. The names begin
with STYLE_. You can also use any | to concat two or more styles as long as it makes
sense.public StyleRange(int start, int length, int fontStyle, java.awt.Color fontColor, java.awt.Color backgroundColor, int additionalStyle)
start
- the start index of the range in a stringlength
- the length of the range.fontStyle
- Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC.fontColor
- the color of the text.backgroundColor
- the background color of the text.additionalStyle
- Valid additional styles are defined as constants in StyleRange
. The names begin
with STYLE_. You can also use any | to concat two or more styles as long as it makes
sense.public StyleRange(int fontStyle, java.awt.Color fontColor, int additionalStyle, java.awt.Color lineColor, java.awt.Stroke lineStroke)
fontStyle
- Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC.fontColor
- the color of the text.additionalStyle
- Valid additional styles are defined as constants in StyleRange
. The names begin
with STYLE_. You can also use any | to concat two or more styles as long as it makes
sense.lineColor
- the color of the line.public StyleRange(int start, int length, int fontStyle, java.awt.Color fontColor, int additionalStyle, java.awt.Color lineColor)
start
- the start index of the range in a stringlength
- the length of the range.fontStyle
- Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC.fontColor
- the color of the text.additionalStyle
- Valid additional styles are defined as constants in StyleRange
. The names begin
with STYLE_. You can also use any | to concat two or more styles as long as it makes
sense.lineColor
- the color of the line.public StyleRange(int start, int length, int fontStyle, java.awt.Color fontColor, java.awt.Color backgroundColor, int additionalStyle, java.awt.Color lineColor)
start
- the start index of the range in a stringlength
- the length of the range.fontStyle
- Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC.fontColor
- the color of the text.backgroundColor
- the background color of the text.additionalStyle
- Valid additional styles are defined as constants in StyleRange
. The names begin
with STYLE_. You can also use any | to concat two or more styles as long as it makes
sense.lineColor
- the color of the line.public StyleRange(int start, int length, int fontStyle, java.awt.Color fontColor, int additionalStyle, java.awt.Color lineColor, java.awt.Stroke lineStroke)
start
- the start index of the range in a stringlength
- the length of the range.fontStyle
- Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC.fontColor
- the color of the text.additionalStyle
- Valid additional styles are defined as constants in StyleRange
. The names begin
with STYLE_. You can also use any | to concat two or more styles as long as it makes
sense.lineColor
- the color of the line.lineStroke
- the stroke of the line.public StyleRange(int start, int length, int fontStyle, java.awt.Color fontColor, java.awt.Color backgroundColor, int additionalStyle, java.awt.Color lineColor, java.awt.Stroke lineStroke)
start
- the start index of the range in a stringlength
- the length of the range.fontStyle
- Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC.fontColor
- the color of the text.backgroundColor
- the background color of the text.additionalStyle
- Valid additional styles are defined as constants in StyleRange
. The names begin
with STYLE_. You can also use any | to concat two or more styles as long as it makes
sense.lineColor
- the color of the line.lineStroke
- the stroke of the line.public StyleRange(int start, int length, int fontStyle, java.awt.Color fontColor, int additionalStyle, java.awt.Color lineColor, java.awt.Stroke lineStroke, float fontShrinkRatio)
start
- the start index of the range in a stringlength
- the length of the range.fontStyle
- Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC.fontColor
- the color of the text.additionalStyle
- Valid additional styles are defined as constants in StyleRange
. The names begin
with STYLE_. You can also use any | to concat two or more styles as long as it makes
sense.lineColor
- the color of the line.lineStroke
- the stroke of the line.fontShrinkRatio
- the ratio that regular font size divides by subscript or superscript font size.public StyleRange(int start, int length, int fontStyle, java.awt.Color fontColor, java.awt.Color backgroundColor, int additionalStyle, java.awt.Color lineColor, java.awt.Stroke lineStroke, float fontShrinkRatio)
start
- the start index of the range in a stringlength
- the length of the range.fontStyle
- Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC.fontColor
- the color of the text.backgroundColor
- the background color of the text.additionalStyle
- Valid additional styles are defined as constants in StyleRange
. The names begin
with STYLE_. You can also use bitwise OR "|" to concat any two or more styles as long as
it makes sense.lineColor
- the color of the line.lineStroke
- the stroke of the line.fontShrinkRatio
- the ratio that regular font size divides by subscript or superscript font size.public int getStart()
public int getLength()
public int getFontStyle()
public java.awt.Color getFontColor()
public java.awt.Color getBackgroundColor()
public int getAdditionalStyle()
StyleRange
. The names
begin with STYLE_. The value could also be two or more styles concatenated by | as long as it makes sense. It
could be more convenient to use methods isStrikethrough()
, isDoublestrikethrough()
, isDotted()
, isWaved()
, isUnderlined()
, isSubscript()
, isSuperscript()
to
see what's the additional style.public java.awt.Color getLineColor()
public java.awt.Stroke getLineStroke()
public boolean isStrikethrough()
public boolean isDoublestrikethrough()
public boolean isWaved()
public boolean isUnderlined()
public boolean isDotted()
public boolean isSuperscript()
public boolean isSubscript()
public float getFontShrinkRatio()