public abstract class AbstractFontManager extends Object implements IFontManager
IFontManager
interface.IFontManager.FontStyle
Modifier and Type | Field and Description |
---|---|
protected int |
currentFontIndex |
Constructor and Description |
---|
AbstractFontManager()
Call this in subclasses with the super() constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
atLowerBoundary()
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 |
atUpperBoundary()
Test the virtual font pointer to see if it is at the upper boundary of
the font size range (|fonts| - 1).
|
void |
decreaseFontSize()
Move the font size pointer down.
|
String |
getFontName()
Get the font family name used in this font manager.
|
protected Integer |
getFontSizeForZoom(double zoom)
For a particular zoom, get the appropriate font size.
|
IFontManager.FontStyle |
getFontStyle()
Get the font style, defined in the
IFontManager interface. |
int |
getNumberOfFontSizes()
Get the number of font sizes used.
|
void |
increaseFontSize()
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 |
makeFonts()
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 |
resetVirtualCounts()
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.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setFontForZoom
public AbstractFontManager()
protected abstract void makeFonts()
public String getFontName()
public void setFontName(String fontName)
setFontName
in interface IFontManager
fontName
- name of the font to usepublic void setFontStyle(IFontManager.FontStyle fontStyle)
setFontStyle
in interface IFontManager
fontStyle
- an IFontManager.FontStyle
typepublic IFontManager.FontStyle getFontStyle()
IFontManager
interface.public void registerFontSizeMapping(double zoom, int size)
zoom
- the zoom levelsize
- the font sizeprotected Integer getFontSizeForZoom(double zoom)
zoom
- the zoom levelpublic int getNumberOfFontSizes()
public void resetVirtualCounts()
public void toMiddle()
public void increaseFontSize()
public void decreaseFontSize()
public boolean inRange()
public boolean atLowerBoundary()
public boolean atUpperBoundary()
public boolean inLower()
public boolean inUpper()
public boolean atMax()
public boolean atMin()
Copyright © 2017. All Rights Reserved.