001: /*
002: * Copyright (c) 2004 JETA Software, Inc. All rights reserved.
003: *
004: * Redistribution and use in source and binary forms, with or without modification,
005: * are permitted provided that the following conditions are met:
006: *
007: * o Redistributions of source code must retain the above copyright notice,
008: * this list of conditions and the following disclaimer.
009: *
010: * o Redistributions in binary form must reproduce the above copyright notice,
011: * this list of conditions and the following disclaimer in the documentation
012: * and/or other materials provided with the distribution.
013: *
014: * o Neither the name of JETA Software nor the names of its contributors may
015: * be used to endorse or promote products derived from this software without
016: * specific prior written permission.
017: *
018: * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
019: * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
020: * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
021: * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
022: * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
023: * INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
024: * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
025: * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
026: * INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
027: * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
028: */
029:
030: package com.jeta.forms.components.line;
031:
032: import java.awt.Image;
033: import java.beans.BeanDescriptor;
034: import java.beans.BeanInfo;
035: import java.beans.EventSetDescriptor;
036: import java.beans.MethodDescriptor;
037: import java.beans.PropertyDescriptor;
038:
039: /**
040: * BeanInfo for a HorizontalLineComponent.
041: *
042: * @author Jeff Tassin
043: */
044: public class HorizontalLineComponentBeanInfo implements BeanInfo {
045: private PropertyDescriptor[] m_props = null;
046:
047: /**
048: * ctor
049: */
050: public HorizontalLineComponentBeanInfo() {
051: try {
052: PropertyDescriptor linedef = new PropertyDescriptor(
053: "lineDefinition", HorizontalLineComponent.class,
054: "getLineDefinition", "setLineDefinition");
055: PropertyDescriptor namedef = new PropertyDescriptor("name",
056: HorizontalLineComponent.class, "getName", "setName");
057: PropertyDescriptor posdef = new PropertyDescriptor(
058: "position", HorizontalLineComponent.class,
059: "getPosition", "setPosition");
060:
061: linedef.setPreferred(true);
062: posdef.setPreferred(true);
063: m_props = new PropertyDescriptor[] { linedef, namedef,
064: posdef };
065: } catch (Exception e) {
066: m_props = new PropertyDescriptor[0];
067: e.printStackTrace();
068: }
069: }
070:
071: public BeanInfo[] getAdditionalBeanInfo() {
072: return new BeanInfo[0];
073: }
074:
075: public BeanDescriptor getBeanDescriptor() {
076: return new BeanDescriptor(HorizontalLineComponent.class);
077: }
078:
079: public int getDefaultEventIndex() {
080: return 0;
081: }
082:
083: public int getDefaultPropertyIndex() {
084: return 0;
085: }
086:
087: public EventSetDescriptor[] getEventSetDescriptors() {
088: return new EventSetDescriptor[0];
089: }
090:
091: public Image getIcon(int i) {
092: return null;
093: }
094:
095: public MethodDescriptor[] getMethodDescriptors() {
096: return new MethodDescriptor[0];
097: }
098:
099: /**
100: * @return a collection of JETAPropertyDescriptor objects
101: */
102: public PropertyDescriptor[] getPropertyDescriptors() {
103: return m_props;
104: }
105:
106: }
|