org.openstreetmap.josm.gui.mappaint.xml
Class XmlStyleSource
java.lang.Object
org.openstreetmap.josm.gui.preferences.SourceEntry
org.openstreetmap.josm.gui.mappaint.StyleSource
org.openstreetmap.josm.gui.mappaint.xml.XmlStyleSource
- All Implemented Interfaces:
- StyleKeys
public class XmlStyleSource
- extends StyleSource
- implements StyleKeys
Fields inherited from interface org.openstreetmap.josm.gui.mappaint.StyleKeys |
COLOR, DASHES, DASHES_BACKGROUND_COLOR, DASHES_BACKGROUND_OPACITY, DASHES_OFFSET, FILL_COLOR, FILL_IMAGE, FILL_OPACITY, ICON_IMAGE, MODIFIER, OBJECT_Z_INDEX, OFFSET, OPACITY, REAL_WIDTH, TEXT, TEXT_POSITION, WIDTH, Z_INDEX |
Method Summary |
void |
add(XmlCondition c,
java.util.Collection<XmlCondition> conditions,
Prototype prot)
|
void |
apply(MultiCascade mc,
OsmPrimitive osm,
double scale,
OsmPrimitive multipolyOuterWay,
boolean pretendWayIsClosed)
|
private void |
get(OsmPrimitive primitive,
boolean closed,
XmlStyleSource.WayPrototypesRecord p,
java.lang.Double scale,
MultiCascade mc)
|
private IconPrototype |
getNode(OsmPrimitive primitive,
java.lang.Double scale,
MultiCascade mc)
|
java.io.InputStream |
getSourceInputStream()
|
protected void |
init()
|
void |
loadStyleSource()
|
private boolean |
requiresUpdate(Prototype current,
Prototype candidate,
java.lang.Double scale,
MultiCascade mc)
checks whether a certain match is better than the current match |
private
|
update(T current,
T candidate,
java.lang.Double scale,
MultiCascade mc)
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
icons
protected final java.util.HashMap<java.lang.String,IconPrototype> icons
lines
protected final java.util.HashMap<java.lang.String,LinePrototype> lines
modifiers
protected final java.util.HashMap<java.lang.String,LinemodPrototype> modifiers
areas
protected final java.util.HashMap<java.lang.String,AreaPrototype> areas
iconsList
protected final java.util.LinkedList<IconPrototype> iconsList
linesList
protected final java.util.LinkedList<LinePrototype> linesList
modifiersList
protected final java.util.LinkedList<LinemodPrototype> modifiersList
areasList
protected final java.util.LinkedList<AreaPrototype> areasList
XmlStyleSource
public XmlStyleSource(java.lang.String url,
java.lang.String name,
java.lang.String shortdescription)
XmlStyleSource
public XmlStyleSource(SourceEntry entry)
init
protected void init()
- Overrides:
init
in class StyleSource
loadStyleSource
public void loadStyleSource()
- Specified by:
loadStyleSource
in class StyleSource
getSourceInputStream
public java.io.InputStream getSourceInputStream()
throws java.io.IOException
- Specified by:
getSourceInputStream
in class StyleSource
- Throws:
java.io.IOException
update
private <T extends Prototype> T update(T current,
T candidate,
java.lang.Double scale,
MultiCascade mc)
requiresUpdate
private boolean requiresUpdate(Prototype current,
Prototype candidate,
java.lang.Double scale,
MultiCascade mc)
- checks whether a certain match is better than the current match
- Parameters:
current
- can be nullcandidate
- the new Prototype that could be used insteadscale
- ignored if null, otherwise checks if scale is within the range of candidatemc
- side effect: update the valid region for the current MultiCascade
getNode
private IconPrototype getNode(OsmPrimitive primitive,
java.lang.Double scale,
MultiCascade mc)
get
private void get(OsmPrimitive primitive,
boolean closed,
XmlStyleSource.WayPrototypesRecord p,
java.lang.Double scale,
MultiCascade mc)
- Parameters:
closed
- The primitive is a closed way or we pretend it is closed.
This is useful for multipolygon relations and outer ways of untagged
multipolygon relations.
add
public void add(XmlCondition c,
java.util.Collection<XmlCondition> conditions,
Prototype prot)
apply
public void apply(MultiCascade mc,
OsmPrimitive osm,
double scale,
OsmPrimitive multipolyOuterWay,
boolean pretendWayIsClosed)
- Specified by:
apply
in class StyleSource
JOSM