public class MapCSSStyleSource extends StyleSource
Modifier and Type | Field and Description |
---|---|
private Color |
backgroundColorOverride |
private String |
css |
List<MapCSSRule> |
rules |
private ZipFile |
zipFile |
icon, zipIcons
active, isZip, name, title, url, zipEntryPath
Constructor and Description |
---|
MapCSSStyleSource(SourceEntry entry) |
MapCSSStyleSource(String css)
Creates a new style source from the MapCSS styles supplied in
css |
MapCSSStyleSource(String url,
String name,
String shortdescription) |
Modifier and Type | Method and Description |
---|---|
void |
apply(MultiCascade mc,
OsmPrimitive osm,
double scale,
OsmPrimitive multipolyOuterWay,
boolean pretendWayIsClosed) |
void |
closeSourceInputStream(InputStream is)
Closes the source input stream previously returned by
StyleSource.getSourceInputStream() and other linked resources, if applicable. |
private Cascade |
constructSpecial(String type) |
Color |
getBackgroundColorOverride() |
InputStream |
getSourceInputStream()
Returns a new
InputStream to the style source. |
private void |
loadCanvas() |
private void |
loadMeta()
load meta info from a selector "meta"
|
void |
loadStyleSource() |
String |
toString() |
getErrors, getIcon, getLastMTime, getSourceIcon, getToolTipText, init, logError, setLastMTime
equals, getDisplayString, getFileNamePart, getLocalSourceDir, getPrefName, getZipEntryDirName, hashCode, isLocal
public final List<MapCSSRule> rules
private Color backgroundColorOverride
public MapCSSStyleSource(String url, String name, String shortdescription)
public MapCSSStyleSource(SourceEntry entry)
public MapCSSStyleSource(String css) throws IllegalArgumentException
Creates a new style source from the MapCSS styles supplied in
css
css
- the MapCSS style declaration. Must not be null.IllegalArgumentException
- thrown if css
is nullpublic 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)
public void closeSourceInputStream(InputStream is)
StyleSource
StyleSource.getSourceInputStream()
and other linked resources, if applicable.closeSourceInputStream
in class StyleSource
is
- The source input stream that must be closedStyleSource.getSourceInputStream()
private void loadMeta()
private void loadCanvas()
private Cascade constructSpecial(String type)
public Color getBackgroundColorOverride()
getBackgroundColorOverride
in class StyleSource
public void apply(MultiCascade mc, OsmPrimitive osm, double scale, OsmPrimitive multipolyOuterWay, boolean pretendWayIsClosed)
apply
in class StyleSource
public String toString()
toString
in class SourceEntry