public class FontSizer
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Field and Description |
---|---|
protected float |
baseScale |
protected float |
curScale |
protected java.awt.Font |
font |
protected java.awt.Font |
lastFont |
protected float |
lastScale |
protected int |
maxPointSize |
protected int |
minPointSize |
protected int |
multiplier
Default of 1.
|
Constructor and Description |
---|
FontSizer(float baseScale,
int multiplier,
int minPointSize,
int maxPointSize)
Constructor that uses the OMText DEFAULT_FONT as the base font.
|
FontSizer(java.awt.Font font,
float baseScale,
int multiplier,
int minPointSize,
int maxPointSize) |
FontSizer(FontSizer source)
Create a FontSizer with the same settings as the source.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Font |
getFont()
Get the base font.
|
java.awt.Font |
getFont(float scale)
Get a font sized for the scale, given the size restrictions.
|
int |
getMultiplier() |
protected java.awt.Font |
getScaledFont() |
void |
restore(FontSizer source) |
void |
setFont(java.awt.Font font)
Set the base font.
|
void |
setMultiplier(int mul) |
protected transient java.awt.Font font
protected transient java.awt.Font lastFont
protected float baseScale
protected transient float lastScale
protected transient float curScale
protected int minPointSize
protected int maxPointSize
protected int multiplier
public FontSizer(FontSizer source)
source
- public FontSizer(java.awt.Font font, float baseScale, int multiplier, int minPointSize, int maxPointSize)
font
- the font to use as the base font.baseScale
- the scale where the base font is shown at its
natural size.multiplier
- to use against the ratio of base
scale:current scale.minPointSize
- the minimum point size to use for the
scaled font.maxPointSize
- the maximum point size to use for the
scaled font.public FontSizer(float baseScale, int multiplier, int minPointSize, int maxPointSize)
baseScale
- the scale where the base font is shown at its
natural size.multiplier
- to use against the ratio of base
scale:current scale.minPointSize
- the minimum point size to use for the
scaled font.maxPointSize
- the maximum point size to use for the
scaled font.public void setFont(java.awt.Font font)
public java.awt.Font getFont(float scale)
protected java.awt.Font getScaledFont()
public java.awt.Font getFont()
public void setMultiplier(int mul)
public int getMultiplier()
public void restore(FontSizer source)
Copyright (C) BBNT Solutions LLC; See http://openmap.bbn.com/ for details