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()
Loads the theme from 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.Externalizable
java.io.IOException
public void readExternal(java.io.ObjectInput in) throws java.io.IOException, java.lang.ClassNotFoundException
Externalizable.readExternal(java.io.ObjectInput)
implementation.readExternal
in interface java.io.Externalizable
java.io.IOException
java.lang.ClassNotFoundException
public void saveToXml(java.lang.String fileName) throws XmlException
fileName
- The name of the file to save to.XmlException
public java.lang.String saveToString() throws XmlException, java.io.UnsupportedEncodingException
XmlException
java.io.UnsupportedEncodingException
public void loadFromXml(java.lang.String fileName) throws XmlException, org.xml.sax.SAXException, java.io.IOException, javax.xml.transform.TransformerException
fileName
- The name of the file to load from.XmlException
org.xml.sax.SAXException
java.io.IOException
javax.xml.transform.TransformerException
public void loadFromString(java.lang.String xml) throws XmlException, org.xml.sax.SAXException, java.io.IOException, javax.xml.transform.TransformerException
xml
- The string to load from.XmlException
org.xml.sax.SAXException
java.io.IOException
javax.xml.transform.TransformerException
public 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.