Ignore:
Timestamp:
2011-03-09T16:01:54+01:00 (13 years ago)
Author:
bastiK
Message:

MapCSS: an identifier literal at the right side of a declaration is now parsed as Keyword and not as String. This means 'color: "blue";' does not work any longer, but you have to write 'color: blue;'. This is useful for future extensions.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java

    r3903 r3967  
    121121
    122122    }
    123    
     123
    124124    public static final NodeElemStyle SIMPLE_NODE_ELEMSTYLE;
    125125    static {
     
    171171        if (te != null) {
    172172            HorizontalTextAlignment hAlign = HorizontalTextAlignment.RIGHT;
    173             String hAlignStr = c.get("text-anchor-horizontal", null, String.class);
    174             if (equal(hAlignStr, "left")) {
     173            Keyword hAlignKW = c.get("text-anchor-horizontal", Keyword.RIGHT, Keyword.class);
     174            if (equal(hAlignKW.val, "left")) {
    175175                hAlign = HorizontalTextAlignment.LEFT;
    176             } else if (equal(hAlignStr, "center")) {
     176            } else if (equal(hAlignKW.val, "center")) {
    177177                hAlign = HorizontalTextAlignment.CENTER;
    178             } else if (equal(hAlignStr, "right")) {
     178            } else if (equal(hAlignKW.val, "right")) {
    179179                hAlign = HorizontalTextAlignment.RIGHT;
    180180            }
    181181            VerticalTextAlignment vAlign = VerticalTextAlignment.BOTTOM;
    182             String vAlignStr = c.get("text-anchor-vertical", null, String.class);
     182            String vAlignStr = c.get("text-anchor-vertical", Keyword.BOTTOM, Keyword.class).val;
    183183            if (equal(vAlignStr, "above")) {
    184184                vAlign = VerticalTextAlignment.ABOVE;
     
    203203
    204204        SymbolShape shape;
    205         String shapeStr = c.get("symbol-shape", null, String.class);
    206         if (equal(shapeStr, "square")) {
     205        Keyword shapeKW = c.get("symbol-shape", null, Keyword.class);
     206        if (shapeKW == null)
     207            return null;
     208        if (equal(shapeKW, "square")) {
    207209            shape = SymbolShape.SQUARE;
    208         } else if (equal(shapeStr, "circle")) {
     210        } else if (equal(shapeKW, "circle")) {
    209211            shape = SymbolShape.CIRCLE;
    210212        } else
Note: See TracChangeset for help on using the changeset viewer.