org.opencms.jsp.util.CmsJspScaledImageBean Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of opencms-test Show documentation
Show all versions of opencms-test Show documentation
OpenCms is an enterprise-ready, easy to use website content management system based on Java and XML technology. Offering a complete set of features, OpenCms helps content managers worldwide to create and maintain beautiful websites fast and efficiently.
package org.opencms.jsp.util;
import java.util.HashMap;
import java.util.Map;
/**
* Bean extending the CmsJspImageBean with an additional Map containing hi-DPI variants of the same image.
*/
public class CmsJspScaledImageBean extends CmsJspImageBean {
/**
* Internal Map used to store the hi-DPI variants of the image.
*
* - key: the variant multiplier, e.g. "2x" (the common retina multiplier)
* - value: a CmsJspImageBean representing the hi-DPI variant
*
*/
private Map m_hiDpiImages;
/**
* adds a CmsJspImageBean as hi-DPI variant to this image
* @param factor the variant multiplier, e.g. "2x" (the common retina multiplier)
* @param image the image to be used for this variant
*/
public void addHiDpiImage(String factor, CmsJspImageBean image) {
if (m_hiDpiImages == null) {
m_hiDpiImages = new HashMap<>();
}
m_hiDpiImages.put(factor, image);
}
/**
* Returns the map containing all hi-DPI variants of this image.
* @return Map containing the hi-DPI variants of the image.
*
* - key: the variant multiplier, e.g. "2x" (the common retina multiplier)
* - value: a CmsJspImageBean representing the hi-DPI variant
*
*/
public Map getHiDpiImages() {
return m_hiDpiImages;
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy