📄 skin.java
字号:
/*
* ====================================================================
* The JSP Tree Software License, Version 1.1
*
* (this license is derived and fully compatible with the Apache Software
* License - see http://www.apache.org/LICENSE.txt)
*
* Copyright (c) 2002-2005 jsptree.sourceforge.net . All rights reserved.
*
* 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
* jsptree.sourceforge.net (http://jsptree.sourceforge.net/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The name "JSP Tree" must not be used to endorse or promote
* products derived from this software without prior written permission.
* For written permission, please contact modano@users.sourceforge.net .
*
* 5. Products derived from this software may not be called "JSP Tree",
* nor may "JSP Tree" appear in their name, without prior written
* permission of jsptree.sourceforge.net.
*
* 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 THE APACHE SOFTWARE FOUNDATION 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.
* ====================================================================
*/
package net.sf.jsptree.skin;
import java.io.IOException;
/**
* It is intended to be subclassed by different renderers type (Skins).
* Each tree can be rendered by particular skin. There are a few
* standard skins:
* <ul>
* <li>MENU_SKIN</li>
* <li>DEFAULT_SKIN</li>
* <li>FOLDER_SKIN</li>
* </ul>
* <p/>
* We are going to drawing a series of icons on the screen,
* where each represents either leaf or node. It does not make
* sense to have an individual class instance for each of them that
* is responsible for rendering. These icons are one of a few
* similar images and the position where they are drawn is
* calculated dynamically based on the node's depth, for example.
* </p>
* <p/>
* Skins are shareable instances of a class. It might at first seem that
* each class is a <i>Singleton</i>, but in fact there might be a small number of
* instances, one for every skin type. The number of instances that are
* allocated must be decided as the class instances are needed, and this
* is accomplished with a {@link SkinFactory} class.
* </p>
* <p>Skins must be programmed in a thread-safe manner, because the
* application will share the same instance for multiple simultaneous
* requests. This means you should design with the following items in mind:
* </p>
* <ul>
* <li>Instance and static variables MUST NOT be used to store information
* related to the state of a particular request. </li>
* <li>Access to other resources (JavaBeans, session variables, etc.) MUST
* be synchronized if those resources require protection.</li>
* </ul>
* <b>Design note:</b> It is a <i>Flyweight</i> implementation [GoF].
*
* @author Vladislav Kamensky
* @see AbstractSkin
* @see DefaultTemplateSkin
* @see FolderTemplateSkin
* @see MenuTemplateSkin
*/
public interface Skin {
/**
* @param p_nodeInfo
* @throws IOException
*/
void paint(NodeInfo p_nodeInfo) throws IOException;
/**
* @return skin's type.
*/
String getType();
/**
* @return array of templates' names.
*/
String[] getTemplateNames();
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -