Package com.tagtraum.beatunes.plaf
Interface Theme
-
- All Known Implementing Classes:
AbstractTheme
,ColorTheme
,GradientBackgroundTheme
,MacOSTheme
,TiledBackgroundTheme
,VistaTheme
,Win7Theme
,WindowsTheme
public interface Theme
UI Theme.- Author:
- Hendrik Schreiber
-
-
Field Summary
Fields Modifier and Type Field Description static String
PAINT_FANCY_BACKGROUND
static String
PAINT_PLAIN_BACKGROUND
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description void
activate()
Is called by the system, when the Theme is activated.void
customize(Container container)
Is called by the systems for a number of different components and give this theme a chance to customize them.void
deactivate()
Is called by the system when the Theme is de-activated.Paint
getBackgroundPaint(Container container)
Background paint.String
getDescription()
Short description.Paint
getFocusedBackgroundPaint(Container container)
Background paint.String
getId()
Persistent ID.String
getLocalizedString(String key)
Returns a localized string.URL
getResource(String resourceName)
Used for theme specific loading of resources.boolean
isAvailable()
Indicates, whether this Theme is available on the platform beaTunes is currently running on.default boolean
isLight()
Returnstrue
, if the background color of this theme is generally light, rather than dark.void
paintBackground(Graphics graphics, Container container)
Paints a themed background.boolean
requiresRestart()
Indicates that a restart is required to fully switch to or from this theme.
-
-
-
Field Detail
-
PAINT_PLAIN_BACKGROUND
static final String PAINT_PLAIN_BACKGROUND
- See Also:
- Constant Field Values
-
PAINT_FANCY_BACKGROUND
static final String PAINT_FANCY_BACKGROUND
- See Also:
- Constant Field Values
-
-
Method Detail
-
getBackgroundPaint
Paint getBackgroundPaint(Container container)
Background paint.- Parameters:
container
- component- Returns:
- background paint
-
getFocusedBackgroundPaint
Paint getFocusedBackgroundPaint(Container container)
Background paint. This is used for the icon in the general preferences.- Parameters:
container
- component- Returns:
- background paint
-
getDescription
String getDescription()
Short description. Used in preferences.- Returns:
- description
-
getId
String getId()
Persistent ID. Used in general preferences.- Returns:
- unique, persistent id for this instance
-
isAvailable
boolean isAvailable()
Indicates, whether this Theme is available on the platform beaTunes is currently running on.- Returns:
- true or false
-
paintBackground
void paintBackground(Graphics graphics, Container container)
Paints a themed background.- Parameters:
graphics
- graphicscontainer
- component to paint in
-
activate
void activate()
Is called by the system, when the Theme is activated.
-
deactivate
void deactivate()
Is called by the system when the Theme is de-activated. The Theme is expected to return any UI defaults etc. to their original state.
-
requiresRestart
boolean requiresRestart()
Indicates that a restart is required to fully switch to or from this theme.- Returns:
- true or false
-
customize
void customize(Container container)
Is called by the systems for a number of different components and give this theme a chance to customize them.- Parameters:
container
- component to customize
-
getResource
URL getResource(String resourceName)
Used for theme specific loading of resources.- 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
String getLocalizedString(String key)
Returns a localized string. Lets you override the default strings- Parameters:
key
- key- Returns:
- localized string
- See Also:
ResourceBundle.getString(String)
-
isLight
default boolean isLight()
Returnstrue
, if the background color of this theme is generally light, rather than dark.- Returns:
true
orfalse
-
-