|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object de.lmu.ifi.dbs.elki.visualization.css.CSSClassManager
public class CSSClassManager
Manager class to track CSS classes used in a particular SVG document.
Nested Class Summary | |
---|---|
class |
CSSClassManager.CSSNamingConflict
Class to signal a CSS naming conflict. |
Field Summary | |
---|---|
private HashMap<String,CSSClass> |
store
Store the contained CSS classes. |
Constructor Summary | |
---|---|
CSSClassManager()
|
Method Summary | |
---|---|
CSSClass |
addClass(CSSClass clss)
Add a single class to the map. |
boolean |
contains(String name)
Check if a name is already used in the classes. |
CSSClass |
getClass(String name)
Retrieve a single class by name only |
CSSClass |
getClass(String name,
Object owner)
Retrieve a single class by name and owner |
Collection<CSSClass> |
getClasses()
Get all CSS classes in this manager. |
Element |
makeStyleElement(Document document)
Make a (filled) CSS style element for the given document. |
boolean |
mergeCSSFrom(CSSClassManager other)
Merge CSS classes, for example to merge two plots. |
void |
removeClass(CSSClass clss)
Remove a single CSS class from the map. |
void |
serialize(StringBuffer buf)
Serialize managed CSS classes to rule file. |
boolean |
testMergeable(CSSClassManager other)
Check whether or not CSS classes of two plots can be merged |
void |
updateStyleElement(Document document,
Element style)
Update the text contents of an existing style element. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private HashMap<String,CSSClass> store
Constructor Detail |
---|
public CSSClassManager()
Method Detail |
---|
public CSSClass addClass(CSSClass clss) throws CSSClassManager.CSSNamingConflict
clss
- new CSS class
CSSClassManager.CSSNamingConflict
- when a class of the same name but different owner object exists.public void removeClass(CSSClass clss)
clss
- Class to removepublic CSSClass getClass(String name, Object owner) throws CSSClassManager.CSSNamingConflict
name
- Class nameowner
- Class owner
CSSClassManager.CSSNamingConflict
- if an owner was specified and doesn't matchpublic CSSClass getClass(String name)
name
- CSS class name
public boolean contains(String name)
name
- CSS class name
public void serialize(StringBuffer buf)
buf
- String bufferpublic Collection<CSSClass> getClasses()
public boolean testMergeable(CSSClassManager other)
other
- Other class
public boolean mergeCSSFrom(CSSClassManager other) throws CSSClassManager.CSSNamingConflict
other
- Other class to merge with
CSSClassManager.CSSNamingConflict
- If there is a naming conflict.public void updateStyleElement(Document document, Element style)
document
- Document element (factory)style
- Style elementpublic Element makeStyleElement(Document document)
document
- Document
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |