|
||||||||||
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.CSSClass
public class CSSClass
Class representing a single CSS class.
Nested Class Summary | |
---|---|
class |
CSSClass.InvalidCSS
Exception class thrown when encountering invalid CSS. |
Field Summary | |
---|---|
private String |
name
CSS class name |
private WeakReference<Object> |
owner
Owner. |
private Collection<Pair<String,String>> |
statements
Actual CSS statements |
Constructor Summary | |
---|---|
CSSClass(Object owner,
String name)
Simplified constructor, empty statements list. |
|
CSSClass(Object owner,
String name,
Collection<Pair<String,String>> statements)
Full constructor |
|
CSSClass(Object owner,
String name,
CSSClass other)
Cloning constructor |
Method Summary | |
---|---|
void |
appendCSSDefinition(StringBuffer buf)
Append CSS definition to a stream |
static boolean |
checkCSSStatement(String key,
String value)
Validate a single CSS statement. |
static boolean |
checkCSSStatements(Collection<Pair<String,String>> statements)
Validate a set of CSS statements. |
static boolean |
checkName(String name)
Verify that the name is an admissible CSS class name. |
String |
getName()
Get the class name. |
Object |
getOwner()
Get class owner. |
String |
getStatement(String key)
Get the current value of a particular CSS statement. |
Collection<Pair<String,String>> |
getStatements()
Get read-only collection access to all statements. |
String |
inlineCSS()
Render CSS class to inline formatting |
void |
removeStatement(String key)
Remove a CSS statement. |
static String |
sanitizeName(String name)
Return a sanitized version of the given string. |
void |
setName(String name)
Set the class name. |
void |
setStatement(String key,
double value)
Set a CSS statement. |
void |
setStatement(String key,
int value)
Set a CSS statement. |
void |
setStatement(String key,
String value)
Set a CSS statement. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private String name
private Collection<Pair<String,String>> statements
private WeakReference<Object> owner
Constructor Detail |
---|
public CSSClass(Object owner, String name, Collection<Pair<String,String>> statements)
owner
- Class owner (to detect conflicts)name
- Class namestatements
- Collection of CSS statementspublic CSSClass(Object owner, String name)
owner
- Class owner.name
- Class name.public CSSClass(Object owner, String name, CSSClass other)
owner
- Class owner.name
- Class name.other
- Class to cloneMethod Detail |
---|
public static boolean checkName(String name)
name
- name to use
public static String sanitizeName(String name)
name
- name to sanitize
public static boolean checkCSSStatement(String key, String value)
key
- Keyvalue
- Value
public static boolean checkCSSStatements(Collection<Pair<String,String>> statements)
statements
- Statements to check
public String getName()
public void setName(String name)
name
- new class name.public Object getOwner()
public String getStatement(String key)
key
- statement key.
public Collection<Pair<String,String>> getStatements()
public void setStatement(String key, String value)
key
- Statement key.value
- Value or null (to unset)public void setStatement(String key, int value)
key
- Statement key.value
- Valuepublic void setStatement(String key, double value)
key
- Statement key.value
- Valuepublic void removeStatement(String key)
key
- Statement key.public void appendCSSDefinition(StringBuffer buf)
buf
- String buffer to append to.public String inlineCSS()
|
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |