Class Selector.ChildOrParentSelector
- java.lang.Object
-
- org.openstreetmap.josm.gui.mappaint.mapcss.Selector.ChildOrParentSelector
-
- All Implemented Interfaces:
Selector
- Enclosing interface:
- Selector
public static class Selector.ChildOrParentSelector extends java.lang.Object implements 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 Classes Modifier and Type Class Description private static classSelector.ChildOrParentSelector.AbstractFinderprivate classSelector.ChildOrParentSelector.ContainsFinderFinds elements which are inside the right element, collects those inchildrenprivate classSelector.ChildOrParentSelector.CrossingFinderprivate classSelector.ChildOrParentSelector.InsideOrEqualFinderFinds elements which are inside the left element, or in other words, it finds elements enclosing e.osm.private classSelector.ChildOrParentSelector.MatchingReferrerFinderFinds the first referrer matchingleftprivate classSelector.ChildOrParentSelector.MultipolygonOpenEndFinder-
Nested classes/interfaces inherited from interface org.openstreetmap.josm.gui.mappaint.mapcss.Selector
Selector.AbstractSelector, Selector.ChildOrParentSelector, Selector.ChildOrParentSelectorType, Selector.GeneralSelector, Selector.LinkSelector
-
-
Field Summary
Fields Modifier and Type Field Description SelectorleftSelector.LinkSelectorlinkSelectorrightSelector.ChildOrParentSelectorTypetype-
Fields 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
Constructors Constructor Description ChildOrParentSelector(Selector a, Selector.LinkSelector link, Selector b, Selector.ChildOrParentSelectorType type)Constructs a newChildOrParentSelector.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetBase()java.util.List<Condition>getConditions()Returns the list of conditions.RangegetRange()Returns the scale range, an interval of the form "lower < x <= upper" where 0 <= lower < upper.SubpartgetSubpart()Returns the subpart, if supported.private static booleanisArea(IPrimitive p)booleanmatches(Environment e)Apply the selector to the primitive and check if it matches.java.lang.StringtoString()private voidvisitBBox(Environment e, Selector.ChildOrParentSelector.AbstractFinder finder)
-
-
-
Field Detail
-
link
public final Selector.LinkSelector link
-
type
public final Selector.ChildOrParentSelectorType type
-
-
Constructor Detail
-
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 Detail
-
getConditions
public java.util.List<Condition> getConditions()
Description copied from interface:SelectorReturns the list of conditions.- Specified by:
getConditionsin interfaceSelector- Returns:
- the list of conditions
-
visitBBox
private void visitBBox(Environment e, Selector.ChildOrParentSelector.AbstractFinder finder)
-
isArea
private static boolean isArea(IPrimitive p)
-
matches
public boolean matches(Environment e)
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
public Subpart 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
public Range getRange()
Description copied from interface:SelectorReturns the scale range, an interval of the form "lower < x <= upper" where 0 <= lower < upper.
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-