Changeset 7731 in josm for trunk/src/org/openstreetmap


Ignore:
Timestamp:
2014-11-18T23:34:19+01:00 (5 years ago)
Author:
Don-vip
Message:

see #10684 - fix javadoc

Location:
trunk/src/org/openstreetmap/josm/tools
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/tools/ImageProvider.java

    r7706 r7731  
    9595     */
    9696    public static enum OverlayPosition {
    97         NORTHWEST, NORTHEAST, SOUTHWEST, SOUTHEAST
     97        /** North west */
     98        NORTHWEST,
     99        /** North east */
     100        NORTHEAST,
     101        /** South west */
     102        SOUTHWEST,
     103        /** South east */
     104        SOUTHEAST
    98105    }
    99106
     
    113120     */
    114121    public static enum ImageSizes {
    115         /* SMALL_ICON value of on Action */
     122        /** SMALL_ICON value of on Action */
    116123        SMALLICON,
    117         /* LARGE_ICON_KEY value of on Action */
     124        /** LARGE_ICON_KEY value of on Action */
    118125        LARGEICON,
    119         /* MAP icon */
     126        /** MAP icon */
    120127        MAP,
    121         /* MAP icon maximum size */
     128        /** MAP icon maximum size */
    122129        MAPMAX,
    123         /* MENU icon size */
     130        /** MENU icon size */
    124131        MENU,
    125132    }
     
    169176     */
    170177    public interface ImageCallback {
     178        /**
     179         * Called when image loading has finished.
     180         * @param result the loaded image icon
     181         */
    171182        void finished(ImageIcon result);
    172183    }
     
    177188     */
    178189    public interface ImageResourceCallback {
     190        /**
     191         * Called when image loading has finished.
     192         * @param result the loaded image resource
     193         */
    179194        void finished(ImageResource result);
    180195    }
     
    247262    /**
    248263     * Convert enumerated size values to real numbers
    249      * @return dimension of image
     264     * @param size the size enumeration
     265     * @return dimension of image in pixels
    250266     * @since 7687
    251267     */
     
    496512
    497513    /**
     514     * Load an image with a given file name.
     515     *
    498516     * @param name The icon name (base name with or without '.png' or '.svg' extension)
    499517     * @return the requested image or null if the request failed
     
    933951    }
    934952
     953    /**
     954     * Load a cursor with a given file name, optionally decorated with an overlay image.
     955     *
     956     * @param name the cursor image filename in "cursor" directory
     957     * @param overlay optional overlay image
     958     * @return cursor with a given file name, optionally decorated with an overlay image
     959     */
    935960    public static Cursor getCursor(String name, String overlay) {
    936961        ImageIcon img = get("cursor", name);
     
    11111136    }
    11121137
     1138    /**
     1139     * Constructs an image from the given SVG data.
     1140     * @param svg the SVG data
     1141     * @param dim the desired image dimension
     1142     * @return an image from the given SVG data at the desired dimension.
     1143     */
    11131144    public static BufferedImage createImageFromSvg(SVGDiagram svg, Dimension dim) {
    11141145        float realWidth = svg.getWidth();
  • trunk/src/org/openstreetmap/josm/tools/ImageResource.java

    r7696 r7731  
    88import java.util.Map;
    99
     10import javax.swing.AbstractAction;
    1011import javax.swing.Action;
    11 import javax.swing.AbstractAction;
    1212import javax.swing.ImageIcon;
    1313
     
    2929    private Map<Dimension, Image> imgCache = new HashMap<>();
    3030    private SVGDiagram svg;
     31    /**
     32     * Use this dimension to request original file dimension.
     33     */
    3134    public static final Dimension DEFAULT_DIMENSION = new Dimension(-1, -1);
    3235
     36    /**
     37     * Constructs a new {@code ImageResource} from an image.
     38     * @param img the image
     39     */
    3340    public ImageResource(Image img) {
    3441        CheckParameterUtil.ensureParameterNotNull(img);
     
    3643    }
    3744
     45    /**
     46     * Constructs a new {@code ImageResource} from SVG data.
     47     * @param svg SVG data
     48     */
    3849    public ImageResource(SVGDiagram svg) {
    3950        CheckParameterUtil.ensureParameterNotNull(svg);
     
    4152    }
    4253
     54    /**
     55     * Returns the image icon at default dimension.
     56     * @return the image icon at default dimension
     57     */
    4358    public ImageIcon getImageIcon() {
    4459        return getImageIcon(DEFAULT_DIMENSION);
     
    4762    /**
    4863     * Set both icons of an Action
    49      * @param action The action for the icons
     64     * @param a The action for the icons
    5065     * @since 7693
    5166     */
     
    5671        a.putValue(Action.LARGE_ICON_KEY, icon);
    5772    }
    58    
     73
    5974    /**
    6075     * Get an ImageIcon object for the image of this resource
Note: See TracChangeset for help on using the changeset viewer.