001: /*
002: * BEGIN_HEADER - DO NOT EDIT
003: *
004: * The contents of this file are subject to the terms
005: * of the Common Development and Distribution License
006: * (the "License"). You may not use this file except
007: * in compliance with the License.
008: *
009: * You can obtain a copy of the license at
010: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
011: * See the License for the specific language governing
012: * permissions and limitations under the License.
013: *
014: * When distributing Covered Code, include this CDDL
015: * HEADER in each file and include the License file at
016: * https://open-esb.dev.java.net/public/CDDLv1.0.html.
017: * If applicable add the following below this CDDL HEADER,
018: * with the fields enclosed by brackets "[]" replaced with
019: * your own identifying information: Portions Copyright
020: * [year] [name of copyright owner]
021: */
022:
023: /*
024: * @(#)ChartBean.java
025: * Copyright 2004-2007 Sun Microsystems, Inc. All Rights Reserved.
026: *
027: * END_HEADER - DO NOT EDIT
028: */
029: package org.openesb.tools.charting.persist;
030:
031: import org.openesb.tools.extchart.property.ChartPropertyGroupsBeanBasic;
032:
033: /**
034: *
035: * @author rdwivedi
036: */
037: public class ChartBean {
038:
039: private String mCID = null;
040: private String mCName = null;
041: private String mCParentName = null;
042: private String mCType = null;
043: private ChartPropertyGroupsBeanBasic mChartProps = null;
044: private String mDBID = null;
045: private String mCParentGrpID = "133";
046:
047: /** Creates a new instance of ChartBean */
048: public ChartBean() {
049: }
050:
051: public void setChartName(String cn) {
052: mCName = cn;
053: }
054:
055: public void setChartParentName(String pn) {
056: mCParentName = pn;
057: }
058:
059: public String getParentID() {
060: return mCParentGrpID;
061: }
062:
063: public void setParentID(String id) {
064: mCParentGrpID = id;
065: }
066:
067: public void setChartID(String id) {
068: mCID = id;
069: }
070:
071: public void createNewChartID() {
072: mCID = "_c" + System.currentTimeMillis();
073: }
074:
075: public void setChartDataBeanID(String d) {
076: mDBID = d;
077: }
078:
079: public String getChartDataBeanID() {
080: return mDBID;
081: }
082:
083: public void setChartProperties(ChartPropertyGroupsBeanBasic d) {
084: mChartProps = d;
085: }
086:
087: public String getChartID() {
088: return mCID;
089: }
090:
091: public String getChartName() {
092: return mCName;
093: }
094:
095: public String getChartType() {
096: return mCType;
097: }
098:
099: public String getChartParentName() {
100: return mCParentName;
101: }
102:
103: public ChartPropertyGroupsBeanBasic getChartProperties() {
104: if (mChartProps == null && mCType != null) {
105: setChartPropertiesForDataset(null, mCType);
106: }
107: return mChartProps;
108: }
109:
110: public void setChartPropertiesForDataset(String dsType, String cType) {
111: mCType = cType;
112: ChartPropertyGroupsBeanBasic g = new ChartPropertyGroupsBeanBasic();
113: g.repopulate(cType);
114: this .setChartProperties(g);
115: }
116:
117: public void resetChartType(String cType) {
118: mCType = cType;
119: ChartPropertyGroupsBeanBasic g = this .getChartProperties();
120: if (g == null) {
121:
122: g = new ChartPropertyGroupsBeanBasic();
123: }
124: g.repopulate(cType);
125: this .setChartProperties(g);
126: }
127: //public void setChartType(String cType) {
128: // mCType = cType;
129: //}
130:
131: }
|