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 theThemeInstallerto install a selected theme. These objects are usually created by theBundleInstallerwhen the application starts.- Since:
- 3.0
- Author:
- Chris Jennings
-
-
Constructor Summary
Constructors Constructor Description InstalledTheme(PluginBundle bundle, java.lang.String className)Creates a newInstalledThemeinstance that describes the theme with the given className.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompareTo(InstalledBundleObject o)A comparator that sorts plug-ins by load order, then by priority, then by name, then by catalog ID date.booleanequals(java.lang.Object obj)java.lang.StringgetDescription()Returns a description of the plug-in (or other bundle object).ThemedIcongetIcon()Returns a small icon for the theme.ThemedIcongetLargeIcon()Returns a large icon for the theme.java.lang.StringgetName()Returns the theme's human-friendly name.java.awt.image.BufferedImagegetScreenshot()Returns a screenshot of the theme if one is available, otherwise returns null.java.net.URLgetScreenshotUrl()Returns a URL for the location of a screenshot image if one is available, otherwise returns null.java.lang.StringgetThemeClass()Returns the fully qualified name of the class that must be instantiated to install this theme (that is, theThemesubclass).inthashCode()java.lang.StringtoString()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 newInstalledThemeinstance that describes the theme with the given className.- Parameters:
bundle- the bundle that the theme class is stored in, ornullfor 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 isnulljava.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, theThemesubclass).- Returns:
- the name of the Theme subclass
-
getName
public java.lang.String getName()
Returns the theme's human-friendly name.- Specified by:
getNamein classInstalledBundleObject- Returns:
- a short name for the theme
-
getDescription
public java.lang.String getDescription()
Description copied from class:InstalledBundleObjectReturns 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:
getDescriptionin classInstalledBundleObject- Returns:
- the description reported by the plug-in
-
getIcon
public ThemedIcon getIcon()
Returns a small icon for the theme.- Specified by:
getIconin interfaceIconProvider- Specified by:
getIconin 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:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
Description copied from class:InstalledBundleObjectReturns the name of the object.- Overrides:
toStringin classInstalledBundleObject- Returns:
- the value of
InstalledBundleObject.getName()
-
compareTo
public int compareTo(InstalledBundleObject o)
Description copied from class:InstalledBundleObjectA comparator that sorts plug-ins by load order, then by priority, then by name, then by catalog ID date.- Specified by:
compareToin interfacejava.lang.Comparable<InstalledBundleObject>- Overrides:
compareToin 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)
-
-