|
Multivalent API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectmultivalent.StyleSheet
Map structural name pattern into ContextListener to add to Context's list of active behaviors. This is the superclass for all StyleSheets. It implements a simple style sheet that just uses VObject name and VObject handle as selectors -- no class, id, context, no nested selectors, no textual form (everything set programmatically).
CSS
Field Summary | |
---|---|
protected StyleSheet |
cascade_
Link to lower priority style sheet. |
protected Context |
cx_
|
static boolean |
DEBUG
|
java.util.Map<java.lang.Object,ContextListener> |
key2cl_
|
protected java.lang.String |
name_
|
static int |
PRIORITY_BLOCK
|
static int |
PRIORITY_CLASS
|
static int |
PRIORITY_ELEMENT
|
static int |
PRIORITY_ID
|
static int |
PRIORITY_INLINE
|
protected static java.lang.Object |
TERMINAL
|
Constructor Summary | |
---|---|
StyleSheet()
|
Method Summary | |
---|---|
void |
activesAdd(java.util.List<ContextListener> actives,
VObject o,
Node parent)
Add all relevant ContextListeners to Context. |
void |
activesRemove(java.util.List<ContextListener> actives,
VObject o,
Node parent)
|
StyleSheet |
copy()
|
protected Context |
createContext()
Create new Context matched to this StyleSheet's ContextListeners. |
static int |
eatSpace(java.lang.String str,
int inx)
Arbitrary behaviors can be associated with styles. |
ContextListener |
get(java.lang.Object key)
Low level: hash on object itself. |
ContextListener |
get(java.lang.Object key,
Node context)
|
StyleSheet |
getCascade()
|
StyleSheet |
getCascade(java.lang.String name)
|
Context |
getContext()
|
Context |
getContext(java.awt.Graphics2D g,
Context enclosing)
Return Context matched to this StyleSheet's ContextListeners. |
java.lang.String |
getName()
|
void |
parse(java.lang.String csstxt,
java.net.URL base)
Parse internal style sheet. |
void |
parse(java.net.URL url)
Parse external style sheet. |
void |
put(java.lang.Object key,
ContextListener cl)
Low level: hash on object itself. |
void |
put(java.lang.String selector,
ContextListener cl)
More sophisticated style sheet implementation can parse selector. |
ContextListener |
remove(java.lang.Object key)
|
ContextListener |
remove(java.lang.String selector)
|
void |
setAttr(CLGeneral gs,
java.lang.String name,
java.lang.String value)
Parse attribute name-value pair into settings in CLGeneral. |
void |
setAttrs(CLGeneral gs,
java.lang.String pairs)
Parse attribute name-value pair into settings in CLGeneral. |
void |
setCascade(Document doc)
|
void |
setCascade(StyleSheet parent)
|
void |
setName(java.lang.String name)
LATER Cache last lookup, so faster if have add immediately followed by remove on same args. |
void |
setPriority(java.lang.String selector,
CLGeneral cl)
Compute priority of passed selector. |
int |
size()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean DEBUG
public static final int PRIORITY_INLINE
public static final int PRIORITY_BLOCK
public static final int PRIORITY_ID
public static final int PRIORITY_CLASS
public static final int PRIORITY_ELEMENT
protected static final java.lang.Object TERMINAL
protected Context cx_
protected java.lang.String name_
protected StyleSheet cascade_
public java.util.Map<java.lang.Object,ContextListener> key2cl_
Constructor Detail |
---|
public StyleSheet()
Method Detail |
---|
public void setName(java.lang.String name)
public java.lang.String getName()
public StyleSheet getCascade()
public StyleSheet getCascade(java.lang.String name)
public void setCascade(StyleSheet parent)
public void setCascade(Document doc)
public StyleSheet copy()
public int size()
public Context getContext(java.awt.Graphics2D g, Context enclosing)
public Context getContext()
protected Context createContext()
public void activesAdd(java.util.List<ContextListener> actives, VObject o, Node parent)
public void activesRemove(java.util.List<ContextListener> actives, VObject o, Node parent)
public void put(java.lang.Object key, ContextListener cl)
public void put(java.lang.String selector, ContextListener cl)
public ContextListener get(java.lang.Object key)
public ContextListener get(java.lang.Object key, Node context)
public ContextListener remove(java.lang.Object key)
public ContextListener remove(java.lang.String selector)
public void parse(java.net.URL url)
public void parse(java.lang.String csstxt, java.net.URL base)
public void setAttr(CLGeneral gs, java.lang.String name, java.lang.String value)
public void setAttrs(CLGeneral gs, java.lang.String pairs)
public void setPriority(java.lang.String selector, CLGeneral cl)
public static int eatSpace(java.lang.String str, int inx)
|
Multivalent API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |