public class ExtendedFont
extends java.lang.Object
implements java.io.Serializable
ExtendedFont class implements an extended font object.
The extended font has a color attribute and an underline attribute.
The extended font is immutable.
| 修飾子とタイプ | フィールドと説明 |
|---|---|
protected java.awt.Color |
color
The color attribute of this font.
|
protected java.awt.FontMetrics |
metrics
The font metrics of this font.
|
protected boolean |
underline
The underline attribute of this font.
|
| コンストラクタと説明 |
|---|
ExtendedFont(java.awt.Font font)
Constructs an extended font with the specified font.
|
ExtendedFont(java.awt.Font font,
boolean underline)
Constructs an extended font with the specified font and underline.
|
ExtendedFont(java.awt.Font font,
java.awt.Color color)
Constructs an extended font with the specified font and color.
|
ExtendedFont(java.awt.Font font,
java.awt.Color color,
boolean underline)
Constructs an extended font with the specified font, color and
underline.
|
ExtendedFont(java.lang.String name,
int style,
int size)
Constructs an extended font with the specified name, style and size.
|
ExtendedFont(java.lang.String name,
int style,
int size,
boolean underline)
Constructs an extended font with the specified name, style, size
and underline.
|
ExtendedFont(java.lang.String name,
int style,
int size,
java.awt.Color color)
Constructs an extended font with the specified name, style, size
and color.
|
ExtendedFont(java.lang.String name,
int style,
int size,
java.awt.Color color,
boolean underline)
Constructs an extended font with the specified name, style, size,
color and underline.
|
| 修飾子とタイプ | メソッドと説明 |
|---|---|
ExtendedFont |
deriveFont(boolean underline)
Creates a new font by replicating this font with a new underline
attribute associated with it.
|
ExtendedFont |
deriveFont(java.awt.Color color)
Creates a new font by replicating this font with a new color
object associated with it.
|
boolean |
equals(java.lang.Object anObject)
Compares two objects for equality.
|
boolean |
equalsStyle(ExtendedFont exFont)
Compares the styles of two fonts for equality.
|
java.awt.Color |
getColor()
Returns the color of the extended font.
|
java.lang.String |
getFamily()
Returns the platform specific family name of the font.
|
java.awt.Font |
getFont()
Returns the font object in this extended font.
|
java.awt.FontMetrics |
getFontMetrics()
Returns the font metrics for this extended font.
|
protected static java.awt.FontMetrics |
getFontMetrics(java.awt.Font font)
Returns the font metrics in the cashe for the given font.
|
java.lang.String |
getName()
Returns the logical name of the font.
|
int |
getSize()
Returns the point size of the font.
|
int |
getStyle()
Returns the style of the font.
|
int |
hashCode()
Returns a hashcode for this font.
|
boolean |
isBold()
Returns true if the font is bold.
|
boolean |
isItalic()
Returns true if the font is italic.
|
boolean |
isPlain()
Returns true if the font is plain.
|
boolean |
isUnderline()
Checks if this extended font is underlined.
|
java.lang.String |
toString()
Returns the string representation of this extended font.
|
protected java.awt.FontMetrics metrics
protected java.awt.Color color
protected boolean underline
public ExtendedFont(java.lang.String name,
int style,
int size)
name - the name of the font.style - the style of the font.size - the point size of the font.public ExtendedFont(java.lang.String name,
int style,
int size,
java.awt.Color color)
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.public ExtendedFont(java.lang.String name,
int style,
int size,
boolean underline)
name - the name of the font.style - the style of the font.size - the point size of the font.underline - the font is underlined.public ExtendedFont(java.lang.String name,
int style,
int size,
java.awt.Color color,
boolean underline)
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.public ExtendedFont(java.awt.Font font)
font - the font object.public ExtendedFont(java.awt.Font font,
java.awt.Color color)
font - the font object.color - the color of the font.public ExtendedFont(java.awt.Font font,
boolean underline)
font - the font object.underline - the font is underlined.public ExtendedFont(java.awt.Font font,
java.awt.Color color,
boolean underline)
font - the font object.color - the color of the font.underline - the font is underlined.protected static java.awt.FontMetrics getFontMetrics(java.awt.Font font)
public java.lang.String getFamily()
public java.lang.String getName()
public int getStyle()
Font.PLAIN,
Font.BOLD,
Font.ITALICpublic int getSize()
public boolean isPlain()
public boolean isBold()
public boolean isItalic()
public java.awt.Font getFont()
public java.awt.FontMetrics getFontMetrics()
public java.awt.Color getColor()
public boolean isUnderline()
public ExtendedFont deriveFont(java.awt.Color color)
color - the color object for the new font.public ExtendedFont deriveFont(boolean underline)
underline - the underline attribute for the new font.public int hashCode()
hashCode クラス内 java.lang.Objectpublic boolean equals(java.lang.Object anObject)
equals クラス内 java.lang.Objectpublic boolean equalsStyle(ExtendedFont exFont)
public java.lang.String toString()
toString クラス内 java.lang.Object