org.openstreetmap.josm.gui.mappaint
Class Environment

java.lang.Object
  extended by org.openstreetmap.josm.gui.mappaint.Environment

public class Environment
extends java.lang.Object


Field Summary
 OsmPrimitive child
          The same for parent selector.
private  Condition.Context context
           
 java.lang.Integer index
          index of node in parent way or member in parent relation.
 java.lang.String layer
           
 MultiCascade mc
           
 OsmPrimitive osm
           
 OsmPrimitive parent
          If not null, this is the matching parent object if an condition or an expression is evaluated in a Selector.LinkSelector (within a child selector)
 StyleSource source
           
 
Constructor Summary
Environment()
          Creates a new uninitialized environment
Environment(Environment other)
          Creates a clone of the environment other
Environment(OsmPrimitive osm, MultiCascade mc, java.lang.String layer, StyleSource source)
           
 
Method Summary
 void clearSelectorMatchingInformation()
           
 Condition.Context getContext()
          Replies the current context.
 java.lang.String getRole()
           
 boolean hasParentRelation()
           
 boolean isLinkContext()
           
 Environment withChild(OsmPrimitive child)
           
 Environment withContext(Condition.Context context)
           
 Environment withIndex(int index)
           
 Environment withLinkContext()
           
 Environment withParent(OsmPrimitive parent)
           
 Environment withPrimitive(OsmPrimitive osm)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

osm

public OsmPrimitive osm

mc

public MultiCascade mc

layer

public java.lang.String layer

source

public StyleSource source

context

private Condition.Context context

parent

public OsmPrimitive parent
If not null, this is the matching parent object if an condition or an expression is evaluated in a Selector.LinkSelector (within a child selector)


child

public OsmPrimitive child
The same for parent selector. Only one of the 2 fields (parent or child) is not null in any environment.


index

public java.lang.Integer index
index of node in parent way or member in parent relation. Must be != null in LINK context.

Constructor Detail

Environment

public Environment()
Creates a new uninitialized environment


Environment

public Environment(OsmPrimitive osm,
                   MultiCascade mc,
                   java.lang.String layer,
                   StyleSource source)

Environment

public Environment(Environment other)
            throws java.lang.IllegalArgumentException
Creates a clone of the environment other

Parameters:
other - the other environment. Must not be null.
Throws:
java.lang.IllegalArgumentException
Method Detail

withPrimitive

public Environment withPrimitive(OsmPrimitive osm)

withParent

public Environment withParent(OsmPrimitive parent)

withChild

public Environment withChild(OsmPrimitive child)

withIndex

public Environment withIndex(int index)

withContext

public Environment withContext(Condition.Context context)

withLinkContext

public Environment withLinkContext()

isLinkContext

public boolean isLinkContext()

hasParentRelation

public boolean hasParentRelation()

getContext

public Condition.Context getContext()
Replies the current context.

Returns:
the current context

getRole

public java.lang.String getRole()

clearSelectorMatchingInformation

public void clearSelectorMatchingInformation()


JOSM