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.String
base
Range
range
Subpart
subpart
-
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.String
checkBase(java.lang.String base)
Set base and check if this is a known value.static Range
fromLevel(int a, int b)
java.lang.String
getBase()
Range
getRange()
Returns the scale range, an interval of the form "lower < x <= upper" where 0 <= lower < upper.Subpart
getSubpart()
Returns the subpart, if supported.static double
level2scale(int lvl)
boolean
matches(Environment e)
Determines if all conditions match the given environment.boolean
matchesBase(IPrimitive p)
boolean
matchesBase(OsmPrimitiveType type)
boolean
matchesBase(Environment e)
boolean
matchesConditions(Environment e)
static int
scale2level(double scale)
java.lang.String
toString()
-
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:Selector
Returns the subpart, if supported. A subpart identifies different rendering layers (::subpart
syntax).- Returns:
- the subpart, if supported
-
getRange
public Range getRange()
Description copied from interface:Selector
Returns 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.AbstractSelector
Determines if all conditions match the given environment.- Specified by:
matches
in interfaceSelector
- Overrides:
matches
in classSelector.AbstractSelector
- Parameters:
e
- The environment to check- Returns:
true
if 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:
toString
in classjava.lang.Object
-
-