| java.lang.Object org.jfree.report.style.FontDefinition
FontDefinition | public class FontDefinition implements Serializable,Cloneable(Code) | | The FontDefinition encapsulates all Font-Style information. The java.awt.Font class
does not support extended Styles like Strikethrough or Underline or font metadata like
the base encoding.
author: Thomas Morgner |
Field Summary | |
final public static boolean | BOLD a constant to draw a font in bold style. | final public static boolean | ITALIC a constant to draw a font in italic style. | final public static boolean | PLAIN a constant to draw a font in plain style. | final public static boolean | STRIKETHROUGH a constant to draw a font with strikethrough style. | final public static boolean | UNDERLINE a constant to draw a font with underline style. |
Constructor Summary | |
public | FontDefinition(String fontName, int fontSize, boolean bold, boolean italic, boolean underline, boolean strikeThrough, String encoding, boolean embedded) Creates a font definition using the given name and size and with the given styles
defined. | public | FontDefinition(String fontName, int fontSize, boolean bold, boolean italic, boolean underline, boolean strikeThrough) Creates a font definition using the given name and size and with the given styles
defined. | public | FontDefinition(String fontName, int fontSize) Creates a font definition using the given name and size and with no additional style
enabled. | public | FontDefinition(Font font) Creates a font definition base on the given AWT font. |
Method Summary | |
public Object | clone() Creates and returns a copy of this object. | public boolean | equals(Object o) Indicates whether some other object is "equal to" this one.
Parameters: o - the reference object with which to compare. | public Font | getFont() returns the AWT-Font defined by this FontDefinition. | public String | getFontEncoding(String defaultEncoding) Returns this fonts string encoding. | public String | getFontName() Returns the font name of this font definition. | public int | getFontSize() Returns the size of the defined font. | public int | hashCode() Returns a hash code value for the object. | public boolean | isBold() Returns the bold style of this font definition. | public boolean | isCourier() Returns true if the logical font name is equivalent to 'Courier', and false
otherwise. | public boolean | isEmbeddedFont() Returns whether the font should be embedded in the target document. | public boolean | isItalic() Returns the italic style of this font definition. | public boolean | isSansSerif() Returns true if the logical font name is equivalent to 'SansSerif', and false
otherwise. | public boolean | isSerif() Returns true if the logical font name is equivalent to 'Serif', and false otherwise. | public boolean | isStrikeThrough() Returns the strikethrough style of this font definition. | public boolean | isUnderline() Returns the underline style of this font definition. | public String | toString() Returns a string representation of this font definition. |
BOLD | final public static boolean BOLD(Code) | | a constant to draw a font in bold style.
|
ITALIC | final public static boolean ITALIC(Code) | | a constant to draw a font in italic style.
|
PLAIN | final public static boolean PLAIN(Code) | | a constant to draw a font in plain style.
|
STRIKETHROUGH | final public static boolean STRIKETHROUGH(Code) | | a constant to draw a font with strikethrough style.
|
UNDERLINE | final public static boolean UNDERLINE(Code) | | a constant to draw a font with underline style.
|
FontDefinition | public FontDefinition(String fontName, int fontSize, boolean bold, boolean italic, boolean underline, boolean strikeThrough, String encoding, boolean embedded)(Code) | | Creates a font definition using the given name and size and with the given styles
defined.
Parameters: fontName - the font name used in this font definition. Parameters: fontSize - the font size for the defined font. Parameters: bold - true, if the font should be bold, false otherwise Parameters: italic - true, if the font should be italic, false otherwise Parameters: underline - true, if the font should be drawn with underline style, falseotherwise Parameters: strikeThrough - true, if the font should be drawn with strikethrough style,false otherwise Parameters: encoding - the default text encoding that should be used with this font. Parameters: embedded - whether this font should be embedded in the target document. |
FontDefinition | public FontDefinition(String fontName, int fontSize, boolean bold, boolean italic, boolean underline, boolean strikeThrough)(Code) | | Creates a font definition using the given name and size and with the given styles
defined.
Parameters: fontName - the font name used in this font definition. Parameters: fontSize - the font size for the defined font. Parameters: bold - true, if the font should be bold, false otherwise Parameters: italic - true, if the font should be italic, false otherwise Parameters: underline - true, if the font should be drawn with underline style, falseotherwise Parameters: strikeThrough - true, if the font should be drawn with strikethrough style,false otherwise |
FontDefinition | public FontDefinition(String fontName, int fontSize)(Code) | | Creates a font definition using the given name and size and with no additional style
enabled.
Parameters: fontName - the font name used in this font definition. Parameters: fontSize - the font size for the defined font. |
FontDefinition | public FontDefinition(Font font)(Code) | | Creates a font definition base on the given AWT font.
Parameters: font - the awt font that should be used as definition source. |
equals | public boolean equals(Object o)(Code) | | Indicates whether some other object is "equal to" this one.
Parameters: o - the reference object with which to compare. true if this object is the same as the obj argument;false otherwise. See Also: FontDefinition.hashCode() See Also: java.util.Hashtable |
getFont | public Font getFont()(Code) | | returns the AWT-Font defined by this FontDefinition.
the AWT font. |
getFontEncoding | public String getFontEncoding(String defaultEncoding)(Code) | | Returns this fonts string encoding. If the font does not define an encoding, the
given default encoding is returned.
Parameters: defaultEncoding - the font encoding to be used if this font definition does notdefine an own encoding. the font encoding or the default encoding. |
getFontName | public String getFontName()(Code) | | Returns the font name of this font definition. The font name is the font face name.
the name of the font. |
getFontSize | public int getFontSize()(Code) | | Returns the size of the defined font.
the font size in points. |
hashCode | public int hashCode()(Code) | | Returns a hash code value for the object. This method is supported for the benefit of
hashtables such as those provided by java.util.Hashtable .
a hash code value for this object. See Also: java.lang.Object.equals(java.lang.Object) |
isBold | public boolean isBold()(Code) | | Returns the bold style of this font definition.
true, if the font should be drawn in bold style. |
isCourier | public boolean isCourier()(Code) | | Returns true if the logical font name is equivalent to 'Courier', and false
otherwise.
true or false. |
isEmbeddedFont | public boolean isEmbeddedFont()(Code) | | Returns whether the font should be embedded in the target document.
true, if the font should be embedded. |
isItalic | public boolean isItalic()(Code) | | Returns the italic style of this font definition.
true, if the font should be drawn in italic style. |
isSansSerif | public boolean isSansSerif()(Code) | | Returns true if the logical font name is equivalent to 'SansSerif', and false
otherwise.
true or false. |
isSerif | public boolean isSerif()(Code) | | Returns true if the logical font name is equivalent to 'Serif', and false otherwise.
true or false. |
isStrikeThrough | public boolean isStrikeThrough()(Code) | | Returns the strikethrough style of this font definition.
true, if the font should be drawn in strikethrough style. |
isUnderline | public boolean isUnderline()(Code) | | Returns the underline style of this font definition.
true, if the font should be drawn in underline style. |
toString | public String toString()(Code) | | Returns a string representation of this font definition.
a string representation of this font definition. |
|
|