edu.northwestern.at.utils.swing.styledtext
Class StyleRun

java.lang.Object
  extended by edu.northwestern.at.utils.swing.styledtext.StyleRun
All Implemented Interfaces:
java.lang.Cloneable

public class StyleRun
extends java.lang.Object
implements java.lang.Cloneable

A style run.

This lightweight class records style information for a run of characters in a string.


Field Summary
static int ALIGNMENT
          Alignment style.
static int ALIGNMENT_CENTER
          Center alignment.
static int ALIGNMENT_JUSTIFIED
          Fully justified alignment.
static int ALIGNMENT_LEFT
          Left alignment.
static int ALIGNMENT_RIGHT
          Right alignment.
static int BOLD
          Bold style.
static int COLOR
          Color style.
static int COLOR_BLACK
          Black.
static int COLOR_BLUE
          Blue.
static int COLOR_GREEN
          Green.
static int COLOR_RED
          Red.
static int EMOTICON
          Emoticon "style".
static int EMOTICON_ALERT
          Alert emoticon.
static int EMOTICON_ANGRY
          Angry emoticon.
static int EMOTICON_ATTENTION
          Attention emoticon.
static int EMOTICON_BIGGRIN
          Big grin emoticon.
static int EMOTICON_DEVIL
          Devil emoticon.
static int EMOTICON_IDEA
          Idea emoticon.
static int EMOTICON_SAD
          Sad emoticon.
static int EMOTICON_SICK
          Sick emoticon.
static int EMOTICON_SMILE
          Smile emoticon.
static int EMOTICON_TIRED
          Tired emoticon.
static int EMOTICON_TONGUE
          Tongue emoticon.
 int end
          The ending offset in the string of this run.
static int FAMILY
          Font family style.
static int FAMILY_MONOSPACED
          Monospaced font family.
static int FAMILY_SANS_SERIF
          Sans-serif font family.
static int FAMILY_SERIF
          Serif font family.
static int ITALIC
          Italic style.
 int kind
          The kind of style.
 int param
          The style parameter, if any.
static int SIZE
          Font size style.
static int SIZE_BIG
          Big font size.
static int SIZE_BIGGER
          Bigger font size.
static int SIZE_BIGGEST
          Biggest font size.
static int SIZE_NORMAL
          Normal font size.
static int SIZE_SMALL
          Small font size.
static int SIZE_SMALLER
          Smaller font size.
static int SIZE_SMALLEST
          Smallest font size.
static int STARICON
          Star icon "style".
static int STARICON_FIVE
           
static int STARICON_FOUR
           
static int STARICON_FOUR_AND_A_HALF
           
static int STARICON_HALF
           
static int STARICON_ONE
           
static int STARICON_ONE_AND_A_HALF
           
static int STARICON_THREE
           
static int STARICON_THREE_AND_A_HALF
           
static int STARICON_TWO
           
static int STARICON_TWO_AND_A_HALF
           
static int STARICON_ZERO
          Star icons for no stars to five stars.
 int start
          The starting offset in the string of this run.
static int STRIKETHROUGH
          Strikethrough style.
static int SUBSCRIPT
          Subscript style.
static int SUPERSCRIPT
          Superscript style.
static int UNDERLINE
          Underline style.
 
Constructor Summary
StyleRun(int start, int end, int kind)
          Constructs a new StyleRun object with param = 0.
StyleRun(int start, int end, int kind, int param)
          Constructs a new StyleRun object.
 
Method Summary
 java.lang.Object clone()
          Returns a copy of the style run.
 boolean equals(java.lang.Object obj)
          Compares this style run to some other style run.
 java.lang.String toString()
          Returns a string representation of the style run.
 
Methods inherited from class java.lang.Object
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BOLD

public static final int BOLD
Bold style.

See Also:
Constant Field Values

ITALIC

public static final int ITALIC
Italic style.

See Also:
Constant Field Values

UNDERLINE

public static final int UNDERLINE
Underline style.

See Also:
Constant Field Values

STRIKETHROUGH

public static final int STRIKETHROUGH
Strikethrough style.

See Also:
Constant Field Values

ALIGNMENT

public static final int ALIGNMENT
Alignment style.

See Also:
Constant Field Values

ALIGNMENT_LEFT

public static final int ALIGNMENT_LEFT
Left alignment.

See Also:
Constant Field Values

ALIGNMENT_CENTER

public static final int ALIGNMENT_CENTER
Center alignment.

See Also:
Constant Field Values

ALIGNMENT_RIGHT

public static final int ALIGNMENT_RIGHT
Right alignment.

See Also:
Constant Field Values

ALIGNMENT_JUSTIFIED

public static final int ALIGNMENT_JUSTIFIED
Fully justified alignment.

See Also:
Constant Field Values

FAMILY

public static final int FAMILY
Font family style.

See Also:
Constant Field Values

FAMILY_SERIF

public static final int FAMILY_SERIF
Serif font family.

See Also:
Constant Field Values

FAMILY_SANS_SERIF

public static final int FAMILY_SANS_SERIF
Sans-serif font family.

See Also:
Constant Field Values

FAMILY_MONOSPACED

public static final int FAMILY_MONOSPACED
Monospaced font family.

See Also:
Constant Field Values

SIZE

public static final int SIZE
Font size style.

See Also:
Constant Field Values

SIZE_SMALLEST

public static final int SIZE_SMALLEST
Smallest font size.

