001: /*
002: * Copyright 2006-2007 Pentaho Corporation. All rights reserved.
003: * This software was developed by Pentaho Corporation and is provided under the terms
004: * of the Mozilla Public License, Version 1.1, or any later version. You may not use
005: * this file except in compliance with the license. If you need a copy of the license,
006: * please go to http://www.mozilla.org/MPL/MPL-1.1.txt.
007: *
008: * Software distributed under the Mozilla Public License is distributed on an "AS IS"
009: * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. Please refer to
010: * the license for the specific language governing your rights and limitations.
011: *
012: * Additional Contributor(s): Martin Schmid gridvision engineering GmbH
013: */
014: package org.pentaho.reportdesigner.crm.report.model;
015:
016: import org.jetbrains.annotations.NotNull;
017: import org.pentaho.reportdesigner.crm.report.PropertyKeys;
018:
019: import java.beans.BeanDescriptor;
020: import java.beans.IntrospectionException;
021: import java.beans.PropertyDescriptor;
022: import java.beans.SimpleBeanInfo;
023:
024: /**
025: * User: Martin
026: * Date: 21.10.2005
027: * Time: 07:11:26
028: */
029: public class RectangleReportElementBeanInfo extends SimpleBeanInfo {
030: @NotNull
031: private PropertyDescriptor[] propertyDescriptors;
032:
033: public RectangleReportElementBeanInfo()
034: throws IntrospectionException {
035: GroupingPropertyDescriptor nameDescriptor = new GroupingPropertyDescriptor(
036: PropertyKeys.NAME, PropertyKeys.GROUP_ID, false, 1,
037: RectangleReportElement.class);
038:
039: GroupingPropertyDescriptor positionContentDescriptor = new GroupingPropertyDescriptor(
040: PropertyKeys.POSITION, PropertyKeys.GROUP_SPATIAL,
041: false, 1, RectangleReportElement.class);
042: GroupingPropertyDescriptor minimumSizeContentDescriptor = new GroupingPropertyDescriptor(
043: PropertyKeys.MINIMUM_SIZE, PropertyKeys.GROUP_SPATIAL,
044: false, 2, RectangleReportElement.class);
045: GroupingPropertyDescriptor maximumSizeContentDescriptor = new GroupingPropertyDescriptor(
046: PropertyKeys.MAXIMUM_SIZE, PropertyKeys.GROUP_SPATIAL,
047: false, 3, RectangleReportElement.class);
048:
049: GroupingPropertyDescriptor backgroundDescriptor = new GroupingPropertyDescriptor(
050: PropertyKeys.COLOR, PropertyKeys.GROUP_APPEARANCE,
051: true, 1, RectangleReportElement.class);
052: GroupingPropertyDescriptor fillDescriptor = new GroupingPropertyDescriptor(
053: PropertyKeys.FILL, PropertyKeys.GROUP_APPEARANCE, true,
054: 2, RectangleReportElement.class);
055: GroupingPropertyDescriptor drawDescriptor = new GroupingPropertyDescriptor(
056: PropertyKeys.DRAW_BORDER,
057: PropertyKeys.GROUP_APPEARANCE, true, 3,
058: RectangleReportElement.class);
059: //GroupingPropertyDescriptor lineWidthDescriptor = new GroupingPropertyDescriptor(PropertyKeys.LINE_WIDTH, PropertyKeys.GROUP_APPEARANCE, true, 4, RectangleReportElement.class);
060: GroupingPropertyDescriptor borderDefinitionDescriptor = new GroupingPropertyDescriptor(
061: PropertyKeys.BORDER_DEFINITION,
062: PropertyKeys.GROUP_APPEARANCE, true, 4,
063: RectangleReportElement.class);
064: GroupingPropertyDescriptor arcWidthDescriptor = new GroupingPropertyDescriptor(
065: PropertyKeys.ARC_WIDTH, PropertyKeys.GROUP_APPEARANCE,
066: true, 5, RectangleReportElement.class);
067: GroupingPropertyDescriptor arcHeightDescriptor = new GroupingPropertyDescriptor(
068: PropertyKeys.ARC_HEIGHT, PropertyKeys.GROUP_APPEARANCE,
069: true, 6, RectangleReportElement.class);
070: GroupingPropertyDescriptor styleExpressionsDescriptor = new GroupingPropertyDescriptor(
071: PropertyKeys.STYLE_EXPRESSIONS,
072: PropertyKeys.GROUP_APPEARANCE, false, 7,
073: RectangleReportElement.class);
074: GroupingPropertyDescriptor paddingContentDescriptor = new GroupingPropertyDescriptor(
075: PropertyKeys.PADDING, PropertyKeys.GROUP_APPEARANCE,
076: false, 8, RectangleReportElement.class);
077: //GroupingPropertyDescriptor elementBorderDescriptor = new GroupingPropertyDescriptor(PropertyKeys.ELEMENT_BORDER, PropertyKeys.GROUP_APPEARANCE, false, 9, RectangleReportElement.class);
078:
079: propertyDescriptors = new PropertyDescriptor[] {
080: nameDescriptor, styleExpressionsDescriptor,
081: positionContentDescriptor,
082: minimumSizeContentDescriptor,
083: maximumSizeContentDescriptor, backgroundDescriptor,
084: fillDescriptor, drawDescriptor,
085: borderDefinitionDescriptor, arcWidthDescriptor,
086: arcHeightDescriptor, paddingContentDescriptor };
087:
088: }
089:
090: @NotNull
091: public BeanDescriptor getBeanDescriptor() {
092: return new BeanDescriptor(RectangleReportElement.class);
093: }
094:
095: @NotNull
096: public PropertyDescriptor[] getPropertyDescriptors() {
097: return propertyDescriptors;
098: }
099:
100: }
|