Class AbstractFontManager
java.lang.Object
org.openscience.cdk.renderer.font.AbstractFontManager
- All Implemented Interfaces:
IFontManager
- Direct Known Subclasses:
AWTFontManager
Implements the common parts of the
IFontManager
interface.- Source code:
- main
- Belongs to CDK module:
- renderbasic
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.openscience.cdk.renderer.font.IFontManager
IFontManager.FontStyle
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
Test the virtual font pointer to see if it is at the lower boundary of the font size range (0).boolean
atMax()
Check if the font pointer is as the maximum value.boolean
atMin()
Check if the font pointer is as the minimum value.boolean
Test the virtual font pointer to see if it is at the upper boundary of the font size range (|fonts| - 1).void
Move the font size pointer down.Get the font family name used in this font manager.protected Integer
getFontSizeForZoom
(double zoom) For a particular zoom, get the appropriate font size.Get the font style, defined in theIFontManager
interface.int
Get the number of font sizes used.void
Move the font size pointer up.boolean
inLower()
Test to see if the lower virtual pointer is in use.boolean
inRange()
Check that the font pointer is in the range (0, numberOfFonts - 1).boolean
inUpper()
Test to see if the upper virtual pointer is in use.protected abstract void
Make widget-specific fonts.void
registerFontSizeMapping
(double zoom, int size) For a particular zoom level, register a font point-size so that this size of font will be used when the zoom is at this level.void
Reset the virtual counts.void
setFontName
(String fontName) Set the font name ('Arial', 'Times New Roman') and so on.void
setFontStyle
(IFontManager.FontStyle fontStyle) Set the font style.void
toMiddle()
Set the font size pointer to the middle of the range.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.openscience.cdk.renderer.font.IFontManager
setFontForZoom
-
Field Details
-
currentFontIndex
protected int currentFontIndex
-
-
Constructor Details
-
AbstractFontManager
public AbstractFontManager()Call this in subclasses with the super() constructor.
-
-
Method Details
-
makeFonts
protected abstract void makeFonts()Make widget-specific fonts. -
getFontName
Get the font family name used in this font manager.- Returns:
- the font name
-
setFontName
Set the font name ('Arial', 'Times New Roman') and so on.- Specified by:
setFontName
in interfaceIFontManager
- Parameters:
fontName
- name of the font to use
-
setFontStyle
Set the font style.- Specified by:
setFontStyle
in interfaceIFontManager
- Parameters:
fontStyle
- anIFontManager.FontStyle
type
-
getFontStyle
Get the font style, defined in theIFontManager
interface.- Returns:
- the font style
-
registerFontSizeMapping
public void registerFontSizeMapping(double zoom, int size) For a particular zoom level, register a font point-size so that this size of font will be used when the zoom is at this level.- Parameters:
zoom
- the zoom levelsize
- the font size
-
getFontSizeForZoom
For a particular zoom, get the appropriate font size.- Parameters:
zoom
- the zoom level- Returns:
- an integer font size
-
getNumberOfFontSizes
public int getNumberOfFontSizes()Get the number of font sizes used.- Returns:
- the size of the zoom to font map
-
resetVirtualCounts
public void resetVirtualCounts()Reset the virtual counts. -
toMiddle
public void toMiddle()Set the font size pointer to the middle of the range. -
increaseFontSize
public void increaseFontSize()Move the font size pointer up. If this would move the pointer past the maximum font size, track this increase with a virtual size. -
decreaseFontSize
public void decreaseFontSize()Move the font size pointer down. If this would move the pointer past the minimum font size, track this increase with a virtual size. -
inRange
public boolean inRange()Check that the font pointer is in the range (0, numberOfFonts - 1).- Returns:
- true if the current font index is between 0 and |fonts| - 1
-
atLowerBoundary
public boolean atLowerBoundary()Test the virtual font pointer to see if it is at the lower boundary of the font size range (0).- Returns:
- true if the lower virtual count is zero
-
atUpperBoundary
public boolean atUpperBoundary()Test the virtual font pointer to see if it is at the upper boundary of the font size range (|fonts| - 1).- Returns:
- true if the upper virtual count is |fonts| - 1
-
inLower
public boolean inLower()Test to see if the lower virtual pointer is in use.- Returns:
- true if the lower virtual count is less than zero
-
inUpper
public boolean inUpper()Test to see if the upper virtual pointer is in use.- Returns:
- true if the upper virtual count is greater than |fonts| - 1
-
atMax
public boolean atMax()Check if the font pointer is as the maximum value.- Returns:
- true if the current font index is equal to |fonts| - 1
-
atMin
public boolean atMin()Check if the font pointer is as the minimum value.- Returns:
- true if the current font index is equal to zero
-