See Also:
Constant Field Values

SIZE_SMALLER

public static final int SIZE_SMALLER
Smaller font size.

See Also:
Constant Field Values

SIZE_SMALL

public static final int SIZE_SMALL
Small font size.

See Also:
Constant Field Values

SIZE_NORMAL

public static final int SIZE_NORMAL
Normal font size.

See Also:
Constant Field Values

SIZE_BIG

public static final int SIZE_BIG
Big font size.

See Also:
Constant Field Values

SIZE_BIGGER

public static final int SIZE_BIGGER
Bigger font size.

See Also:
Constant Field Values

SIZE_BIGGEST

public static final int SIZE_BIGGEST
Biggest font size.

See Also:
Constant Field Values

COLOR

public static final int COLOR
Color style.

See Also:
Constant Field Values

COLOR_RED

public static final int COLOR_RED
Red.

See Also:
Constant Field Values

COLOR_BLUE

public static final int COLOR_BLUE
Blue.

See Also:
Constant Field Values

COLOR_GREEN

public static final int COLOR_GREEN
Green.

See Also:
Constant Field Values

COLOR_BLACK

public static final int COLOR_BLACK
Black.

See Also:
Constant Field Values

EMOTICON

public static final int EMOTICON
Emoticon "style".

See Also:
Constant Field Values

EMOTICON_SMILE

public static final int EMOTICON_SMILE
Smile emoticon.

See Also:
Constant Field Values

EMOTICON_SAD

public static final int EMOTICON_SAD
Sad emoticon.

See Also:
Constant Field Values

EMOTICON_ANGRY

public static final int EMOTICON_ANGRY
Angry emoticon.

See Also:
Constant Field Values

EMOTICON_SICK

public static final int EMOTICON_SICK
Sick emoticon.

See Also:
Constant Field Values

EMOTICON_TIRED

public static final int EMOTICON_TIRED
Tired emoticon.

See Also:
Constant Field Values

EMOTICON_DEVIL

public static final int EMOTICON_DEVIL
Devil emoticon.

See Also:
Constant Field Values

EMOTICON_BIGGRIN

public static final int EMOTICON_BIGGRIN
Big grin emoticon.

See Also:
Constant Field Values

EMOTICON_TONGUE

public static final int EMOTICON_TONGUE
Tongue emoticon.

See Also:
Constant Field Values

EMOTICON_ATTENTION

public static final int EMOTICON_ATTENTION
Attention emoticon.

See Also:
Constant Field Values

EMOTICON_ALERT

public static final int EMOTICON_ALERT
Alert emoticon.

See Also:
Constant Field Values

EMOTICON_IDEA

public static final int EMOTICON_IDEA
Idea emoticon.

See Also:
Constant Field Values

STARICON

public static final int STARICON
Star icon "style".

See Also:
Constant Field Values

STARICON_ZERO

public static final int STARICON_ZERO
Star icons for no stars to five stars.

See Also:
Constant Field Values

STARICON_HALF

public static final int STARICON_HALF
See Also:
Constant Field Values

STARICON_ONE

public static final int STARICON_ONE
See Also:
Constant Field Values

STARICON_ONE_AND_A_HALF

public static final int STARICON_ONE_AND_A_HALF
See Also:
Constant Field Values

STARICON_TWO

public static final int STARICON_TWO
See Also:
Constant Field Values

STARICON_TWO_AND_A_HALF

public static final int STARICON_TWO_AND_A_HALF
See Also:
Constant Field Values

STARICON_THREE

public static final int STARICON_THREE
See Also:
Constant Field Values

STARICON_THREE_AND_A_HALF

public static final int STARICON_THREE_AND_A_HALF
See Also:
Constant Field Values

STARICON_FOUR

public static final int STARICON_FOUR
See Also:
Constant Field Values

STARICON_FOUR_AND_A_HALF

public static final int STARICON_FOUR_AND_A_HALF
See Also:
Constant Field Values

STARICON_FIVE

public static final int STARICON_FIVE
See Also:
Constant Field Values

SUBSCRIPT

public static final int SUBSCRIPT
Subscript style.

See Also:
Constant Field Values

SUPERSCRIPT

public static final int SUPERSCRIPT
Superscript style.

See Also:
Constant Field Values

start

public int start
The starting offset in the string of this run.


end

public int end
The ending offset in the string of this run.


kind

public int kind
The kind of style.


param

public int param
The style parameter, if any.

Constructor Detail

StyleRun

public StyleRun(int start,
                int end,
                int kind,
                int param)
Constructs a new StyleRun object.

Parameters:
start - The starting offset in the string of the run.
end - The ending offset in the string of the run.
kind - The kind of style.
param - The style parameter.

StyleRun

public StyleRun(int start,
                int end,
                int kind)
Constructs a new StyleRun object with param = 0.

Parameters:
start - The starting offset in the string of the run.
end - The ending offset in the string of the run.
kind - The kind of style.
Method Detail

equals

public boolean equals(java.lang.Object obj)
Compares this style run to some other style run.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The other style run.
Returns:
True if the two style runs are equal.

toString

public java.lang.String toString()
Returns a string representation of the style run.

Overrides:
toString in class java.lang.Object
Returns:
The string representation.

clone

public java.lang.Object clone()
Returns a copy of the style run.

Overrides:
clone in class java.lang.Object
Returns:
The copy.