Package com.tagtraum.beatunes.plaf
Class AbstractTheme
- java.lang.Object
-
- com.tagtraum.beatunes.plaf.AbstractTheme
-
- All Implemented Interfaces:
Theme
- Direct Known Subclasses:
ColorTheme,GradientBackgroundTheme,TiledBackgroundTheme
public abstract class AbstractTheme extends Object implements Theme
AbstractTheme.- Author:
- Hendrik Schreiber
-
-
Field Summary
-
Fields inherited from interface com.tagtraum.beatunes.plaf.Theme
PAINT_FANCY_BACKGROUND, PAINT_PLAIN_BACKGROUND
-
-
Constructor Summary
Constructors Constructor Description AbstractTheme()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description PaintgetBackgroundPaint(Container container)Background paint.abstract PaintgetBackgroundPaint(Container container, boolean hasFocus)PaintgetFocusedBackgroundPaint(Container container)Background paint.StringgetLocalizedString(String key)Returns a localized string.URLgetResource(String resourceName)Used for theme specific loading of resources.static RootPaneContainergetRootPaneContainer(Container component)protected booleanhasFocus(Container container)booleanisAvailable()Indicates, whether this Theme is available on the platform beaTunes is currently running on.voidpaintBackground(Graphics graphics, Container container)Paints a themed background.voidpaintBackground(Graphics graphics, Container container, Paint paint)booleanrequiresRestart()Indicates that a restart is required to fully switch to or from this theme.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.tagtraum.beatunes.plaf.Theme
activate, customize, deactivate, getDescription, getId, isLight
-
-
-
-
Method Detail
-
isAvailable
public boolean isAvailable()
Description copied from interface:ThemeIndicates, whether this Theme is available on the platform beaTunes is currently running on.- Specified by:
isAvailablein interfaceTheme- Returns:
- true or false
-
paintBackground
public void paintBackground(Graphics graphics, Container container)
Description copied from interface:ThemePaints a themed background.- Specified by:
paintBackgroundin interfaceTheme- Parameters:
graphics- graphicscontainer- component to paint in
-
requiresRestart
public boolean requiresRestart()
Description copied from interface:ThemeIndicates that a restart is required to fully switch to or from this theme.- Specified by:
requiresRestartin interfaceTheme- Returns:
- true or false
-
getResource
public URL getResource(String resourceName)
Description copied from interface:ThemeUsed for theme specific loading of resources.- Specified by:
getResourcein interfaceTheme- Parameters:
resourceName- name of a resource, e.g. "newplaylist.png"- Returns:
- the resource URL or null, if the resource should be resolved by the application instead of the theme.
-
getLocalizedString
public String getLocalizedString(String key)
Description copied from interface:ThemeReturns a localized string. Lets you override the default strings- Specified by:
getLocalizedStringin interfaceTheme- Parameters:
key- key- Returns:
- localized string
- See Also:
ResourceBundle.getString(String)
-
hasFocus
protected boolean hasFocus(Container container)
-
getRootPaneContainer
public static RootPaneContainer getRootPaneContainer(Container component)
-
getBackgroundPaint
public Paint getBackgroundPaint(Container container)
Description copied from interface:ThemeBackground paint.- Specified by:
getBackgroundPaintin interfaceTheme- Parameters:
container- component- Returns:
- background paint
-
getFocusedBackgroundPaint
public Paint getFocusedBackgroundPaint(Container container)
Description copied from interface:ThemeBackground paint. This is used for the icon in the general preferences.- Specified by:
getFocusedBackgroundPaintin interfaceTheme- Parameters:
container- component- Returns:
- background paint
-
-