Changeset 9983 in josm for trunk/src/org/openstreetmap/josm/gui/mappaint
- Timestamp:
- 2016-03-13T21:36:47+01:00 (8 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/gui/mappaint
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/mappaint/Cascade.java
r9341 r9983 19 19 */ 20 20 public final class Cascade implements Cloneable { 21 22 public static final Cascade EMPTY_CASCADE = new Cascade();23 21 24 22 private Map<String, Object> prop = new HashMap<>(); -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java
r9540 r9983 523 523 * @return {@code true} if the way is closed or the relation is a closed multipolygon 524 524 */ 525 static boolean closed(Environment e) { 525 static boolean closed(Environment e) { // NO_UCD (unused code) 526 526 if (e.osm instanceof Way && ((Way) e.osm).isClosed()) 527 527 return true; … … 537 537 * @see OsmPrimitive#isModified() 538 538 */ 539 static boolean modified(Environment e) { 539 static boolean modified(Environment e) { // NO_UCD (unused code) 540 540 return e.osm.isModified() || e.osm.isNewOrUndeleted(); 541 541 } … … 547 547 * @see OsmPrimitive#isNew() 548 548 */ 549 static boolean _new(Environment e) { 549 static boolean _new(Environment e) { // NO_UCD (unused code) 550 550 return e.osm.isNew(); 551 551 } … … 557 557 * @see Node#isConnectionNode() 558 558 */ 559 static boolean connection(Environment e) { 559 static boolean connection(Environment e) { // NO_UCD (unused code) 560 560 return e.osm instanceof Node && e.osm.getDataSet() != null && ((Node) e.osm).isConnectionNode(); 561 561 } … … 567 567 * @see OsmPrimitive#isTagged() 568 568 */ 569 static boolean tagged(Environment e) { 569 static boolean tagged(Environment e) { // NO_UCD (unused code) 570 570 return e.osm.isTagged(); 571 571 } … … 577 577 * @see OsmPrimitive#hasSameInterestingTags(OsmPrimitive) 578 578 */ 579 static boolean sameTags(Environment e) { 579 static boolean sameTags(Environment e) { // NO_UCD (unused code) 580 580 return e.osm.hasSameInterestingTags(Utils.firstNonNull(e.child, e.parent)); 581 581 } … … 587 587 * @see ElemStyles#hasAreaElemStyle(OsmPrimitive, boolean) 588 588 */ 589 static boolean areaStyle(Environment e) { 589 static boolean areaStyle(Environment e) { // NO_UCD (unused code) 590 590 // only for validator 591 591 return ElemStyles.hasAreaElemStyle(e.osm, false); … … 597 597 * @return {@code true} if the object is a unconnected node 598 598 */ 599 static boolean unconnected(Environment e) { 599 static boolean unconnected(Environment e) { // NO_UCD (unused code) 600 600 return e.osm instanceof Node && OsmPrimitive.getFilteredList(e.osm.getReferrers(), Way.class).isEmpty(); 601 601 } … … 607 607 * @see ExpressionFactory.Functions#is_right_hand_traffic(Environment) 608 608 */ 609 static boolean righthandtraffic(Environment e) { 609 static boolean righthandtraffic(Environment e) { // NO_UCD (unused code) 610 610 return ExpressionFactory.Functions.is_right_hand_traffic(e); 611 611 } … … 618 618 * @see ExpressionFactory.Functions#is_clockwise(Environment) 619 619 */ 620 static boolean clockwise(Environment e) { 620 static boolean clockwise(Environment e) { // NO_UCD (unused code) 621 621 return ExpressionFactory.Functions.is_clockwise(e); 622 622 } … … 629 629 * @see ExpressionFactory.Functions#is_anticlockwise(Environment) 630 630 */ 631 static boolean anticlockwise(Environment e) { 631 static boolean anticlockwise(Environment e) { // NO_UCD (unused code) 632 632 return ExpressionFactory.Functions.is_anticlockwise(e); 633 633 } … … 638 638 * @return {@code true} if the object is an unclosed multipolygon 639 639 */ 640 static boolean unclosed_multipolygon(Environment e) { 640 static boolean unclosed_multipolygon(Environment e) { // NO_UCD (unused code) 641 641 return e.osm instanceof Relation && ((Relation) e.osm).isMultipolygon() && 642 642 !e.osm.isIncomplete() && !((Relation) e.osm).hasIncompleteMembers() && … … 652 652 * @see InDataSourceArea 653 653 */ 654 static boolean inDownloadedArea(Environment e) { 654 static boolean inDownloadedArea(Environment e) { // NO_UCD (unused code) 655 655 return IN_DOWNLOADED_AREA.evaluate(e.osm); 656 656 } 657 657 658 static boolean completely_downloaded(Environment e) { 658 static boolean completely_downloaded(Environment e) { // NO_UCD (unused code) 659 659 if (e.osm instanceof Relation) { 660 660 return !((Relation) e.osm).hasIncompleteMembers(); … … 664 664 } 665 665 666 static boolean closed2(Environment e) { 666 static boolean closed2(Environment e) { // NO_UCD (unused code) 667 667 if (e.osm instanceof Way && ((Way) e.osm).isClosed()) 668 668 return true; … … 672 672 } 673 673 674 static boolean selected(Environment e) { 674 static boolean selected(Environment e) { // NO_UCD (unused code) 675 675 Cascade c = e.mc.getCascade(e.layer); 676 676 c.setDefaultSelectedHandling(false); -
trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java
r9952 r9983 122 122 * @return {@code o} unchanged 123 123 */ 124 public static Object eval(Object o) { 124 public static Object eval(Object o) { // NO_UCD (unused code) 125 125 return o; 126 126 } … … 131 131 * @return Sum of arguments 132 132 */ 133 public static float plus(float... args) { 133 public static float plus(float... args) { // NO_UCD (unused code) 134 134 float res = 0; 135 135 for (float f : args) { … … 144 144 * @return Substraction of arguments 145 145 */ 146 public static Float minus(float... args) { 146 public static Float minus(float... args) { // NO_UCD (unused code) 147 147 if (args.length == 0) { 148 148 return 0.0F; … … 163 163 * @return Multiplication of arguments 164 164 */ 165 public static float times(float... args) { 165 public static float times(float... args) { // NO_UCD (unused code) 166 166 float res = 1; 167 167 for (float f : args) { … … 176 176 * @return Division of arguments 177 177 */ 178 public static Float divided_by(float... args) { 178 public static Float divided_by(float... args) { // NO_UCD (unused code) 179 179 if (args.length == 0) { 180 180 return 1.0F; … … 196 196 * @see Arrays#asList(Object[]) 197 197 */ 198 public static List<Object> list(Object... args) { 198 public static List<Object> list(Object... args) { // NO_UCD (unused code) 199 199 return Arrays.asList(args); 200 200 } … … 205 205 * @return length of the list 206 206 */ 207 public static Integer count(List<?> lst) { 207 public static Integer count(List<?> lst) { // NO_UCD (unused code) 208 208 return lst.size(); 209 209 } … … 217 217 */ 218 218 @NullableArguments 219 public static Object any(Object... args) { 219 public static Object any(Object... args) { // NO_UCD (unused code) 220 220 return Utils.firstNonNull(args); 221 221 } … … 228 228 * @since 5699 229 229 */ 230 public static Object get(List<?> lst, float n) { 230 public static Object get(List<?> lst, float n) { // NO_UCD (unused code) 231 231 int idx = Math.round(n); 232 232 if (idx >= 0 && idx < lst.size()) { … … 244 244 * @since 5699 245 245 */ 246 public static List<String> split(String sep, String toSplit) { 246 public static List<String> split(String sep, String toSplit) { // NO_UCD (unused code) 247 247 return Arrays.asList(toSplit.split(Pattern.quote(sep), -1)); 248 248 } … … 256 256 * @see Color#Color(float, float, float) 257 257 */ 258 public static Color rgb(float r, float g, float b) { 258 public static Color rgb(float r, float g, float b) { // NO_UCD (unused code) 259 259 try { 260 260 return new Color(r, g, b); … … 274 274 * @see Color#Color(float, float, float, float) 275 275 */ 276 public static Color rgba(float r, float g, float b, float alpha) { 276 public static Color rgba(float r, float g, float b, float alpha) { // NO_UCD (unused code) 277 277 try { 278 278 return new Color(r, g, b, alpha); … … 289 289 * @return the corresponding color 290 290 */ 291 public static Color hsb_color(float h, float s, float b) { 291 public static Color hsb_color(float h, float s, float b) { // NO_UCD (unused code) 292 292 try { 293 293 return Color.getHSBColor(h, s, b); … … 302 302 * @return color matching the given notation 303 303 */ 304 public static Color html2color(String html) { 304 public static Color html2color(String html) { // NO_UCD (unused code) 305 305 return ColorHelper.html2color(html); 306 306 } … … 311 311 * @return HTML notation matching the given color 312 312 */ 313 public static String color2html(Color c) { 313 public static String color2html(Color c) { // NO_UCD (unused code) 314 314 return ColorHelper.color2html(c); 315 315 } … … 321 321 * @see java.awt.Color#getRed() 322 322 */ 323 public static float red(Color c) { 323 public static float red(Color c) { // NO_UCD (unused code) 324 324 return Utils.color_int2float(c.getRed()); 325 325 } … … 331 331 * @see java.awt.Color#getGreen() 332 332 */ 333 public static float green(Color c) { 333 public static float green(Color c) { // NO_UCD (unused code) 334 334 return Utils.color_int2float(c.getGreen()); 335 335 } … … 341 341 * @see java.awt.Color#getBlue() 342 342 */ 343 public static float blue(Color c) { 343 public static float blue(Color c) { // NO_UCD (unused code) 344 344 return Utils.color_int2float(c.getBlue()); 345 345 } … … 351 351 * @see java.awt.Color#getAlpha() 352 352 */ 353 public static float alpha(Color c) { 353 public static float alpha(Color c) { // NO_UCD (unused code) 354 354 return Utils.color_int2float(c.getAlpha()); 355 355 } … … 362 362 */ 363 363 @NullableArguments 364 public static String concat(Object... args) { 364 public static String concat(Object... args) { // NO_UCD (unused code) 365 365 return Utils.join("", Arrays.asList(args)); 366 366 } … … 373 373 */ 374 374 @NullableArguments 375 public static String join(String... args) { 375 public static String join(String... args) { // NO_UCD (unused code) 376 376 return Utils.join(args[0], Arrays.asList(args).subList(1, args.length)); 377 377 } … … 384 384 * @see Utils#join 385 385 */ 386 public static String join_list(final String separator, final List<String> values) { 386 public static String join_list(final String separator, final List<String> values) { // NO_UCD (unused code) 387 387 return Utils.join(separator, values); 388 388 } … … 394 394 * @return the property value 395 395 */ 396 public static Object prop(final Environment env, String key) { 396 public static Object prop(final Environment env, String key) { // NO_UCD (unused code) 397 397 return prop(env, key, null); 398 398 } … … 415 415 * @return {@code true} if the property is set, {@code false} otherwise 416 416 */ 417 public static Boolean is_prop_set(final Environment env, String key) { 417 public static Boolean is_prop_set(final Environment env, String key) { // NO_UCD (unused code) 418 418 return is_prop_set(env, key, null); 419 419 } … … 436 436 * @return the value for given key 437 437 */ 438 public static String tag(final Environment env, String key) { 438 public static String tag(final Environment env, String key) { // NO_UCD (unused code) 439 439 return env.osm == null ? null : env.osm.get(key); 440 440 } … … 446 446 * @return first non-null value of the key {@code key} from the object's parent(s) 447 447 */ 448 public static String parent_tag(final Environment env, String key) { 448 public static String parent_tag(final Environment env, String key) { // NO_UCD (unused code) 449 449 if (env.parent == null) { 450 450 if (env.osm != null) { … … 470 470 * @return a list of non-null values of the key {@code key} from the object's parent(s) 471 471 */ 472 public static List<String> parent_tags(final Environment env, String key) { 472 public static List<String> parent_tags(final Environment env, String key) { // NO_UCD (unused code) 473 473 if (env.parent == null) { 474 474 if (env.osm != null) { … … 494 494 * @return the value of the key {@code key} from the object's child, or {@code null} if there is no child 495 495 */ 496 public static String child_tag(final Environment env, String key) { 496 public static String child_tag(final Environment env, String key) { // NO_UCD (unused code) 497 497 return env.child == null ? null : env.child.get(key); 498 498 } … … 504 504 * @return {@code true} if the object has a tag with the given key, {@code false} otherwise 505 505 */ 506 public static boolean has_tag_key(final Environment env, String key) { 506 public static boolean has_tag_key(final Environment env, String key) { // NO_UCD (unused code) 507 507 return env.osm.hasKey(key); 508 508 } … … 513 513 * @return the index as float. Starts at 1 514 514 */ 515 public static Float index(final Environment env) { 515 public static Float index(final Environment env) { // NO_UCD (unused code) 516 516 if (env.index == null) { 517 517 return null; … … 526 526 * @see Environment#getRole() 527 527 */ 528 public static String role(final Environment env) { 528 public static String role(final Environment env) { // NO_UCD (unused code) 529 529 return env.getRole(); 530 530 } … … 536 536 * @see Geometry#computeArea(OsmPrimitive) 537 537 */ 538 public static Float areasize(final Environment env) { 538 public static Float areasize(final Environment env) { // NO_UCD (unused code) 539 539 final Double area = Geometry.computeArea(env.osm); 540 540 return area == null ? null : area.floatValue(); … … 547 547 * @see Way#getLength() 548 548 */ 549 public static Float waylength(final Environment env) { 549 public static Float waylength(final Environment env) { // NO_UCD (unused code) 550 550 if (env.osm instanceof Way) { 551 551 return (float) ((Way) env.osm).getLength(); … … 560 560 * @return {@code true} if {@code !b} 561 561 */ 562 public static boolean not(boolean b) { 562 public static boolean not(boolean b) { // NO_UCD (unused code) 563 563 return !b; 564 564 } … … 570 570 * @return {@code true} if {@code a >= b} 571 571 */ 572 public static boolean greater_equal(float a, float b) { 572 public static boolean greater_equal(float a, float b) { // NO_UCD (unused code) 573 573 return a >= b; 574 574 } … … 580 580 * @return {@code true} if {@code a <= b} 581 581 */ 582 public static boolean less_equal(float a, float b) { 582 public static boolean less_equal(float a, float b) { // NO_UCD (unused code) 583 583 return a <= b; 584 584 } … … 590 590 * @return {@code true} if {@code a > b} 591 591 */ 592 public static boolean greater(float a, float b) { 592 public static boolean greater(float a, float b) { // NO_UCD (unused code) 593 593 return a > b; 594 594 } … … 600 600 * @return {@code true} if {@code a < b} 601 601 */ 602 public static boolean less(float a, float b) { 602 public static boolean less(float a, float b) { // NO_UCD (unused code) 603 603 return a < b; 604 604 } … … 610 610 * @see Math#toRadians(double) 611 611 */ 612 public static double degree_to_radians(double degree) { 612 public static double degree_to_radians(double degree) { // NO_UCD (unused code) 613 613 return Math.toRadians(degree); 614 614 } … … 623 623 * @see RotationAngle#parseCardinalRotation(String) 624 624 */ 625 public static Double cardinal_to_radians(String cardinal) { 625 public static Double cardinal_to_radians(String cardinal) { // NO_UCD (unused code) 626 626 try { 627 627 return RotationAngle.parseCardinalRotation(cardinal); … … 651 651 * @see Object#equals(Object) 652 652 */ 653 public static boolean not_equal(Object a, Object b) { 653 public static boolean not_equal(Object a, Object b) { // NO_UCD (unused code) 654 654 return !equal(a, b); 655 655 } … … 662 662 * @see SearchCompiler 663 663 */ 664 public static Boolean JOSM_search(final Environment env, String searchStr) { 664 public static Boolean JOSM_search(final Environment env, String searchStr) { // NO_UCD (unused code) 665 665 Match m; 666 666 try { … … 680 680 * @return value for key, or default value if not found 681 681 */ 682 public static String JOSM_pref(Environment env, String key, String def) { 682 public static String JOSM_pref(Environment env, String key, String def) { // NO_UCD (unused code) 683 683 return MapPaintStyles.getStyles().getPreferenceCached(key, def); 684 684 } … … 692 692 * @since 5699 693 693 */ 694 public static boolean regexp_test(String pattern, String target) { 694 public static boolean regexp_test(String pattern, String target) { // NO_UCD (unused code) 695 695 return Pattern.matches(pattern, target); 696 696 } … … 707 707 * @since 5699 708 708 */ 709 public static boolean regexp_test(String pattern, String target, String flags) { 709 public static boolean regexp_test(String pattern, String target, String flags) { // NO_UCD (unused code) 710 710 int f = 0; 711 711 if (flags.contains("i")) { … … 734 734 * @since 5701 735 735 */ 736 public static List<String> regexp_match(String pattern, String target, String flags) { 736 public static List<String> regexp_match(String pattern, String target, String flags) { // NO_UCD (unused code) 737 737 int f = 0; 738 738 if (flags.contains("i")) { … … 757 757 * @since 5701 758 758 */ 759 public static List<String> regexp_match(String pattern, String target) { 759 public static List<String> regexp_match(String pattern, String target) { // NO_UCD (unused code) 760 760 return Utils.getMatches(Pattern.compile(pattern).matcher(target)); 761 761 } … … 767 767 * @see OsmPrimitive#getUniqueId() 768 768 */ 769 public static long osm_id(final Environment env) { 769 public static long osm_id(final Environment env) { // NO_UCD (unused code) 770 770 return env.osm.getUniqueId(); 771 771 } … … 778 778 */ 779 779 @NullableArguments 780 public static String tr(String... args) { 780 public static String tr(String... args) { // NO_UCD (unused code) 781 781 final String text = args[0]; 782 782 System.arraycopy(args, 1, args, 0, args.length - 1); … … 791 791 * @see String#substring(int) 792 792 */ 793 public static String substring(String s, /* due to missing Cascade.convertTo for int*/ float begin) { 793 public static String substring(String s, /* due to missing Cascade.convertTo for int*/ float begin) { // NO_UCD (unused code) 794 794 return s == null ? null : s.substring((int) begin); 795 795 } … … 804 804 * @see String#substring(int, int) 805 805 */ 806 public static String substring(String s, float begin, float end) { 806 public static String substring(String s, float begin, float end) { // NO_UCD (unused code) 807 807 return s == null ? null : s.substring((int) begin, (int) end); 808 808 } … … 816 816 * @see String#replace(CharSequence, CharSequence) 817 817 */ 818 public static String replace(String s, String target, String replacement) { 818 public static String replace(String s, String target, String replacement) { // NO_UCD (unused code) 819 819 return s == null ? null : s.replace(target, replacement); 820 820 } … … 827 827 * @return the encoded string 828 828 */ 829 public static String URL_encode(String s) { 829 public static String URL_encode(String s) { // NO_UCD (unused code) 830 830 return s == null ? null : Utils.encodeUrl(s); 831 831 } … … 838 838 * @return the encoded string 839 839 */ 840 public static String XML_encode(String s) { 840 public static String XML_encode(String s) { // NO_UCD (unused code) 841 841 return s == null ? null : XmlWriter.encode(s); 842 842 } … … 847 847 * @return long value from 0 to 2^32-1 848 848 */ 849 public static long CRC32_checksum(String s) { 849 public static long CRC32_checksum(String s) { // NO_UCD (unused code) 850 850 CRC32 cs = new CRC32(); 851 851 cs.update(s.getBytes(StandardCharsets.UTF_8)); … … 903 903 */ 904 904 @NullableArguments 905 public static Object print(Object o) { 905 public static Object print(Object o) { // NO_UCD (unused code) 906 906 System.out.print(o == null ? "none" : o.toString()); 907 907 return o; … … 915 915 */ 916 916 @NullableArguments 917 public static Object println(Object o) { 917 public static Object println(Object o) { // NO_UCD (unused code) 918 918 System.out.println(o == null ? "none" : o.toString()); 919 919 return o; … … 925 925 * @return number of tags 926 926 */ 927 public static int number_of_tags(Environment env) { 927 public static int number_of_tags(Environment env) { // NO_UCD (unused code) 928 928 return env.osm.getNumKeys(); 929 929 } … … 935 935 * @return the value of the setting (calculated when the style is loaded) 936 936 */ 937 public static Object setting(Environment env, String key) { 937 public static Object setting(Environment env, String key) { // NO_UCD (unused code) 938 938 return env.source.settingValues.get(key); 939 939 }
Note:
See TracChangeset
for help on using the changeset viewer.