public class ZoomableFont extends Object
PropertyChangeListener
.Constructor and Description |
---|
ZoomableFont()
Creates a new instance of this class with a height of 10 and the font style
Font.PLAIN
and the font name Font.SANS_SERIF . |
ZoomableFont(String name,
int style,
double originalHeight)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(PropertyChangeListener listener) |
void |
addPropertyChangeListener(String propertyName,
PropertyChangeListener listener) |
void |
adjustFromFont(Font font) |
Font |
createFont(double zoom)
Creates a new
Font instance according to the properties if this object and the provided zoom factor. |
String |
getName()
Returns the font name.
|
double |
getOriginalHeight()
Returns the font size for a zoom factor of 100 %.
|
int |
getStyle()
Returns the font style.
|
void |
removePropertyChangeListener(PropertyChangeListener listener) |
void |
removePropertyChangeListener(String propertyName,
PropertyChangeListener listener) |
void |
setName(String name)
Sets a new font name.
|
void |
setOriginalHeight(double originalHeight)
Sets a new font size for a zoom factor of 100 %.
|
void |
setStyle(int style)
Sets a new font style.
|
public ZoomableFont()
Font.PLAIN
and the font name Font.SANS_SERIF
.public ZoomableFont(String name, int style, double originalHeight)
name
- the font namestyle
- the font styleoriginalHeight
- the font size for a zoom factor of 100 %public double getOriginalHeight()
Font.getSize()
public void setOriginalHeight(double originalHeight)
originalHeight
- the new font heightFont.getSize()
public int getStyle()
Font.getStyle()
public void setStyle(int style)
style
- the new font styleFont.getStyle()
public String getName()
Font.getName()
public void setName(String name)
name
- the new font nameFont.getName()
public Font createFont(double zoom)
Font
instance according to the properties if this object and the provided zoom factor.zoom
- the zoom factor to determine the font size of the returned objectpublic void adjustFromFont(Font font)
public void addPropertyChangeListener(PropertyChangeListener listener)
public void addPropertyChangeListener(String propertyName, PropertyChangeListener listener)
public void removePropertyChangeListener(PropertyChangeListener listener)
public void removePropertyChangeListener(String propertyName, PropertyChangeListener listener)