/** * Sets the scaling type for the image.<p> * * If no valid integer is given, then "0" is used as value.<p> * * @param value the scaling type for the image to set */ public void setScaleType(String value) { m_scaler.setType(CmsStringUtil.getIntValue(value, 0, SCALE_ATTR_TYPE)); }
/** * Sets the scaling type for the image.<p> * * If no valid integer is given, then "0" is used as value.<p> * * @param value the scaling type for the image to set */ public void setScaleType(String value) { m_scaler.setType(CmsStringUtil.getIntValue(value, 0, SCALE_ATTR_TYPE)); }
/** * Initializes the crop area setting.<p> * * Only if all 4 required parameters have been set, the crop area is set accordingly. * Moreover, it is not required to specify the target image width and height when using crop, * because these parameters can be calculated from the crop area.<p> */ private void initCropArea() { if (isCropping()) { // crop area is set up correctly // adjust target image height or width if required if (m_width < 0) { m_width = m_cropWidth; } if (m_height < 0) { m_height = m_cropHeigt; } // set type to 0 - scale type is ignored when using crop setType(0); } }
/** * Initializes the crop area setting.<p> * * Only if all 4 required parameters have been set, the crop area is set accordingly. * Moreover, it is not required to specify the target image width and height when using crop, * because these parameters can be calculated from the crop area.<p> * * Scale type 6 and 7 are used for a 'crop around point' operation, see {@link #getType()} for a description.<p> */ private void initCropArea() { if (isCropping()) { // crop area is set up correctly // adjust target image height or width if required if (m_width < 0) { m_width = m_cropWidth; } if (m_height < 0) { m_height = m_cropHeight; } if ((getType() != 6) && (getType() != 7)) { // cropping type can only be 6 or 7 (point cropping) // all other values with cropping coordinates are invalid setType(0); } } }
/** * Returns the initialized image scaler object used to generate thumbnails for the dialog form.<p> * * @return the initialized image scaler object used to generate thumbnails for the dialog form */ protected CmsImageScaler getImageScaler() { if (m_imageScaler == null) { // not initialized, create image scaler with default settings m_imageScaler = new CmsImageScaler(); m_imageScaler.setWidth(THUMB_WIDTH); m_imageScaler.setHeight(THUMB_HEIGHT); m_imageScaler.setRenderMode(Simapi.RENDER_SPEED); m_imageScaler.setColor(new Color(0, 0, 0)); m_imageScaler.setType(1); } return m_imageScaler; }
/** * Returns the initialized image scaler object used to generate thumbnails for the dialog form.<p> * * @return the initialized image scaler object used to generate thumbnails for the dialog form */ protected CmsImageScaler getImageScaler() { if (m_imageScaler == null) { // not initialized, create image scaler with default settings m_imageScaler = new CmsImageScaler(); m_imageScaler.setWidth(THUMB_WIDTH); m_imageScaler.setHeight(THUMB_HEIGHT); m_imageScaler.setRenderMode(Simapi.RENDER_SPEED); m_imageScaler.setColor(new Color(0, 0, 0)); m_imageScaler.setType(1); } return m_imageScaler; }
} else if (SCALE_PARAM_TYPE.equals(k)) { setType(CmsStringUtil.getIntValue(v, -1, CmsImageScaler.SCALE_PARAM_TYPE)); } else if (SCALE_PARAM_COLOR.equals(k)) {
} else if (SCALE_PARAM_TYPE.equals(k)) { setType(CmsStringUtil.getIntValue(v, -1, CmsImageScaler.SCALE_PARAM_TYPE)); } else if (SCALE_PARAM_COLOR.equals(k)) {
if (!m_defaultScaleParams.isValid()) { m_defaultScaleParams.setType(0); m_defaultScaleParams.setPosition(0); m_defaultScaleParams.setWidth(120);
if (!m_defaultScaleParams.isValid()) { m_defaultScaleParams.setType(0); m_defaultScaleParams.setPosition(0); m_defaultScaleParams.setWidth(120);
scaler.setType(2); scaler.setHeight(192); scaler.setWidth(192);
result.setType(type); return result;