📄 tabsplitterbeaninfo.java
字号:
package com.magelang.tabsplitter;
/**
* The bean information class for com.magelang.tabsplitter.TabSplitter.
*
* <p>Use this code at your own risk! MageLang Institute is not
* responsible for any damage caused directly or indirectly through
* use of this code.
* <p><p>
* <b>SOFTWARE RIGHTS</b>
* <p>
* TabSplitter, version 2.0, Scott Stanchfield, MageLang Institute
* <p>
* We reserve no legal rights to this code--it is fully in the
* public domain. An individual or company may do whatever
* they wish with source code distributed with it, including
* including the incorporation of it into commerical software.
*
* <p>However, this code <i>cannot</i> be sold as a standalone product.
* <p>
* We encourage users to develop software with this code. However,
* we do ask that credit is given to us for developing it
* By "credit", we mean that if you use these components or
* incorporate any source code into one of your programs
* (commercial product, research project, or otherwise) that
* you acknowledge this fact somewhere in the documentation,
* research report, etc... If you like these components and have
* developed a nice tool with the output, please mention that
* you developed it using these components. In addition, we ask that
* the headers remain intact in our source code. As long as these
* guidelines are kept, we expect to continue enhancing this
* system and expect to make other tools available as they are
* completed.
* <p>
* The MageLang Support Classes Gang:
* @version TabSplitter 2.0, MageLang Insitute, Jan 18, 1998
* @author <a href="http:www.scruz.net/~thetick">Scott Stanchfield</a>, <a href=http://www.MageLang.com>MageLang Institute</a>
*/
import java.beans.*;
public class TabSplitterBeanInfo extends java.beans.SimpleBeanInfo {
/**
* Gets the actionPerformed(java.awt.event.ActionEvent) method descriptor.
* @return java.beans.MethodDescriptor
*/
public java.beans.MethodDescriptor actionPerformed_javaawteventActionEventMethodDescriptor() {
java.beans.MethodDescriptor aDescriptor = null;
try {
/* Create and return the actionPerformed(java.awt.event.ActionEvent) method descriptor. */
java.lang.reflect.Method aMethod = null;
try {
/* Attempt to find the method using getMethod with parameter types. */
java.lang.Class aParameterTypes[] = {
java.awt.event.ActionEvent.class
};
aMethod = getBeanClass().getMethod("actionPerformed", aParameterTypes);
} catch (Throwable exception) {
/* Since getMethod failed, call findMethod. */
handleException(exception);
aMethod = findMethod(getBeanClass(), "actionPerformed", 1);
};
try {
/* Try creating the method descriptor with parameter descriptors. */
java.beans.ParameterDescriptor aParameterDescriptor1 = new java.beans.ParameterDescriptor();
aParameterDescriptor1.setName("arg1");
aParameterDescriptor1.setDisplayName("e");
java.beans.ParameterDescriptor aParameterDescriptors[] = {
aParameterDescriptor1
};
aDescriptor = new java.beans.MethodDescriptor(aMethod, aParameterDescriptors);
} catch (Throwable exception) {
/* Try creating the method descriptor without parameter descriptors. */
handleException(exception);
aDescriptor = new java.beans.MethodDescriptor(aMethod);
};
/* aDescriptor.setDisplayName("actionPerformed(java"); */
aDescriptor.setShortDescription("actionPerformed(java.awt.event.ActionEvent)");
/* aDescriptor.setExpert(false); */
/* aDescriptor.setHidden(false); */
} catch (Throwable exception) {
handleException(exception);
};
return aDescriptor;
}
/**
* Find the method by comparing (name & parameter size) against the methods in the class.
* @return java.lang.reflect.Method
* @param aClass java.lang.Class
* @param methodName java.lang.String
* @param parameterCount int
*/
public static java.lang.reflect.Method findMethod(java.lang.Class aClass, java.lang.String methodName, int parameterCount) {
try {
/* Since this method attempts to find a method by getting all methods from the class, */
/* this method should only be called if getMethod can not find the method. */
java.lang.reflect.Method methods[] = aClass.getMethods();
for (int index = 0; index < methods.length; index++){
java.lang.reflect.Method method = methods[index];
if ((method.getParameterTypes().length == parameterCount) && (method.getName().equals(methodName))) {
return method;
};
};
} catch (java.lang.Throwable exception) {
return null;
};
return null;
}
/**
* Gets the font property descriptor.
* @return java.beans.PropertyDescriptor
*/
public java.beans.PropertyDescriptor fontPropertyDescriptor() {
java.beans.PropertyDescriptor aDescriptor = null;
try {
try {
/* Using methods via getMethod is the faster way to create the font property descriptor. */
java.lang.reflect.Method aGetMethod = null;
try {
/* Attempt to find the method using getMethod with parameter types. */
java.lang.Class aGetMethodParameterTypes[] = {};
aGetMethod = getBeanClass().getMethod("getFont", aGetMethodParameterTypes);
} catch (Throwable exception) {
/* Since getMethod failed, call findMethod. */
handleException(exception);
aGetMethod = findMethod(getBeanClass(), "getFont", 0);
};
java.lang.reflect.Method aSetMethod = null;
try {
/* Attempt to find the method using getMethod with parameter types. */
java.lang.Class aSetMethodParameterTypes[] = {
java.awt.Font.class
};
aSetMethod = getBeanClass().getMethod("setFont", aSetMethodParameterTypes);
} catch (Throwable exception) {
/* Since getMethod failed, call findMethod. */
handleException(exception);
aSetMethod = findMethod(getBeanClass(), "setFont", 1);
};
aDescriptor = new java.beans.PropertyDescriptor("font"
, aGetMethod, aSetMethod);
} catch (Throwable exception) {
/* Since we failed using methods, try creating a default property descriptor. */
handleException(exception);
aDescriptor = new java.beans.PropertyDescriptor("font"
, getBeanClass());
};
/* aDescriptor.setBound(false); */
/* aDescriptor.setConstrained(false); */
/* aDescriptor.setDisplayName("font"); */
/* aDescriptor.setShortDescription("font"); */
/* aDescriptor.setExpert(false); */
/* aDescriptor.setHidden(false); */
} catch (Throwable exception) {
handleException(exception);
};
return aDescriptor;
}
/**
* Claim there are no other relevant BeanInfo objects. You
* may override this if you want to (for example) return a
* BeanInfo for a base class.
*/
public BeanInfo[] getAdditionalBeanInfo() {
try {
BeanInfo[] bia = { Introspector.getBeanInfo(TabPanel.class) };
return bia;
}
catch (IntrospectionException e) {
System.err.println(e);
return null;
}
}
/**
* Gets the bean class.
* @return java.lang.Class
*/
public static java.lang.Class getBeanClass() {
return com.magelang.tabsplitter.TabSplitter.class;
}
/**
* Gets the bean class name.
* @return java.lang.String
*/
public static java.lang.String getBeanClassName() {
return "com.magelang.tabsplitter.TabSplitter";
}
/**
* Return the event set descriptors for this bean.
* @return java.beans.EventSetDescriptor[]
*/
public java.beans.EventSetDescriptor[] getEventSetDescriptors() {
try {
java.beans.EventSetDescriptor aDescriptorList[] = {
};
return aDescriptorList;
} catch (Throwable exception) {
handleException(exception);
};
return null;
}
/**
* Return the method descriptors for this bean.
* @return java.beans.MethodDescriptor[]
*/
public java.beans.MethodDescriptor[] getMethodDescriptors() {
try {
java.beans.MethodDescriptor aDescriptorList[] = {
actionPerformed_javaawteventActionEventMethodDescriptor()
,getVisibleComponentMethodDescriptor()
,getVisibleComponentNumMethodDescriptor()
,mouseDragged_javaawteventMouseEventMethodDescriptor()
,mouseExited_javaawteventMouseEventMethodDescriptor()
,mouseMoved_javaawteventMouseEventMethodDescriptor()
,mousePressed_javaawteventMouseEventMethodDescriptor()
,mouseReleased_javaawteventMouseEventMethodDescriptor()
,remove_intMethodDescriptor()
,remove_javaawtComponentMethodDescriptor()
,removeAllMethodDescriptor()
,separateTabs_javalangString_javaawtComponent_javalangString_javalangString_javaawtComponent_javalangString_commagelangtabsplitterSplitterPanelMethodDescriptor()
,setFont_javaawtFontMethodDescriptor()
,show_intMethodDescriptor()
,show_javaawtComponentMethodDescriptor()
,show_javalangStringMethodDescriptor()
,swapOrientationMethodDescriptor()
};
return aDescriptorList;
} catch (Throwable exception) {
handleException(exception);
};
return null;
}
/**
* Return the property descriptors for this bean.
* @return java.beans.PropertyDescriptor[]
*/
public java.beans.PropertyDescriptor[] getPropertyDescriptors() {
try {
java.beans.PropertyDescriptor aDescriptorList[] = {
fontPropertyDescriptor()
,visibleComponentNumPropertyDescriptor()
,visibleComponentPropertyDescriptor()
};
return aDescriptorList;
} catch (Throwable exception) {
handleException(exception);
};
return null;
}
/**
* Gets the getVisibleComponent() method descriptor.
* @return java.beans.MethodDescriptor
*/
public java.beans.MethodDescriptor getVisibleComponentMethodDescriptor() {
java.beans.MethodDescriptor aDescriptor = null;
try {
/* Create and return the getVisibleComponent() method descriptor. */
java.lang.reflect.Method aMethod = null;
try {
/* Attempt to find the method using getMethod with parameter types. */
java.lang.Class aParameterTypes[] = {};
aMethod = getBeanClass().getMethod("getVisibleComponent", aParameterTypes);
} catch (Throwable exception) {
/* Since getMethod failed, call findMethod. */
handleException(exception);
aMethod = findMethod(getBeanClass(), "getVisibleComponent", 0);
};
try {
/* Try creating the method descriptor with parameter descriptors. */
java.beans.ParameterDescriptor aParameterDescriptors[] = {};
aDescriptor = new java.beans.MethodDescriptor(aMethod, aParameterDescriptors);
} catch (Throwable exception) {
/* Try creating the method descriptor without parameter descriptors. */
handleException(exception);
aDescriptor = new java.beans.MethodDescriptor(aMethod);
};
/* aDescriptor.setDisplayName("getVisibleComponent()"); */
/* aDescriptor.setShortDescription("getVisibleComponent()"); */
/* aDescriptor.setExpert(false); */
/* aDescriptor.setHidden(false); */
} catch (Throwable exception) {
handleException(exception);
};
return aDescriptor;
}
/**
* Gets the getVisibleComponentNum() method descriptor.
* @return java.beans.MethodDescriptor
*/
public java.beans.MethodDescriptor getVisibleComponentNumMethodDescriptor() {
java.beans.MethodDescriptor aDescriptor = null;
try {
/* Create and return the getVisibleComponentNum() method descriptor. */
java.lang.reflect.Method aMethod = null;
try {
/* Attempt to find the method using getMethod with parameter types. */
java.lang.Class aParameterTypes[] = {};
aMethod = getBeanClass().getMethod("getVisibleComponentNum", aParameterTypes);
} catch (Throwable exception) {
/* Since getMethod failed, call findMethod. */
handleException(exception);
aMethod = findMethod(getBeanClass(), "getVisibleComponentNum", 0);
};
try {
/* Try creating the method descriptor with parameter descriptors. */
java.beans.ParameterDescriptor aParameterDescriptors[] = {};
aDescriptor = new java.beans.MethodDescriptor(aMethod, aParameterDescriptors);
} catch (Throwable exception) {
/* Try creating the method descriptor without parameter descriptors. */
handleException(exception);
aDescriptor = new java.beans.MethodDescriptor(aMethod);
};
/* aDescriptor.setDisplayName("getVisibleComponentNum()"); */
/* aDescriptor.setShortDescription("getVisibleComponentNum()"); */
/* aDescriptor.setExpert(false); */
/* aDescriptor.setHidden(false); */
} catch (Throwable exception) {
handleException(exception);
};
return aDescriptor;
}
/**
* Called whenever the bean information class throws an exception.
* @param exception java.lang.Throwable
*/
private void handleException(java.lang.Throwable exception) {
/* Uncomment the following lines to print uncaught exceptions to stdout */
// System.out.println("--------- UNCAUGHT EXCEPTION ---------");
// exception.printStackTrace(System.out);
}
/**
* Gets the mouseDragged(java.awt.event.MouseEvent) method descriptor.
* @return java.beans.MethodDescriptor
*/
public java.beans.MethodDescriptor mouseDragged_javaawteventMouseEventMethodDescriptor() {
java.beans.MethodDescriptor aDescriptor = null;
try {
/* Create and return the mouseDragged(java.awt.event.MouseEvent) method descriptor. */
java.lang.reflect.Method aMethod = null;
try {
/* Attempt to find the method using getMethod with parameter types. */
java.lang.Class aParameterTypes[] = {
java.awt.event.MouseEvent.class
};
aMethod = getBeanClass().getMethod("mouseDragged", aParameterTypes);
} catch (Throwable exception) {
/* Since getMethod failed, call findMethod. */
handleException(exception);
aMethod = findMethod(getBeanClass(), "mouseDragged", 1);
};
try {
/* Try creating the method descriptor with parameter descriptors. */
java.beans.ParameterDescriptor aParameterDescriptor1 = new java.beans.ParameterDescriptor();
aParameterDescriptor1.setName("arg1");
aParameterDescriptor1.setDisplayName("e");
java.beans.ParameterDescriptor aParameterDescriptors[] = {
aParameterDescriptor1
};
aDescriptor = new java.beans.MethodDescriptor(aMethod, aParameterDescriptors);
} catch (Throwable exception) {
/* Try creating the method descriptor without parameter descriptors. */
handleException(exception);
aDescriptor = new java.beans.MethodDescriptor(aMethod);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -