|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bbn.openmap.omGraphics.FontSizer
public class FontSizer
Helper class to OMText object that resizes font when scale changes. Font gets bigger as you zoom in.
Field Summary | |
---|---|
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 Summary | |
---|---|
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. |
Method Summary | |
---|---|
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)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
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.Method Detail |
---|
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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |