Class Selector.ChildOrParentSelector
java.lang.Object
org.openstreetmap.josm.gui.mappaint.mapcss.Selector.ChildOrParentSelector
- All Implemented Interfaces:
Selector
- Enclosing interface:
- Selector
Represents a child selector or a parent selector.
In addition to the standard CSS notation for child selectors, JOSM also supports an "inverse" notation:
selector_a > selector_b { ... } // the standard notation (child selector)
relation[type=route] > way { ... } // example (all ways of a route)
selector_a < selector_b { ... } // the inverse notation (parent selector)
node[traffic_calming] < way { ... } // example (way that has a traffic calming node)
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprivate static classprivate classFinds elements which are inside the right element, collects those inchildrenprivate final classprivate classFinds elements which are inside the left element, or in other words, it finds elements enclosing e.osm.private classFinds the first referrer matchingleftprivate classNested classes/interfaces inherited from interface org.openstreetmap.josm.gui.mappaint.mapcss.Selector
Selector.AbstractSelector, Selector.ChildOrParentSelector, Selector.ChildOrParentSelectorType, Selector.GeneralSelector, Selector.LinkSelector -
Field Summary
FieldsFields inherited from interface org.openstreetmap.josm.gui.mappaint.mapcss.Selector
BASE_ANY, BASE_AREA, BASE_CANVAS, BASE_META, BASE_NODE, BASE_RELATION, BASE_SETTING, BASE_SETTINGS, BASE_WAY -
Constructor Summary
ConstructorsConstructorDescriptionChildOrParentSelector(Selector a, Selector.LinkSelector link, Selector b, Selector.ChildOrParentSelectorType type) Constructs a newChildOrParentSelector. -
Method Summary
Modifier and TypeMethodDescriptiongetBase()Returns the list of conditions.getRange()Returns the scale range, an interval of the form "lower < x <= upper" where 0 <= lower < upper.Returns the subpart, if supported.private static booleanisArea(IPrimitive p) booleanApply the selector to the primitive and check if it matches.toString()private void
-
Field Details
-
left
-
link
-
right
-
type
-
-
Constructor Details
-
ChildOrParentSelector
public ChildOrParentSelector(Selector a, Selector.LinkSelector link, Selector b, Selector.ChildOrParentSelectorType type) Constructs a newChildOrParentSelector.- Parameters:
a- the first selectorlink- linkb- the second selectortype- the selector type
-
-
Method Details
-
getBase
-
getConditions
Description copied from interface:SelectorReturns the list of conditions.- Specified by:
getConditionsin interfaceSelector- Returns:
- the list of conditions
-
visitBBox
-
isArea
-
matches
Description copied from interface:SelectorApply the selector to the primitive and check if it matches.- Specified by:
matchesin interfaceSelector- Parameters:
e- 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
-
getSubpart
Description copied from interface:SelectorReturns the subpart, if supported. A subpart identifies different rendering layers (::subpartsyntax).- Specified by:
getSubpartin interfaceSelector- Returns:
- the subpart, if supported
-
getRange
Description copied from interface:SelectorReturns the scale range, an interval of the form "lower < x <= upper" where 0 <= lower < upper. -
toString
-