classsupport.java

来自「PIY(Program It Yourself)是一个基于Java的应用程序开发」· Java 代码 · 共 51 行

JAVA
51
字号
package piy;

import javax.swing.JPanel;

/**
* Abstract class representing the property class support offerred by PIY.  Extending
* classes should be placed in the support subdirectory - they will be automatically
* detected and loaded by PIY.  All editable property types (in a UserComponent, for
* example) must have a supporting class - For example, if a particular property is
* a Font type, there must be Class support for fonts for user to be able to edit them.
* As the class represents a panel, it is expected supporting classes should return
* a preferred size - The panel's should be resizable horizontally, but have a fixed
* height.
* <p>
* When a value is changed through its support, the support class should make a call to
* <code>ProjectHandler.getInstance().projectChanged()</code> to notify the project
* handler of a change to the project.
*
* @author David Vivash
* @version 1.0.1, 5/12/00
*/
public abstract class ClassSupport extends JPanel
{
	protected Property property;

	/**
	* Gets the specific class object which the extending class is offering support for. Subclasses
	* MUST override this method - it has only been made non-abstract because static methods cannot 
	* be abstract.
	* @return the supported class
	*/
	public static Class getSupportedClass() {
		return null;
	}

	/**
	* Sets up support for a particular property.  The property must have the same type that this
	* class supports.
	* @param property the property (of same type as supported by this class) that a particular
	* instance of this class will allow editting of
	*/
	public ClassSupport(Property property) {
		this.property = property;
	}

	/**
	* Retrieve the property that this ClassSupport object has been set up to edit.
	* @return the property that this class support object has been set up to edit
	*/
	public Property getProperty() { return property; }
}

⌨️ 快捷键说明

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