亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? filterfontstyle.java

?? 這是學習Java必須讀懂兩套源代碼
?? JAVA
字號:
/**
 * Copyright (C) 2001 Yasna.com. All rights reserved.
 *
 * ===================================================================
 * The Apache Software License, Version 1.1
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by
 *        Yasna.com (http://www.yasna.com)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "Yazd" and "Yasna.com" must not be used to
 *    endorse or promote products derived from this software without
 *    prior written permission. For written permission, please
 *    contact yazd@yasna.com.
 *
 * 5. Products derived from this software may not be called "Yazd",
 *    nor may "Yazd" appear in their name, without prior written
 *    permission of Yasna.com.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL YASNA.COM OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of Yasna.com. For more information
 * on Yasna.com, please see <http://www.yasna.com>.
 */

/**
 * Copyright (C) 2000 CoolServlets.com. All rights reserved.
 *
 * ===================================================================
 * The Apache Software License, Version 1.1
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 *
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in
 *    the documentation and/or other materials provided with the
 *    distribution.
 *
 * 3. The end-user documentation included with the redistribution,
 *    if any, must include the following acknowledgment:
 *       "This product includes software developed by
 *        CoolServlets.com (http://www.coolservlets.com)."
 *    Alternately, this acknowledgment may appear in the software itself,
 *    if and wherever such third-party acknowledgments normally appear.
 *
 * 4. The names "Jive" and "CoolServlets.com" must not be used to
 *    endorse or promote products derived from this software without
 *    prior written permission. For written permission, please
 *    contact webmaster@coolservlets.com.
 *
 * 5. Products derived from this software may not be called "Jive",
 *    nor may "Jive" appear in their name, without prior written
 *    permission of CoolServlets.com.
 *
 * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
 * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
 * DISCLAIMED.  IN NO EVENT SHALL COOLSERVLETS.COM OR
 * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
 * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
 * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 * ====================================================================
 *
 * This software consists of voluntary contributions made by many
 * individuals on behalf of CoolServlets.com. For more information
 * on CoolServlets.com, please see <http://www.coolservlets.com>.
 */

package com.Yasna.forum.filter;

import com.Yasna.forum.*;
import com.Yasna.util.*;
import java.util.*;
import java.io.*;

/**
 * A ForumMessageFilter that replaces [b][/b] and [i][/i] tags with their HTML
 * tag equivalents. This filter should only be run after any HTML stripping
 * filters are.
 */
public class FilterFontStyle extends ForumMessageFilter implements Serializable {

    /**
     * Property values of the filter.
     */
    private Properties props;

    /**
     * Property descriptions of the filter.
     */
    private Properties propDescriptions;

    /**
     * Creates a new filter not associated with a message. This is
     * generally only useful for defining a template filter that other
     * fitlers will be cloned from.
     */
    public FilterFontStyle() {
        super();
        this.props = new Properties(props);
        this.propDescriptions = new Properties(propDescriptions);
        initializeProperties();
    }

    /**
     * Creates a new filter wrapped around the specified message. This
     * constructor is normally called when cloning a filter template.
     *
     * @param message the ForumMessage to wrap the new filter around.
     * @param properties the property values for the filter.
     * @param propertyDescriptions the property descriptions for the filter.
     */
    public FilterFontStyle(ForumMessage message, Properties props,
            Properties propDescriptions)
    {
        super(message);
        this.props = new Properties(props);
        this.propDescriptions = new Properties(propDescriptions);
    }

    /**
     * Clones a new filter that will have the same properties and that
     * will wrap around the specified message.
     *
     * @param message the ForumMessage to wrap the new filter around.
     */
    public ForumMessageFilter clone(ForumMessage message){
        return new FilterFontStyle(message, props, propDescriptions);
    }

    /**
     * Returns the name of the filter.
     */
    public String getName() {
        return "Font Stylizer";
    }

    /**
     * Returns a description of the filter.
     */
    public String getDescription() {
        return "Converts custom font tags into HTML equivalents. It " +
                "currently supports [b][/b] and [i][/i] tags.";
    }

    /**
     * Returns the author of the filter.
     */
    public String getAuthor() {
        return "CoolServlets.com";
    }

    /**
     * Returns the major version number of the filter.
     */
    public int getMajorVersion() {
        return 1;
    }

    /**
     * Returns the minor version number of the filter.
     */
    public int getMinorVersion() {
        return 0;
    }

    /**
     * Returns the value of a property of the filter.
     *
     * @param name the name of the property.
     * @returns the value of the property.
     */
    public String getFilterProperty(String name) {
        return props.getProperty(name);
    }

    /**
     * Returns the description of a property of the filter.
     *
     * @param name the name of the property.
     * @return the description of the property.
     */
    public String getFilterPropertyDescription(String name) {
        return propDescriptions.getProperty(name);
    }

