com.alee.utils.swing
Interface FontMethods<C extends java.awt.Component>

Type Parameters:
C - component type
All Superinterfaces:
SwingMethods
All Known Implementing Classes:
DictionariesTree, DictionariesTreeRenderer, GenericCellEditor, HotkeyTipLabel, LanguageExample.MyLabel, SampleTreeCellRenderer, ViewTabbedPane, WebAsyncTree, WebAsyncTreeCellRenderer, WebAsyncTreeFilterField, WebBooleanRenderer, WebBreadcrumbButton, WebBreadcrumbLabel, WebBreadcrumbToggleButton, WebButton, WebCheckBox, WebCheckBoxList, WebCheckBoxListElement, WebCheckBoxMenuItem, WebCheckBoxTree, WebClock, WebColorChooserField, WebComboBox, WebComboBoxElement, WebCursorTracker, WebDateField, WebDateRenderer, WebDoubleRenderer, WebEditorPane, WebFileList, WebFileListCellRenderer, WebFileTable, WebFileTableCellRenderer, WebFileTree, WebFileTreeCellRenderer, WebFormattedTextField, WebHotkeyField, WebHotkeyLabel, WebIconRenderer, WebLabel, WebLinkLabel, WebList, WebListCellRenderer, WebListCellRenderer.UIResource, WebListElement, WebMemoryBar, WebMenu, WebMenuItem, WebMultiLineLabel, WebNumberRenderer, WebPasswordField, WebProgressBar, WebRadioButton, WebRadioButtonMenuItem, WebRootPaneUI.TitleLabel, WebSlider, WebSpinner, WebSplitButton, WebStatusLabel, WebStepLabel, WebTabbedPane, WebTable, WebTableCellRenderer, WebTableCellRenderer.UIResource, WebTableHeaderCellRenderer, WebTableHeaderCellRenderer.UIResource, WebTextArea, WebTextField, WebTextPane, WebToggleButton, WebToolTip, WebTree, WebTreeCellRenderer, WebTreeElement, WebTristateCheckBox, WebVerticalLabel

public interface FontMethods<C extends java.awt.Component>
extends SwingMethods

This interface provides a set of methods that should be added into components that support font and uses that font to render. Basically all these methods are already implemented in SwingUtils but it is much easier to call them directly from component.

Author:
Mikle Garin
See Also:
SwingMethods, SwingUtils

Method Summary
 C changeFontSize(int change)
          Changes font size of the specified component.
 java.lang.String getFontName()
          Returns component font name.
 int getFontSize()
          Returns component font size.
 boolean isBoldFont()
          Returns whether component font is bold or not.
 boolean isItalicFont()
          Returns whether component font is italic or not.
 boolean isPlainFont()
          Returns whether component font is plain or not.
 C setBoldFont()
          Sets bold font for the component.
 C setBoldFont(boolean apply)
          Sets bold font for the component.
 C setFontName(java.lang.String fontName)
          Sets component font name.
 C setFontSize(int fontSize)
          Sets component font size.
 C setFontSizeAndStyle(int fontSize, boolean bold, boolean italic)
          Sets font size and style for the specified component.
 C setFontSizeAndStyle(int fontSize, int style)
          Sets font size and style for the specified component.
 C setFontStyle(boolean bold, boolean italic)
          Sets component font style.
 C setFontStyle(int style)
          Sets component font style.
 C setItalicFont()
          Sets italic or plain font for the component.
 C setItalicFont(boolean apply)
          Sets italic or plain font for the component.
 C setPlainFont()
          Sets plain font for the component.
 C setPlainFont(boolean apply)
          Sets plain font for the component.
 

Method Detail

setPlainFont

C setPlainFont()
Sets plain font for the component.

Returns:
modified component

setPlainFont

C setPlainFont(boolean apply)
Sets plain font for the component.

Parameters:
apply - whether to apply font changes or not
Returns:
modified component

isPlainFont

boolean isPlainFont()
Returns whether component font is plain or not.

Returns:
true if component font is plain, false otherwise

setBoldFont

C setBoldFont()
Sets bold font for the component.

Returns:
modified component

setBoldFont

C setBoldFont(boolean apply)
Sets bold font for the component.

Parameters:
apply - whether to apply font changes or not
Returns:
modified component

isBoldFont

boolean isBoldFont()
Returns whether component font is bold or not.

Returns:
true if component font is bold, false otherwise

setItalicFont

C setItalicFont()
Sets italic or plain font for the component.

Returns:
modified component

setItalicFont

C setItalicFont(boolean apply)
Sets italic or plain font for the component.

Parameters:
apply - whether to apply font changes or not
Returns:
modified component

isItalicFont

boolean isItalicFont()
Returns whether component font is italic or not.

Returns:
true if component font is italic, false otherwise

setFontStyle

C setFontStyle(boolean bold,
               boolean italic)
Sets component font style.

Parameters:
bold - whether should set bold font or not
italic - whether should set italic font or not
Returns:
modified component

setFontStyle

C setFontStyle(int style)
Sets component font style.

Parameters:
style - new style
Returns:
modified component

setFontSize

C setFontSize(int fontSize)
Sets component font size.

Parameters:
fontSize - font size
Returns:
modified component

changeFontSize

C changeFontSize(int change)
Changes font size of the specified component.

Parameters:
change - font size change amount
Returns:
modified component

getFontSize

int getFontSize()
Returns component font size.

Returns:
component font size

setFontSizeAndStyle

C setFontSizeAndStyle(int fontSize,
                      boolean bold,
                      boolean italic)
Sets font size and style for the specified component.

Parameters:
fontSize - new font size
bold - whether should set bold font or not
italic - whether should set italic font or not
Returns:
modified component

setFontSizeAndStyle

C setFontSizeAndStyle(int fontSize,
                      int style)
Sets font size and style for the specified component.

Parameters:
fontSize - new font size
style - new style
Returns:
modified component

setFontName

C setFontName(java.lang.String fontName)
Sets component font name.

Parameters:
fontName - new font name
Returns:
modified component

getFontName

java.lang.String getFontName()
Returns component font name.

Returns:
component font name