public class ZoomableFont extends java.lang.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(java.lang.String name,
int style,
double originalHeight)
Creates a new instance of this class.
|
Modifier and Type | Method and Description |
---|---|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener) |
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener) |
void |
adjustFromFont(java.awt.Font font) |
java.awt.Font |
createFont(double zoom)
Creates a new
Font instance according to the properties if this object and the provided zoom factor. |
java.lang.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(java.beans.PropertyChangeListener listener) |
void |
removePropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener) |
void |
setName(java.lang.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(java.lang.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 java.lang.String getName()
Font.getName()
public void setName(java.lang.String name)
name
- the new font nameFont.getName()
public java.awt.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(java.awt.Font font)
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
public void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
public void removePropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener listener)