public abstract class StyleSource extends SourceEntry
Modifier and Type | Field and Description |
---|---|
private static javax.swing.ImageIcon |
defaultIcon |
private java.util.List<java.lang.Throwable> |
errors |
java.lang.String |
icon
The following fields is additional information found in the header
of the source file.
|
private javax.swing.ImageIcon |
imageIcon |
java.io.File |
zipIcons |
active, isZip, name, title, url, zipEntryPath
Constructor and Description |
---|
StyleSource(SourceEntry entry) |
StyleSource(java.lang.String url,
java.lang.String name,
java.lang.String title) |
Modifier and Type | Method and Description |
---|---|
abstract void |
apply(MultiCascade mc,
OsmPrimitive osm,
double scale,
OsmPrimitive multipolyOuterWay,
boolean pretendWayIsClosed)
Apply style to osm primitive.
|
void |
closeSourceInputStream(java.io.InputStream is)
Closes the source input stream previously returned by
getSourceInputStream() and other linked resources, if applicable. |
java.awt.Color |
getBackgroundColorOverride() |
abstract CachedFile |
getCachedFile()
Returns a new
CachedFile to the local file containing style source (can be a text file or an archive). |
private static javax.swing.ImageIcon |
getDefaultIcon() |
java.util.Collection<java.lang.Throwable> |
getErrors() |
javax.swing.ImageIcon |
getIcon() |
protected javax.swing.ImageIcon |
getSourceIcon() |
abstract java.io.InputStream |
getSourceInputStream()
Returns a new
InputStream to the style source. |
java.lang.String |
getToolTipText() |
protected void |
init() |
abstract void |
loadStyleSource()
Loads the style source.
|
void |
logError(java.lang.Throwable e) |
equals, getDisplayString, getFileNamePart, getLocalSourceDir, getPrefName, getZipEntryDirName, hashCode, isLocal, toString
private java.util.List<java.lang.Throwable> errors
public java.io.File zipIcons
private javax.swing.ImageIcon imageIcon
public java.lang.String icon
private static javax.swing.ImageIcon defaultIcon
public StyleSource(java.lang.String url, java.lang.String name, java.lang.String title)
public StyleSource(SourceEntry entry)
public abstract void apply(MultiCascade mc, OsmPrimitive osm, double scale, OsmPrimitive multipolyOuterWay, boolean pretendWayIsClosed)
StyleSource
s add
their properties on after the other. At a later stage, concrete painting
primitives (lines, icons, text, ...) are derived from the MultiCascade.mc
- the current MultiCascade, empty for the first StyleSourceosm
- the primitivescale
- the map scalemultipolyOuterWay
- support for a very old multipolygon tagging style
where you add the tags both to the outer and the inner way.
However, independent inner way style is also possible.pretendWayIsClosed
- For styles that require the way to be closed,
we pretend it is. This is useful for generating area styles from the (segmented)
outer ways of a multipolygon.public abstract void loadStyleSource()
public abstract java.io.InputStream getSourceInputStream() throws java.io.IOException
InputStream
to the style source. When finished, closeSourceInputStream(InputStream)
must be called.InputStream
to the style source that must be closed by the callerjava.io.IOException
- if any I/O error occurs.closeSourceInputStream(InputStream)
public abstract CachedFile getCachedFile() throws java.io.IOException
CachedFile
to the local file containing style source (can be a text file or an archive).CachedFile
to the local file containing style sourcejava.io.IOException
- if any I/O error occurs.public void closeSourceInputStream(java.io.InputStream is)
getSourceInputStream()
and other linked resources, if applicable.is
- The source input stream that must be closedgetSourceInputStream()
public void logError(java.lang.Throwable e)
public java.util.Collection<java.lang.Throwable> getErrors()
protected void init()
private static javax.swing.ImageIcon getDefaultIcon()
protected javax.swing.ImageIcon getSourceIcon()
public final javax.swing.ImageIcon getIcon()
public java.lang.String getToolTipText()
public java.awt.Color getBackgroundColorOverride()