{@inheritDoc}

@see XHTMLImageRenderer#onImage(org.xwiki.rendering.listener.reference.ResourceReference , boolean,
java.util.Map)
@since 2.5RC1
972541
@Override
    public void onImage(ResourceReference reference, boolean freestanding, Map<String, String> parameters)
    {
        Map<String, String> attributes = new LinkedHashMap<String, String>();

        try {
            // First we need to compute the image SRC attribute value.
            String imageSrcAttributeValue = getImageSrcAttributeValue(reference, parameters);

            // Then add it as an attribute of the IMG element.
            attributes.put(XHTMLImageRenderer.SRC, imageSrcAttributeValue);

            // Add the class if we're on a freestanding uri
            if (freestanding) {
                attributes.put(CLASS, "wikimodel-freestanding");
            }

            // Add the other parameters as attributes
            attributes.putAll(parameters);

            // If no ALT attribute has been specified, add it since the XHTML specifications makes it mandatory.
            if (!parameters.containsKey(XHTMLImageRenderer.ALTERNATE)) {
                attributes.put(XHTMLImageRenderer.ALTERNATE, computeAltAttributeValue(reference));
            }

            // And generate the XHTML IMG element.
            getXHTMLWikiPrinter().printXMLElement(XHTMLImageRenderer.IMG, attributes);
        } catch (Throwable e) {
            // Error title
            getXHTMLWikiPrinter().printXMLStartElement(SPAN, new String[][] { { CLASS, "xwikirenderingerror" } });
            getXHTMLWikiPrinter().printXML(e.getMessage());
            getXHTMLWikiPrinter().printXMLEndElement(SPAN);

            // Error details
            getXHTMLWikiPrinter().printXMLStartElement(SPAN,
                new String[][] { { CLASS, "xwikirenderingerrordescription hidden" } });
            getXHTMLWikiPrinter().printXMLStartElement(TT, new String[][] { { CLASS, "wikimodel-verbatim" } });
            getXHTMLWikiPrinter().printXML(ExceptionUtils.getStackTrace(e));
            getXHTMLWikiPrinter().printXMLEndElement(TT);
            getXHTMLWikiPrinter().printXMLEndElement(SPAN);
        }
    }
1072856
public void setImageBuilderErrors(java.util.Collection<ResourceError> imageBuilderErrors) {
        if (imageBuilderErrors == null) {
            this.imageBuilderErrors = null;
            return;
        }

        this.imageBuilderErrors = new java.util.ArrayList<ResourceError>(imageBuilderErrors);
    }
1056836
public final void setDialogWindowBackground(@DrawableRes final int resourceId) {
        this.dialogWindowBackground = ContextCompat.getDrawable(getContext(), resourceId);
        this.dialogWindowBackgroundBitmap = null;
        this.dialogWindowBackgroundId = resourceId;
    }
602759
public void setImage(final GVRImage imageData)
    {
        mImage = imageData;
        if (imageData != null)
            NativeTexture.setImage(getNative(), imageData, imageData.getNative());
        else
            NativeTexture.setImage(getNative(), null, 0);
    }
712717
public void setImaginary(T value, int m, int n)
    {
        setImaginary( value, getIndex(m,n) );
    }
503294
public void drawImage(final Context2D context)
    {
        if (isLoaded())
        {
            doUpdateCheck();

            if (context.isSelection())
            {
                if (ImageSelectionMode.SELECT_BOUNDS == m_image.getImageSelectionMode())
                {
                    context.setFillColor(m_image.getColorKey());

                    context.beginPath();

                    context.rect(0, 0, m_dest_wide, m_dest_high);

                    context.fill();

                    context.closePath();
                }
                else
                {
                    context.drawImage(m_selectImage.getElement(), 0, 0);
                }
            }
            else
            {
                if (m_fastout)
                {
                    context.drawImage(m_jsimg, m_clip_xpos, m_clip_ypos, m_clip_wide, m_clip_high, 0, 0, m_dest_wide, m_dest_high);
                }
                else
                {
                    context.drawImage(m_filterImage.getElement(), 0, 0);
                }
            }
        }
    }
421141
@Override
    public void onDataChanged(DataEventBuffer dataEvents) {
        for (DataEvent dataEvent : dataEvents) {
            String path = dataEvent.getDataItem().getUri().getPath();
            Log.d(TAG, "onDataChanged(" + path + ")");
            if (path.startsWith(DAVINCI_PATH)) { //if it's a davinci path
                Log.d(TAG, "davinci-onDataChanged " + path);

                //download the bitmap and add it to cache
                Asset asset = DataMapItem.fromDataItem(dataEvent.getDataItem()).getDataMap().getAsset(DAVINCI_ASSET_IMAGE);
                Bitmap bitmap = loadBitmapFromAsset(asset);
                if (bitmap != null)
                    saveBitmap(getKey(path), bitmap);

                //callbacks
                callIntoWaiting(path);
            }
        }
    }
950369
public void setImageDrawable(Drawable drawable, boolean animate) {
        if (view != null) {
            ((ImageView) view).setImageDrawable(drawable);
        }
    }
374356
public void imageUpdate(ImageReader source, BufferedImage theImage,
            int minX, int minY, int width, int height, int periodX,
            int periodY, int[] bands)
    {
        if (image == null || !image.equals(theImage))
        {
            repaint(0);
            image = theImage;
        }
    }
1349504
public void setIcon(final Image IMAGE) {
        if (null == icon) {
            _icon = IMAGE;
            fireSectionEvent(UPDATE_EVENT);
        } else {
            icon.set(IMAGE);
        }
    }
1121198
public void setImageName(String imageName) {
		if (imageName.length() == 0) {
			imageName = null;
		}

		this.imageName = imageName;
		if (imageName == null) {
			image = null;
		} else {
			updateImage = true;
		}
	}
158660
private ResourceReference getResourceReference()
	{
		final Map<String, Object> map = new HashMap<>();
		map.put("url", WicketUrlExtensions.getUrlAsString(pageClass));
		final ResourceReference resourceReference = new TextTemplateResourceReference(pageClass,
			this.filename, "text/javascript", Model.ofMap(map));
		return resourceReference;
	}
1327519
public static <IMAGE extends ImageView> void doLoadImageUrl(@NonNull IMAGE view, @Nullable String url) {
        Preconditions.checkState(sImageSetter != null, "ImageSetter must be initialized before calling image load");
        sImageSetter.doLoadImageUrl(view, url);
    }
566408
public void setImage(BufferedImage image) {
		this.image = image;
		setPreferredSize(new Dimension(image.getWidth(), image.getHeight()));
		setSize(new Dimension(image.getWidth(), image.getHeight()));
		getParent().repaint(0);
	}
212202
public T image(int resid) {

        if (view instanceof ImageView) {
            ImageView iv = (ImageView) view;
            if (resid == 0) {
                iv.setImageBitmap(null);
            } else {
                iv.setImageResource(resid);
            }
        }

        return self();
    }
959937
public void setImage(I image, D derivX, D derivY) {
		InputSanityCheck.checkSameShape(image, derivX, derivY);

		this.image = image;
		this.interpInput.setImage(image);

		this.derivX = derivX;
		this.derivY = derivY;
	}
829354
protected void setResponsiveImageSource(HtmlElement<?> mediaElement, JSONArray responsiveImageSources, Media media) {
    mediaElement.setData(PROP_RESPONSIVE_SOURCES, responsiveImageSources.toString());
  }