Ignore:
Timestamp:
2017-11-19T19:07:47+01:00 (6 years ago)
Author:
Don-vip
Message:

see #15476 - fix checkstyle/pmd warnings, add some javadoc

File:
1 edited

Legend:

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

    r13127 r13129  
    617617     * implementation, which adds support for HiDPI displays. The effect will be
    618618     * that in HiDPI mode, when GUI elements are scaled by a factor 1.5, 2.0, etc.,
    619      * the images are not just up-scaled, but a higher resolution version of the
    620      * image is rendered instead.
     619     * the images are not just up-scaled, but a higher resolution version of the image is rendered instead.
    621620     * <p>
    622      * Use {@link HiDPISupport#getBaseImage(java.awt.Image)} to extract the original
    623      * image from a multi-resolution image.
     621     * Use {@link HiDPISupport#getBaseImage(java.awt.Image)} to extract the original image from a multi-resolution image.
    624622     * <p>
    625      * See {@link HiDPISupport#processMRImage} for how to process the image without
    626      * removing the multi-resolution magic.
     623     * See {@link HiDPISupport#processMRImage} for how to process the image without removing the multi-resolution magic.
    627624     * @param multiResolution true, if multi-resolution image is requested
    628625     * @return the current object, for convenience
     
    821818            // This method is called from different thread and modifying HashMap concurrently can result
    822819            // for example in loops in map entries (ie freeze when such entry is retrieved)
    823             // Yes, it did happen to me :-)
    824820            if (name == null)
    825821                return null;
     
    911907                        // and redundant when you have a whole ton of objects. So,
    912908                        // index the cache by the name of the icon we're looking for
    913                         // and don't bother to create a URL unless we're actually
    914                         // creating the image.
     909                        // and don't bother to create a URL unless we're actually creating the image.
    915910                        URL path = getImageUrl(fullName);
    916911                        if (path == null) {
     
    16181613     * has a transparency set to {@code TRANSLUCENT} and uses the correct transparent color.
    16191614     *
    1620      * @return a <code>BufferedImage</code> containing the decoded
    1621      * contents of the input, or <code>null</code>.
     1615     * @return a <code>BufferedImage</code> containing the decoded contents of the input, or <code>null</code>.
    16221616     *
    16231617     * @throws IllegalArgumentException if <code>input</code> is <code>null</code>.
     
    16731667     * has a transparency set to {@code TRANSLUCENT} and uses the correct transparent color.
    16741668     *
    1675      * @return a <code>BufferedImage</code> containing the decoded
    1676      * contents of the input, or <code>null</code>.
     1669     * @return a <code>BufferedImage</code> containing the decoded contents of the input, or <code>null</code>.
    16771670     *
    16781671     * @throws IllegalArgumentException if <code>input</code> is <code>null</code>.
     
    17171710     * has a transparency set to {@code TRANSLUCENT} and uses the correct transparent color.
    17181711     *
    1719      * @return a <code>BufferedImage</code> containing the decoded
    1720      * contents of the input, or <code>null</code>.
     1712     * @return a <code>BufferedImage</code> containing the decoded contents of the input, or <code>null</code>.
    17211713     *
    17221714     * @throws IllegalArgumentException if <code>input</code> is <code>null</code>.
     
    19871979    public static BufferedImage toBufferedImage(Image image, Rectangle crop_area) {
    19881980        BufferedImage buffImage = null;
    1989 
    19901981        Rectangle r = new Rectangle(image.getWidth(null), image.getHeight(null));
    19911982        if (r.intersection(crop_area).equals(crop_area)) {
    19921983            buffImage = new BufferedImage(crop_area.width, crop_area.height, BufferedImage.TYPE_INT_ARGB);
    19931984            Graphics2D g2 = buffImage.createGraphics();
    1994             g2.drawImage(image,
    1995                 0, 0, crop_area.width, crop_area.height,
    1996                 crop_area.x, crop_area.y,
    1997                 crop_area.x + crop_area.width, crop_area.y + crop_area.height,
    1998                 null);
     1985            g2.drawImage(image, 0, 0, crop_area.width, crop_area.height,
     1986                crop_area.x, crop_area.y, crop_area.x + crop_area.width, crop_area.y + crop_area.height, null);
    19991987            g2.dispose();
    20001988        }
Note: See TracChangeset for help on using the changeset viewer.