bibliothek.gui.dock.themes
Class DefaultThemeMeta

java.lang.Object
  extended by bibliothek.gui.dock.themes.DefaultThemeMeta
All Implemented Interfaces:
ThemeMeta

public class DefaultThemeMeta
extends Object
implements ThemeMeta

This default implementation of ThemeMeta uses the TextManager to read label and description.

Author:
Benjamin Sigg

Constructor Summary
DefaultThemeMeta(ThemeFactory factory, DockController controller, String nameId, String descriptionId, String[] authors, URI[] webpages)
          Creates new meta information.
 
Method Summary
 void addListener(ThemeMetaListener listener)
          Adds a listener to this meta information, the listener will be informed if this meta information changes.
protected  void fireAuthorChanged()
          Invokes ThemeMetaListener.authorsChanged(ThemeMeta) on all registered listeners.
protected  void fireDescriptionChanged()
          Invokes ThemeMetaListener.descriptionChanged(ThemeMeta) on all registered listeners.
protected  void fireNameChanged()
          Invokes ThemeMetaListener.nameChanged(ThemeMeta) on all registered listeners.
protected  void fireWebpagesChanged()
          Invokes ThemeMetaListener.webpagesChanged(ThemeMeta) on all registered listeners.
 String[] getAuthors()
          Gets a list of strings, containing the names of the authors.
 String getDescription()
          Gets a human readable description of the theme.
 ThemeFactory getFactory()
          Gets the factory which created this ThemeMeta.
 String getName()
          Gets the name of the theme.
 URI[] getWebpages()
          Gets a set of links to any webpage the authors might want to show the user.
protected  boolean hasListeners()
          Tells whether at least one ThemeMetaListener is registered at this ThemeMeta.
 void removeListener(ThemeMetaListener listener)
          Removes a listener from this
 void setAuthors(String[] authors)
           
 void setFactory(ThemeFactory factory)
          Changes the result of ThemeMeta.getFactory() to factory.
 void setWebpages(URI[] webpages)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultThemeMeta

public DefaultThemeMeta(ThemeFactory factory,
                        DockController controller,
                        String nameId,
                        String descriptionId,
                        String[] authors,
                        URI[] webpages)
Creates new meta information.

Parameters:
factory - the source of this information
controller - the controller to be used
nameId - the unique identifier of the name, will be used for the TextManager
descriptionId - the unique identifier of the description, will be used for the TextManager
authors - all the people creating the theme
webpages - additional webpages users may visit
Method Detail

hasListeners

protected boolean hasListeners()
Tells whether at least one ThemeMetaListener is registered at this ThemeMeta.

Returns:
true if there is at least one listener

fireNameChanged

protected void fireNameChanged()
Invokes ThemeMetaListener.nameChanged(ThemeMeta) on all registered listeners.


fireDescriptionChanged

protected void fireDescriptionChanged()
Invokes ThemeMetaListener.descriptionChanged(ThemeMeta) on all registered listeners.


fireAuthorChanged

protected void fireAuthorChanged()
Invokes ThemeMetaListener.authorsChanged(ThemeMeta) on all registered listeners.


fireWebpagesChanged

protected void fireWebpagesChanged()
Invokes ThemeMetaListener.webpagesChanged(ThemeMeta) on all registered listeners.


getFactory

public ThemeFactory getFactory()
Description copied from interface: ThemeMeta
Gets the factory which created this ThemeMeta.

Specified by:
getFactory in interface ThemeMeta
Returns:
the source of this meta

setFactory

public void setFactory(ThemeFactory factory)
Description copied from interface: ThemeMeta
Changes the result of ThemeMeta.getFactory() to factory. This method is intended to be used by ThemeFactorys that wrap around other factories.

Specified by:
setFactory in interface ThemeMeta
Parameters:
factory - the new factory

addListener

public void addListener(ThemeMetaListener listener)
Description copied from interface: ThemeMeta
Adds a listener to this meta information, the listener will be informed if this meta information changes.

Specified by:
addListener in interface ThemeMeta
Parameters:
listener - the new listener

removeListener

public void removeListener(ThemeMetaListener listener)
Description copied from interface: ThemeMeta
Removes a listener from this

Specified by:
removeListener in interface ThemeMeta
Parameters:
listener - the listener to remove

setAuthors

public void setAuthors(String[] authors)

getAuthors

public String[] getAuthors()
Description copied from interface: ThemeMeta
Gets a list of strings, containing the names of the authors.

Specified by:
getAuthors in interface ThemeMeta
Returns:
the authors, might be null

getDescription

public String getDescription()
Description copied from interface: ThemeMeta
Gets a human readable description of the theme.

Specified by:
getDescription in interface ThemeMeta
Returns:
the description, might be null

getName

public String getName()
Description copied from interface: ThemeMeta
Gets the name of the theme.

Specified by:
getName in interface ThemeMeta
Returns:
the name, might be null

setWebpages

public void setWebpages(URI[] webpages)

getWebpages

public URI[] getWebpages()
Description copied from interface: ThemeMeta
Gets a set of links to any webpage the authors might want to show the user.

Specified by:
getWebpages in interface ThemeMeta
Returns:
the pages, might be null