Ignore:
Timestamp:
2016-03-13T21:36:47+01:00 (8 years ago)
Author:
Don-vip
Message:

remove unused code

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  
    1919 */
    2020public final class Cascade implements Cloneable {
    21 
    22     public static final Cascade EMPTY_CASCADE = new Cascade();
    2321
    2422    private Map<String, Object> prop = new HashMap<>();
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Condition.java

    r9540 r9983  
    523523         * @return {@code true} if the way is closed or the relation is a closed multipolygon
    524524         */
    525         static boolean closed(Environment e) {
     525        static boolean closed(Environment e) { // NO_UCD (unused code)
    526526            if (e.osm instanceof Way && ((Way) e.osm).isClosed())
    527527                return true;
     
    537537         * @see OsmPrimitive#isModified()
    538538         */
    539         static boolean modified(Environment e) {
     539        static boolean modified(Environment e) { // NO_UCD (unused code)
    540540            return e.osm.isModified() || e.osm.isNewOrUndeleted();
    541541        }
     
    547547         * @see OsmPrimitive#isNew()
    548548         */
    549         static boolean _new(Environment e) {
     549        static boolean _new(Environment e) { // NO_UCD (unused code)
    550550            return e.osm.isNew();
    551551        }
     
    557557         * @see Node#isConnectionNode()
    558558         */
    559         static boolean connection(Environment e) {
     559        static boolean connection(Environment e) { // NO_UCD (unused code)
    560560            return e.osm instanceof Node && e.osm.getDataSet() != null && ((Node) e.osm).isConnectionNode();
    561561        }
     
    567567         * @see OsmPrimitive#isTagged()
    568568         */
    569         static boolean tagged(Environment e) {
     569        static boolean tagged(Environment e) { // NO_UCD (unused code)
    570570            return e.osm.isTagged();
    571571        }
     
    577577         * @see OsmPrimitive#hasSameInterestingTags(OsmPrimitive)
    578578         */
    579         static boolean sameTags(Environment e) {
     579        static boolean sameTags(Environment e) { // NO_UCD (unused code)
    580580            return e.osm.hasSameInterestingTags(Utils.firstNonNull(e.child, e.parent));
    581581        }
     
    587587         * @see ElemStyles#hasAreaElemStyle(OsmPrimitive, boolean)
    588588         */
    589         static boolean areaStyle(Environment e) {
     589        static boolean areaStyle(Environment e) { // NO_UCD (unused code)
    590590            // only for validator
    591591            return ElemStyles.hasAreaElemStyle(e.osm, false);
     
    597597         * @return {@code true} if the object is a unconnected node
    598598         */
    599         static boolean unconnected(Environment e) {
     599        static boolean unconnected(Environment e) { // NO_UCD (unused code)
    600600            return e.osm instanceof Node && OsmPrimitive.getFilteredList(e.osm.getReferrers(), Way.class).isEmpty();
    601601        }
     
    607607         * @see ExpressionFactory.Functions#is_right_hand_traffic(Environment)
    608608         */
    609         static boolean righthandtraffic(Environment e) {
     609        static boolean righthandtraffic(Environment e) { // NO_UCD (unused code)
    610610            return ExpressionFactory.Functions.is_right_hand_traffic(e);
    611611        }
     
    618618         * @see ExpressionFactory.Functions#is_clockwise(Environment)
    619619         */
    620         static boolean clockwise(Environment e) {
     620        static boolean clockwise(Environment e) { // NO_UCD (unused code)
    621621            return ExpressionFactory.Functions.is_clockwise(e);
    622622        }
     
    629629         * @see ExpressionFactory.Functions#is_anticlockwise(Environment)
    630630         */
    631         static boolean anticlockwise(Environment e) {
     631        static boolean anticlockwise(Environment e) { // NO_UCD (unused code)
    632632            return ExpressionFactory.Functions.is_anticlockwise(e);
    633633        }
     
    638638         * @return {@code true} if the object is an unclosed multipolygon
    639639         */
    640         static boolean unclosed_multipolygon(Environment e) {
     640        static boolean unclosed_multipolygon(Environment e) { // NO_UCD (unused code)
    641641            return e.osm instanceof Relation && ((Relation) e.osm).isMultipolygon() &&
    642642                    !e.osm.isIncomplete() && !((Relation) e.osm).hasIncompleteMembers() &&
     
    652652         * @see InDataSourceArea
    653653         */
    654         static boolean inDownloadedArea(Environment e) {
     654        static boolean inDownloadedArea(Environment e) { // NO_UCD (unused code)
    655655            return IN_DOWNLOADED_AREA.evaluate(e.osm);
    656656        }
    657657
    658         static boolean completely_downloaded(Environment e) {
     658        static boolean completely_downloaded(Environment e) { // NO_UCD (unused code)
    659659            if (e.osm instanceof Relation) {
    660660                return !((Relation) e.osm).hasIncompleteMembers();
     
    664664        }
    665665
    666         static boolean closed2(Environment e) {
     666        static boolean closed2(Environment e) { // NO_UCD (unused code)
    667667            if (e.osm instanceof Way && ((Way) e.osm).isClosed())
    668668                return true;
     
    672672        }
    673673
    674         static boolean selected(Environment e) {
     674        static boolean selected(Environment e) { // NO_UCD (unused code)
    675675            Cascade c = e.mc.getCascade(e.layer);
    676676            c.setDefaultSelectedHandling(false);
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java

    r9952 r9983  
    122122         * @return {@code o} unchanged
    123123         */
    124         public static Object eval(Object o) {
     124        public static Object eval(Object o) { // NO_UCD (unused code)
    125125            return o;
    126126        }
     
    131131         * @return Sum of arguments
    132132         */
    133         public static float plus(float... args) {
     133        public static float plus(float... args) { // NO_UCD (unused code)
    134134            float res = 0;
    135135            for (float f : args) {
     
    144144         * @return Substraction of arguments
    145145         */
    146         public static Float minus(float... args) {
     146        public static Float minus(float... args) { // NO_UCD (unused code)
    147147            if (args.length == 0) {
    148148                return 0.0F;
     
    163163         * @return Multiplication of arguments
    164164         */
    165         public static float times(float... args) {
     165        public static float times(float... args) { // NO_UCD (unused code)
    166166            float res = 1;
    167167            for (float f : args) {
     
    176176         * @return Division of arguments
    177177         */
    178         public static Float divided_by(float... args) {
     178        public static Float divided_by(float... args) { // NO_UCD (unused code)
    179179            if (args.length == 0) {
    180180                return 1.0F;
     
    196196         * @see Arrays#asList(Object[])
    197197         */
    198         public static List<Object> list(Object... args) {
     198        public static List<Object> list(Object... args) { // NO_UCD (unused code)
    199199            return Arrays.asList(args);
    200200        }
     
    205205         * @return length of the list
    206206         */
    207         public static Integer count(List<?> lst) {
     207        public static Integer count(List<?> lst) { // NO_UCD (unused code)
    208208            return lst.size();
    209209        }
     
    217217         */
    218218        @NullableArguments
    219         public static Object any(Object... args) {
     219        public static Object any(Object... args) { // NO_UCD (unused code)
    220220            return Utils.firstNonNull(args);
    221221        }
     
    228228         * @since 5699
    229229         */
    230         public static Object get(List<?> lst, float n) {
     230        public static Object get(List<?> lst, float n) { // NO_UCD (unused code)
    231231            int idx = Math.round(n);
    232232            if (idx >= 0 && idx < lst.size()) {
     
    244244         * @since 5699
    245245         */
    246         public static List<String> split(String sep, String toSplit) {
     246        public static List<String> split(String sep, String toSplit) { // NO_UCD (unused code)
    247247            return Arrays.asList(toSplit.split(Pattern.quote(sep), -1));
    248248        }
     
    256256         * @see Color#Color(float, float, float)
    257257         */
    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)
    259259            try {
    260260                return new Color(r, g, b);
     
    274274         * @see Color#Color(float, float, float, float)
    275275         */
    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)
    277277            try {
    278278                return new Color(r, g, b, alpha);
     
    289289         * @return the corresponding color
    290290         */
    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)
    292292            try {
    293293                return Color.getHSBColor(h, s, b);
     
    302302         * @return color matching the given notation
    303303         */
    304         public static Color html2color(String html) {
     304        public static Color html2color(String html) { // NO_UCD (unused code)
    305305            return ColorHelper.html2color(html);
    306306        }
     
    311311         * @return HTML notation matching the given color
    312312         */
    313         public static String color2html(Color c) {
     313        public static String color2html(Color c) { // NO_UCD (unused code)
    314314            return ColorHelper.color2html(c);
    315315        }
     
    321321         * @see java.awt.Color#getRed()
    322322         */
    323         public static float red(Color c) {
     323        public static float red(Color c) { // NO_UCD (unused code)
    324324            return Utils.color_int2float(c.getRed());
    325325        }
     
    331331         * @see java.awt.Color#getGreen()
    332332         */
    333         public static float green(Color c) {
     333        public static float green(Color c) { // NO_UCD (unused code)
    334334            return Utils.color_int2float(c.getGreen());
    335335        }
     
    341341         * @see java.awt.Color#getBlue()
    342342         */
    343         public static float blue(Color c) {
     343        public static float blue(Color c) { // NO_UCD (unused code)
    344344            return Utils.color_int2float(c.getBlue());
    345345        }
     
    351351         * @see java.awt.Color#getAlpha()
    352352         */
    353         public static float alpha(Color c) {
     353        public static float alpha(Color c) { // NO_UCD (unused code)
    354354            return Utils.color_int2float(c.getAlpha());
    355355        }
     
    362362         */
    363363        @NullableArguments
    364         public static String concat(Object... args) {
     364        public static String concat(Object... args) { // NO_UCD (unused code)
    365365            return Utils.join("", Arrays.asList(args));
    366366        }
     
    373373         */
    374374        @NullableArguments
    375         public static String join(String... args) {
     375        public static String join(String... args) { // NO_UCD (unused code)
    376376            return Utils.join(args[0], Arrays.asList(args).subList(1, args.length));
    377377        }
     
    384384         * @see Utils#join
    385385         */
    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)
    387387            return Utils.join(separator, values);
    388388        }
     
    394394         * @return the property value
    395395         */
    396         public static Object prop(final Environment env, String key) {
     396        public static Object prop(final Environment env, String key) { // NO_UCD (unused code)
    397397            return prop(env, key, null);
    398398        }
     
    415415         * @return {@code true} if the property is set, {@code false} otherwise
    416416         */
    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)
    418418            return is_prop_set(env, key, null);
    419419        }
     
    436436         * @return the value for given key
    437437         */
    438         public static String tag(final Environment env, String key) {
     438        public static String tag(final Environment env, String key) { // NO_UCD (unused code)
    439439            return env.osm == null ? null : env.osm.get(key);
    440440        }
     
    446446         * @return first non-null value of the key {@code key} from the object's parent(s)
    447447         */
    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)
    449449            if (env.parent == null) {
    450450                if (env.osm != null) {
     
    470470         * @return a list of non-null values of the key {@code key} from the object's parent(s)
    471471         */
    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)
    473473            if (env.parent == null) {
    474474                if (env.osm != null) {
     
    494494         * @return the value of the key {@code key} from the object's child, or {@code null} if there is no child
    495495         */
    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)
    497497            return env.child == null ? null : env.child.get(key);
    498498        }
     
    504504         * @return {@code true} if the object has a tag with the given key, {@code false} otherwise
    505505         */
    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)
    507507            return env.osm.hasKey(key);
    508508        }
     
    513513         * @return the index as float. Starts at 1
    514514         */
    515         public static Float index(final Environment env) {
     515        public static Float index(final Environment env) { // NO_UCD (unused code)
    516516            if (env.index == null) {
    517517                return null;
     
    526526         * @see Environment#getRole()
    527527         */
    528         public static String role(final Environment env) {
     528        public static String role(final Environment env) { // NO_UCD (unused code)
    529529            return env.getRole();
    530530        }
     
    536536         * @see Geometry#computeArea(OsmPrimitive)
    537537         */
    538         public static Float areasize(final Environment env) {
     538        public static Float areasize(final Environment env) { // NO_UCD (unused code)
    539539            final Double area = Geometry.computeArea(env.osm);
    540540            return area == null ? null : area.floatValue();
     
    547547         * @see Way#getLength()
    548548         */
    549         public static Float waylength(final Environment env) {
     549        public static Float waylength(final Environment env) { // NO_UCD (unused code)
    550550            if (env.osm instanceof Way) {
    551551                return (float) ((Way) env.osm).getLength();
     
    560560         * @return {@code true} if {@code !b}
    561561         */
    562         public static boolean not(boolean b) {
     562        public static boolean not(boolean b) { // NO_UCD (unused code)
    563563            return !b;
    564564        }
     
    570570         * @return {@code true} if {@code a &gt;= b}
    571571         */
    572         public static boolean greater_equal(float a, float b) {
     572        public static boolean greater_equal(float a, float b) { // NO_UCD (unused code)
    573573            return a >= b;
    574574        }
     
    580580         * @return {@code true} if {@code a &lt;= b}
    581581         */
    582         public static boolean less_equal(float a, float b) {
     582        public static boolean less_equal(float a, float b) { // NO_UCD (unused code)
    583583            return a <= b;
    584584        }
     
    590590         * @return {@code true} if {@code a &gt; b}
    591591         */
    592         public static boolean greater(float a, float b) {
     592        public static boolean greater(float a, float b) { // NO_UCD (unused code)
    593593            return a > b;
    594594        }
     
    600600         * @return {@code true} if {@code a &lt; b}
    601601         */
    602         public static boolean less(float a, float b) {
     602        public static boolean less(float a, float b) { // NO_UCD (unused code)
    603603            return a < b;
    604604        }
     
    610610         * @see Math#toRadians(double)
    611611         */
    612         public static double degree_to_radians(double degree) {
     612        public static double degree_to_radians(double degree) { // NO_UCD (unused code)
    613613            return Math.toRadians(degree);
    614614        }
     
    623623         * @see RotationAngle#parseCardinalRotation(String)
    624624         */
    625         public static Double cardinal_to_radians(String cardinal) {
     625        public static Double cardinal_to_radians(String cardinal) { // NO_UCD (unused code)
    626626            try {
    627627                return RotationAngle.parseCardinalRotation(cardinal);
     
    651651         * @see Object#equals(Object)
    652652         */
    653         public static boolean not_equal(Object a, Object b) {
     653        public static boolean not_equal(Object a, Object b) { // NO_UCD (unused code)
    654654            return !equal(a, b);
    655655        }
     
    662662         * @see SearchCompiler
    663663         */
    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)
    665665            Match m;
    666666            try {
     
    680680         * @return value for key, or default value if not found
    681681         */
    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)
    683683            return MapPaintStyles.getStyles().getPreferenceCached(key, def);
    684684        }
     
    692692         * @since 5699
    693693         */
    694         public static boolean regexp_test(String pattern, String target) {
     694        public static boolean regexp_test(String pattern, String target) { // NO_UCD (unused code)
    695695            return Pattern.matches(pattern, target);
    696696        }
     
    707707         * @since 5699
    708708         */
    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)
    710710            int f = 0;
    711711            if (flags.contains("i")) {
     
    734734         * @since 5701
    735735         */
    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)
    737737            int f = 0;
    738738            if (flags.contains("i")) {
     
    757757         * @since 5701
    758758         */
    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)
    760760            return Utils.getMatches(Pattern.compile(pattern).matcher(target));
    761761        }
     
    767767         * @see OsmPrimitive#getUniqueId()
    768768         */
    769         public static long osm_id(final Environment env) {
     769        public static long osm_id(final Environment env) { // NO_UCD (unused code)
    770770            return env.osm.getUniqueId();
    771771        }
     
    778778         */
    779779        @NullableArguments
    780         public static String tr(String... args) {
     780        public static String tr(String... args) { // NO_UCD (unused code)
    781781            final String text = args[0];
    782782            System.arraycopy(args, 1, args, 0, args.length - 1);
     
    791791         * @see String#substring(int)
    792792         */
    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)
    794794            return s == null ? null : s.substring((int) begin);
    795795        }
     
    804804         * @see String#substring(int, int)
    805805         */
    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)
    807807            return s == null ? null : s.substring((int) begin, (int) end);
    808808        }
     
    816816         * @see String#replace(CharSequence, CharSequence)
    817817         */
    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)
    819819            return s == null ? null : s.replace(target, replacement);
    820820        }
     
    827827         * @return the encoded string
    828828         */
    829         public static String URL_encode(String s) {
     829        public static String URL_encode(String s) { // NO_UCD (unused code)
    830830            return s == null ? null : Utils.encodeUrl(s);
    831831        }
     
    838838         * @return the encoded string
    839839         */
    840         public static String XML_encode(String s) {
     840        public static String XML_encode(String s) { // NO_UCD (unused code)
    841841            return s == null ? null : XmlWriter.encode(s);
    842842        }
     
    847847         * @return long value from 0 to 2^32-1
    848848         */
    849         public static long CRC32_checksum(String s) {
     849        public static long CRC32_checksum(String s) { // NO_UCD (unused code)
    850850            CRC32 cs = new CRC32();
    851851            cs.update(s.getBytes(StandardCharsets.UTF_8));
     
    903903         */
    904904        @NullableArguments
    905         public static Object print(Object o) {
     905        public static Object print(Object o) { // NO_UCD (unused code)
    906906            System.out.print(o == null ? "none" : o.toString());
    907907            return o;
     
    915915         */
    916916        @NullableArguments
    917         public static Object println(Object o) {
     917        public static Object println(Object o) { // NO_UCD (unused code)
    918918            System.out.println(o == null ? "none" : o.toString());
    919919            return o;
     
    925925         * @return number of tags
    926926         */
    927         public static int number_of_tags(Environment env) {
     927        public static int number_of_tags(Environment env) { // NO_UCD (unused code)
    928928            return env.osm.getNumKeys();
    929929        }
     
    935935         * @return the value of the setting (calculated when the style is loaded)
    936936         */
    937         public static Object setting(Environment env, String key) {
     937        public static Object setting(Environment env, String key) { // NO_UCD (unused code)
    938938            return env.source.settingValues.get(key);
    939939        }
Note: See TracChangeset for help on using the changeset viewer.