Class Selector.GeneralSelector
- java.lang.Object
-
- org.openstreetmap.josm.gui.mappaint.mapcss.Selector.AbstractSelector
-
- org.openstreetmap.josm.gui.mappaint.mapcss.Selector.GeneralSelector
-
- All Implemented Interfaces:
Selector
- Enclosing interface:
- Selector
public static class Selector.GeneralSelector extends Selector.AbstractSelector
General selector. See wiki
-
-
Nested Class Summary
-
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 java.lang.StringbaseRangerangeSubpartsubpart-
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 GeneralSelector(java.lang.String base, Range range, java.util.List<Condition> conds, Subpart subpart)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private static java.lang.StringcheckBase(java.lang.String base)Set base and check if this is a known value.static RangefromLevel(int a, int b)java.lang.StringgetBase()RangegetRange()Returns the scale range, an interval of the form "lower < x <= upper" where 0 <= lower < upper.SubpartgetSubpart()Returns the subpart, if supported.static doublelevel2scale(int lvl)booleanmatches(Environment e)Determines if all conditions match the given environment.booleanmatchesBase(IPrimitive p)booleanmatchesBase(OsmPrimitiveType type)booleanmatchesBase(Environment e)booleanmatchesConditions(Environment e)static intscale2level(double scale)java.lang.StringtoString()-
Methods inherited from class org.openstreetmap.josm.gui.mappaint.mapcss.Selector.AbstractSelector
getConditions
-
-
-
-
Constructor Detail
-
GeneralSelector
public GeneralSelector(java.lang.String base, Range range, java.util.List<Condition> conds, Subpart subpart)
-
-
Method Detail
-
getSubpart
public Subpart getSubpart()
Description copied from interface:SelectorReturns the subpart, if supported. A subpart identifies different rendering layers (::subpartsyntax).- 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.- Returns:
- the scale range, if supported
-
matchesConditions
public boolean matchesConditions(Environment e)
-
matches
public boolean matches(Environment e)
Description copied from class:Selector.AbstractSelectorDetermines if all conditions match the given environment.- Specified by:
matchesin interfaceSelector- Overrides:
matchesin classSelector.AbstractSelector- Parameters:
e- The environment to check- Returns:
trueif all conditions apply, false otherwise.
-
checkBase
private static java.lang.String checkBase(java.lang.String base)
Set base and check if this is a known value.- Parameters:
base- value for base- Returns:
- the matching String constant for a known value
- Throws:
java.lang.IllegalArgumentException- if value is not knwon
-
getBase
public java.lang.String getBase()
-
matchesBase
public boolean matchesBase(OsmPrimitiveType type)
-
matchesBase
public boolean matchesBase(IPrimitive p)
-
matchesBase
public boolean matchesBase(Environment e)
-
level2scale
public static double level2scale(int lvl)
-
scale2level
public static int scale2level(double scale)
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-