Module org.jfree.chart3d
Package org.jfree.chart3d.plot

# Class StandardFontSource<K extends Comparable<K>>

java.lang.Object
org.jfree.chart3d.plot.StandardFontSource<K>

All Implemented Interfaces:
  `Serializable`, `FontSource<K>`

public final class StandardFontSource<K extends Comparable<K>> extends Object implements FontSource<K>, Serializable
A standard implementation of the `FontSource` interface.
NOTE: This class is serializable, but the serialization format is subject to change in future releases and should not be relied upon for persisting instances of this class.

See Also:
  - Serialized Form

## Constructor Summary

Constructors
Constructor
Description
`StandardFontSource()`
Creates a new instance with default fonts.
`StandardFontSource(Font defaultFont)`
Creates a new font source with the specified default font.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`equals(Object obj)`
Tests this paint source for equality with an arbitrary object.
`Font`
`getDefaultFont()`
Returns the default font.
`Font`
`getFont(K key)`
Returns the font for the specified key.
`void`
`setDefaultFont(Font font)`
Sets the default font.
`void`
`setFont(K key, Font font)`
Sets the font associated with the specified key.
`void`
`style(Font font)`
Clears existing font settings and sets the default font to the supplied value.

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Constructor Details

### StandardFontSource

public StandardFontSource()
Creates a new instance with default fonts.

### StandardFontSource

public StandardFontSource(Font defaultFont)
Creates a new font source with the specified default font.

Parameters:
  `defaultFont` - the default font (`null` not permitted).

## Method Details

### getDefaultFont

public Font getDefaultFont()
Returns the default font. The default value is `DEFAULT_FONT`.

Returns:
  The default font (never `null`).

### setDefaultFont

public void setDefaultFont(Font font)
Sets the default font.

Parameters:
  `font` - the font (`null` not permitted).

### getFont

public Font getFont(K key)
Returns the font for the specified key.

Specified by:
  `getFont` in interface `FontSource<K extends Comparable<K>>`
Parameters:
  `key` - the key (`null` not permitted).
Returns:
  The font (never `null`).

### setFont

public void setFont(K key, Font font)
Sets the font associated with the specified key.

Specified by:
  `setFont` in interface `FontSource<K extends Comparable<K>>`
Parameters:
  `key` - the key (`null` not permitted).
  `font` - the font (`null` permitted).

### style

public void style(Font font)
Clears existing font settings and sets the default font to the supplied value. This method is used by the framework and is not normally called by client code.

Specified by:
  `style` in interface `FontSource<K extends Comparable<K>>`
Parameters:
  `font` - the font (`null` not permitted).
Since:
  1.2

### equals

public boolean equals(Object obj)
Tests this paint source for equality with an arbitrary object.

Overrides:
  `equals` in class `Object`
Parameters:
  `obj` - the object (`null` permitted).
Returns:
  A boolean.