Changeset 3888 in josm
- Timestamp:
- 2011-02-11T13:21:33+01:00 (13 years ago)
- Location:
- trunk/src/org/openstreetmap/josm
- Files:
-
- 9 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/visitor/paint/MapPainter.java
r3880 r3888 56 56 57 57 private final Color inactiveColor; 58 private final Color textColor;59 58 private final Color selectedColor; 60 59 private final Color relationSelectedColor; 61 private final Color areaTextColor;62 60 private final Color nodeColor; 63 61 private final Color backgroundColor; … … 90 88 91 89 this.inactiveColor = PaintColors.INACTIVE.get(); 92 this.textColor = PaintColors.TEXT.get();93 90 this.selectedColor = PaintColors.SELECTED.get(); 94 91 this.relationSelectedColor = PaintColors.RELATIONSELECTED.get(); 95 this.areaTextColor = PaintColors.AREA_TEXT.get();96 92 this.nodeColor = PaintColors.NODE.get(); 97 93 this.backgroundColor = PaintColors.BACKGROUND.get(); … … 493 489 polygon.contains(centeredNBounds) // slow but nice 494 490 ) { 495 g.setColor( areaTextColor);491 g.setColor(text.color); 496 492 Font defaultFont = g.getFont(); 497 g.setFont ( orderFont);493 g.setFont (text.font); 498 494 g.drawString (name, 499 495 (int)(centeredNBounds.getMinX() - nb.getMinX()), -
trunk/src/org/openstreetmap/josm/gui/mappaint/AreaElemStyle.java
r3880 r3888 13 13 import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintSettings; 14 14 import org.openstreetmap.josm.data.osm.visitor.paint.MapPainter; 15 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors; 15 16 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.IconReference; 16 17 import org.openstreetmap.josm.tools.CheckParameterUtil; … … 79 80 String textPos = c.get("text-position", null, String.class); 80 81 if (textPos == null || Utils.equal(textPos, "center")) { 81 text = TextElement.create(c );82 text = TextElement.create(c, PaintColors.AREA_TEXT.get()); 82 83 } 83 84 -
trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyle.java
r3880 r3888 47 47 RelativeFloat width_rel = c.get(key, null, RelativeFloat.class, true); 48 48 if (width_rel != null) 49 return relativeTo + width_rel.val;49 return relativeTo + 2*width_rel.val; 50 50 } 51 51 } -
trunk/src/org/openstreetmap/josm/gui/mappaint/LineElemStyle.java
r3880 r3888 53 53 LineElemStyle casing = createImpl(env, true); 54 54 if (casing != null) { 55 casing.object_z_index = -1; 55 casing.z_index = -100; 56 casing.isModifier = true; 56 57 } 57 58 return casing; … … 179 180 String textPos = c.get("text-position", null, String.class); 180 181 if (textPos == null || equal(textPos, "line")) { 181 text = TextElement.create(c );182 text = TextElement.create(c, PaintColors.TEXT.get()); 182 183 } 183 184 } … … 192 193 the way is tagged with a direction key 193 194 (even if the tag is negated as in oneway=false) or the way is selected */ 194 boolean showDirection = selected || ((!paintSettings.isUseRealWidth()) && (paintSettings.isShowDirectionArrow()195 && (!paintSettings.isShowRelevantDirectionsOnly() || w.hasDirectionKeys()))) ;195 boolean showDirection = !isModifier && (selected || ((!paintSettings.isUseRealWidth()) && (paintSettings.isShowDirectionArrow() 196 && (!paintSettings.isShowRelevantDirectionsOnly() || w.hasDirectionKeys())))); 196 197 boolean reversedDirection = w.reversedDirection(); 197 198 /* head only takes over control if the option is true, -
trunk/src/org/openstreetmap/josm/gui/mappaint/NodeElemStyle.java
r3880 r3888 18 18 import org.openstreetmap.josm.data.osm.visitor.paint.MapPaintSettings; 19 19 import org.openstreetmap.josm.data.osm.visitor.paint.MapPainter; 20 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors; 20 21 import org.openstreetmap.josm.gui.mappaint.MapPaintStyles.IconReference; 21 22 import org.openstreetmap.josm.tools.CheckParameterUtil; … … 161 162 162 163 NodeTextElement text = null; 163 TextElement te = TextElement.create(c );164 TextElement te = TextElement.create(c, PaintColors.TEXT.get()); 164 165 if (te != null) { 165 166 HorizontalTextAlignment hAlign = HorizontalTextAlignment.RIGHT; -
trunk/src/org/openstreetmap/josm/gui/mappaint/TextElement.java
r3882 r3888 7 7 import java.awt.Font; 8 8 9 import org.openstreetmap.josm.data.osm.visitor.paint.PaintColors;10 9 import org.openstreetmap.josm.tools.CheckParameterUtil; 11 10 … … 27 26 } 28 27 29 public static TextElement create(Cascade c ) {28 public static TextElement create(Cascade c, Color defTextColor) { 30 29 String textStr = c.get("text", null, String.class); 31 30 if (textStr == null) … … 53 52 yOffset = c.get("text-offset-y", yOffset, Float.class); 54 53 55 Color color = c.get("text-color", PaintColors.TEXT.get(), Color.class);54 Color color = c.get("text-color", defTextColor, Color.class); 56 55 57 return new TextElement(textKey, font, (int) xOffset, (int) yOffset, color);56 return new TextElement(textKey, font, (int) xOffset, - (int) yOffset, color); 58 57 } 59 58 -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java
r3876 r3888 43 43 public boolean applies(Environment env) { 44 44 String val = env.osm.get(k); 45 if (val == null )45 if (val == null && op != Op.NEQ) 46 46 return false; 47 47 switch (op) { … … 127 127 @Override 128 128 public boolean applies(Environment e) { 129 return not ^ appliesImpl(e); 130 } 131 132 public boolean appliesImpl(Environment e) { 129 133 if (equal(id, "closed")) { 130 134 if (e.osm instanceof Way && ((Way) e.osm).isClosed()) -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/parser/MapCSSParser.java
r3876 r3888 283 283 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 284 284 case LSQUARE: 285 case EXCLAMATION: 285 286 case COLON: 286 287 ; … … 294 295 c = condition(); 295 296 break; 297 case EXCLAMATION: 296 298 case COLON: 297 299 c = pseudoclass(); … … 516 518 Token t; 517 519 boolean not = false; 518 jj_consume_token(COLON);519 520 switch ((jj_ntk==-1)?jj_ntk():jj_ntk) { 520 521 case EXCLAMATION: … … 526 527 ; 527 528 } 529 jj_consume_token(COLON); 528 530 t = jj_consume_token(IDENT); 529 531 {if (true) return new Condition.PseudoClassCondition(t.image, not);} … … 1026 1028 } 1027 1029 1028 private boolean jj_3R_29() {1029 if (jj_3R_45()) return true;1030 return false;1031 }1032 1033 1030 private boolean jj_3R_17() { 1034 1031 if (jj_scan_token(IDENT)) return true; … … 1043 1040 } 1044 1041 1042 private boolean jj_3R_29() { 1043 if (jj_3R_45()) return true; 1044 return false; 1045 } 1046 1045 1047 private boolean jj_3R_24() { 1046 1048 Token xsp; … … 1117 1119 } 1118 1120 1119 private boolean jj_3R_39() {1120 if (jj_scan_token(LESS)) return true;1121 return false;1122 }1123 1124 1121 private boolean jj_3R_62() { 1125 1122 if (jj_scan_token(PIPE)) return true; … … 1131 1128 } 1132 1129 1133 private boolean jj_3R_3 8() {1134 if (jj_scan_token(LESS _EQUAL)) return true;1130 private boolean jj_3R_39() { 1131 if (jj_scan_token(LESS)) return true; 1135 1132 return false; 1136 1133 } … … 1145 1142 } 1146 1143 1144 private boolean jj_3R_38() { 1145 if (jj_scan_token(LESS_EQUAL)) return true; 1146 return false; 1147 } 1148 1149 private boolean jj_3R_60() { 1150 if (jj_scan_token(LESS)) return true; 1151 if (jj_3R_15()) return true; 1152 if (jj_3R_43()) return true; 1153 if (jj_3R_15()) return true; 1154 return false; 1155 } 1156 1147 1157 private boolean jj_3R_37() { 1148 1158 if (jj_scan_token(GREATER)) return true; … … 1155 1165 } 1156 1166 1157 private boolean jj_3R_60() { 1158 if (jj_scan_token(LESS)) return true; 1167 private boolean jj_3R_59() { 1168 if (jj_scan_token(EQUAL)) return true; 1169 Token xsp; 1170 xsp = jj_scanpos; 1171 if (jj_scan_token(22)) jj_scanpos = xsp; 1159 1172 if (jj_3R_15()) return true; 1160 1173 if (jj_3R_43()) return true; … … 1165 1178 private boolean jj_3R_36() { 1166 1179 if (jj_scan_token(GREATER_EQUAL)) return true; 1167 return false;1168 }1169 1170 private boolean jj_3R_59() {1171 if (jj_scan_token(EQUAL)) return true;1172 Token xsp;1173 xsp = jj_scanpos;1174 if (jj_scan_token(22)) jj_scanpos = xsp;1175 if (jj_3R_15()) return true;1176 if (jj_3R_43()) return true;1177 if (jj_3R_15()) return true;1178 1180 return false; 1179 1181 } … … 1202 1204 } 1203 1205 1206 private boolean jj_3R_69() { 1207 if (jj_scan_token(SLASH)) return true; 1208 if (jj_3R_15()) return true; 1209 if (jj_3R_43()) return true; 1210 if (jj_3R_15()) return true; 1211 return false; 1212 } 1213 1214 private boolean jj_3R_56() { 1215 if (jj_scan_token(GREATER_EQUAL)) return true; 1216 if (jj_3R_15()) return true; 1217 if (jj_3R_43()) return true; 1218 if (jj_3R_15()) return true; 1219 return false; 1220 } 1221 1204 1222 private boolean jj_3R_47() { 1205 1223 if (jj_3R_19()) return true; 1206 return false;1207 }1208 1209 private boolean jj_3R_69() {1210 if (jj_scan_token(SLASH)) return true;1211 if (jj_3R_15()) return true;1212 if (jj_3R_43()) return true;1213 if (jj_3R_15()) return true;1214 return false;1215 }1216 1217 private boolean jj_3R_56() {1218 if (jj_scan_token(GREATER_EQUAL)) return true;1219 if (jj_3R_15()) return true;1220 if (jj_3R_43()) return true;1221 if (jj_3R_15()) return true;1222 1224 return false; 1223 1225 } … … 1425 1427 } 1426 1428 1429 private boolean jj_3R_27() { 1430 if (jj_3R_43()) return true; 1431 if (jj_3R_15()) return true; 1432 Token xsp; 1433 xsp = jj_scanpos; 1434 if (jj_3R_44()) jj_scanpos = xsp; 1435 return false; 1436 } 1437 1427 1438 private boolean jj_3R_20() { 1428 1439 Token xsp; … … 1447 1458 } 1448 1459 1449 private boolean jj_3R_27() {1450 if (jj_3R_43()) return true;1451 if (jj_3R_15()) return true;1452 Token xsp;1453 xsp = jj_scanpos;1454 if (jj_3R_44()) jj_scanpos = xsp;1455 return false;1456 }1457 1458 1460 private boolean jj_3R_26() { 1459 1461 if (jj_scan_token(MINUS)) return true; … … 1482 1484 } 1483 1485 1486 private boolean jj_3R_16() { 1487 Token xsp; 1488 xsp = jj_scanpos; 1489 if (jj_3R_25()) { 1490 jj_scanpos = xsp; 1491 if (jj_3R_26()) { 1492 jj_scanpos = xsp; 1493 if (jj_3R_27()) return true; 1494 } 1495 } 1496 return false; 1497 } 1498 1499 private boolean jj_3_4() { 1500 if (jj_3R_16()) return true; 1501 Token xsp; 1502 xsp = jj_scanpos; 1503 if (jj_scan_token(27)) { 1504 jj_scanpos = xsp; 1505 if (jj_scan_token(13)) return true; 1506 } 1507 return false; 1508 } 1509 1484 1510 private boolean jj_3R_13() { 1485 1511 if (jj_3R_19()) return true; … … 1489 1515 jj_scanpos = xsp; 1490 1516 if (jj_3R_21()) return true; 1491 }1492 return false;1493 }1494 1495 private boolean jj_3R_16() {1496 Token xsp;1497 xsp = jj_scanpos;1498 if (jj_3R_25()) {1499 jj_scanpos = xsp;1500 if (jj_3R_26()) {1501 jj_scanpos = xsp;1502 if (jj_3R_27()) return true;1503 }1504 }1505 return false;1506 }1507 1508 private boolean jj_3_4() {1509 if (jj_3R_16()) return true;1510 Token xsp;1511 xsp = jj_scanpos;1512 if (jj_scan_token(27)) {1513 jj_scanpos = xsp;1514 if (jj_scan_token(13)) return true;1515 1517 } 1516 1518 return false; … … 1604 1606 } 1605 1607 1608 private boolean jj_3R_70() { 1609 if (jj_3R_16()) return true; 1610 Token xsp; 1611 while (true) { 1612 xsp = jj_scanpos; 1613 if (jj_3R_75()) { jj_scanpos = xsp; break; } 1614 } 1615 return false; 1616 } 1617 1606 1618 private boolean jj_3_2() { 1607 1619 if (jj_3R_13()) return true; 1608 1620 if (jj_scan_token(RSQUARE)) return true; 1609 return false;1610 }1611 1612 private boolean jj_3R_70() {1613 if (jj_3R_16()) return true;1614 Token xsp;1615 while (true) {1616 xsp = jj_scanpos;1617 if (jj_3R_75()) { jj_scanpos = xsp; break; }1618 }1619 1621 return false; 1620 1622 } … … 1651 1653 } 1652 1654 private static void jj_la1_init_0() { 1653 jj_la1_0 = new int[] {0xc,0xc,0x12,0x200,0x200,0x200,0x10000000,0x402,0x10000000,0x402,0x40000000,0x2 004000,0x2004000,0x4000000,0x4,0x0,0x4,0x8081011e,0x800000,0x1000012,0x1c00400,0x3c0000,0x1fc0400,0x800000,0x402,0x2,0x8002000,0x8002000,0x80000000,0x400,0x0,0x800,0x400000,0xa07c0c00,0xa07c0c00,0x8081011e,0x8001011e,0x10000000,0x8081011e,0x8000011e,};1655 jj_la1_0 = new int[] {0xc,0xc,0x12,0x200,0x200,0x200,0x10000000,0x402,0x10000000,0x402,0x40000000,0x2804000,0x2804000,0x4000000,0x4,0x0,0x4,0x8081011e,0x800000,0x1000012,0x1c00400,0x3c0000,0x1fc0400,0x800000,0x402,0x2,0x8002000,0x8002000,0x80000000,0x400,0x0,0x800,0x400000,0xa07c0c00,0xa07c0c00,0x8081011e,0x8001011e,0x10000000,0x8081011e,0x8000011e,}; 1654 1656 } 1655 1657 private static void jj_la1_init_1() { -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/parser/MapCSSParser.jj
r3876 r3888 349 349 } 350 350 { 351 ( <EXCLAMATION> { not = true; } )? 351 352 <COLON> 352 ( <EXCLAMATION> { not = true; } )?t=<IDENT>353 t=<IDENT> 353 354 { return new Condition.PseudoClassCondition(t.image, not); } 354 355 }
Note:
See TracChangeset
for help on using the changeset viewer.