⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cmsjsptagimage.java

📁 一个cms内容管理平台
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
    }

    /**
     * Returns the filter list used by the image scaler.<p>
     *
     * @return the filter list used by the image scaler
     */
    public String getScaleFilter() {

        return m_scaler.getFiltersString();
    }

    /**
     * Returns the position used by the image scaler.<p>
     *
     * @return the position used by the image scaler
     */
    public String getScalePosition() {

        return String.valueOf(m_scaler.getPosition());
    }

    /**
     * Returns the quality used by the image scaler.<p>
     *
     * @return the quality used by the image scaler
     */
    public String getScaleQuality() {

        return String.valueOf(m_scaler.getQuality());
    }

    /**
     * Returns the render mode used by the image scaler.<p>
     *
     * @return the render mode used by the image scaler
     */
    public String getScaleRendermode() {

        return String.valueOf(m_scaler.getRenderMode());
    }

    /**
     * Returns the scaling type for the image.<p>
     * 
     * @return the scaling type for the image
     */
    public String getScaleType() {

        return String.valueOf(m_scaler.getType());
    }

    /**
     * Returns the source of the image to scale, 
     * which will have the OpenCms webapp / servlet prefix added.<p>
     * 
     * @return the source of the image to scale
     */
    public String getSrc() {

        return m_src;
    }

    /** 
     * Returns the value of the HTML "style" attribute.<p>
     * 
     * @return the value of the HTML "style" attribute
     */
    public String getStyle() {

        return getAttribute(ATTR_STYLE);
    }

    /** 
     * Returns the value of the HTML "title" attribute.<p>
     * 
     * @return the value of the HTML "title" attribute
     */
    public String getTitle() {

        return getAttribute(ATTR_TITLE);
    }

    /** 
     * Returns the value of the HTML "usemap" attribute.<p>
     * 
     * @return the value of the HTML "usemap" attribute
     */
    public String getUsemap() {

        return getAttribute(ATTR_USEMAP);
    }

    /** 
     * Returns the value of the HTML "vspace" attribute.<p>
     * 
     * @return the value of the HTML "vspace" attribute
     */
    public String getVspace() {

        return getAttribute(ATTR_VSPACE);
    }

    /**
     * Returns the scaling width for the image.<p>
     * 
     * @return the scaling width for the image
     */
    public String getWidth() {

        return String.valueOf(m_scaler.getWidth());
    }

    /**
     * Returns <code>"true"</code> if the HTML tag should only be created as partial tag.<p>
     *
     * @return <code>"true"</code> if the HTML tag should only be created as partial tag
     */
    public String isPartialTag() {

        return String.valueOf(m_partialTag);
    }

    /**
     * @see javax.servlet.jsp.tagext.Tag#release()
     */
    public void release() {

        m_attributes = null;
        m_scaler = new CmsImageScaler();
        m_partialTag = false;
        m_src = null;
        super.release();
    }

    /** 
     * Sets the value of the HTML "align" attribute.<p>
     * 
     * @param value the value of the HTML "align" attribute to set
     */
    public void setAlign(String value) {

        setAttribute(ATTR_ALIGN, value);
    }

    /** 
     * Sets the value of the HTML "alt" attribute.<p>
     * 
     * @param value the value of the HTML "alt" attribute to set
     */
    public void setAlt(String value) {

        setAttribute(ATTR_ALT, value);

    }

    /** 
     * Sets the value of the HTML "border" attribute.<p>
     * 
     * @param value the value of the HTML "border" attribute to set
     */
    public void setBorder(String value) {

        setAttribute(ATTR_BORDER, value);

    }

    /**
     * Sets the scaling height for the image.<p>
     * 
     * If no valid integer is given, then "0" is used as value.<p>
     * 
     * @param value the scaling height for the image to set
     */
    public void setHeight(String value) {

        m_scaler.setHeight(CmsStringUtil.getIntValue(value, 0, SCALE_ATTR_HEIGHT));
    }

    /** 
     * Sets the value of the HTML "hspace" attribute.<p>
     * 
     * @param value the value of the HTML "hspace" attribute to set
     */
    public void setHspace(String value) {

        setAttribute(ATTR_HSPACE, value);

    }

    /** 
     * Sets the value of the HTML "id" attribute.<p>
     * 
     * @param value the value of the HTML "id" attribute to set
     */
    public void setId(String value) {

        setAttribute(ATTR_ID, value);

    }

    /** 
     * Sets the value of the HTML "longdesc" attribute.<p>
     * 
     * @param value the value of the HTML "longdesc" attribute to set
     */
    public void setLongdesc(String value) {

        setAttribute(ATTR_LONGDESC, value);

    }

    /** 
     * Sets the value of the HTML "name" attribute.<p>
     * 
     * @param value the value of the HTML "name" attribute to set
     */
    public void setName(String value) {

        setAttribute(ATTR_NAME, value);

    }

    /**
     * Controls if the created HTML image tag is a full or partial tag.<p>
     *
     * @param partialTag the value to set
     */
    public void setPartialTag(String partialTag) {

        m_partialTag = Boolean.valueOf(partialTag).booleanValue();
    }

    /**
     * Sets the background color used by the image scaler.<p>
     *
     * @param value the background color to set
     */
    public void setScaleColor(String value) {

        m_scaler.setColor(value);
    }

    /**
     * Sets the filter(s) used by the image scaler.<p>
     *
     * @param value the filter(s) to set
     */
    public void setScaleFilter(String value) {

        m_scaler.setFilters(value);
    }

    /**
     * Sets the position used by the image scaler.<p>
     *
     * @param value the position to set
     */
    public void setScalePosition(String value) {

        m_scaler.setPosition(CmsStringUtil.getIntValue(value, 0, SCALE_ATTR_POSITION));
    }

    /**
     * Sets the quality used by the image scaler.<p>
     *
     * @param value the quality to set
     */
    public void setScaleQuality(String value) {

        m_scaler.setQuality(CmsStringUtil.getIntValue(value, 0, SCALE_ATTR_QUALITY));
    }

    /**
     * Sets the render mode used by the image scaler.<p>
     *
     * @param value the render mode to set
     */
    public void setScaleRendermode(String value) {

        m_scaler.setRenderMode(CmsStringUtil.getIntValue(value, 0, SCALE_ATTR_RENDERMODE));
    }

    /**
     * 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 source of the image.<p>
     * 
     * The source must be an absolute path in the current users OpenCms site, without any
     * webapp or servlet prefix.<p>
     * 
     * @param value the image source to set
     */
    public void setSrc(String value) {

        m_src = value;
    }

    /** 
     * Sets the value of the HTML "style" attribute.<p>
     * 
     * @param value the value of the HTML "style" attribute to set
     */
    public void setStyle(String value) {

        setAttribute(ATTR_STYLE, value);
    }

    /** 
     * Sets the value of the HTML "title" attribute.<p>
     * 
     * @param value the value of the HTML "title" attribute to set
     */
    public void setTitle(String value) {

        setAttribute(ATTR_TITLE, value);
    }

    /** 
     * Sets the value of the HTML "usemap" attribute.<p>
     * 
     * @param value the value of the HTML "usemap" attribute to set
     */
    public void setUsemap(String value) {

        setAttribute(ATTR_USEMAP, value);
    }

    /** 
     * Sets the value of the HTML "vspace" attribute.<p>
     * 
     * @param value the value of the HTML "vspace" attribute to set
     */
    public void setVspace(String value) {

        setAttribute(ATTR_VSPACE, value);

    }

    /**
     * Sets the scaling width for the image.<p>
     * 
     * If no valid integer is given, then "0" is used as value.<p>
     * 
     * @param value the scaling width for the image to set
     */
    public void setWidth(String value) {

        m_scaler.setWidth(CmsStringUtil.getIntValue(value, 0, SCALE_ATTR_WIDTH));
    }

    /**
     * Returns the given keys attribute value from the attribute map.<p>
     * 
     * @param key the attribute to read from the map
     * @return the given keys attribute value from the attribute map
     */
    private String getAttribute(String key) {

        if (m_attributes != null) {
            return (String)m_attributes.get(key);
        }
        return null;
    }

    /**
     * Sets the given key with the given value in the attribute map.<p>
     * 
     * @param key the key to set
     * @param value the value to set
     */
    private void setAttribute(String key, String value) {

        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(value)) {
            if (m_attributes == null) {
                m_attributes = new HashMap();
            }
            m_attributes.put(key, value);
        }
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -