org.openstreetmap.josm.gui.mappaint.mapcss
Class MapCSSStyleSource

java.lang.Object
  extended by org.openstreetmap.josm.gui.preferences.SourceEntry
      extended by org.openstreetmap.josm.gui.mappaint.StyleSource
          extended by org.openstreetmap.josm.gui.mappaint.mapcss.MapCSSStyleSource

public class MapCSSStyleSource
extends StyleSource


Field Summary
private  java.awt.Color backgroundColorOverride
           
private  java.lang.String css
           
 java.util.List<MapCSSRule> rules
           
 
Fields inherited from class org.openstreetmap.josm.gui.mappaint.StyleSource
icon, zipIcons
 
Fields inherited from class org.openstreetmap.josm.gui.preferences.SourceEntry
active, name, title, url
 
Constructor Summary
MapCSSStyleSource(SourceEntry entry)
           
MapCSSStyleSource(java.lang.String css)
          Creates a new style source from the MapCSS styles supplied in css
MapCSSStyleSource(java.lang.String url, java.lang.String name, java.lang.String shortdescription)
           
 
Method Summary
 void apply(MultiCascade mc, OsmPrimitive osm, double scale, OsmPrimitive multipolyOuterWay, boolean pretendWayIsClosed)
           
private  Cascade constructSpecial(java.lang.String type)
           
 java.awt.Color getBackgroundColorOverride()
           
 java.io.InputStream getSourceInputStream()
           
private  void loadCanvas()
           
private  void loadMeta()
          load meta info from a selector "meta"
 void loadStyleSource()
           
 java.lang.String toString()
           
 
Methods inherited from class org.openstreetmap.josm.gui.mappaint.StyleSource
getErrors, getIcon, getLastMTime, getSourceIcon, getToolTipText, init, logError, setLastMTime
 
Methods inherited from class org.openstreetmap.josm.gui.preferences.SourceEntry
equals, getDisplayString, getFileNamePart, getLocalSourceDir, getPrefName, hashCode, isLocal
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

rules

public final java.util.List<MapCSSRule> rules

backgroundColorOverride

private java.awt.Color backgroundColorOverride

css

private java.lang.String css
Constructor Detail

MapCSSStyleSource

public MapCSSStyleSource(java.lang.String url,
                         java.lang.String name,
                         java.lang.String shortdescription)

MapCSSStyleSource

public MapCSSStyleSource(SourceEntry entry)

MapCSSStyleSource

public MapCSSStyleSource(java.lang.String css)
                  throws java.lang.IllegalArgumentException

Creates a new style source from the MapCSS styles supplied in css

Parameters:
css - the MapCSS style declaration. Must not be null.
Throws:
java.lang.IllegalArgumentException - thrown if css is null
Method Detail

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

loadMeta

private void loadMeta()
load meta info from a selector "meta"


loadCanvas

private void loadCanvas()

constructSpecial

private Cascade constructSpecial(java.lang.String type)

getBackgroundColorOverride

public java.awt.Color getBackgroundColorOverride()
Overrides:
getBackgroundColorOverride in class StyleSource

apply

public void apply(MultiCascade mc,
                  OsmPrimitive osm,
                  double scale,
                  OsmPrimitive multipolyOuterWay,
                  boolean pretendWayIsClosed)
Specified by:
apply in class StyleSource

toString

public java.lang.String toString()
Overrides:
toString in class SourceEntry


JOSM