Ticket #21867: javadoc.patch

File javadoc.patch, 5.7 KB (added by gaben, 4 years ago)
  • src/org/openstreetmap/josm/gui/mappaint/mapcss/ConditionFactory.java

     
    711711        }
    712712
    713713        /**
    714          * {@code closed} tests whether the way is closed or the relation is a closed multipolygon
     714         * {@code :closed} tests whether the way is closed or the relation is a closed multipolygon
    715715         * @param e MapCSS environment
    716716         * @return {@code true} if the way is closed or the relation is a closed multipolygon
    717717         */
     
    718718        static boolean closed(Environment e) {
    719719            if (e.osm instanceof IWay<?> && ((IWay<?>) e.osm).isClosed())
    720720                return true;
    721             return e.osm instanceof IRelation<?> && ((IRelation<?>) e.osm).isMultipolygon();
     721            return e.osm instanceof IRelation<?> && e.osm.isMultipolygon();
    722722        }
    723723
    724724        /**
     
    732732        }
    733733
    734734        /**
    735          * {@code ;new} tests whether the object is new.
     735         * {@code :new} tests whether the object is new.
    736736         * @param e MapCSS environment
    737737         * @return {@code true} if the object is new
    738738         * @see IPrimitive#isNew()
     
    783783        }
    784784
    785785        /**
    786          * {@code unconnected}: tests whether the object is a unconnected node.
     786         * {@code :unconnected} tests whether the object is an unconnected node.
    787787         * @param e MapCSS environment
    788          * @return {@code true} if the object is a unconnected node
     788         * @return {@code true} if the object is an unconnected node
    789789         */
    790790        static boolean unconnected(Environment e) {
    791791            return e.osm instanceof Node && ((Node) e.osm).getParentWays().isEmpty();
     
    792792        }
    793793
    794794        /**
    795          * {@code righthandtraffic} checks if there is right-hand traffic at the current location.
     795         * {@code :righthandtraffic} checks if there is right-hand traffic at the current location.
    796796         * @param e MapCSS environment
    797797         * @return {@code true} if there is right-hand traffic at the current location
    798798         * @see Functions#is_right_hand_traffic(Environment)
     
    802802        }
    803803
    804804        /**
    805          * {@code clockwise} whether the way is closed and oriented clockwise,
     805         * {@code :clockwise} whether the way is closed and oriented clockwise,
    806806         * or non-closed and the 1st, 2nd and last node are in clockwise order.
    807807         * @param e MapCSS environment
    808808         * @return {@code true} if the way clockwise
     
    813813        }
    814814
    815815        /**
    816          * {@code anticlockwise} whether the way is closed and oriented anticlockwise,
     816         * {@code :anticlockwise} whether the way is closed and oriented anticlockwise,
    817817         * or non-closed and the 1st, 2nd and last node are in anticlockwise order.
    818818         * @param e MapCSS environment
    819819         * @return {@code true} if the way clockwise
     
    824824        }
    825825
    826826        /**
    827          * {@code unclosed-multipolygon} tests whether the object is an unclosed multipolygon.
     827         * {@code :unclosed-multipolygon} tests whether the object is an unclosed multipolygon.
    828828         * @param e MapCSS environment
    829829         * @return {@code true} if the object is an unclosed multipolygon
    830830         */
     
    837837        private static final Predicate<OsmPrimitive> IN_DOWNLOADED_AREA = new InDataSourceArea(false);
    838838
    839839        /**
    840          * {@code in-downloaded-area} tests whether the object is within source area ("downloaded area").
     840         * {@code :in-downloaded-area} tests whether the object is within source area ("downloaded area").
    841841         * @param e MapCSS environment
    842842         * @return {@code true} if the object is within source area ("downloaded area")
    843843         * @see InDataSourceArea
     
    846846            return e.osm instanceof OsmPrimitive && IN_DOWNLOADED_AREA.test((OsmPrimitive) e.osm);
    847847        }
    848848
     849        /**
     850         * {@code :completely_downloaded} tests whether the object is completely downloaded
     851         * @param e MapCSS environment
     852         * @return {@code true} if the object is completely downloaded
     853         */
    849854        static boolean completely_downloaded(Environment e) {
    850855            if (e.osm instanceof IRelation<?>) {
    851856                return !((IRelation<?>) e.osm).hasIncompleteMembers();
     
    861866        static boolean closed2(Environment e) {
    862867            if (e.osm instanceof IWay<?> && ((IWay<?>) e.osm).isClosed())
    863868                return true;
    864             if (e.osm instanceof Relation && ((Relation) e.osm).isMultipolygon()) {
     869            if (e.osm instanceof Relation && e.osm.isMultipolygon()) {
    865870                Multipolygon multipolygon = MultipolygonCache.getInstance().get((Relation) e.osm);
    866871                return multipolygon != null && multipolygon.getOpenEnds().isEmpty();
    867872            }
     
    868873            return false;
    869874        }
    870875
     876        /**
     877         * {@code :selected} tests whether the object is selected in the editor
     878         * @param e MapCSS environment
     879         * @return {@code true} if the object is selected
     880         */
    871881        static boolean selected(Environment e) {
    872882            if (e.mc != null) {
    873883                e.getCascade().setDefaultSelectedHandling(false);
     
    876886        }
    877887
    878888        /**
    879          * Check if the object is highlighted (i.e., is hovered over)
     889         * {@code :highlighted} tests whether the object is highlighted (i.e. is hovered over)
    880890         * @param e The MapCSS environment
    881891         * @return {@code true} if the object is highlighted
    882892         * @see IPrimitive#isHighlighted