bibliothek.gui.dock.util.font
Class GenericFontModifier

java.lang.Object
  extended by bibliothek.gui.dock.util.font.GenericFontModifier
All Implemented Interfaces:
FontModifier

public class GenericFontModifier
extends Object
implements FontModifier

A FontModifier that can change a font in more than just one way.

Author:
Benjamin Sigg

Nested Class Summary
static class GenericFontModifier.Modify
          Tells how to transform some aspect of a font.
 
Constructor Summary
GenericFontModifier()
          Creates a new modifier
 
Method Summary
 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.
 Font modify(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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericFontModifier

public GenericFontModifier()
Creates a new modifier

Method Detail

setSize

public void setSize(int size)
Sets the size of the new font. If 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.

Parameters:
size - the new size or the delta size

getSize

public int getSize()
Gets the size of the new font

Returns:
the new size
See Also:
setSize(int)

setSizeDelta

public void setSizeDelta(boolean sizeDelta)
Sets whether the value of size should be added to the original size or replace the original size.

Parameters:
sizeDelta - true if the two sizes should be summed up, false if the size specified in this modifier replaces the original size

isSizeDelta

public boolean isSizeDelta()
Tells whether the size of the fonts generated by this modifier depend on the original size of the used font or not.

Returns:
true if the sizes are summed up, false if not
See Also:
setSizeDelta(boolean)

setItalic

public void setItalic(GenericFontModifier.Modify italic)
Sets how to modify the italic aspect of a font.

Parameters:
italic - the new modification

getItalic

public GenericFontModifier.Modify getItalic()
Tells how this modifier modifies the italic aspect of a font.

Returns:
the modification

setBold

public void setBold(GenericFontModifier.Modify bold)
Sets how to modify the bold aspect of a font.

Parameters:
bold - the new modification

getBold

public GenericFontModifier.Modify getBold()
Tells how this modifier modifies the bold aspect of a font.

Returns:
the modification

modify

public Font modify(Font font)
Description copied from interface: FontModifier
Creates or gets a font for font.

Specified by:
modify in interface FontModifier
Parameters:
font - the original unmodified font
Returns:
a font that might be a modification of font