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: * Defines the properties for our LineComponent.
041: *
042: * @author Jeff Tassin
043: */
044: public class VerticalLineComponentBeanInfo implements BeanInfo {
045: private PropertyDescriptor[] m_props = new PropertyDescriptor[0];
046:
047: /**
048: * ctor
049: */
050: public VerticalLineComponentBeanInfo() {
051: try {
052: PropertyDescriptor linedef = new PropertyDescriptor(
053: "lineDefinition", VerticalLineComponent.class,
054: "getLineDefinition", "setLineDefinition");
055: PropertyDescriptor namedef = new PropertyDescriptor("name",
056: VerticalLineComponent.class, "getName", "setName");
057: PropertyDescriptor posdef = new PropertyDescriptor(
058: "position", VerticalLineComponent.class,
059: "getPosition", "setPosition");
060:
061: linedef.setPreferred(true);
062: m_props = new PropertyDescriptor[] { linedef, namedef,
063: posdef };
064: } catch (Exception e) {
065: m_props = new PropertyDescriptor[0];
066: e.printStackTrace();
067: }
068: }
069:
070: public BeanInfo[] getAdditionalBeanInfo() {
071: return new BeanInfo[0];
072: }
073:
074: public BeanDescriptor getBeanDescriptor() {
075: return null;
076: }
077:
078: public int getDefaultEventIndex() {
079: return 0;
080: }
081:
082: public int getDefaultPropertyIndex() {
083: return 0;
084: }
085:
086: public EventSetDescriptor[] getEventSetDescriptors() {
087: return new EventSetDescriptor[0];
088: }
089:
090: public Image getIcon(int i) {
091: return null;
092: }
093:
094: public MethodDescriptor[] getMethodDescriptors() {
095: return new MethodDescriptor[0];
096: }
097:
098: /**
099: * @return a collection of JETAPropertyDescriptor objects
100: */
101: public PropertyDescriptor[] getPropertyDescriptors() {
102: return m_props;
103: }
104:
105: }
|