de.muntjak.tinylookandfeel
Class ThemeDescription

java.lang.Object
  extended by de.muntjak.tinylookandfeel.ThemeDescription

public class ThemeDescription
extends java.lang.Object

ThemeDescription describes a TinyLaF theme by its URL and its name.

You can call Theme.getAvailableThemes() to get an array of ThemeDescription objects, each describing a unique TinyLaF theme resource.


Constructor Summary
ThemeDescription(java.net.URI uri)
          Constructs a ThemeDescription using the specified URI.
ThemeDescription(java.net.URL url)
          Constructs a ThemeDescription using the specified URL.
 
Method Summary
 boolean equals(java.lang.Object o)
          Two ThemeDescription objects are equal if their URIs are equal.
 java.io.File getFile()
          Returns the theme file or null.
 java.lang.String getName()
          Returns the name of the TinyLaF theme, for example: "Golden" (for a URL of ...
 java.net.URL getURL()
          Returns the URL of the TinyLaF theme.
 boolean isFile()
          Returns true if the URI or URL argument given at construction time was a file URI/URL, false otherwise.
 boolean isValid()
          Returns true if the URI or URL argument given at construction time was valid, false otherwise.
 java.lang.String toString()
          Returns the same string as would be returned from getName().
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThemeDescription

public ThemeDescription(java.net.URI uri)
Constructs a ThemeDescription using the specified URI.

Note: You can get an URI from a file by calling File.toURI().

Parameters:
uri - a non-null URI
Throws:
java.lang.IllegalArgumentException - if argument is null

ThemeDescription

public ThemeDescription(java.net.URL url)
Constructs a ThemeDescription using the specified URL.

Parameters:
url - a non-null URL
Throws:
java.lang.IllegalArgumentException - if argument is null
Method Detail

equals

public boolean equals(java.lang.Object o)
Two ThemeDescription objects are equal if their URIs are equal.

Overrides:
equals in class java.lang.Object

getFile

public java.io.File getFile()
Returns the theme file or null.

Returns:
the theme file or null.
See Also:
isFile()

getName

public java.lang.String getName()
Returns the name of the TinyLaF theme, for example: "Golden" (for a URL of .../Golden.theme). The returned string will be null if the URL or URI specified at construction time was invalid.

Returns:
the name of the TinyLaF theme

getURL

public java.net.URL getURL()
Returns the URL of the TinyLaF theme. Note that, if isValid() returns false, the returned URL is probably null.

Returns:
the URL of the TinyLaF theme.

isFile

public boolean isFile()
Returns true if the URI or URL argument given at construction time was a file URI/URL, false otherwise.

Returns:
true if the URI or URL argument given at construction time was a file URI/URL, false otherwise.

isValid

public boolean isValid()
Returns true if the URI or URL argument given at construction time was valid, false otherwise.

Returns:
true if the URI or URL argument given at construction time was valid, false otherwise.

toString

public java.lang.String toString()
Returns the same string as would be returned from getName().

Overrides:
toString in class java.lang.Object