All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class jp.kyasu.graphics.ExtendedFont

java.lang.Object
   |
   +----jp.kyasu.graphics.ExtendedFont

public class ExtendedFont
extends Object
implements Serializable
The ExtendedFont class implements an extended font object. The extended font has a color attribute and an underline attribute.

The extended font is immutable.

Version:
25 Nov 1997
Author:
Kazuki YASUMATSU

Constructor Index

 o ExtendedFont(Font)
Constructs an extended font with the specified font.
 o ExtendedFont(Font, boolean)
Constructs an extended font with the specified font and underline.
 o ExtendedFont(Font, Color)
Constructs an extended font with the specified font and color.
 o ExtendedFont(Font, Color, boolean)
Constructs an extended font with the specified font, color and underline.
 o ExtendedFont(String, int, int)
Constructs an extended font with the specified name, style and size.
 o ExtendedFont(String, int, int, boolean)
Constructs an extended font with the specified name, style, size and underline.
 o ExtendedFont(String, int, int, Color)
Constructs an extended font with the specified name, style, size and color.
 o ExtendedFont(String, int, int, Color, boolean)
Constructs an extended font with the specified name, style, size, color and underline.

Method Index

 o deriveFont(boolean)
Creates a new font by replicating this font with a new underline attribute associated with it.
 o deriveFont(Color)
Creates a new font by replicating this font with a new color object associated with it.
 o equals(Object)
Compares two objects for equality.
 o equalsStyle(ExtendedFont)
Compares the styles of two fonts for equality.
 o getColor()
Returns the color of the extended font.
 o getFamily()
Returns the platform specific family name of the font.
 o getFont()
Returns the font object in this extended font.
 o getFontMetrics()
Returns the font metrics for this extended font.
 o getName()
Returns the logical name of the font.
 o getSize()
Returns the point size of the font.
 o getStyle()
Returns the style of the font.
 o hashCode()
Returns a hashcode for this font.
 o isBold()
Returns true if the font is bold.
 o isItalic()
Returns true if the font is italic.
 o isPlain()
Returns true if the font is plain.
 o isUnderline()
Checks if this extended font is underlined.
 o toString()
Returns the string representation of this extended font.

Constructors

 o ExtendedFont
 public ExtendedFont(String name,
                     int style,
                     int size)
Constructs an extended font with the specified name, style and size.

Parameters:
name - the name of the font.
style - the style of the font.
size - the point size of the font.
 o ExtendedFont
 public ExtendedFont(String name,
                     int style,
                     int size,
                     Color color)
Constructs an extended font with the specified name, style, size and color.

Parameters:
name - the name of the font.
style - the style of the font.
size - the point size of the font.
color - the color of the font.
 o ExtendedFont
 public ExtendedFont(String name,
                     int style,
                     int size,
                     boolean underline)
Constructs an extended font with the specified name, style, size and underline.

Parameters:
name - the name of the font.
style - the style of the font.
size - the point size of the font.
underline - the font is underlined.
 o ExtendedFont
 public ExtendedFont(String name,
                     int style,
                     int size,
                     Color color,
                     boolean underline)
Constructs an extended font with the specified name, style, size, color and underline.

Parameters:
name - the name of the font.
style - the style of the font.
size - the point size of the font.
color - the color of the font.
underline - the font is underlined.
 o ExtendedFont
 public ExtendedFont(Font font)
Constructs an extended font with the specified font.

Parameters:
font - the font object.
 o ExtendedFont
 public ExtendedFont(Font font,
                     Color color)
Constructs an extended font with the specified font and color.

Parameters:
font - the font object.
color - the color of the font.
 o ExtendedFont
 public ExtendedFont(Font font,
                     boolean underline)
Constructs an extended font with the specified font and underline.

Parameters:
font - the font object.
underline - the font is underlined.
 o ExtendedFont
 public ExtendedFont(Font font,
                     Color color,
                     boolean underline)
Constructs an extended font with the specified font, color and underline.

Parameters:
font - the font object.
color - the color of the font.
underline - the font is underlined.

Methods

 o getFamily
 public String getFamily()
Returns the platform specific family name of the font.

 o getName
 public String getName()
Returns the logical name of the font.

 o getStyle
 public int getStyle()
Returns the style of the font.

See Also:
PLAIN, BOLD, ITALIC
 o getSize
 public int getSize()
Returns the point size of the font.

 o isPlain
 public boolean isPlain()
Returns true if the font is plain.

 o isBold
 public boolean isBold()
Returns true if the font is bold.

 o isItalic
 public boolean isItalic()
Returns true if the font is italic.

 o getFont
 public Font getFont()
Returns the font object in this extended font.

 o getFontMetrics
 public FontMetrics getFontMetrics()
Returns the font metrics for this extended font.

 o getColor
 public Color getColor()
Returns the color of the extended font.

 o isUnderline
 public boolean isUnderline()
Checks if this extended font is underlined.

 o deriveFont
 public ExtendedFont deriveFont(Color color)
Creates a new font by replicating this font with a new color object associated with it.

Parameters:
color - the color object for the new font.
Returns:
a new font.
 o deriveFont
 public ExtendedFont deriveFont(boolean underline)
Creates a new font by replicating this font with a new underline attribute associated with it.

Parameters:
underline - the underline attribute for the new font.
Returns:
a new font.
 o hashCode
 public int hashCode()
Returns a hashcode for this font.

Overrides:
hashCode in class Object
 o equals
 public boolean equals(Object anObject)
Compares two objects for equality.

Overrides:
equals in class Object
 o equalsStyle
 public boolean equalsStyle(ExtendedFont exFont)
Compares the styles of two fonts for equality.

 o toString
 public String toString()
Returns the string representation of this extended font.

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index