Class InstalledTheme
- java.lang.Object
-
- ca.cgjennings.apps.arkham.plugins.InstalledBundleObject
-
- ca.cgjennings.apps.arkham.plugins.InstalledTheme
-
- All Implemented Interfaces:
IconProvider
,java.lang.Comparable<InstalledBundleObject>
public final class InstalledTheme extends InstalledBundleObject
Provides the information needed to allow the user to select a theme, and for theThemeInstaller
to install a selected theme. These objects are usually created by theBundleInstaller
when the application starts.- Since:
- 3.0
- Author:
- Chris Jennings
-
-
Constructor Summary
Constructors Constructor Description InstalledTheme(PluginBundle bundle, java.lang.String className)
Creates a newInstalledTheme
instance that describes the theme with the given className.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compareTo(InstalledBundleObject o)
A comparator that sorts plug-ins by load order, then by priority, then by name, then by catalog ID date.boolean
equals(java.lang.Object obj)
java.lang.String
getDescription()
Returns a description of the plug-in (or other bundle object).ThemedIcon
getIcon()
Returns a small icon for the theme.ThemedIcon
getLargeIcon()
Returns a large icon for the theme.java.lang.String
getName()
Returns the theme's human-friendly name.java.awt.image.BufferedImage
getScreenshot()
Returns a screenshot of the theme if one is available, otherwise returns null.java.net.URL
getScreenshotUrl()
Returns a URL for the location of a screenshot image if one is available, otherwise returns null.java.lang.String
getThemeClass()
Returns the fully qualified name of the class that must be instantiated to install this theme (that is, theTheme
subclass).int
hashCode()
java.lang.String
toString()
Returns the name of the object.-
Methods inherited from class ca.cgjennings.apps.arkham.plugins.InstalledBundleObject
getBundle, getCatalogID, getPluginRoot, getPriority, getRepresentativeImage, isUninstallPending, isUpdatePending, markFailed
-
-
-
-
Constructor Detail
-
InstalledTheme
public InstalledTheme(PluginBundle bundle, java.lang.String className) throws java.io.IOException, PluginException
Creates a newInstalledTheme
instance that describes the theme with the given className.- Parameters:
bundle
- the bundle that the theme class is stored in, ornull
for built in themesclassName
- the class used to instantiate the theme- Throws:
PluginException
- if the theme is unavailable or there is an exception while extracting the theme informationjava.lang.NullPointerException
- if className isnull
java.io.IOException
-
-
Method Detail
-
getThemeClass
public java.lang.String getThemeClass()
Returns the fully qualified name of the class that must be instantiated to install this theme (that is, theTheme
subclass).- Returns:
- the name of the Theme subclass
-
getName
public java.lang.String getName()
Returns the theme's human-friendly name.- Specified by:
getName
in classInstalledBundleObject
- Returns:
- a short name for the theme
-
getDescription
public java.lang.String getDescription()
Description copied from class:InstalledBundleObject
Returns a description of the plug-in (or other bundle object). If necessary, a new instance of the plug-in will be created temporarily in order to get this information.- Specified by:
getDescription
in classInstalledBundleObject
- Returns:
- the description reported by the plug-in
-
getIcon
public ThemedIcon getIcon()
Returns a small icon for the theme.- Specified by:
getIcon
in interfaceIconProvider
- Specified by:
getIcon
in classInstalledBundleObject
- Returns:
- a small icon
-
getLargeIcon
public ThemedIcon getLargeIcon()
Returns a large icon for the theme.- Returns:
- a large icon
-
getScreenshotUrl
public java.net.URL getScreenshotUrl()
Returns a URL for the location of a screenshot image if one is available, otherwise returns null.- Returns:
- the preview screenshot URL for the theme, or null
-
getScreenshot
public java.awt.image.BufferedImage getScreenshot()
Returns a screenshot of the theme if one is available, otherwise returns null.- Returns:
- the preview screenshot for the theme, or null
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equals
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
toString
public java.lang.String toString()
Description copied from class:InstalledBundleObject
Returns the name of the object.- Overrides:
toString
in classInstalledBundleObject
- Returns:
- the value of
InstalledBundleObject.getName()
-
compareTo
public int compareTo(InstalledBundleObject o)
Description copied from class:InstalledBundleObject
A comparator that sorts plug-ins by load order, then by priority, then by name, then by catalog ID date.- Specified by:
compareTo
in interfacejava.lang.Comparable<InstalledBundleObject>
- Overrides:
compareTo
in classInstalledBundleObject
- Parameters:
o
- the bundle object to compare to- Returns:
- a value that is negative, zero, or positive as the compared bundle object is greater, equal, or less than this bundle object
- See Also:
InstalledBundleObject.getPriority()
,InstalledBundleObject.getName()
,InstalledBundleObject.getCatalogID()
,CatalogID.compareDates(ca.cgjennings.apps.arkham.plugins.catalog.CatalogID)
-
-