/******************************************************************************* * ALMA - Atacama Large Millimeter Array * Copyright (c) ESO - European Southern Observatory, 2011 * (in the framework of the ALMA collaboration). * All rights reserved. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *******************************************************************************/ package dartboard; /** * The bean information class for AMS.PlanetPanel. */ public class PlanetPanelBeanInfo extends java.beans.SimpleBeanInfo { /** * 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 cannot 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; } /** * Returns the BeanInfo of the superclass of this bean to inherit its features. * @return java.beans.BeanInfo[] */ public java.beans.BeanInfo[] getAdditionalBeanInfo() { java.lang.Class superClass; java.beans.BeanInfo superBeanInfo = null; try { superClass = getBeanDescriptor().getBeanClass().getSuperclass(); } catch (java.lang.Throwable exception) { return null; } try { superBeanInfo = java.beans.Introspector.getBeanInfo(superClass); } catch (java.beans.IntrospectionException ie) {} if (superBeanInfo != null) { java.beans.BeanInfo[] ret = new java.beans.BeanInfo[1]; ret[0] = superBeanInfo; return ret; } return null; } /** * Gets the bean class. * @return java.lang.Class */ public static java.lang.Class getBeanClass() { return dartboard.PlanetPanel.class; } /** * Gets the bean class name. * @return java.lang.String */ public static java.lang.String getBeanClassName() { return "dartboard.PlanetPanel"; } public java.beans.BeanDescriptor getBeanDescriptor() { java.beans.BeanDescriptor aDescriptor = null; try { /* Create and return the PlanetPanelBeanInfo bean descriptor. */ aDescriptor = new java.beans.BeanDescriptor(dartboard.PlanetPanel.class); /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("hidden-state", Boolean.FALSE); */ } catch (Throwable exception) { }; return aDescriptor; } /** * 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[] = { getSunRightAscensionLabelMethodDescriptor() ,main_javalangString__MethodDescriptor() }; 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[] = { moonDeclinationLabelPropertyDescriptor() ,moonRightAscensionLabelPropertyDescriptor() ,sunDeclinationLabelPropertyDescriptor() ,sunRightAscensionLabelPropertyDescriptor() }; return aDescriptorList; } catch (Throwable exception) { handleException(exception); }; return null; } /** * Gets the getSunRightAscensionLabel() method descriptor. * @return java.beans.MethodDescriptor */ public java.beans.MethodDescriptor getSunRightAscensionLabelMethodDescriptor() { java.beans.MethodDescriptor aDescriptor = null; try { /* Create and return the getSunRightAscensionLabel() 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("getSunRightAscensionLabel", aParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aMethod = findMethod(getBeanClass(), "getSunRightAscensionLabel", 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("getSunRightAscensionLabel()"); */ /* aDescriptor.setShortDescription("getSunRightAscensionLabel()"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(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 main(java.lang.String[]) method descriptor. * @return java.beans.MethodDescriptor */ public java.beans.MethodDescriptor main_javalangString__MethodDescriptor() { java.beans.MethodDescriptor aDescriptor = null; try { /* Create and return the main(java.lang.String[]) method descriptor. */ java.lang.reflect.Method aMethod = null; try { /* Attempt to find the method using getMethod with parameter types. */ java.lang.Class aParameterTypes[] = { java.lang.String[].class }; aMethod = getBeanClass().getMethod("main", aParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aMethod = findMethod(getBeanClass(), "main", 1); }; try { /* Try creating the method descriptor with parameter descriptors. */ java.beans.ParameterDescriptor aParameterDescriptor1 = new java.beans.ParameterDescriptor(); aParameterDescriptor1.setName("arg1"); aParameterDescriptor1.setDisplayName("args"); 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("main(java.lang.String[])"); */ /* aDescriptor.setShortDescription("main(java.lang.String[])"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Gets the moonDeclinationLabel property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor moonDeclinationLabelPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the moonDeclinationLabel 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("getMoonDeclinationLabel", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getMoonDeclinationLabel", 0); }; java.lang.reflect.Method aSetMethod = null; aDescriptor = new java.beans.PropertyDescriptor("moonDeclinationLabel" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("moonDeclinationLabel" , getBeanClass()); }; /* aDescriptor.setBound(false); */ /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("moonDeclinationLabel"); */ /* aDescriptor.setShortDescription("moonDeclinationLabel"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Gets the moonRightAscensionLabel property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor moonRightAscensionLabelPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the moonRightAscensionLabel property descriptor. */ java.lang.reflect.Method aGetMethod = null; java.lang.reflect.Method aSetMethod = null; aDescriptor = new java.beans.PropertyDescriptor("moonRightAscensionLabel" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("moonRightAscensionLabel" , getBeanClass()); }; /* aDescriptor.setBound(false); */ /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("moonRightAscensionLabel"); */ /* aDescriptor.setShortDescription("moonRightAscensionLabel"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Gets the sunDeclinationLabel property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor sunDeclinationLabelPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the sunDeclinationLabel 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("getSunDeclinationLabel", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getSunDeclinationLabel", 0); }; java.lang.reflect.Method aSetMethod = null; aDescriptor = new java.beans.PropertyDescriptor("sunDeclinationLabel" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("sunDeclinationLabel" , getBeanClass()); }; /* aDescriptor.setBound(false); */ /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("sunDeclinationLabel"); */ /* aDescriptor.setShortDescription("sunDeclinationLabel"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } /** * Gets the sunRightAscensionLabel property descriptor. * @return java.beans.PropertyDescriptor */ public java.beans.PropertyDescriptor sunRightAscensionLabelPropertyDescriptor() { java.beans.PropertyDescriptor aDescriptor = null; try { try { /* Using methods via getMethod is the faster way to create the sunRightAscensionLabel 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("getSunRightAscensionLabel", aGetMethodParameterTypes); } catch (Throwable exception) { /* Since getMethod failed, call findMethod. */ handleException(exception); aGetMethod = findMethod(getBeanClass(), "getSunRightAscensionLabel", 0); }; java.lang.reflect.Method aSetMethod = null; aDescriptor = new java.beans.PropertyDescriptor("sunRightAscensionLabel" , aGetMethod, aSetMethod); } catch (Throwable exception) { /* Since we failed using methods, try creating a default property descriptor. */ handleException(exception); aDescriptor = new java.beans.PropertyDescriptor("sunRightAscensionLabel" , getBeanClass()); }; /* aDescriptor.setBound(false); */ /* aDescriptor.setConstrained(false); */ /* aDescriptor.setDisplayName("sunRightAscensionLabel"); */ /* aDescriptor.setShortDescription("sunRightAscensionLabel"); */ /* aDescriptor.setExpert(false); */ /* aDescriptor.setHidden(false); */ /* aDescriptor.setValue("preferred", new Boolean(false)); */ /* aDescriptor.setValue("ivjDesignTimeProperty", new Boolean(true)); */ } catch (Throwable exception) { handleException(exception); }; return aDescriptor; } }