Changeset 9239 in josm for trunk/src/org


Ignore:
Timestamp:
2016-01-01T17:01:08+01:00 (4 years ago)
Author:
Don-vip
Message:

javadoc update

Location:
trunk/src/org/openstreetmap/josm
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/conflict/Conflict.java

    r9230 r9239  
    1717 *   {@link OsmPrimitive} from the dataset in another layer or the one retrieved from the server.</li>
    1818 * </ul>
     19 * @param <T> primitive type of the conflict
    1920 * @since 1750
    2021 */
  • trunk/src/org/openstreetmap/josm/data/osm/event/DataSetListener.java

    r8419 r9239  
    6161     * Called after big changes in dataset. Usually other events are stopped using Dataset.beginUpdate() and
    6262     * after operation is completed (Dataset.endUpdate()), {@link #dataChanged(DataChangedEvent event)} is called.
     63     * @param event data change event
    6364     */
    6465    void dataChanged(DataChangedEvent event);
  • trunk/src/org/openstreetmap/josm/data/validation/routines/DomainValidator.java

    r8870 r9239  
    121121    }
    122122
    123     /** Private constructor. */
     123    /**
     124     * Private constructor.
     125     * @param allowLocal whether to allow local domains
     126     */
    124127    private DomainValidator(boolean allowLocal) {
    125128       this.allowLocal = allowLocal;
  • trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/MarkerProducers.java

    r8806 r9239  
    2323     * @param relativePath An path to use for constructing relative URLs or
    2424     *        <code>null</code> for no relative URLs
     25     * @param parentLayer parent marker layer
     26     * @param time Absolute time of marker in seconds since epoch
     27     * @param offset Time offset in seconds from the gpx point from which it was derived
    2528     * @return A collection of Marker objects, or <code>null</code>.
    2629     */
  • trunk/src/org/openstreetmap/josm/gui/layer/markerlayer/PlayHeadMarker.java

    r9214 r9239  
    113113    /**
    114114     * reinstate the old map mode after switching temporarily to do a play head drag
     115     * @param reset whether to reset state (pause audio and restore old coordinates)
    115116     */
    116117    private void endDrag(boolean reset) {
     
    182183            endDrag(true);
    183184        } else {
    184             setCoor(cw.getCoor());
    185             ca.play(cw.time - ca.time);
     185            if (cw != null) {
     186                setCoor(cw.getCoor());
     187                ca.play(cw.time - ca.time);
     188            }
    186189            endDrag(false);
    187190        }
  • trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyle.java

    r8882 r9239  
    6464     * @param c the cascade
    6565     * @param key property key for the width value
    66      * @param relativeTo reference width. Only needed, when relative width syntax
    67      *              is used, e.g. "+4".
     66     * @param relativeTo reference width. Only needed, when relative width syntax is used, e.g. "+4".
     67     * @return width
    6868     */
    6969    protected static Float getWidth(Cascade c, String key, Float relativeTo) {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/ElemStyles.java

    r9114 r9239  
    8181     * Automatically adds default styles in case no proper style was found.
    8282     * Uses the cache, if possible, and saves the results to the cache.
     83     * @param osm OSM primitive
     84     * @param scale scale
     85     * @param nc navigatable component
     86     * @return pair containing style list and range
    8387     */
    8488    public Pair<StyleList, Range> getStyleCacheWithRange(OsmPrimitive osm, double scale, NavigatableComponent nc) {
     
    169173     * or area) If not, add a default line style from the area color of the multipolygon.
    170174     *
     175     * @param osm OSM primitive
     176     * @param scale scale
     177     * @param nc navigatable component
     178     * @return pair containing style list and range
    171179     */
    172180    private Pair<StyleList, Range> getImpl(OsmPrimitive osm, double scale, NavigatableComponent nc) {
     
    372380    /**
    373381     * Draw a default node symbol for nodes that have no style?
     382     * @return {@code true} if default node symbol must be drawn
    374383     */
    375384    private boolean isDefaultNodes() {
     
    383392    /**
    384393     * Draw a default line for ways that do not have an own line style?
     394     * @return {@code true} if default line must be drawn
    385395     */
    386396    private boolean isDefaultLines() {
     
    422432    /**
    423433     * add a style source; only accessed from MapPaintStyles
     434     * @param style style source to add
    424435     */
    425436    void add(StyleSource style) {
     
    429440    /**
    430441     * set the style sources; only accessed from MapPaintStyles
     442     * @param sources new style sources
    431443     */
    432444    void setStyleSources(Collection<StyleSource> sources) {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/Environment.java

    r8840 r9239  
    5353    /**
    5454     * Creates a new environment.
     55     * @param osm OSM primitive
    5556     * @since 8415
    5657     */
     
    6162    /**
    6263     * Creates a new environment.
     64     * @param osm OSM primitive
     65     * @param mc multi cascade
     66     * @param layer layer
     67     * @param source style source
    6368     */
    6469    public Environment(OsmPrimitive osm, MultiCascade mc, String layer, StyleSource source) {
     
    9095    /**
    9196     * Creates a clone of this environment, with the specified primitive.
     97     * @param osm OSM primitive
    9298     * @return A clone of this environment, with the specified primitive
    9399     * @see #osm
     
    177183    /**
    178184     * Creates a clone of this environment, with the specified {@link Context}.
     185     * @param context context
    179186     * @return A clone of this environment, with the specified {@code Context}
    180187     */
  • trunk/src/org/openstreetmap/josm/gui/mappaint/MapPaintStyles.java

    r9078 r9239  
    150150    /**
    151151     * No icon with the given name was found, show a dummy icon instead
     152     * @param source style source
    152153     * @return the icon misc/no_icon.png, in descending priority:
    153154     *   - relative to source file
  • trunk/src/org/openstreetmap/josm/gui/mappaint/MultiCascade.java

    r9078 r9239  
    3131     * a new layer with that name and return it. The new layer will be
    3232     * a clone of the "*" layer, if it exists.
     33     * @param layer layer
     34     * @return cascade
    3335     */
    3436    public Cascade getOrCreateCascade(String layer) {
     
    5254
    5355    /**
    54      * Read-only version of getOrCreateCascade. For convenience, it returns an
     56     * Read-only version of {@link #getOrCreateCascade}. For convenience, it returns an
    5557     * empty cascade for non-existing layers. However this empty (read-only) cascade
    5658     * is not added to this MultiCascade object.
     59     * @param layer layer
     60     * @return cascade
    5761     */
    5862    public Cascade getCascade(String layer) {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/Range.java

    r8958 r9239  
    5555     *
    5656     * result (----------------]
     57     * @param x value
     58     * @param other other range
     59     * @return reduced range
    5760     */
    5861    public Range reduceAround(double x, Range other) {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/StyleCache.java

    r9078 r9239  
    103103    /**
    104104     * looks up styles for a certain scale value
     105     * @param scale scale
     106     * @return style list
    105107     */
    106108    public StyleList get(double scale) {
     
    118120     * looks up styles for a certain scale value and additionally returns
    119121     * the scale range for the returned styles
     122     * @param scale scale
     123     * @return pair containing syle list and range
    120124     */
    121125    public Pair<StyleList, Range> getWithRange(double scale) {
     
    137141     * add a new styles to the cache. this is only possible, if
    138142     * for this scale range, there is nothing in the cache yet.
     143     * @param sl style list
     144     * @param lower lower bound
     145     * @param upper upper bound
     146     * @return interned style cache
    139147     */
    140148    public StyleCache put(StyleList sl, double lower, double upper) {
     
    165173     *         (--------]
    166174     *       lower     upper
     175     * @param sl style list
     176     * @param lower lower bound
     177     * @param upper upper bound
    167178     */
    168179    private void putImpl(StyleList sl, double lower, double upper) {
     
    227238    /**
    228239     * Like String.intern() (reduce memory consumption).
    229      * StyleCache must not be changed after it has
    230      * been added to the intern pool.
     240     * StyleCache must not be changed after it has been added to the intern pool.
     241     * @return style cache
    231242     */
    232243    public StyleCache intern() {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/TextElement.java

    r8510 r9239  
    7676     *
    7777     * @param c the style properties
    78      * @return the label composition strategy
     78     * @param defaultAnnotate whether to return {@link #AUTO_LABEL_COMPOSITION_STRATEGY} if not strategy is found
     79     * @return the label composition strategy, or {@code null}
    7980     */
    8081    protected static LabelCompositionStrategy buildLabelCompositionStrategy(Cascade c, boolean defaultAnnotate) {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/ExpressionFactory.java

    r9114 r9239  
    402402         * @param env the environment
    403403         * @param key the property key
     404         * @param layer layer
    404405         * @return the property value
    405406         */
     
    422423         * @param env the environment
    423424         * @param key the property key
     425         * @param layer layer
    424426         * @return {@code true} if the property is set, {@code false} otherwise
    425427         */
     
    676678         * Obtains the JOSM'key {@link org.openstreetmap.josm.data.Preferences} string for key {@code key},
    677679         * and defaults to {@code def} if that is null.
     680         * @param env the environment
    678681         * @param key Key in JOSM preference
    679682         * @param def Default value
     
    11351138        /**
    11361139         * Constructs a new {@code ParameterFunction}.
     1140         * @param m method
     1141         * @param args arguments
     1142         * @param needsEnvironment whether function needs environment
    11371143         */
    11381144        public ParameterFunction(Method m, List<Expression> args, boolean needsEnvironment) {
     
    12081214        /**
    12091215         * Constructs a new {@code ArrayFunction}.
     1216         * @param m method
     1217         * @param args arguments
    12101218         */
    12111219        public ArrayFunction(Method m, List<Expression> args) {
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/MapCSSParser.jj

    r9099 r9239  
    5252 *
    5353 */
    54 
    5554public class MapCSSParser {
    5655    MapCSSStyleSource sheet;
     
    7776    /**
    7877     * Constructor which initializes the parser with a certain lexical state.
     78     * @param in input
     79     * @param encoding contents encoding
     80     * @param initState initial state
    7981     */
    8082    public MapCSSParser(InputStream in, String encoding, LexicalState initState) {
     
    9597    /**
    9698     * Constructor which initializes the parser with a certain lexical state.
     99     * @param in input
     100     * @param initState initial state
    97101     */
    98102    public MapCSSParser(Reader in, LexicalState initState) {
     
    108112PARSER_END(MapCSSParser)
    109113
    110 /*************
     114/**
    111115 * Token definitions
    112116 *
     
    222226
    223227
    224 /*************
    225  *
     228/*
    226229 * Preprocessor parser definitions:
    227230 *
     
    243246/**
    244247 * root method for the preprocessor.
     248 * @param sheet MapCSS style source
     249 * @return result string
     250 * @throws ParseException in case of parsing error
    245251 */
    246252String pp_root(MapCSSStyleSource sheet):
     
    260266 *
    261267 * @param write false if this content should be skipped (@pp_media condition is not fulfilled), true otherwise
     268 * @throws ParseException in case of parsing error
    262269 */
    263270void pp_black_box(boolean write):
     
    284291 * @param ignore if the content of this rule should be ignored
    285292 * (because we are already inside a @supports block that didn't pass)
     293 * @throws ParseException in case of parsing error
    286294 */
    287295void pp_supports(boolean ignore):
     
    302310 * Unlike other parsing rules, grabs trailing whitespace.
    303311 * @return true, if the condition is fulfilled
     312 * @throws ParseException in case of parsing error
    304313 */
    305314boolean pp_supports_condition():
     
    329338 *
    330339 * @return true, if the condition is fulfilled
     340 * @throws ParseException in case of parsing error
    331341 */
    332342boolean pp_supports_condition_in_parens():
     
    350360 *
    351361 * @return true if the condition is fulfilled
     362 * @throws ParseException in case of parsing error
    352363 */
    353364boolean pp_supports_declaration_condition():
     
    411422 *
    412423 * @return true if the condition is fulfilled
     424 * @throws ParseException in case of parsing error
    413425 */
    414426// deprecated
     
    443455}
    444456
    445 /*************
    446  *
     457/*
    447458 * Parser definition for the main MapCSS parser:
    448459 *
     
    542553/**
    543554 * white-space
     555 * @throws ParseException in case of parsing error
    544556 */
    545557void s() :
     
    552564/**
    553565 * mix of white-space and comments
     566 * @throws ParseException in case of parsing error
    554567 */
    555568void w() :
     
    562575/**
    563576 * comma delimited list of floats (at least 2, all &gt;= 0)
     577 * @return list of floats
     578 * @throws ParseException in case of parsing error
    564579 */
    565580List<Float> float_array() :
     
    581596/**
    582597 * entry point for the main parser
     598 * @param sheet MapCSS style source
     599 * @throws ParseException in case of parsing error
    583600 */
    584601void sheet(MapCSSStyleSource sheet):
  • trunk/src/org/openstreetmap/josm/gui/mappaint/mapcss/Selector.java

    r9078 r9239  
    9494
    9595        /**
    96          *
     96         * Constructs a new {@code ChildOrParentSelector}.
    9797         * @param a the first selector
     98         * @param link link
    9899         * @param b the second selector
    99100         * @param type the selector type
  • trunk/src/org/openstreetmap/josm/gui/mappaint/xml/LinemodPrototype.java

    r8513 r9239  
    3131    }
    3232
    33     /** get width for overlays */
     33    /**
     34     * get width for overlays
     35     * @param ref reference width
     36     * @return width according to {@link #widthMode} with a minimal value of 1
     37     */
    3438    public float getWidth(float ref) {
    3539        float res;
  • trunk/src/org/openstreetmap/josm/gui/mappaint/xml/XmlStyleSource.java

    r8870 r9239  
    140140     * @param scale ignored if null, otherwise checks if scale is within the range of candidate
    141141     * @param mc side effect: update the valid region for the current MultiCascade
     142     * @return {@code true} if {@code candidate} is better than the current match
    142143     */
    143144    private static boolean requiresUpdate(Prototype current, Prototype candidate, Double scale, MultiCascade mc) {
     
    181182
    182183    /**
     184     * @param primitive OSM primitive
    183185     * @param closed The primitive is a closed way or we pretend it is closed.
    184186     *  This is useful for multipolygon relations and outer ways of untagged
  • trunk/src/org/openstreetmap/josm/gui/preferences/PreferenceTabbedPane.java

    r9075 r9239  
    274274     * Construct a PreferencePanel for the preference settings. Layout is GridBagLayout
    275275     * and a centered title label and the description are added.
     276     * @param caller Preference settings, that display a top level tab
    276277     * @return The created panel ready to add other controls.
    277278     */
     
    283284     * Construct a PreferencePanel for the preference settings. Layout is GridBagLayout
    284285     * and a centered title label and the description are added.
     286     * @param caller Preference settings, that display a top level tab
    285287     * @param inScrollPane if <code>true</code> the added tab will show scroll bars
    286288     *        if the panel content is larger than the available space
     
    288290     */
    289291    public PreferencePanel createPreferenceTab(TabPreferenceSetting caller, boolean inScrollPane) {
    290         CheckParameterUtil.ensureParameterNotNull(caller);
     292        CheckParameterUtil.ensureParameterNotNull(caller, "caller");
    291293        PreferencePanel p = new PreferencePanel(caller);
    292294
  • trunk/src/org/openstreetmap/josm/gui/preferences/SourceEditor.java

    r9078 r9239  
    416416
    417417    /**
    418      * Provide the GUI strings. (There are differences for MapPaint and Preset)
     418     * Provide the GUI strings. (There are differences for MapPaint, Preset and TagChecker Rule)
     419     * @param ident any {@link I18nString} value
     420     * @return the translated string for {@code ident}
    419421     */
    420422    protected abstract String getStr(I18nString ident);
     
    423425     * Identifiers for strings that need to be provided.
    424426     */
    425     public enum I18nString { AVAILABLE_SOURCES, ACTIVE_SOURCES, NEW_SOURCE_ENTRY_TOOLTIP, NEW_SOURCE_ENTRY,
    426         REMOVE_SOURCE_TOOLTIP, EDIT_SOURCE_TOOLTIP, ACTIVATE_TOOLTIP, RELOAD_ALL_AVAILABLE,
    427         LOADING_SOURCES_FROM, FAILED_TO_LOAD_SOURCES_FROM, FAILED_TO_LOAD_SOURCES_FROM_HELP_TOPIC,
    428         ILLEGAL_FORMAT_OF_ENTRY }
     427    public enum I18nString {
     428        /** Available (styles|presets|rules) */
     429        AVAILABLE_SOURCES,
     430        /** Active (styles|presets|rules) */
     431        ACTIVE_SOURCES,
     432        /** Add a new (style|preset|rule) by entering filename or URL */
     433        NEW_SOURCE_ENTRY_TOOLTIP,
     434        /** New (style|preset|rule) entry */
     435        NEW_SOURCE_ENTRY,
     436        /** Remove the selected (styles|presets|rules) from the list of active (styles|presets|rules) */
     437        REMOVE_SOURCE_TOOLTIP,
     438        /** Edit the filename or URL for the selected active (style|preset|rule) */
     439        EDIT_SOURCE_TOOLTIP,
     440        /** Add the selected available (styles|presets|rules) to the list of active (styles|presets|rules) */
     441        ACTIVATE_TOOLTIP,
     442        /** Reloads the list of available (styles|presets|rules) */
     443        RELOAD_ALL_AVAILABLE,
     444        /** Loading (style|preset|rule) sources */
     445        LOADING_SOURCES_FROM,
     446        /** Failed to load the list of (style|preset|rule) sources */
     447        FAILED_TO_LOAD_SOURCES_FROM,
     448        /** /Preferences/(Styles|Presets|Rules)#FailedToLoad(Style|Preset|Rule)Sources */
     449        FAILED_TO_LOAD_SOURCES_FROM_HELP_TOPIC,
     450        /** Illegal format of entry in (style|preset|rule) list */
     451        ILLEGAL_FORMAT_OF_ENTRY
     452    }
    429453
    430454    public boolean hasActiveSourcesChanged() {
  • trunk/src/org/openstreetmap/josm/gui/preferences/SubPreferenceSetting.java

    r8958 r9239  
    1212    /**
    1313     * Returns the preference setting (displayed in the specified preferences tab pane) that contains this preference setting.
     14     * @param gui preferences tabbed pane
    1415     * @return parent preference setting
    1516     */
  • trunk/src/org/openstreetmap/josm/gui/preferences/ToolbarPreferences.java

    r9078 r9239  
    10181018
    10191019    /**
     1020     * @param action Action to register
    10201021     * @return The parameter (for better chaining)
    10211022     */
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ExportProfileAction.java

    r8846 r9239  
    3434    /**
    3535     * Constructs a new {@code ExportProfileAction}.
     36     * @param prefs preferences
     37     * @param schemaKey filename prefix
     38     * @param prefPattern preference key pattern used to determine which entries are exported
    3639     */
    3740    public ExportProfileAction(Preferences prefs, String schemaKey, String prefPattern) {
     
    6770            @Override
    6871            public boolean accept(File f) {
    69                 return f.isDirectory() || Utils.hasExtension(f, "xml") && f.getName().toLowerCase(Locale.ENGLISH).startsWith(schemaKey);
     72                return f.isDirectory() || (Utils.hasExtension(f, "xml") && f.getName().toLowerCase(Locale.ENGLISH).startsWith(schemaKey));
    7073            }
    7174
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ListEditor.java

    r9078 r9239  
    3636     * Constructs a new {@code ListEditor}.
    3737     * @param gui The parent component
     38     * @param entry preference entry
     39     * @param setting list setting
    3840     */
    3941    public ListEditor(final JComponent gui, PrefEntry entry, ListSetting setting) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/ListListEditor.java

    r9078 r9239  
    5151     * Constructs a new {@code ListListEditor}.
    5252     * @param gui The parent component
     53     * @param entry preference entry
     54     * @param setting list of lists setting
    5355     */
    5456    public ListListEditor(final JComponent gui, PrefEntry entry, ListListSetting setting) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/advanced/StringEditor.java

    r9078 r9239  
    2626     * Constructs a new {@code StringEditor}.
    2727     * @param gui The parent component
     28     * @param entry preference entry
     29     * @param setting string setting
    2830     */
    2931    public StringEditor(final JComponent gui, PrefEntry entry, StringSetting setting) {
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/ListProjectionChoice.java

    r8510 r9239  
    5353    /**
    5454     * Convert 0-based index to preference value.
     55     * @param idx 0-based index
     56     * @return preference value
     57     * @see #zoneToIndex
    5558     */
    5659    protected abstract String indexToZone(int idx);
     
    5861    /**
    5962     * Convert preference value to 0-based index.
     63     * @param zone preference value
     64     * @return 0-based index
     65     * @see #indexToZone
    6066     */
    6167    protected abstract int zoneToIndex(String zone);
  • trunk/src/org/openstreetmap/josm/gui/preferences/projection/ProjectionChoice.java

    r7937 r9239  
    5858     * Will be called when the preference dialog is dismissed or
    5959     * when the listener from getPreferencePanel is invoked.
     60     * @param panel projection preferences panel
     61     * @return preferences as a list of strings; may be null to reset everything.
     62     * @see #setPreferences
    6063     */
    6164    Collection<String> getPreferences(JPanel panel);
     
    8285     * @return the name
    8386     */
     87    @Override
    8488    String toString();
    8589}
Note: See TracChangeset for help on using the changeset viewer.