public class StyleSheet.NameSpace extends Object
The name space defines a default rule for a kind of elements, a set of rules for this kind of elements with a given identifier, and a set or rules for this kind of elements with a given class.
Modifier and Type | Field and Description |
---|---|
HashMap<String,Rule> |
byClass
The set of rules for this kind of elements with a given class.
|
HashMap<String,Rule> |
byId
The set of rules for this kind of elements with a given identifier.
|
Rule |
defaultRule
The default rule for this kind of elements.
|
Selector.Type |
type
The kind of elements in this name space.
|
Constructor and Description |
---|
NameSpace(Selector.Type type) |
Modifier and Type | Method and Description |
---|---|
protected Rule |
addEventRule(Rule newRule) |
protected Rule |
addRule(Rule newRule)
Add a new rule.
|
protected void |
clear()
Remove all styles.
|
protected void |
getClassRules(Element element,
ArrayList<Rule> rules)
Search if the given element has classes attributes and fill the given
array with the set of rules that match these classes.
|
int |
getClassRulesCount()
Number of specific (class) rules.
|
Selector.Type |
getGraphElementType()
The kind of elements this name space applies rules to.
|
int |
getIdRulesCount()
Number of specific (id) rules.
|
protected ArrayList<Rule> |
getRulesFor(Element element)
Get the rules that match a given element.
|
String |
toString() |
String |
toString(int level) |
protected void |
toStringRules(int level,
StringBuilder builder,
HashMap<String,Rule> rules,
String title) |
public Selector.Type type
public Rule defaultRule
public HashMap<String,Rule> byId
public NameSpace(Selector.Type type)
public Selector.Type getGraphElementType()
public int getIdRulesCount()
public int getClassRulesCount()
protected ArrayList<Rule> getRulesFor(Element element)
protected void getClassRules(Element element, ArrayList<Rule> rules)
element
- The element for which classes must be found.rules
- The rule array to fill.protected void clear()
protected Rule addRule(Rule newRule)
Several cases can occur :
newRule
- The rule to add or copy.protected Rule addEventRule(Rule newRule)
protected void toStringRules(int level, StringBuilder builder, HashMap<String,Rule> rules, String title)
WebARTS Library Licensed Under the GNU - General Public License. Other Libraries licensed under their respective Open Source Licenses