Package com.tagtraum.beatunes.plaf
Class MacOSTheme
- java.lang.Object
-
- com.tagtraum.beatunes.plaf.MacOSTheme
-
- All Implemented Interfaces:
Theme
public class MacOSTheme extends Object implements Theme
Native macOS theme.- 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 MacOSTheme()
-
Method Summary
All Methods Static Methods Instance Methods Concrete 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.boolean
equals(Object obj)
Paint
getBackgroundPaint(Container container)
Background paint.static Color
getDarkGray()
String
getDescription()
Short description.Paint
getFocusedBackgroundPaint(Container container)
Background paint.String
getId()
Persistent ID.static Color
getLightGray()
String
getLocalizedString(String key)
Returns a localized string.URL
getResource(String resourceName)
Used for theme specific loading of resources.static Color
getUnfocusedDarkGray()
static Color
getUnfocusedLightGray()
int
hashCode()
boolean
isAvailable()
Indicates, whether this Theme is available on the platform beaTunes is currently running on.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.String
toString()
-
-
-
Method Detail
-
getDarkGray
public static Color getDarkGray()
-
getUnfocusedDarkGray
public static Color getUnfocusedDarkGray()
-
getLightGray
public static Color getLightGray()
-
getUnfocusedLightGray
public static Color getUnfocusedLightGray()
-
getBackgroundPaint
public Paint getBackgroundPaint(Container container)
Description copied from interface:Theme
Background paint.- Specified by:
getBackgroundPaint
in interfaceTheme
- Parameters:
container
- component- Returns:
- background paint
-
getFocusedBackgroundPaint
public Paint getFocusedBackgroundPaint(Container container)
Description copied from interface:Theme
Background paint. This is used for the icon in the general preferences.- Specified by:
getFocusedBackgroundPaint
in interfaceTheme
- Parameters:
container
- component- Returns:
- background paint
-
getDescription
public String getDescription()
Description copied from interface:Theme
Short description. Used in preferences.- Specified by:
getDescription
in interfaceTheme
- Returns:
- description
-
getId
public String getId()
Description copied from interface:Theme
Persistent ID. Used in general preferences.
-
isAvailable
public boolean isAvailable()
Description copied from interface:Theme
Indicates, whether this Theme is available on the platform beaTunes is currently running on.- Specified by:
isAvailable
in interfaceTheme
- Returns:
- true or false
-
paintBackground
public void paintBackground(Graphics graphics, Container container)
Description copied from interface:Theme
Paints a themed background.- Specified by:
paintBackground
in interfaceTheme
- Parameters:
graphics
- graphicscontainer
- component to paint in
-
activate
public void activate()
Description copied from interface:Theme
Is called by the system, when the Theme is activated.
-
deactivate
public void deactivate()
Description copied from interface:Theme
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.- Specified by:
deactivate
in interfaceTheme
-
requiresRestart
public boolean requiresRestart()
Description copied from interface:Theme
Indicates that a restart is required to fully switch to or from this theme.- Specified by:
requiresRestart
in interfaceTheme
- Returns:
- true or false
-
customize
public void customize(Container container)
Description copied from interface:Theme
Is called by the systems for a number of different components and give this theme a chance to customize them.
-
getResource
public URL getResource(String resourceName)
Description copied from interface:Theme
Used for theme specific loading of resources.- Specified by:
getResource
in 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:Theme
Returns a localized string. Lets you override the default strings- Specified by:
getLocalizedString
in interfaceTheme
- Parameters:
key
- key- Returns:
- localized string
- See Also:
ResourceBundle.getString(String)
-
-