Package org.fife.ui.rsyntaxtextarea
Class Style
- java.lang.Object
-
- org.fife.ui.rsyntaxtextarea.Style
-
- All Implemented Interfaces:
Cloneable
public class Style extends Object implements Cloneable
The color and style information for a token type. Each token type in anRSyntaxTextAreahas a correspondingStyle; thisStyletells us the following things:- What foreground color to use for tokens of this type.
- What background color to use.
- The font to use.
- Whether the token should be underlined.
-
-
Field Summary
Fields Modifier and Type Field Description Colorbackgroundstatic ColorDEFAULT_BACKGROUNDstatic FontDEFAULT_FONTstatic ColorDEFAULT_FOREGROUNDFontfontColorforegroundbooleanunderline
-
Constructor Summary
Constructors Constructor Description Style()Creates a new style defaulting to black foreground, no background, and no styling.Style(Color fg)Creates a new style with the specified foreground and no styling.Style(Color fg, Color bg)Creates a new style with the specified colors and no styling.Style(Color fg, Color bg, Font font)Creates a new style.Style(Color fg, Color bg, Font font, boolean underline)Creates a new style.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Objectclone()Returns a deep copy of this object.booleanequals(Object o2)Returns whether or not two syntax schemes are equal.inthashCode()Computes the hash code to use when adding this syntax scheme to hash tables.StringtoString()Returns a string representation of this style.
-
-
-
Field Detail
-
DEFAULT_FOREGROUND
public static final Color DEFAULT_FOREGROUND
-
DEFAULT_BACKGROUND
public static final Color DEFAULT_BACKGROUND
-
DEFAULT_FONT
public static final Font DEFAULT_FONT
-
foreground
public Color foreground
-
background
public Color background
-
underline
public boolean underline
-
font
public Font font
-
-
Constructor Detail
-
Style
public Style()
Creates a new style defaulting to black foreground, no background, and no styling.
-
Style
public Style(Color fg)
Creates a new style with the specified foreground and no styling.- Parameters:
fg- The foreground color to use.
-
Style
public Style(Color fg, Color bg)
Creates a new style with the specified colors and no styling.- Parameters:
fg- The foreground color to use.bg- The background color to use.
-
Style
public Style(Color fg, Color bg, Font font)
Creates a new style.- Parameters:
fg- The foreground color to use.bg- The background color to use.font- The font for this syntax scheme.
-
-
Method Detail
-
clone
public Object clone()
Returns a deep copy of this object.
-
equals
public boolean equals(Object o2)
Returns whether or not two syntax schemes are equal.
-
hashCode
public int hashCode()
Computes the hash code to use when adding this syntax scheme to hash tables.This method is implemented, since
equals(Object)is implemented, to keep FindBugs happy.
-
-