public class XmlStyleSource extends StyleSource implements StyleKeys
Modifier and Type | Class and Description |
---|---|
private static class |
XmlStyleSource.WayPrototypesRecord |
Modifier and Type | Field and Description |
---|---|
protected Map<String,AreaPrototype> |
areas |
protected List<AreaPrototype> |
areasList |
protected Map<String,IconPrototype> |
icons |
protected List<IconPrototype> |
iconsList |
protected Map<String,LinePrototype> |
lines |
protected List<LinePrototype> |
linesList |
protected Map<String,LinemodPrototype> |
modifiers |
protected List<LinemodPrototype> |
modifiersList |
icon, zipIcons
active, isZip, name, title, url, zipEntryPath
COLOR, DASHES, DASHES_BACKGROUND_COLOR, DASHES_BACKGROUND_OPACITY, DASHES_OFFSET, FILL_COLOR, FILL_IMAGE, FILL_OPACITY, ICON_HEIGHT_IDX, ICON_IMAGE, ICON_IMAGE_IDX, ICON_OPACITY_IDX, ICON_WIDTH_IDX, MODIFIER, OBJECT_Z_INDEX, OFFSET, OPACITY, REAL_WIDTH, REPEAT_IMAGE, REPEAT_IMAGE_ALIGN, REPEAT_IMAGE_OFFSET, REPEAT_IMAGE_PHASE, REPEAT_IMAGE_SPACING, TEXT, TEXT_POSITION, WIDTH, Z_INDEX
Constructor and Description |
---|
XmlStyleSource(SourceEntry entry) |
XmlStyleSource(String url,
String name,
String shortdescription) |
Modifier and Type | Method and Description |
---|---|
void |
add(XmlCondition c,
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,
Double scale,
MultiCascade mc) |
private IconPrototype |
getNode(OsmPrimitive primitive,
Double scale,
MultiCascade mc) |
InputStream |
getSourceInputStream()
Returns a new
InputStream to the style source. |
protected void |
init() |
void |
loadStyleSource() |
private boolean |
requiresUpdate(Prototype current,
Prototype candidate,
Double scale,
MultiCascade mc)
checks whether a certain match is better than the current match
|
private <T extends Prototype> |
update(T current,
T candidate,
Double scale,
MultiCascade mc) |
closeSourceInputStream, getBackgroundColorOverride, getErrors, getIcon, getLastMTime, getSourceIcon, getToolTipText, logError, setLastMTime
equals, getDisplayString, getFileNamePart, getLocalSourceDir, getPrefName, getZipEntryDirName, hashCode, isLocal, toString
protected final Map<String,IconPrototype> icons
protected final Map<String,LinePrototype> lines
protected final Map<String,LinemodPrototype> modifiers
protected final Map<String,AreaPrototype> areas
protected final List<IconPrototype> iconsList
protected final List<LinePrototype> linesList
protected final List<LinemodPrototype> modifiersList
protected final List<AreaPrototype> areasList
public XmlStyleSource(String url, String name, String shortdescription)
public XmlStyleSource(SourceEntry entry)
protected void init()
init
in class StyleSource
public void loadStyleSource()
loadStyleSource
in class StyleSource
public InputStream getSourceInputStream() throws IOException
StyleSource
InputStream
to the style source. When finished, StyleSource.closeSourceInputStream(InputStream)
must be called.getSourceInputStream
in class StyleSource
InputStream
to the style source that must be closed by the callerIOException
- if any I/O error occurs.StyleSource.closeSourceInputStream(InputStream)
private <T extends Prototype> T update(T current, T candidate, Double scale, MultiCascade mc)
private boolean requiresUpdate(Prototype current, Prototype candidate, Double scale, MultiCascade mc)
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 MultiCascadeprivate IconPrototype getNode(OsmPrimitive primitive, Double scale, MultiCascade mc)
private void get(OsmPrimitive primitive, boolean closed, XmlStyleSource.WayPrototypesRecord p, Double scale, MultiCascade mc)
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.public void add(XmlCondition c, Collection<XmlCondition> conditions, Prototype prot)
public void apply(MultiCascade mc, OsmPrimitive osm, double scale, OsmPrimitive multipolyOuterWay, boolean pretendWayIsClosed)
apply
in class StyleSource