    /**
     * Returns an Enumeration of all the property names.
     */
    public Enumeration filterPropertyNames() {
        return props.propertyNames();
    }

    /**
     * Sets a property of the filter. Each filter has a set number of
     * properties that are determined by the filter author. 
     *
     * @param name the name of the property to set.
     * @param value the new value for the property.
     *
     * @throws IllegalArgumentException if the property trying to be set doesn't
     *    exist.
     */
    public void setFilterProperty(String name, String value)
            throws IllegalArgumentException
    {
        if (props.getProperty(name) == null) {
            throw new IllegalArgumentException();
        }
        props.put(name, value);
    }

    /**
     * <b>Overloaded</b> to return the body of the message with custom font
     * stylizing tags translated to HTML.
     */
    public String getBody() {
        return fontStyleToHTML(message.getBody());
    }

    /**
     * Creates properties and sets their descriptions.
     */
    private void initializeProperties() {
        props.put("Bold","on");
        props.put("Italics","on");

        propDescriptions.put(
            "Bold", "Toggles translation of [b][/b] to HTML bold tags."
        );
        propDescriptions.put(
            "Italics", "Toggles translation of [i][/i] to HTML bold tags."
        );
    }
  
   /**
    * This method takes a string which may contain CoolServlets tags that
    * the style of a font.  These will be converted to HTML tags.
    *
    * @param input The text to be converted.
    * @return The input string with the CoolServlets tags [b] (indicating
    * bold, and [i] (indicating italics) changed to the HTML tags <b> and
    * <i>, respectively. In addition, the corresponding tags [/b] and [/i]
    * will be changed to </b> and </i>
    */
    private String fontStyleToHTML( String input ) {
        // Check if the string is null or zero length -- if so, return what was sent in.
        if( input == null || input.length() == 0 ) {
            return input;
        }
        else {
            // Create int [] objects to determine if all bold and italic
            // tags have been closed
            int [] boldStartCount = new int[1];
            int [] italicsStartCount = new int[1];
            int [] boldEndCount = new int[1];
            int [] italicsEndCount = new int[1];
            if (props.getProperty("Bold").equals("on")) {
                input = StringUtils.replace( input, "[b]", "<b>", boldStartCount );
                input = StringUtils.replace( input, "[/b]", "</b>", boldEndCount );
                int bStartCount = boldStartCount[0];
                int bEndCount = boldEndCount[0];
                while (bStartCount > bEndCount) {
                    input = input.concat("</b>");
                    bEndCount++;
                }
            }
            if (props.getProperty("Italics").equals("on")) {
                input = StringUtils.replace( input, "[i]", "<i>", italicsStartCount );
                input = StringUtils.replace( input, "[/i]", "</i>", italicsEndCount );
                int iStartCount = italicsStartCount[0];
                int iEndCount = italicsEndCount[0];
                while (iStartCount > iEndCount) {
                    input = input.concat("</i>");
                    iEndCount++;
                }
            }
        }
        return input;
    }
}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
av一区二区三区黑人| 欧美精品在线观看一区二区| 国产91精品精华液一区二区三区| 国产在线精品不卡| 成人黄色电影在线| 欧美日韩精品一区二区| 亚洲精品一区二区三区蜜桃下载 | 国产xxx精品视频大全| 不卡视频在线看| 51精品国自产在线| 国产蜜臀97一区二区三区| 亚洲免费视频成人| 久久精品国产一区二区三| 99国产麻豆精品| 国产欧美日韩在线视频| 石原莉奈在线亚洲二区| 99riav一区二区三区| 久久久亚洲综合| 亚洲成人黄色小说| 91蜜桃免费观看视频| 欧美成人一区二区三区在线观看| 中文字幕日本不卡| 国产成人av电影免费在线观看| 日韩一区二区视频| 亚洲国产成人va在线观看天堂 | 欧美在线免费观看亚洲| 国产精品乱子久久久久| 久久99热国产| 日韩一区二区影院| 青青草精品视频| 欧美精品v日韩精品v韩国精品v| 亚洲色图一区二区| 99久久国产综合精品女不卡| 国产日韩精品久久久| 国内精品伊人久久久久av一坑 | 亚洲午夜免费电影| 欧美色图12p| 午夜精品一区二区三区电影天堂 | 欧美精品在线视频| 午夜a成v人精品| 欧美日韩久久不卡| 蜜乳av一区二区| 精品国免费一区二区三区| 久久99精品久久久久久久久久久久| 欧美一区二区三区性视频| 伦理电影国产精品| 久久99久久久久| 日本一区二区免费在线| eeuss鲁片一区二区三区在线看| 成人免费一区二区三区在线观看| 在线国产亚洲欧美| 亚洲自拍偷拍综合| 欧美日本乱大交xxxxx| 午夜精品一区二区三区电影天堂 | 美国av一区二区| 日韩精品自拍偷拍| 国产专区欧美精品| 国产欧美一区二区三区网站| 成人高清视频在线| 亚洲免费三区一区二区| 欧美色爱综合网| 日本伊人色综合网| 欧美成人一区二区三区在线观看| 久久爱另类一区二区小说| 中文字幕免费不卡| 欧美丰满少妇xxxxx高潮对白| 美女爽到高潮91| 中文在线免费一区三区高中清不卡| 99精品热视频| 亚洲成av人在线观看| 精品国精品国产| 91视频在线观看| 日韩成人伦理电影在线观看| 精品成人佐山爱一区二区| 91在线精品秘密一区二区| 欧美aⅴ一区二区三区视频| ...xxx性欧美| 亚洲精品一区二区三区香蕉| 色综合色综合色综合色综合色综合 | 久久精品99久久久| 中文字幕欧美一| 久久婷婷一区二区三区| 91社区在线播放| 国产福利一区在线| 亚洲bt欧美bt精品777| 国产精品久线在线观看| 2021久久国产精品不只是精品| 一本色道久久综合狠狠躁的推荐| 久久91精品久久久久久秒播| 亚洲国产视频一区| 亚洲激情图片一区| 中文字幕中文乱码欧美一区二区| 欧美成人在线直播| 精品美女一区二区| 欧美大白屁股肥臀xxxxxx| 欧美日韩黄色影视| 色老汉一区二区三区| 99精品久久99久久久久| 91国产福利在线| 欧美色成人综合| 日韩视频一区二区三区| 久久久久97国产精华液好用吗| 久久精品在线免费观看| 国产精品久久久久婷婷| ㊣最新国产の精品bt伙计久久| 一区二区三区美女视频| 香蕉久久夜色精品国产使用方法 | 久久综合丝袜日本网| 国产片一区二区| 亚洲人成小说网站色在线| 亚洲成人久久影院| 国产成人av一区二区三区在线| 成人激情黄色小说| 欧美系列在线观看| 国产亚洲欧美一级| 亚洲综合另类小说| 久久国产精品99久久人人澡| yourporn久久国产精品| 制服丝袜日韩国产| 国产精品久久久久久久久久久免费看| 亚洲综合色区另类av| 久久国产人妖系列| 在线一区二区三区做爰视频网站| 51精品国自产在线| 亚洲三级在线免费观看| 国内精品国产三级国产a久久| 成人精品在线视频观看| 日韩免费一区二区三区在线播放| 中文字幕精品一区二区精品绿巨人 | 久久精品免视看| 亚洲综合激情小说| 99re这里只有精品首页| 精品国产不卡一区二区三区| 亚洲成人tv网| 92精品国产成人观看免费| 久久综合视频网| 久久97超碰色| 欧美一区二区性放荡片| 亚洲精品国产a久久久久久 | 成人av免费在线| 中文欧美字幕免费| 国产成人精品影院| 久久久久久久电影| 国产成人在线免费观看| 国产欧美一区二区在线| 国产在线国偷精品产拍免费yy | 成人国产一区二区三区精品| 中文一区二区在线观看| 成人av中文字幕| 1区2区3区欧美| 欧美亚洲尤物久久| 日韩电影一二三区| 欧美精品久久一区二区三区| 婷婷国产v国产偷v亚洲高清| 欧美日韩精品三区| 精品一区二区三区免费| 精品久久久久久最新网址| 国产宾馆实践打屁股91| **性色生活片久久毛片| 欧美综合久久久| 蜜乳av一区二区三区| 国产亚洲精品资源在线26u| 国产成人亚洲综合a∨婷婷| 中文字幕一区在线| 欧美无砖专区一中文字| 麻豆精品在线看| 国产精品乱码人人做人人爱| 欧美三区在线观看| 国内精品伊人久久久久av影院| 欧美极品xxx| 欧美日韩精品福利| 成人综合在线网站| 亚洲超碰97人人做人人爱| 久久午夜色播影院免费高清| 91丝袜美女网| 国产永久精品大片wwwapp| 亚洲桃色在线一区| 精品欧美一区二区久久| 99国产精品国产精品毛片| 美女视频第一区二区三区免费观看网站| 久久久蜜桃精品| 欧美日本一区二区三区| 91视频免费播放| 国产精品一区久久久久| 天天影视涩香欲综合网| 亚洲视频一区在线| 日本一区二区三区在线不卡| 欧美一级生活片| 欧美自拍偷拍一区| 99精品视频免费在线观看| 国模娜娜一区二区三区| 午夜精品福利在线| 亚洲女爱视频在线| 国产精品国产三级国产aⅴ中文| 欧美大度的电影原声| 日韩视频免费直播| 日韩视频中午一区| 91精品国产综合久久福利软件| 欧美在线免费播放| 欧美图区在线视频|