01: /*
02: * BEGIN_HEADER - DO NOT EDIT
03: *
04: * The contents of this file are subject to the terms
05: * of the Common Development and Distribution License
06: * (the "License"). You may not use this file except
07: * in compliance with the License.
08: *
09: * You can obtain a copy of the license at
10: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
11: * See the License for the specific language governing
12: * permissions and limitations under the License.
13: *
14: * When distributing Covered Code, include this CDDL
15: * HEADER in each file and include the License file at
16: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
17: * If applicable add the following below this CDDL HEADER,
18: * with the fields enclosed by brackets "[]" replaced with
19: * your own identifying information: Portions Copyright
20: * [year] [name of copyright owner]
21: */
22:
23: /*
24: * @(#)ChartPropertyGroupsBeanBasic.java
25: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
26: *
27: * END_HEADER - DO NOT EDIT
28: */
29: package org.openesb.tools.extchart.property;
30:
31: import org.openesb.tools.extchart.property.bar.BarProperties;
32: import org.openesb.tools.extchart.property.bar.XYProperties;
33: import org.openesb.tools.extpropertysheet.IExtProperty;
34: import org.openesb.tools.extpropertysheet.IExtPropertyGroup;
35: import org.openesb.tools.extpropertysheet.impl.ExtPropertyGroupsBean;
36: import java.util.logging.Logger;
37:
38: /**
39: *
40: * @author rdwivedi
41: */
42: public class ChartPropertyGroupsBeanBasic extends ExtPropertyGroupsBean {
43:
44: private static Logger mLogger = Logger
45: .getLogger(ChartPropertyGroupsBeanBasic.class.getName());
46: private String cType = null;
47:
48: /** Creates a new instance of ChartPropertyGroupsBeanBasic */
49: public ChartPropertyGroupsBeanBasic() {
50: }
51:
52: public void repopulate(String chartType) {
53: mLogger.info("The chart types is " + chartType);
54: ChartDefaults commonProp = (ChartDefaults) getGroupByName(JFChartConstants.CHART_COMMON_PROPERTIES);
55: if (commonProp == null) {
56: commonProp = new ChartDefaults();
57: addGroup(commonProp);
58: }
59: commonProp.setProperty(JFChartConstants.CHART_TYPE, chartType,
60: IExtProperty.HIDDEN_TEXT);
61:
62: //clear();
63: XYProperties props = (XYProperties) getGroupByName(JFChartConstants.CHART_SPECIFIC_PROPERTIES);
64: if (props == null) {
65: props = new XYProperties();
66: addGroup(props);
67: }
68: BarProperties bProps = (BarProperties) getGroupByName(JFChartConstants.CHART_BAR_PROPERTIES);
69: if (bProps == null
70: && chartType.equals(JFChartConstants.BAR_CHART)) {
71: bProps = new BarProperties();
72: addGroup(bProps);
73: }
74: if (bProps != null
75: && !chartType.equals(JFChartConstants.BAR_CHART)) {
76: this
77: .removeGroupByName(JFChartConstants.CHART_BAR_PROPERTIES);
78: }
79:
80: cType = chartType;
81:
82: }
83:
84: public String getChartType() {
85: return cType;
86: }
87:
88: }
|