Class MapCSSRule
java.lang.Object
org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSRule
- All Implemented Interfaces:
Comparable<MapCSSRule>
A MapCSS rule.
A MapCSS style is simply a list of MapCSS rules. Each rule has a selector
and a declaration. Whenever the selector matches the primitive, the
declaration block is executed for this primitive.
-
Field Summary
FieldsModifier and TypeFieldDescriptionfinal DeclarationThe instructions for this selectorThe selector. -
Constructor Summary
ConstructorsConstructorDescriptionMapCSSRule(List<Selector> selectors, Declaration declaration) Constructs a newMapCSSRule. -
Method Summary
Modifier and TypeMethodDescriptionintvoidexecute(Environment env) Executes the instructions against the environmentenvbooleanmatches(Environment env) Test whether the selector of this rule applies to the primitive.toString()
-
Field Details
-
selectors
The selector. If it matches, this rule should be applied -
declaration
The instructions for this selector
-
-
Constructor Details
-
MapCSSRule
Constructs a newMapCSSRule.- Parameters:
selectors- The selectorsdeclaration- The declaration
-
-
Method Details
-
matches
Test whether the selector of this rule applies to the primitive.- Parameters:
env- the Environment. env.mc and env.layer are read-only when matching a selector. env.source is not needed. This method will set the matchingReferrers field of env as a side effect! Make sure to clear it before invoking this method.- Returns:
- true, if the selector applies
- See Also:
-
execute
Executes the instructions against the environment
env- Parameters:
env- the environment- See Also:
-
compareTo
- Specified by:
compareToin interfaceComparable<MapCSSRule>
-
toString
-