Oxygen XML Editor 11.2 Author API

ro.sync.exml.view.graphics
Class Font

java.lang.Object
  extended by ro.sync.exml.view.graphics.Font

public class Font
extends Object

Font common class.


Field Summary
static int BOLD
          The bold style constant.
static int ITALIC
          The italicized style constant.
static int PLAIN
          The plain style constant.
 
Constructor Summary
Font(String name, int style, int size)
          Creates a new Font from the specified name, style and point size.
 
Method Summary
 boolean equals(Object obj)
          Checks if the two colors have the same RGB value.
 String getName()
           
 int getSize()
           
 int getStyle()
           
 String hash()
           
static String hash(String name, int style, int size)
          Hash the font
 int hashCode()
           
 boolean isBold()
          Indicates whether or not this Font object's style is BOLD.
 boolean isItalic()
          Indicates whether or not this Font object's style is ITALIC.
 boolean isPlain()
          Indicates whether or not this Font object's style is PLAIN.
 String toString()
          Converts this Font object to a String representation.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

PLAIN

public static final int PLAIN
The plain style constant.

See Also:
Constant Field Values

BOLD

public static final int BOLD
The bold style constant. This can be combined with the other style constants (except PLAIN) for mixed styles.

See Also:
Constant Field Values

ITALIC

public static final int ITALIC
The italicized style constant. This can be combined with the other style constants (except PLAIN) for mixed styles.

See Also:
Constant Field Values
Constructor Detail

Font

public Font(String name,
            int style,
            int size)
Creates a new Font from the specified name, style and point size.

Parameters:
name - the font name. This can be a logical font name or a font face name. A logical name must be either: Dialog, DialogInput, Monospaced, Serif, or SansSerif. If name is null, the name of the new Font is set to the name "Default".
style - the style constant for the Font The style argument is an integer bitmask that may be PLAIN, or a bitwise union of BOLD and/or ITALIC (for example, ITALIC or BOLD|ITALIC).
size - the point size of the Font
Method Detail

getName

public String getName()
Returns:
The name

getSize

public int getSize()
Returns:
The size

getStyle

public int getStyle()
Returns:
The style

toString

public String toString()
Converts this Font object to a String representation.

Overrides:
toString in class Object
Returns:
a String representation of this Font object.
Since:
JDK1.0

isPlain

public boolean isPlain()
Indicates whether or not this Font object's style is PLAIN.

Returns:
true if this Font has a PLAIN sytle; false otherwise.
Since:
JDK1.0
See Also:
Font.getStyle()

isBold

public boolean isBold()
Indicates whether or not this Font object's style is BOLD.

Returns:
true if this Font object's style is BOLD; false otherwise.
Since:
JDK1.0
See Also:
Font.getStyle()

isItalic

public boolean isItalic()
Indicates whether or not this Font object's style is ITALIC.

Returns:
true if this Font object's style is ITALIC; false otherwise.
Since:
JDK1.0
See Also:
Font.getStyle()

hash

public String hash()
Returns:
A hash of the font

hash

public static final String hash(String name,
                                int style,
                                int size)
Hash the font

Parameters:
name - Name
style - Style
size - Size
Returns:
The hash

equals

public boolean equals(Object obj)
Checks if the two colors have the same RGB value. The alpha is also taken into account.

Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object
See Also:
Object.hashCode()

Oxygen XML Editor 11.2 Author API

© Copyright SyncRO Soft SRL 2002 - 2010.