public class GenericFontModifier extends java.lang.Object implements FontModifier
FontModifier
that can change a font in more than just one way.Modifier and Type | Class and Description |
---|---|
static class |
GenericFontModifier.Modify
Tells how to transform some aspect of a font.
|
Constructor and Description |
---|
GenericFontModifier()
Creates a new modifier
|
Modifier and Type | Method and Description |
---|---|
GenericFontModifier.Modify |
getBold()
Tells how this modifier modifies the bold aspect of a font.
|
GenericFontModifier.Modify |
getItalic()
Tells how this modifier modifies the italic aspect of a font.
|
int |
getSize()
Gets the size of the new font
|
boolean |
isSizeDelta()
Tells whether the size of the fonts generated by this modifier depend
on the original size of the used font or not.
|
java.awt.Font |
modify(java.awt.Font font)
Creates or gets a font for
font . |
void |
setBold(GenericFontModifier.Modify bold)
Sets how to modify the bold aspect of a font.
|
void |
setItalic(GenericFontModifier.Modify italic)
Sets how to modify the italic aspect of a font.
|
void |
setSize(int size)
Sets the size of the new font.
|
void |
setSizeDelta(boolean sizeDelta)
Sets whether the value of
size should be added
to the original size or replace the original size. |
public void setSize(int size)
delta size
is set to true
then this value is added to the original size
of the font, otherwise this value replaces the original size.size
- the new size or the delta sizepublic int getSize()
setSize(int)
public void setSizeDelta(boolean sizeDelta)
size
should be added
to the original size or replace the original size.sizeDelta
- true
if the two sizes should be summed up,
false
if the size specified in this modifier replaces
the original sizepublic boolean isSizeDelta()
true
if the sizes are summed up, false
if notsetSizeDelta(boolean)
public void setItalic(GenericFontModifier.Modify italic)
italic
- the new modificationpublic GenericFontModifier.Modify getItalic()
public void setBold(GenericFontModifier.Modify bold)
bold
- the new modificationpublic GenericFontModifier.Modify getBold()
public java.awt.Font modify(java.awt.Font font)
FontModifier
font
.modify
in interface FontModifier
font
- the original unmodified fontfont