Ignore:
Timestamp:
2017-06-02T21:39:27+02:00 (7 years ago)
Author:
michael2402
Message:

Javadoc for package org.openstreetmap.josm.gui.mappaint.styleelement

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/mappaint/styleelement/MapImage.java

    r10748 r12303  
    3333    private BufferedImage img;
    3434
     35    /**
     36     * The alpha (opacity) value of the image. It is multiplied to the image alpha channel.
     37     * Range: 0...255
     38     */
    3539    public int alpha = 255;
     40    /**
     41     * The name of the image that should be displayed. It is given to the {@link ImageProvider}
     42     */
    3643    public String name;
     44    /**
     45     * The StyleSource that registered the image
     46     */
    3747    public StyleSource source;
     48    /**
     49     * A flag indicating that the image should automatically be scaled to the right size.
     50     */
    3851    public boolean autoRescale;
     52    /**
     53     * The width of the image, as set by MapCSS
     54     */
    3955    public int width = -1;
     56    /**
     57     * The height of the image, as set by MapCSS
     58     */
    4059    public int height = -1;
     60    /**
     61     * The x offset of the anchor of this image
     62     */
    4163    public int offsetX;
     64    /**
     65     * The y offset of the anchor of this image
     66     */
    4267    public int offsetY;
    4368
    4469    private boolean temporary;
     70
     71    /**
     72     * A cache that holds a disabled (gray) version of this image
     73     */
    4574    private BufferedImage disabledImgCache;
    4675
     76    /**
     77     * Creates a new {@link MapImage}
     78     * @param name The image name
     79     * @param source The style source that requests this image
     80     */
    4781    public MapImage(String name, StyleSource source) {
    4882        this(name, source, true);
    4983    }
    5084
     85    /**
     86     * Creates a new {@link MapImage}
     87     * @param name The image name
     88     * @param source The style source that requests this image
     89     * @param autoRescale A flag indicating to automatically adjust the width/height of the image
     90     */
    5191    public MapImage(String name, StyleSource source, boolean autoRescale) {
    5292        this.name = name;
     
    125165    }
    126166
     167    /**
     168     * Gets the image width
     169     * @return The real image width
     170     */
    127171    public int getWidth() {
    128172        return getImage().getWidth(null);
    129173    }
    130174
     175    /**
     176     * Gets the image height
     177     * @return The real image height
     178     */
    131179    public int getHeight() {
    132180        return getImage().getHeight(null);
    133181    }
    134182
     183    /**
     184     * Gets the alpha value the image should be multiplied with
     185     * @return The value in range 0..1
     186     */
    135187    public float getAlphaFloat() {
    136188        return Utils.colorInt2float(alpha);
     
    187239    }
    188240
     241    /**
     242     * Gets a box provider that provides a box that covers the size of this image
     243     * @return The box provider
     244     */
    189245    public BoxProvider getBoxProvider() {
    190246        return new MapImageBoxProvider();
Note: See TracChangeset for help on using the changeset viewer.