public abstract class StyleSource extends SourceEntry
Modifier and Type | Field and Description |
---|---|
private static ImageProvider |
defaultIconProvider
image provider returning the default icon
|
private List<Throwable> |
errors |
String |
icon
The following fields is additional information found in the header
of the source file.
|
private ImageProvider |
imageIconProvider
image provider returning the icon for this style
|
List<StyleSetting> |
settings
List of settings for user customization.
|
Map<String,Object> |
settingValues
Values of the settings for efficient lookup.
|
File |
zipIcons |
active, isZip, name, title, url, zipEntryPath
Constructor and Description |
---|
StyleSource(SourceEntry entry) |
StyleSource(String url,
String name,
String title) |
Modifier and Type | Method and Description |
---|---|
abstract void |
apply(MultiCascade mc,
OsmPrimitive osm,
double scale,
boolean pretendWayIsClosed)
Apply style to osm primitive.
|
void |
closeSourceInputStream(InputStream is)
Closes the source input stream previously returned by
getSourceInputStream() and other linked resources, if applicable. |
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 ImageProvider |
getDefaultIconProvider()
Image provider for default icon.
|
Collection<Throwable> |
getErrors() |
ImageIcon |
getIcon()
Image for source icon.
|
ImageProvider |
getIconProvider()
Image provider for source icon.
|
protected ImageProvider |
getSourceIconProvider()
Image provider for source icon.
|
abstract InputStream |
getSourceInputStream()
Returns a new
InputStream to the style source. |
String |
getToolTipText()
Return text to display as ToolTip.
|
protected void |
init()
Initialize the class.
|
abstract void |
loadStyleSource()
Loads the style source.
|
void |
logError(Throwable e) |
equals, getDisplayString, getFileNamePart, getLocalSourceDir, getPrefName, getZipEntryDirName, hashCode, isLocal, toString
private ImageProvider imageIconProvider
private static ImageProvider defaultIconProvider
public String icon
public final List<StyleSetting> settings
public Map<String,Object> settingValues
public StyleSource(String url, String name, String title)
public StyleSource(SourceEntry entry)
public abstract void apply(MultiCascade mc, OsmPrimitive osm, double scale, 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 scalepretendWayIsClosed
- 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 InputStream getSourceInputStream() throws IOException
InputStream
to the style source. When finished, closeSourceInputStream(InputStream)
must be called.InputStream
to the style source that must be closed by the callerIOException
- if any I/O error occurs.closeSourceInputStream(InputStream)
public abstract CachedFile getCachedFile() throws IOException
CachedFile
to the local file containing style source (can be a text file or an archive).CachedFile
to the local file containing style sourceIOException
- if any I/O error occurs.public void closeSourceInputStream(InputStream is)
getSourceInputStream()
and other linked resources, if applicable.is
- The source input stream that must be closedgetSourceInputStream()
public Collection<Throwable> getErrors()
protected void init()
private static ImageProvider getDefaultIconProvider()
getIconProvider()
protected ImageProvider getSourceIconProvider()
getIconProvider()
public final ImageProvider getIconProvider()
public String getToolTipText()
public Color getBackgroundColorOverride()