| java.lang.Object com.jidesoft.swing.StyleRange
StyleRange | public class StyleRange (Code) | | A data structure represents a style for a range of text. There are two categories of styles
that currently supports. One is the font style and color which includes bold, italic, superscript,
subscript as well as the color of the text. The other one is line color and style. The line style could be
straight line, dotted line, waved line or any customized style using Stroke. The line could be used as
underline or strikethrough line.
The name of StyleRange comes from SWT's StyleRange. We borrowed some design idea from it.
StyledLabel is actually very similar to SWT's StyledText. Saying
that, the features of the two components are not exactly the same since the purpose of the
two components are quite different.
|
Constructor Summary | |
public | StyleRange(int fontStyle) Creates a style range with a specified font style. | public | StyleRange(Color fontColor) Creates a style range with a specified font color. | public | StyleRange(int fontStyle, Color fontColor) Creates a style range with a specified font style and font color. | public | StyleRange(int fontStyle, int additionalStyle) Creates a style range with a specified font style and additional style.
Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. | public | StyleRange(int fontStyle, int additionalStyle, float fontShrinkRatio) Creates a style range with a specified font style and additional style.
Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. | public | StyleRange(int start, int length, int fontStyle) Creates a style range with a specified font style and a range. | public | StyleRange(int start, int length, int fontStyle, Color fontColor) Creates a style range with a specified font style, font color and a range. | public | StyleRange(int start, int length, Color fontColor) Creates a style range with a specified font color and a range. | public | StyleRange(int start, int length, int fontStyle, int additionalStyle) Creates a style range with a specified font style, additional style and a range.
Parameters: start - the start index of the range in a string Parameters: length - the length of the range. Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. | public | 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.
Parameters: start - the start index of the range in a string Parameters: length - the length of the range. Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. | public | StyleRange(int fontStyle, Color fontColor, int additionalStyle, Color lineColor) Creates a style range with a specified font style, font color, and additional style.
Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. | public | StyleRange(int fontStyle, Color fontColor, Color backgroundColor, int additionalStyle, Color lineColor) Creates a style range with a specified font style, font color, and additional style.
Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text. Parameters: backgroundColor - the background color of the text. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. | public | StyleRange(int start, int length, int fontStyle, Color fontColor, int additionalStyle) Creates a style range with a specified font style, font color, additional style and a range.
Parameters: start - the start index of the range in a string Parameters: length - the length of the range. Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. | public | StyleRange(int start, int length, int fontStyle, Color fontColor, Color backgroundColor, int additionalStyle) Creates a style range with a specified font style, font color, additional style and a range.
Parameters: start - the start index of the range in a string Parameters: length - the length of the range. Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text. Parameters: backgroundColor - the background color of the text. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. | public | StyleRange(int fontStyle, Color fontColor, int additionalStyle, Color lineColor, Stroke lineStroke) Creates a style range with a specified font style, font color, additional style, and line color.
Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. | public | StyleRange(int start, int length, int fontStyle, Color fontColor, int additionalStyle, Color lineColor) Creates a style range with a specified font style, font color, additional style, line color and a range.
Parameters: start - the start index of the range in a string Parameters: length - the length of the range. Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. | public | StyleRange(int start, int length, int fontStyle, Color fontColor, Color backgroundColor, int additionalStyle, Color lineColor) Creates a style range with a specified font style, font color, additional style, line color and a range.
Parameters: start - the start index of the range in a string Parameters: length - the length of the range. Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text. Parameters: backgroundColor - the background color of the text. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. | public | StyleRange(int start, int length, int fontStyle, Color fontColor, int additionalStyle, Color lineColor, Stroke lineStroke) Creates a style range with a specified font style, font color, additional style, line color, line stroke and a range.
Parameters: start - the start index of the range in a string Parameters: length - the length of the range. Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. | public | StyleRange(int start, int length, int fontStyle, Color fontColor, Color backgroundColor, int additionalStyle, Color lineColor, Stroke lineStroke) Creates a style range with a specified font style, font color, additional style, line color, line stroke and a range.
Parameters: start - the start index of the range in a string Parameters: length - the length of the range. Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text. Parameters: backgroundColor - the background color of the text. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. | public | StyleRange(int start, int length, int fontStyle, Color fontColor, int additionalStyle, Color lineColor, Stroke lineStroke, float fontShrinkRatio) Creates a style range with a specified font style, font color, additional style, line color, line stroke and a range.
Parameters: start - the start index of the range in a string Parameters: length - the length of the range. Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. | public | StyleRange(int start, int length, int fontStyle, Color fontColor, Color backgroundColor, int additionalStyle, Color lineColor, Stroke lineStroke, float fontShrinkRatio) Creates a style range with a specified font style, font color, additional style, line color, line stroke and a range.
Parameters: start - the start index of the range in a string Parameters: length - the length of the range. Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text. Parameters: backgroundColor - the background color of the text. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. |
STYLE_DOTTED | final public static int STYLE_DOTTED(Code) | | |
STYLE_DOUBLE_STRIKE_THROUGH | final public static int STYLE_DOUBLE_STRIKE_THROUGH(Code) | | |
STYLE_STRIKE_THROUGH | final public static int STYLE_STRIKE_THROUGH(Code) | | |
STYLE_SUBSCRIPT | final public static int STYLE_SUBSCRIPT(Code) | | |
STYLE_SUPERSCRIPT | final public static int STYLE_SUPERSCRIPT(Code) | | |
STYLE_UNDERLINED | final public static int STYLE_UNDERLINED(Code) | | |
STYLE_WAVED | final public static int STYLE_WAVED(Code) | | |
StyleRange | public StyleRange(int fontStyle)(Code) | | Creates a style range with a specified font style.
Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. |
StyleRange | public StyleRange(Color fontColor)(Code) | | Creates a style range with a specified font color.
Parameters: fontColor - the color of the text |
StyleRange | public StyleRange(int fontStyle, Color fontColor)(Code) | | Creates a style range with a specified font style and font color.
Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text |
StyleRange | public StyleRange(int fontStyle, int additionalStyle)(Code) | | Creates a style range with a specified font style and additional style.
Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. The names begin withSTYLE_. You can also use any | to concat two or more styles as long as it makes sense. |
StyleRange | public StyleRange(int fontStyle, int additionalStyle, float fontShrinkRatio)(Code) | | Creates a style range with a specified font style and additional style.
Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. The names begin withSTYLE_. You can also use any | to concat two or more styles as long as it makes sense. Parameters: fontShrinkRatio - the ratio that regular font size divides by subscript or superscript font size. |
StyleRange | public StyleRange(int start, int length, int fontStyle)(Code) | | Creates a style range with a specified font style and a range.
Parameters: start - the start index of the range in a string Parameters: length - the length of the range. Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. |
StyleRange | public StyleRange(int start, int length, int fontStyle, Color fontColor)(Code) | | Creates a style range with a specified font style, font color and a range.
Parameters: start - the start index of the range in a string Parameters: length - the length of the range. Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text. |
StyleRange | public StyleRange(int start, int length, Color fontColor)(Code) | | Creates a style range with a specified font color and a range.
Parameters: start - the start index of the range in a string Parameters: length - the length of the range. Parameters: fontColor - the color of the text. |
StyleRange | public StyleRange(int start, int length, int fontStyle, int additionalStyle)(Code) | | Creates a style range with a specified font style, additional style and a range.
Parameters: start - the start index of the range in a string Parameters: length - the length of the range. Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. The names begin withSTYLE_. You can also use any | to concat two or more styles as long as it makes sense. |
StyleRange | public StyleRange(int start, int length, int fontStyle, int additionalStyle, float fontShrinkRatio)(Code) | | Creates a style range with a specified font style, additional style and a range.
Parameters: start - the start index of the range in a string Parameters: length - the length of the range. Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. The names begin withSTYLE_. You can also use any | to concat two or more styles as long as it makes sense. Parameters: fontShrinkRatio - the ratio that regular font size divides by subscript or superscript font size. |
StyleRange | public StyleRange(int fontStyle, Color fontColor, int additionalStyle, Color lineColor)(Code) | | Creates a style range with a specified font style, font color, and additional style.
Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. The names begin withSTYLE_. You can also use any | to concat two or more styles as long as it makes sense. |
StyleRange | public StyleRange(int fontStyle, Color fontColor, Color backgroundColor, int additionalStyle, Color lineColor)(Code) | | Creates a style range with a specified font style, font color, and additional style.
Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text. Parameters: backgroundColor - the background color of the text. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. The names begin withSTYLE_. You can also use any | to concat two or more styles as long as it makes sense. |
StyleRange | public StyleRange(int start, int length, int fontStyle, Color fontColor, int additionalStyle)(Code) | | Creates a style range with a specified font style, font color, additional style and a range.
Parameters: start - the start index of the range in a string Parameters: length - the length of the range. Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. The names begin withSTYLE_. You can also use any | to concat two or more styles as long as it makes sense. |
StyleRange | public StyleRange(int start, int length, int fontStyle, Color fontColor, Color backgroundColor, int additionalStyle)(Code) | | Creates a style range with a specified font style, font color, additional style and a range.
Parameters: start - the start index of the range in a string Parameters: length - the length of the range. Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text. Parameters: backgroundColor - the background color of the text. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. The names begin withSTYLE_. You can also use any | to concat two or more styles as long as it makes sense. |
StyleRange | public StyleRange(int fontStyle, Color fontColor, int additionalStyle, Color lineColor, Stroke lineStroke)(Code) | | Creates a style range with a specified font style, font color, additional style, and line color.
Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. The names begin withSTYLE_. You can also use any | to concat two or more styles as long as it makes sense. Parameters: lineColor - the color of the line. |
StyleRange | public StyleRange(int start, int length, int fontStyle, Color fontColor, int additionalStyle, Color lineColor)(Code) | | Creates a style range with a specified font style, font color, additional style, line color and a range.
Parameters: start - the start index of the range in a string Parameters: length - the length of the range. Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. The names begin withSTYLE_. You can also use any | to concat two or more styles as long as it makes sense. Parameters: lineColor - the color of the line. |
StyleRange | public StyleRange(int start, int length, int fontStyle, Color fontColor, Color backgroundColor, int additionalStyle, Color lineColor)(Code) | | Creates a style range with a specified font style, font color, additional style, line color and a range.
Parameters: start - the start index of the range in a string Parameters: length - the length of the range. Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text. Parameters: backgroundColor - the background color of the text. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. The names begin withSTYLE_. You can also use any | to concat two or more styles as long as it makes sense. Parameters: lineColor - the color of the line. |
StyleRange | public StyleRange(int start, int length, int fontStyle, Color fontColor, int additionalStyle, Color lineColor, Stroke lineStroke)(Code) | | Creates a style range with a specified font style, font color, additional style, line color, line stroke and a range.
Parameters: start - the start index of the range in a string Parameters: length - the length of the range. Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. The names begin withSTYLE_. You can also use any | to concat two or more styles as long as it makes sense. Parameters: lineColor - the color of the line. Parameters: lineStroke - the stroke of the line. |
StyleRange | public StyleRange(int start, int length, int fontStyle, Color fontColor, Color backgroundColor, int additionalStyle, Color lineColor, Stroke lineStroke)(Code) | | Creates a style range with a specified font style, font color, additional style, line color, line stroke and a range.
Parameters: start - the start index of the range in a string Parameters: length - the length of the range. Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text. Parameters: backgroundColor - the background color of the text. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. The names begin withSTYLE_. You can also use any | to concat two or more styles as long as it makes sense. Parameters: lineColor - the color of the line. Parameters: lineStroke - the stroke of the line. |
StyleRange | public StyleRange(int start, int length, int fontStyle, Color fontColor, int additionalStyle, Color lineColor, Stroke lineStroke, float fontShrinkRatio)(Code) | | Creates a style range with a specified font style, font color, additional style, line color, line stroke and a range.
Parameters: start - the start index of the range in a string Parameters: length - the length of the range. Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. The names begin withSTYLE_. You can also use any | to concat two or more styles as long as it makes sense. Parameters: lineColor - the color of the line. Parameters: lineStroke - the stroke of the line. Parameters: fontShrinkRatio - the ratio that regular font size divides by subscript or superscript font size. |
StyleRange | public StyleRange(int start, int length, int fontStyle, Color fontColor, Color backgroundColor, int additionalStyle, Color lineColor, Stroke lineStroke, float fontShrinkRatio)(Code) | | Creates a style range with a specified font style, font color, additional style, line color, line stroke and a range.
Parameters: start - the start index of the range in a string Parameters: length - the length of the range. Parameters: fontStyle - Valid values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC. Parameters: fontColor - the color of the text. Parameters: backgroundColor - the background color of the text. Parameters: additionalStyle - Valid additional styles are defined as constants in StyleRange. The names begin withSTYLE_. You can also use bitwise OR "|" to concat any two or more styles as long as it makes sense. Parameters: lineColor - the color of the line. Parameters: lineStroke - the stroke of the line. Parameters: fontShrinkRatio - the ratio that regular font size divides by subscript or superscript font size. |
getBackgroundColor | public Color getBackgroundColor()(Code) | | Gets the background color.
the background color. |
getFontColor | public Color getFontColor()(Code) | | Gets the font color.
the font color. |
getFontShrinkRatio | public float getFontShrinkRatio()(Code) | | Gets the font shrink ratio for superscript and subscript.
the shrink ratio. |
getFontStyle | public int getFontStyle()(Code) | | Gets the font style. Possible values are Font.PLAIN, Font.ITALIC, Font.BOLD or Font.BOLD | Font.ITALIC.
the font style. |
getLength | public int getLength()(Code) | | Gets the length of the range.
the length of the range. |
getLineColor | public Color getLineColor()(Code) | | Gets the line color.
the line color. |
getLineStroke | public Stroke getLineStroke()(Code) | | Gets the line stroke.
the line stroke. |
getStart | public int getStart()(Code) | | Gets the start index of the range.
the start index of the range. |
isDotted | public boolean isDotted()(Code) | | Checks if the line has dotted style.
true if the line has dotted style. |
isDoublestrikethrough | public boolean isDoublestrikethrough()(Code) | | Checks if the text has double strike through style.
true if the text has double strike through style. |
isStrikethrough | public boolean isStrikethrough()(Code) | | Checks if the text has strike through style.
true if the text has strike through style. |
isSubscript | public boolean isSubscript()(Code) | | Checks if the text is subscript.
true if the text is subscript. |
isSuperscript | public boolean isSuperscript()(Code) | | Checks if the text is superscript.
true if the text is superscript. |
isUnderlined | public boolean isUnderlined()(Code) | | Checks if the text has underlined style.
true if the text has underlined style. |
isWaved | public boolean isWaved()(Code) | | Checks if the line has waved style.
true if the line has waved style. |
|
|