syntaxhighlight
Class Style

java.lang.Object
  extended by syntaxhighlight.Style
All Implemented Interfaces:
java.lang.Cloneable

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

The style used by syntaxhiglight.Theme as those of CSS styles.

Author:
Chan Wai Shing

Field Summary
protected  javax.swing.text.SimpleAttributeSet attributeSet
          The AttributeSet representation of this style.
protected  java.awt.Color background
          The background color, null means no background color is set.
protected  boolean bold
          Font bold.
protected  boolean changed
          It indicate whether the attributeSet has updated after any style changes.
protected  java.awt.Color color
          Font color.
protected  boolean italic
          Font italic.
protected  boolean underline
          Font underline.
 
Constructor Summary
Style()
          Constructor.
 
Method Summary
 Style clone()
          
 boolean equals(java.lang.Object obj)
          
 javax.swing.text.SimpleAttributeSet getAttributeSet()
          Get the AttributeSet of this style.
 java.awt.Color getBackground()
          Get the background color.
 java.awt.Color getColor()
           
 int hashCode()
          
 boolean isBold()
           
 boolean isItalic()
           
 boolean isUnderline()
           
 void setBackground(java.awt.Color background)
          Set the background color.
 void setBold(boolean bold)
           
 void setColor(java.awt.Color color)
           
 void setItalic(boolean italic)
           
 void setUnderline(boolean underline)
           
 java.lang.String toString()
          
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

changed

protected boolean changed
It indicate whether the attributeSet has updated after any style changes.


attributeSet

protected javax.swing.text.SimpleAttributeSet attributeSet
The AttributeSet representation of this style.


bold

protected boolean bold
Font bold.


color

protected java.awt.Color color
Font color.


background

protected java.awt.Color background
The background color, null means no background color is set.


underline

protected boolean underline
Font underline.


italic

protected boolean italic
Font italic.

Constructor Detail

Style

public Style()
Constructor.

Default values:

Method Detail

getAttributeSet

public javax.swing.text.SimpleAttributeSet getAttributeSet()
Get the AttributeSet of this style.

Returns:
the AttributeSet

getBackground

public java.awt.Color getBackground()
Get the background color.

Returns:
the background color or null if no color is set

setBackground

public void setBackground(java.awt.Color background)
Set the background color.

Parameters:
background - null means do not set the background

isBold

public boolean isBold()

setBold

public void setBold(boolean bold)

getColor

public java.awt.Color getColor()

setColor

public void setColor(java.awt.Color color)

isItalic

public boolean isItalic()

setItalic

public void setItalic(boolean italic)

isUnderline

public boolean isUnderline()

setUnderline

public void setUnderline(boolean underline)

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

equals

public boolean equals(java.lang.Object obj)

Overrides:
equals in class java.lang.Object

clone

public Style clone()

Overrides:
clone in class java.lang.Object

toString

public java.lang.String toString()

Overrides:
toString in class java.lang.Object