public class Theme
extends java.lang.Object
implements java.io.Externalizable
Style objects for different diagram item types.| Constructor and Description |
|---|
Theme()
Initializes a new instance of the
Theme class. |
| Modifier and Type | Method and Description |
|---|---|
void |
addThemeListener(ThemeListener listener)
Registers
listener so that it will receive events when
the theme changes. |
void |
loadFromString(java.lang.String xml)
Loads the theme from an XML string.
|
void |
loadFromXml(java.lang.String fileName)
Loads the theme from an XML file.
|
void |
readExternal(java.io.ObjectInput in)
Externalizable.readExternal(java.io.ObjectInput) implementation. |
void |
registerStyle(java.lang.Class<?> type,
Style style)
Registers the specified Style object for the items of the specified type.
|
void |
removeThemeListener(ThemeListener listener)
Unregisters
listener so that it will no longer
receive theme events. |
java.lang.String |
saveToString()
Saves the theme into an XML string.
|
void |
saveToXml(java.lang.String fileName)
Saves the theme to an XML file.
|
void |
unregisterStyle(java.lang.Class<?> type)
Unregisters the Style object associated with the specified type.
|
void |
writeExternal(java.io.ObjectOutput out)
Externalizable.writeExternal(java.io.ObjectOutput) implementation. |
public Theme()
Theme class.public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
Externalizable.writeExternal(java.io.ObjectOutput) implementation.writeExternal in interface java.io.Externalizablejava.io.IOExceptionpublic void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
Externalizable.readExternal(java.io.ObjectInput) implementation.readExternal in interface java.io.Externalizablejava.io.IOExceptionjava.lang.ClassNotFoundExceptionpublic void saveToXml(java.lang.String fileName)
throws com.mindfusion.common.XmlException
fileName - The name of the file to save to.com.mindfusion.common.XmlExceptionpublic java.lang.String saveToString()
throws com.mindfusion.common.XmlException,
java.io.UnsupportedEncodingException
com.mindfusion.common.XmlExceptionjava.io.UnsupportedEncodingExceptionpublic void loadFromXml(java.lang.String fileName)
throws com.mindfusion.common.XmlException,
org.xml.sax.SAXException,
java.io.IOException,
javax.xml.transform.TransformerException
fileName - The name of the file to load from.com.mindfusion.common.XmlExceptionorg.xml.sax.SAXExceptionjava.io.IOExceptionjavax.xml.transform.TransformerExceptionpublic void loadFromString(java.lang.String xml)
throws com.mindfusion.common.XmlException,
org.xml.sax.SAXException,
java.io.IOException,
javax.xml.transform.TransformerException
xml - The string to load from.com.mindfusion.common.XmlExceptionorg.xml.sax.SAXExceptionjava.io.IOExceptionjavax.xml.transform.TransformerExceptionpublic void registerStyle(java.lang.Class<?> type,
Style style)
type - The runtime type to register.style - The style to associate with the specified type.
The previously associated style, if any, is discarded.public void unregisterStyle(java.lang.Class<?> type)
type - The runtime type to unregister.public void addThemeListener(ThemeListener listener)
listener so that it will receive events when
the theme changes.listener - An object implementing the ThemeListener interface.public void removeThemeListener(ThemeListener listener)
listener so that it will no longer
receive theme events.listener - An object implementing the ThemeListener interface.