0001: /*
0002: * Copyright (C) 2005 - 2008 JasperSoft Corporation. All rights reserved.
0003: * http://www.jaspersoft.com.
0004: *
0005: * Unless you have purchased a commercial license agreement from JasperSoft,
0006: * the following license terms apply:
0007: *
0008: * This program is free software; you can redistribute it and/or modify
0009: * it under the terms of the GNU General Public License version 2 as published by
0010: * the Free Software Foundation.
0011: *
0012: * This program is distributed WITHOUT ANY WARRANTY; and without the
0013: * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
0014: * See the GNU General Public License for more details.
0015: *
0016: * You should have received a copy of the GNU General Public License
0017: * along with this program; if not, see http://www.gnu.org/licenses/gpl.txt
0018: * or write to:
0019: *
0020: * Free Software Foundation, Inc.,
0021: * 59 Temple Place - Suite 330,
0022: * Boston, MA USA 02111-1307
0023: *
0024: *
0025: *
0026: *
0027: * ChartPropertiesDialog.java
0028: *
0029: * Created on 15 agosto 2005, 10.19
0030: *
0031: */
0032:
0033: package it.businesslogic.ireport.chart.gui;
0034:
0035: import it.businesslogic.ireport.chart.Axis;
0036: import it.businesslogic.ireport.gui.JRLinkParameterDialog;
0037: import it.businesslogic.ireport.gui.MainFrame;
0038: import it.businesslogic.ireport.gui.sheet.*;
0039: import it.businesslogic.ireport.chart.*;
0040: import it.businesslogic.ireport.*;
0041: import it.businesslogic.ireport.gui.JRSubreportParameterDialog;
0042: import it.businesslogic.ireport.gui.JReportFrame;
0043: import it.businesslogic.ireport.gui.event.SheetPropertyValueChangedEvent;
0044: import it.businesslogic.ireport.gui.event.SheetPropertyValueChangedListener;
0045: import java.awt.event.ActionEvent;
0046: import javax.swing.DefaultListSelectionModel;
0047: import javax.swing.JOptionPane;
0048: import it.businesslogic.ireport.util.Misc;
0049: import java.awt.Color;
0050: import java.awt.Component;
0051: import java.util.Vector;
0052: import javax.swing.border.TitledBorder;
0053: import javax.swing.event.CellEditorListener;
0054: import javax.swing.event.ChangeEvent;
0055: import javax.swing.event.ListSelectionEvent;
0056: import javax.swing.event.ListSelectionListener;
0057: import javax.swing.table.DefaultTableModel;
0058: import javax.swing.table.TableColumn;
0059: import it.businesslogic.ireport.util.I18n;
0060:
0061: /**
0062: *
0063: * @author Administrator
0064: */
0065: public class ChartPropertiesDialog extends javax.swing.JDialog
0066: implements SheetPropertyValueChangedListener {
0067:
0068: private CategorySheetPanel sheetPanel = null;
0069: private ChartReportElement2 currentSelectedChartElement = null;
0070: private int dialogResult = javax.swing.JOptionPane.OK_OPTION;
0071: private JReportFrame jReportFrame = null;
0072: private boolean init = false;
0073:
0074: public void setChartElement(ChartReportElement2 chartReportElement) {
0075: setInit(true);
0076:
0077: try {
0078:
0079: currentSelectedChartElement = chartReportElement;
0080:
0081: jButtonPaste
0082: .setEnabled(it.businesslogic.ireport.gui.MainFrame
0083: .getMainInstance()
0084: .getChartDatasetClipBoard() != null);
0085:
0086: if (currentSelectedChartElement == null) {
0087: // We have to clean all the gui....
0088: sheetPanel.removeAllProperties();
0089: jComboBoxTypeOfData.removeAllItems();
0090: jPanelDataDefinition.removeAll();
0091: } else {
0092: updateGroups();
0093: updateSubDatasets();
0094: // Case by case...
0095: addCommonChartProperties();
0096:
0097: while (jTabbedPane1.getTabCount() > 1)
0098: jTabbedPane1.remove(1);
0099: if (currentSelectedChartElement.getChart() instanceof MultiAxisChart) {
0100: jTabbedPane1.add("Multiaxis charts",
0101: jPanelMultiAxis);
0102: jTabbedPane1
0103: .setTitleAt(
0104: 1,
0105: it.businesslogic.ireport.util.I18n
0106: .getString(
0107: "gui.ChartPropertiesDialog.TabChartMultiaxis",
0108: "Chart Multiaxis"));
0109:
0110: DefaultTableModel dtm = (DefaultTableModel) jTable1
0111: .getModel();
0112: dtm.setRowCount(0);
0113:
0114: java.util.List axes = ((MultiAxisPlot) currentSelectedChartElement
0115: .getChart().getPlot()).getAxis();
0116: for (int i = 0; i < axes.size(); ++i) {
0117: Axis axis = (Axis) axes.get(i);
0118: dtm.addRow(new Object[] { axis,
0119: axis.getPosition() });
0120: }
0121:
0122: } else {
0123: jTabbedPane1.add("Chart data", jPanelData);
0124: jTabbedPane1
0125: .setTitleAt(
0126: 1,
0127: it.businesslogic.ireport.util.I18n
0128: .getString(
0129: "gui.ChartPropertiesDialog.TabChartData",
0130: "Chart data"));
0131:
0132: // Set general dataset data...
0133: Misc.setComboboxSelectedTagValue(
0134: jComboBoxIncrementType,
0135: currentSelectedChartElement.getChart()
0136: .getDataset().getIncrementType());
0137: jComboBoxIncrementGroup
0138: .setSelectedItem(currentSelectedChartElement
0139: .getChart().getDataset()
0140: .getIncrementGroup());
0141: Misc.setComboboxSelectedTagValue(
0142: jComboBoxResetType,
0143: currentSelectedChartElement.getChart()
0144: .getDataset().getResetType());
0145: jComboBoxResetGroup
0146: .setSelectedItem(currentSelectedChartElement
0147: .getChart().getDataset()
0148: .getResetGroup());
0149: jRTextExpressionAreaFilterExpression
0150: .setText(currentSelectedChartElement
0151: .getChart().getDataset()
0152: .getIncrementWhenExpression());
0153:
0154: if (currentSelectedChartElement.getChart()
0155: .getDataset().getSubDataset() != null) {
0156: jComboBoxSubDataset
0157: .setSelectedItem(currentSelectedChartElement
0158: .getChart().getDataset()
0159: .getSubDataset());
0160: jTabbedPaneSubDataset.setVisible(true);
0161:
0162: jRTextExpressionAreaMapExpression
0163: .setText(currentSelectedChartElement
0164: .getChart().getDataset()
0165: .getParametersMapExpression());
0166: if (!currentSelectedChartElement.getChart()
0167: .getDataset().isUseConnection()
0168: && Misc
0169: .nvl(
0170: currentSelectedChartElement
0171: .getChart()
0172: .getDataset()
0173: .getDataSourceExpression(),
0174: "").trim().equals("")) {
0175: this .jComboBoxDatasetConnectionType
0176: .setSelectedIndex(0);
0177: this .jRTextExpressionAreaTextConnectionExpression
0178: .setEnabled(false);
0179: this .jRTextExpressionAreaTextConnectionExpression
0180: .setBackground(Color.LIGHT_GRAY);
0181: this .jRTextExpressionAreaTextConnectionExpression
0182: .setText("");
0183: } else if (currentSelectedChartElement
0184: .getChart().getDataset()
0185: .isUseConnection()) {
0186: this .jComboBoxDatasetConnectionType
0187: .setSelectedIndex(1);
0188: this .jRTextExpressionAreaTextConnectionExpression
0189: .setEnabled(true);
0190: this .jRTextExpressionAreaTextConnectionExpression
0191: .setBackground(Color.WHITE);
0192: this .jRTextExpressionAreaTextConnectionExpression
0193: .setText(currentSelectedChartElement
0194: .getChart().getDataset()
0195: .getConnectionExpression());
0196: } else {
0197: this .jComboBoxDatasetConnectionType
0198: .setSelectedIndex(2);
0199: this .jRTextExpressionAreaTextConnectionExpression
0200: .setEnabled(true);
0201: this .jRTextExpressionAreaTextConnectionExpression
0202: .setBackground(Color.WHITE);
0203: this .jRTextExpressionAreaTextConnectionExpression
0204: .setText(currentSelectedChartElement
0205: .getChart().getDataset()
0206: .getDataSourceExpression());
0207: }
0208:
0209: //Add parameters...
0210: javax.swing.table.DefaultTableModel dtm = (javax.swing.table.DefaultTableModel) jTableDatasetParameters
0211: .getModel();
0212: dtm.setRowCount(0);
0213:
0214: java.util.Enumeration enum_parameters = currentSelectedChartElement
0215: .getChart().getDataset()
0216: .getSubreportParameters().elements();
0217: while (enum_parameters.hasMoreElements()) {
0218: it.businesslogic.ireport.JRSubreportParameter parameter = (it.businesslogic.ireport.JRSubreportParameter) enum_parameters
0219: .nextElement();
0220: Vector row = new Vector();
0221: row.addElement(parameter);
0222: row.addElement(parameter.getExpression());
0223: dtm.addRow(row);
0224: }
0225:
0226: jRTextExpressionAreaFilterExpression
0227: .setSubDataset(currentSelectedChartElement
0228: .getChart().getDataset()
0229: .getSubDataset());
0230:
0231: } else {
0232: javax.swing.table.DefaultTableModel dtm = (javax.swing.table.DefaultTableModel) jTableDatasetParameters
0233: .getModel();
0234: dtm.setRowCount(0);
0235: this .jComboBoxDatasetConnectionType
0236: .setSelectedIndex(0);
0237: this .jRTextExpressionAreaTextConnectionExpression
0238: .setEnabled(false);
0239: this .jRTextExpressionAreaTextConnectionExpression
0240: .setBackground(Color.LIGHT_GRAY);
0241: this .jRTextExpressionAreaTextConnectionExpression
0242: .setText("");
0243: jRTextExpressionAreaMapExpression.setText("");
0244:
0245: jComboBoxSubDataset.setSelectedIndex(0);
0246: jTabbedPaneSubDataset.setVisible(false);
0247: }
0248:
0249: java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
0250: gridBagConstraints.gridx = 4;
0251: gridBagConstraints.gridy = 2;
0252: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0253: gridBagConstraints.weightx = 1.0;
0254: gridBagConstraints.weighty = 1.0;
0255: gridBagConstraints.fill = gridBagConstraints.BOTH;
0256: gridBagConstraints.insets = new java.awt.Insets(4,
0257: 4, 4, 4);
0258:
0259: if (currentSelectedChartElement.getChart() instanceof PieChart
0260: || currentSelectedChartElement.getChart() instanceof Pie3DChart) {
0261: jComboBoxTypeOfData
0262: .addItem(new Tag(
0263: "it.businesslogic.ireport.chart.PieDataset",
0264: "Pie dataset"));
0265: } else if (currentSelectedChartElement.getChart() instanceof BarChart
0266: || currentSelectedChartElement.getChart() instanceof Bar3DChart
0267: || currentSelectedChartElement.getChart() instanceof StackedBarChart
0268: || currentSelectedChartElement.getChart() instanceof StackedBar3DChart
0269: || currentSelectedChartElement.getChart() instanceof LineChart
0270: || currentSelectedChartElement.getChart() instanceof AreaChart
0271: || currentSelectedChartElement.getChart() instanceof StackedAreaChart) {
0272: jComboBoxTypeOfData
0273: .addItem(new Tag(
0274: "it.businesslogic.ireport.chart.CategoryDataset",
0275: "Category dataset"));
0276: } else if (currentSelectedChartElement.getChart() instanceof XYBarChart) {
0277: jComboBoxTypeOfData
0278: .addItem(new Tag(
0279: "it.businesslogic.ireport.chart.TimePeriodDataset",
0280: "Time period dataset"));
0281: jComboBoxTypeOfData
0282: .addItem(new Tag(
0283: "it.businesslogic.ireport.chart.TimeSeriesDataset",
0284: "Time series dataset"));
0285: jComboBoxTypeOfData
0286: .addItem(new Tag(
0287: "it.businesslogic.ireport.chart.XYDataset",
0288: "XY dataset"));
0289: } else if (currentSelectedChartElement.getChart() instanceof XYLineChart
0290: || currentSelectedChartElement.getChart() instanceof XYAreaChart
0291: || currentSelectedChartElement.getChart() instanceof ScatterChart) {
0292: jComboBoxTypeOfData
0293: .addItem(new Tag(
0294: "it.businesslogic.ireport.chart.XYDataset",
0295: "XY dataset"));
0296: } else if (currentSelectedChartElement.getChart() instanceof BubbleChart) {
0297: jComboBoxTypeOfData
0298: .addItem(new Tag(
0299: "it.businesslogic.ireport.chart.XYZDataset",
0300: "XYZ dataset"));
0301: } else if (currentSelectedChartElement.getChart() instanceof TimeSeriesChart) {
0302: jComboBoxTypeOfData
0303: .addItem(new Tag(
0304: "it.businesslogic.ireport.chart.TimeSeriesDataset",
0305: "Time series dataset"));
0306: } else if (currentSelectedChartElement.getChart() instanceof HighLowChart
0307: || currentSelectedChartElement.getChart() instanceof CandlestickChart) {
0308: jComboBoxTypeOfData
0309: .addItem(new Tag(
0310: "it.businesslogic.ireport.chart.HighLowDataset",
0311: "High low dataset"));
0312: } else if (currentSelectedChartElement.getChart() instanceof MeterChart
0313: || currentSelectedChartElement.getChart() instanceof ThermometerChart) {
0314: jComboBoxTypeOfData
0315: .addItem(new Tag(
0316: "it.businesslogic.ireport.chart.ValueDataset",
0317: "Value dataset"));
0318: }
0319:
0320: setDatasetPanel(currentSelectedChartElement
0321: .getChart().getDataset());
0322: }
0323:
0324: setPlotSheetProperties(currentSelectedChartElement
0325: .getChart().getPlot());
0326:
0327: }
0328:
0329: sheetPanel.setShowResetButton(false);
0330: sheetPanel.recreateSheet();
0331:
0332: } catch (Exception ex) {
0333: ex.printStackTrace();
0334: }
0335: setInit(false);
0336: }
0337:
0338: /** Creates new dialog ChartPropertiesDialog */
0339: public ChartPropertiesDialog(java.awt.Dialog parent, boolean modal) {
0340: super (parent, modal);
0341: initAll();
0342: }
0343:
0344: /** Creates new dialog ChartPropertiesDialog */
0345: public ChartPropertiesDialog(java.awt.Frame parent, boolean modal) {
0346: super (parent, modal);
0347: initAll();
0348: }
0349:
0350: public void initAll() {
0351: initComponents();
0352:
0353: java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
0354: gridBagConstraints.gridx = 4;
0355: gridBagConstraints.gridy = 2;
0356: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0357: gridBagConstraints.weightx = 1.0;
0358: gridBagConstraints.weighty = 1.0;
0359: gridBagConstraints.fill = gridBagConstraints.BOTH;
0360: gridBagConstraints.insets = new java.awt.Insets(0, -1, -1, -1);
0361: sheetPanel = new CategorySheetPanel();
0362: sheetPanel.addSheetPropertyValueChangedListener(this );
0363:
0364: jPanelProperties.add(sheetPanel, gridBagConstraints);
0365:
0366: Vector values = new Vector();
0367: values.add(new Tag("leftOrTop",
0368: it.businesslogic.ireport.util.I18n.getString(
0369: "leftOrTop", "Left or top")));
0370: values.add(new Tag("rightOrBottom",
0371: it.businesslogic.ireport.util.I18n.getString(
0372: "rightOrBottom", "Right or bottom")));
0373: TableColumn col = jTable1.getColumnModel().getColumn(1);
0374: jTable1.setRowHeight(21);
0375: TagComboCellEditor comboEditor = new TagComboCellEditor(values);
0376: col.setCellEditor(comboEditor);
0377: col.setCellRenderer(new TagComboBoxRenderer(values));
0378: comboEditor.addCellEditorListener(new CellEditorListener() {
0379: public void editingCanceled(ChangeEvent e) {
0380:
0381: }
0382:
0383: public void editingStopped(ChangeEvent e) {
0384: jTable1editingStopped(e);
0385: }
0386: });
0387:
0388: applyI18n();
0389:
0390: this .jComboBoxResetType.addItem(new Tag("None",
0391: it.businesslogic.ireport.util.I18n.getString(
0392: "resetType.None", "None")));
0393: this .jComboBoxResetType.addItem(new Tag("Report",
0394: it.businesslogic.ireport.util.I18n.getString(
0395: "resetType.Report", "Report")));
0396: this .jComboBoxResetType.addItem(new Tag("Page",
0397: it.businesslogic.ireport.util.I18n.getString(
0398: "resetType.Page", "Page")));
0399: this .jComboBoxResetType.addItem(new Tag("Column",
0400: it.businesslogic.ireport.util.I18n.getString(
0401: "resetType.Column", "Column")));
0402: this .jComboBoxResetType.addItem(new Tag("Group",
0403: it.businesslogic.ireport.util.I18n.getString(
0404: "resetType.Group", "Group")));
0405:
0406: this .jComboBoxIncrementType.addItem(new Tag("None",
0407: it.businesslogic.ireport.util.I18n.getString(
0408: "incrementType.None", "None")));
0409: this .jComboBoxIncrementType.addItem(new Tag("Report",
0410: it.businesslogic.ireport.util.I18n.getString(
0411: "incrementType.Report", "Report")));
0412: this .jComboBoxIncrementType.addItem(new Tag("Page",
0413: it.businesslogic.ireport.util.I18n.getString(
0414: "incrementType.Page", "Page")));
0415: this .jComboBoxIncrementType.addItem(new Tag("Column",
0416: it.businesslogic.ireport.util.I18n.getString(
0417: "incrementType.Column", "Column")));
0418: this .jComboBoxIncrementType.addItem(new Tag("Group",
0419: it.businesslogic.ireport.util.I18n.getString(
0420: "incrementType.Group", "Group")));
0421:
0422: jComboBoxDatasetConnectionType.addItem(new Tag(
0423: "Don't use connection or datasource",
0424: it.businesslogic.ireport.util.I18n.getString(
0425: "ConnectionType.1",
0426: "Don't use connection or datasource")));
0427: jComboBoxDatasetConnectionType.addItem(new Tag(
0428: "Use connection expression",
0429: it.businesslogic.ireport.util.I18n
0430: .getString("ConnectionType.2",
0431: "Use connection expression")));
0432: jComboBoxDatasetConnectionType.addItem(new Tag(
0433: "Use datasource expression",
0434: it.businesslogic.ireport.util.I18n
0435: .getString("ConnectionType.3",
0436: "Use datasource expression")));
0437:
0438: this .jRTextExpressionAreaMapExpression.getDocument()
0439: .addDocumentListener(
0440: new javax.swing.event.DocumentListener() {
0441: public void changedUpdate(
0442: javax.swing.event.DocumentEvent evt) {
0443: jRTextExpressionAreaMapExpressionTextChanged();
0444: }
0445:
0446: public void insertUpdate(
0447: javax.swing.event.DocumentEvent evt) {
0448: jRTextExpressionAreaMapExpressionTextChanged();
0449: }
0450:
0451: public void removeUpdate(
0452: javax.swing.event.DocumentEvent evt) {
0453: jRTextExpressionAreaMapExpressionTextChanged();
0454: }
0455: });
0456:
0457: this .jRTextExpressionAreaFilterExpression.getDocument()
0458: .addDocumentListener(
0459: new javax.swing.event.DocumentListener() {
0460: public void changedUpdate(
0461: javax.swing.event.DocumentEvent evt) {
0462: jRTextExpressionAreaFilterExpressionTextChanged();
0463: }
0464:
0465: public void insertUpdate(
0466: javax.swing.event.DocumentEvent evt) {
0467: jRTextExpressionAreaFilterExpressionTextChanged();
0468: }
0469:
0470: public void removeUpdate(
0471: javax.swing.event.DocumentEvent evt) {
0472: jRTextExpressionAreaFilterExpressionTextChanged();
0473: }
0474: });
0475:
0476: this .jRTextExpressionAreaTextConnectionExpression.getDocument()
0477: .addDocumentListener(
0478: new javax.swing.event.DocumentListener() {
0479: public void changedUpdate(
0480: javax.swing.event.DocumentEvent evt) {
0481: jRTextExpressionAreaTextConnectionExpressionTextChanged();
0482: }
0483:
0484: public void insertUpdate(
0485: javax.swing.event.DocumentEvent evt) {
0486: jRTextExpressionAreaTextConnectionExpressionTextChanged();
0487: }
0488:
0489: public void removeUpdate(
0490: javax.swing.event.DocumentEvent evt) {
0491: jRTextExpressionAreaTextConnectionExpressionTextChanged();
0492: }
0493: });
0494:
0495: javax.swing.DefaultListSelectionModel dlsm = (javax.swing.DefaultListSelectionModel) this .jTableDatasetParameters
0496: .getSelectionModel();
0497: dlsm
0498: .addListSelectionListener(new javax.swing.event.ListSelectionListener() {
0499: public void valueChanged(
0500: javax.swing.event.ListSelectionEvent e) {
0501: jTableDatasetParametersListSelectionValueChanged(e);
0502: }
0503: });
0504:
0505: jTable1.getSelectionModel().addListSelectionListener(
0506: new ListSelectionListener() {
0507: public void valueChanged(ListSelectionEvent e) {
0508: jTable1ValueChanged(e);
0509: }
0510: });
0511:
0512: this .pack();
0513: it.businesslogic.ireport.util.Misc.centerFrame(this );
0514:
0515: javax.swing.KeyStroke escape = javax.swing.KeyStroke
0516: .getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0,
0517: false);
0518: javax.swing.Action escapeAction = new javax.swing.AbstractAction() {
0519: public void actionPerformed(java.awt.event.ActionEvent e) {
0520: jButtonCloseActionPerformed(e);
0521: }
0522: };
0523:
0524: getRootPane().getInputMap(
0525: javax.swing.JComponent.WHEN_IN_FOCUSED_WINDOW).put(
0526: escape, "ESCAPE");
0527: getRootPane().getActionMap().put("ESCAPE", escapeAction);
0528:
0529: //to make the default button ...
0530: this .getRootPane().setDefaultButton(this .jButtonClose);
0531: }
0532:
0533: private void jTable1ValueChanged(
0534: javax.swing.event.ListSelectionEvent evt) {
0535:
0536: if (jTable1.getSelectedRowCount() > 0) {
0537: jButtonDelete.setEnabled(true);
0538: jButtonModify.setEnabled(true);
0539: jButtonMoveUp.setEnabled(jTable1.getSelectedRow() > 0);
0540: jButtonMoveDown
0541: .setEnabled(jTable1.getSelectedRow() < jTable1
0542: .getRowCount() - 1);
0543: } else {
0544: jButtonModify.setEnabled(false);
0545: jButtonDelete.setEnabled(false);
0546: jButtonMoveUp.setEnabled(false);
0547: jButtonMoveDown.setEnabled(false);
0548: }
0549:
0550: }
0551:
0552: public void jRTextExpressionAreaMapExpressionTextChanged() {
0553: if (this .isInit())
0554: return;
0555: if (currentSelectedChartElement != null) {
0556: currentSelectedChartElement.getChart().getDataset()
0557: .setParametersMapExpression(
0558: ""
0559: + jRTextExpressionAreaMapExpression
0560: .getText());
0561: }
0562: }
0563:
0564: public void jRTextExpressionAreaFilterExpressionTextChanged() {
0565: if (this .isInit())
0566: return;
0567: if (currentSelectedChartElement != null) {
0568: currentSelectedChartElement
0569: .getChart()
0570: .getDataset()
0571: .setIncrementWhenExpression(
0572: ""
0573: + jRTextExpressionAreaFilterExpression
0574: .getText());
0575: }
0576: }
0577:
0578: public void jRTextExpressionAreaTextConnectionExpressionTextChanged() {
0579: if (this .isInit())
0580: return;
0581: if (currentSelectedChartElement != null) {
0582: if (currentSelectedChartElement.getChart().getDataset()
0583: .isUseConnection())
0584: currentSelectedChartElement
0585: .getChart()
0586: .getDataset()
0587: .setConnectionExpression(
0588: ""
0589: + jRTextExpressionAreaTextConnectionExpression
0590: .getText());
0591: else
0592: currentSelectedChartElement
0593: .getChart()
0594: .getDataset()
0595: .setDataSourceExpression(
0596: ""
0597: + jRTextExpressionAreaTextConnectionExpression
0598: .getText());
0599: }
0600: }
0601:
0602: public void jTableDatasetParametersListSelectionValueChanged(
0603: javax.swing.event.ListSelectionEvent e) {
0604: if (this .jTableDatasetParameters.getSelectedRowCount() > 0) {
0605: this .jButtonModParameter.setEnabled(true);
0606: this .jButtonRemParameter.setEnabled(true);
0607: } else {
0608: this .jButtonModParameter.setEnabled(false);
0609: this .jButtonRemParameter.setEnabled(false);
0610: }
0611: }
0612:
0613: /** This method is called from within the constructor to
0614: * initialize the form.
0615: * WARNING: Do NOT modify this code. The content of this method is
0616: * always regenerated by the Form Editor.
0617: */
0618: // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
0619: private void initComponents() {
0620: java.awt.GridBagConstraints gridBagConstraints;
0621:
0622: jTabbedPane1 = new javax.swing.JTabbedPane();
0623: jPanelProperties = new javax.swing.JPanel();
0624: jPanelData = new javax.swing.JPanel();
0625: jLabelTypeOfData = new javax.swing.JLabel();
0626: jComboBoxTypeOfData = new javax.swing.JComboBox();
0627: jTabbedPaneData = new javax.swing.JTabbedPane();
0628: jPanelDataset = new javax.swing.JPanel();
0629: jLabelResetType = new javax.swing.JLabel();
0630: jComboBoxResetType = new javax.swing.JComboBox();
0631: jLabelResetGroup = new javax.swing.JLabel();
0632: jComboBoxResetGroup = new javax.swing.JComboBox();
0633: jLabelIncrementType = new javax.swing.JLabel();
0634: jComboBoxIncrementType = new javax.swing.JComboBox();
0635: jLabelIncrementGroup = new javax.swing.JLabel();
0636: jComboBoxIncrementGroup = new javax.swing.JComboBox();
0637: jLabelIncrementType2 = new javax.swing.JLabel();
0638: jPanel1 = new javax.swing.JPanel();
0639: jLabelIncrementType1 = new javax.swing.JLabel();
0640: jComboBoxSubDataset = new javax.swing.JComboBox();
0641: jPanel7 = new javax.swing.JPanel();
0642: jTabbedPaneSubDataset = new javax.swing.JTabbedPane();
0643: jPanel4 = new javax.swing.JPanel();
0644: jPanel16 = new javax.swing.JPanel();
0645: jScrollPane2 = new javax.swing.JScrollPane();
0646: jTableDatasetParameters = new javax.swing.JTable();
0647: jPanel10 = new javax.swing.JPanel();
0648: jButtonAddParameter = new javax.swing.JButton();
0649: jButtonModParameter = new javax.swing.JButton();
0650: jButtonRemParameter = new javax.swing.JButton();
0651: jPanel5 = new javax.swing.JPanel();
0652: jLabel26 = new javax.swing.JLabel();
0653: jRTextExpressionAreaMapExpression = new it.businesslogic.ireport.gui.JRTextExpressionArea();
0654: jPanel6 = new javax.swing.JPanel();
0655: jLabel41 = new javax.swing.JLabel();
0656: jComboBoxDatasetConnectionType = new javax.swing.JComboBox();
0657: jRTextExpressionAreaTextConnectionExpression = new it.businesslogic.ireport.gui.JRTextExpressionArea();
0658: jPanel2 = new javax.swing.JPanel();
0659: jButtonCopy = new javax.swing.JButton();
0660: jButtonPaste = new javax.swing.JButton();
0661: jPanel3 = new javax.swing.JPanel();
0662: jRTextExpressionAreaFilterExpression = new it.businesslogic.ireport.gui.JRTextExpressionArea();
0663: jPanelDataDefinition = new javax.swing.JPanel();
0664: jPanelMultiAxis = new javax.swing.JPanel();
0665: jScrollPane1 = new javax.swing.JScrollPane();
0666: jTable1 = new javax.swing.JTable();
0667: jPanel9 = new javax.swing.JPanel();
0668: jButtonAdd = new javax.swing.JButton();
0669: jButtonModify = new javax.swing.JButton();
0670: jButtonDelete = new javax.swing.JButton();
0671: jButtonMoveUp = new javax.swing.JButton();
0672: jButtonMoveDown = new javax.swing.JButton();
0673: jPanel8 = new javax.swing.JPanel();
0674: jButtonClose = new javax.swing.JButton();
0675:
0676: setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
0677: setTitle("Chart details");
0678: addWindowListener(new java.awt.event.WindowAdapter() {
0679: public void windowClosing(java.awt.event.WindowEvent evt) {
0680: formWindowClosing(evt);
0681: }
0682:
0683: public void windowOpened(java.awt.event.WindowEvent evt) {
0684: formWindowOpened(evt);
0685: }
0686: });
0687:
0688: jTabbedPane1.setMinimumSize(new java.awt.Dimension(450, 454));
0689: jTabbedPane1.setPreferredSize(new java.awt.Dimension(450, 500));
0690: jPanelProperties.setLayout(new java.awt.GridBagLayout());
0691:
0692: jTabbedPane1.addTab("Chart properties", jPanelProperties);
0693:
0694: jPanelData.setLayout(new java.awt.GridBagLayout());
0695:
0696: jLabelTypeOfData.setText("Type of dataset");
0697: gridBagConstraints = new java.awt.GridBagConstraints();
0698: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
0699: jPanelData.add(jLabelTypeOfData, gridBagConstraints);
0700:
0701: jComboBoxTypeOfData
0702: .addActionListener(new java.awt.event.ActionListener() {
0703: public void actionPerformed(
0704: java.awt.event.ActionEvent evt) {
0705: jComboBoxTypeOfDataActionPerformed(evt);
0706: }
0707: });
0708:
0709: gridBagConstraints = new java.awt.GridBagConstraints();
0710: gridBagConstraints.gridx = 1;
0711: gridBagConstraints.gridy = 0;
0712: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0713: gridBagConstraints.weightx = 1.0;
0714: gridBagConstraints.insets = new java.awt.Insets(4, 0, 4, 4);
0715: jPanelData.add(jComboBoxTypeOfData, gridBagConstraints);
0716:
0717: jPanelDataset.setLayout(new java.awt.GridBagLayout());
0718:
0719: jLabelResetType.setText("Reset type");
0720: gridBagConstraints = new java.awt.GridBagConstraints();
0721: gridBagConstraints.gridx = 0;
0722: gridBagConstraints.gridy = 4;
0723: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
0724: gridBagConstraints.insets = new java.awt.Insets(3, 3, 0, 3);
0725: jPanelDataset.add(jLabelResetType, gridBagConstraints);
0726:
0727: jComboBoxResetType
0728: .addActionListener(new java.awt.event.ActionListener() {
0729: public void actionPerformed(
0730: java.awt.event.ActionEvent evt) {
0731: jComboBoxResetTypeActionPerformed(evt);
0732: }
0733: });
0734:
0735: gridBagConstraints = new java.awt.GridBagConstraints();
0736: gridBagConstraints.gridx = 0;
0737: gridBagConstraints.gridy = 5;
0738: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0739: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
0740: gridBagConstraints.weightx = 1.0;
0741: gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
0742: jPanelDataset.add(jComboBoxResetType, gridBagConstraints);
0743:
0744: jLabelResetGroup.setText("Reset group");
0745: gridBagConstraints = new java.awt.GridBagConstraints();
0746: gridBagConstraints.gridx = 1;
0747: gridBagConstraints.gridy = 4;
0748: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
0749: gridBagConstraints.insets = new java.awt.Insets(3, 3, 0, 3);
0750: jPanelDataset.add(jLabelResetGroup, gridBagConstraints);
0751:
0752: jComboBoxResetGroup
0753: .addActionListener(new java.awt.event.ActionListener() {
0754: public void actionPerformed(
0755: java.awt.event.ActionEvent evt) {
0756: jComboBoxResetGroupActionPerformed(evt);
0757: }
0758: });
0759:
0760: gridBagConstraints = new java.awt.GridBagConstraints();
0761: gridBagConstraints.gridx = 1;
0762: gridBagConstraints.gridy = 5;
0763: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0764: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
0765: gridBagConstraints.weightx = 1.0;
0766: gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
0767: jPanelDataset.add(jComboBoxResetGroup, gridBagConstraints);
0768:
0769: jLabelIncrementType.setText("Increment type");
0770: gridBagConstraints = new java.awt.GridBagConstraints();
0771: gridBagConstraints.gridx = 0;
0772: gridBagConstraints.gridy = 6;
0773: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
0774: gridBagConstraints.insets = new java.awt.Insets(3, 3, 0, 3);
0775: jPanelDataset.add(jLabelIncrementType, gridBagConstraints);
0776:
0777: jComboBoxIncrementType
0778: .addActionListener(new java.awt.event.ActionListener() {
0779: public void actionPerformed(
0780: java.awt.event.ActionEvent evt) {
0781: jComboBoxIncrementTypeActionPerformed(evt);
0782: }
0783: });
0784:
0785: gridBagConstraints = new java.awt.GridBagConstraints();
0786: gridBagConstraints.gridx = 0;
0787: gridBagConstraints.gridy = 7;
0788: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0789: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
0790: gridBagConstraints.weightx = 1.0;
0791: gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
0792: jPanelDataset.add(jComboBoxIncrementType, gridBagConstraints);
0793:
0794: jLabelIncrementGroup.setText("Increment group");
0795: gridBagConstraints = new java.awt.GridBagConstraints();
0796: gridBagConstraints.gridx = 1;
0797: gridBagConstraints.gridy = 6;
0798: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
0799: gridBagConstraints.insets = new java.awt.Insets(3, 3, 0, 3);
0800: jPanelDataset.add(jLabelIncrementGroup, gridBagConstraints);
0801:
0802: jComboBoxIncrementGroup
0803: .addActionListener(new java.awt.event.ActionListener() {
0804: public void actionPerformed(
0805: java.awt.event.ActionEvent evt) {
0806: jComboBoxIncrementGroupActionPerformed(evt);
0807: }
0808: });
0809:
0810: gridBagConstraints = new java.awt.GridBagConstraints();
0811: gridBagConstraints.gridx = 1;
0812: gridBagConstraints.gridy = 7;
0813: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0814: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
0815: gridBagConstraints.weightx = 1.0;
0816: gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
0817: jPanelDataset.add(jComboBoxIncrementGroup, gridBagConstraints);
0818:
0819: jLabelIncrementType2.setText("Increment When expression");
0820: gridBagConstraints = new java.awt.GridBagConstraints();
0821: gridBagConstraints.gridx = 0;
0822: gridBagConstraints.gridy = 8;
0823: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
0824: gridBagConstraints.insets = new java.awt.Insets(3, 3, 0, 3);
0825: jPanelDataset.add(jLabelIncrementType2, gridBagConstraints);
0826:
0827: jPanel1.setLayout(new java.awt.GridBagLayout());
0828:
0829: jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder(
0830: javax.swing.BorderFactory.createEtchedBorder(),
0831: "Dataset run"));
0832: jPanel1.setPreferredSize(new java.awt.Dimension(329, 192));
0833: jLabelIncrementType1.setText("Sub dataset");
0834: gridBagConstraints = new java.awt.GridBagConstraints();
0835: gridBagConstraints.gridx = 0;
0836: gridBagConstraints.gridy = 0;
0837: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0838: gridBagConstraints.insets = new java.awt.Insets(3, 3, 0, 3);
0839: jPanel1.add(jLabelIncrementType1, gridBagConstraints);
0840:
0841: jComboBoxSubDataset
0842: .addActionListener(new java.awt.event.ActionListener() {
0843: public void actionPerformed(
0844: java.awt.event.ActionEvent evt) {
0845: jComboBoxSubDatasetActionPerformed(evt);
0846: }
0847: });
0848:
0849: gridBagConstraints = new java.awt.GridBagConstraints();
0850: gridBagConstraints.gridx = 1;
0851: gridBagConstraints.gridy = 0;
0852: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0853: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0854: gridBagConstraints.weightx = 1.0;
0855: gridBagConstraints.insets = new java.awt.Insets(3, 3, 3, 3);
0856: jPanel1.add(jComboBoxSubDataset, gridBagConstraints);
0857:
0858: jPanel7.setLayout(new java.awt.GridBagLayout());
0859:
0860: jPanel4.setLayout(new java.awt.GridBagLayout());
0861:
0862: jPanel16.setLayout(new java.awt.GridBagLayout());
0863:
0864: jScrollPane2.setMinimumSize(new java.awt.Dimension(300, 50));
0865: jScrollPane2.setPreferredSize(new java.awt.Dimension(300, 50));
0866: jTableDatasetParameters
0867: .setModel(new javax.swing.table.DefaultTableModel(
0868: new Object[][] {
0869:
0870: }, new String[] { "Parameter", "Expression" }) {
0871: boolean[] canEdit = new boolean[] { false, false };
0872:
0873: public boolean isCellEditable(int rowIndex,
0874: int columnIndex) {
0875: return canEdit[columnIndex];
0876: }
0877: });
0878: jTableDatasetParameters
0879: .addMouseListener(new java.awt.event.MouseAdapter() {
0880: public void mouseClicked(
0881: java.awt.event.MouseEvent evt) {
0882: jTableDatasetParametersMouseClicked(evt);
0883: }
0884: });
0885:
0886: jScrollPane2.setViewportView(jTableDatasetParameters);
0887:
0888: gridBagConstraints = new java.awt.GridBagConstraints();
0889: gridBagConstraints.gridx = 0;
0890: gridBagConstraints.gridy = 0;
0891: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0892: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0893: gridBagConstraints.weightx = 1.0;
0894: gridBagConstraints.weighty = 1.0;
0895: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
0896: jPanel16.add(jScrollPane2, gridBagConstraints);
0897:
0898: jPanel10.setLayout(new java.awt.GridBagLayout());
0899:
0900: jPanel10.setMinimumSize(new java.awt.Dimension(150, 33));
0901: jButtonAddParameter.setText("Add");
0902: jButtonAddParameter
0903: .addActionListener(new java.awt.event.ActionListener() {
0904: public void actionPerformed(
0905: java.awt.event.ActionEvent evt) {
0906: jButtonAddParameterActionPerformed(evt);
0907: }
0908: });
0909:
0910: gridBagConstraints = new java.awt.GridBagConstraints();
0911: gridBagConstraints.gridx = 0;
0912: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0913: gridBagConstraints.weightx = 1.0;
0914: jPanel10.add(jButtonAddParameter, gridBagConstraints);
0915:
0916: jButtonModParameter.setText("Modify");
0917: jButtonModParameter.setEnabled(false);
0918: jButtonModParameter
0919: .addActionListener(new java.awt.event.ActionListener() {
0920: public void actionPerformed(
0921: java.awt.event.ActionEvent evt) {
0922: jButtonModParameterActionPerformed(evt);
0923: }
0924: });
0925:
0926: gridBagConstraints = new java.awt.GridBagConstraints();
0927: gridBagConstraints.gridx = 0;
0928: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0929: gridBagConstraints.weightx = 1.0;
0930: jPanel10.add(jButtonModParameter, gridBagConstraints);
0931:
0932: jButtonRemParameter.setText("Remove");
0933: jButtonRemParameter.setEnabled(false);
0934: jButtonRemParameter
0935: .addActionListener(new java.awt.event.ActionListener() {
0936: public void actionPerformed(
0937: java.awt.event.ActionEvent evt) {
0938: jButtonRemParameterActionPerformed(evt);
0939: }
0940: });
0941:
0942: gridBagConstraints = new java.awt.GridBagConstraints();
0943: gridBagConstraints.gridx = 0;
0944: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
0945: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
0946: gridBagConstraints.weightx = 1.0;
0947: gridBagConstraints.weighty = 1.0;
0948: jPanel10.add(jButtonRemParameter, gridBagConstraints);
0949:
0950: gridBagConstraints = new java.awt.GridBagConstraints();
0951: gridBagConstraints.gridx = 1;
0952: gridBagConstraints.gridy = 0;
0953: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0954: gridBagConstraints.weighty = 1.0;
0955: gridBagConstraints.insets = new java.awt.Insets(4, 0, 4, 4);
0956: jPanel16.add(jPanel10, gridBagConstraints);
0957:
0958: gridBagConstraints = new java.awt.GridBagConstraints();
0959: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0960: gridBagConstraints.weightx = 1.0;
0961: gridBagConstraints.weighty = 1.0;
0962: jPanel4.add(jPanel16, gridBagConstraints);
0963:
0964: jTabbedPaneSubDataset.addTab("Parameters", jPanel4);
0965:
0966: jPanel5.setLayout(new java.awt.GridBagLayout());
0967:
0968: jLabel26
0969: .setHorizontalAlignment(javax.swing.SwingConstants.LEFT);
0970: jLabel26.setText("Parameters Map Expression");
0971: gridBagConstraints = new java.awt.GridBagConstraints();
0972: gridBagConstraints.gridx = 0;
0973: gridBagConstraints.gridy = 2;
0974: gridBagConstraints.gridwidth = 3;
0975: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0976: gridBagConstraints.insets = new java.awt.Insets(6, 8, 0, 0);
0977: jPanel5.add(jLabel26, gridBagConstraints);
0978:
0979: jRTextExpressionAreaMapExpression
0980: .setBorder(javax.swing.BorderFactory
0981: .createEtchedBorder());
0982: jRTextExpressionAreaMapExpression.setElectricScroll(0);
0983: jRTextExpressionAreaMapExpression
0984: .setMinimumSize(new java.awt.Dimension(0, 0));
0985: jRTextExpressionAreaMapExpression
0986: .setPreferredSize(new java.awt.Dimension(300, 50));
0987: gridBagConstraints = new java.awt.GridBagConstraints();
0988: gridBagConstraints.gridx = 0;
0989: gridBagConstraints.gridy = 3;
0990: gridBagConstraints.gridwidth = 3;
0991: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
0992: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
0993: gridBagConstraints.weightx = 1.0;
0994: gridBagConstraints.weighty = 1.0;
0995: gridBagConstraints.insets = new java.awt.Insets(2, 4, 4, 4);
0996: jPanel5.add(jRTextExpressionAreaMapExpression,
0997: gridBagConstraints);
0998:
0999: jTabbedPaneSubDataset.addTab("Parameters map exp", jPanel5);
1000:
1001: jPanel6.setLayout(new java.awt.GridBagLayout());
1002:
1003: jLabel41.setText("Connection / Datasource Expression");
1004: gridBagConstraints = new java.awt.GridBagConstraints();
1005: gridBagConstraints.gridx = 0;
1006: gridBagConstraints.gridy = 2;
1007: gridBagConstraints.gridwidth = 2;
1008: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
1009: gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 0);
1010: jPanel6.add(jLabel41, gridBagConstraints);
1011:
1012: jComboBoxDatasetConnectionType
1013: .setMinimumSize(new java.awt.Dimension(300, 20));
1014: jComboBoxDatasetConnectionType
1015: .setPreferredSize(new java.awt.Dimension(300, 20));
1016: jComboBoxDatasetConnectionType
1017: .addActionListener(new java.awt.event.ActionListener() {
1018: public void actionPerformed(
1019: java.awt.event.ActionEvent evt) {
1020: jComboBoxDatasetConnectionTypeActionPerformed(evt);
1021: }
1022: });
1023:
1024: gridBagConstraints = new java.awt.GridBagConstraints();
1025: gridBagConstraints.gridx = 0;
1026: gridBagConstraints.gridy = 3;
1027: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1028: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
1029: gridBagConstraints.insets = new java.awt.Insets(2, 6, 0, 6);
1030: jPanel6.add(jComboBoxDatasetConnectionType, gridBagConstraints);
1031:
1032: jRTextExpressionAreaTextConnectionExpression
1033: .setBorder(javax.swing.BorderFactory
1034: .createEtchedBorder());
1035: jRTextExpressionAreaTextConnectionExpression.setEnabled(false);
1036: jRTextExpressionAreaTextConnectionExpression
1037: .setMinimumSize(new java.awt.Dimension(300, 50));
1038: jRTextExpressionAreaTextConnectionExpression
1039: .setPreferredSize(new java.awt.Dimension(300, 50));
1040: gridBagConstraints = new java.awt.GridBagConstraints();
1041: gridBagConstraints.gridx = 0;
1042: gridBagConstraints.gridy = 4;
1043: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1044: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1045: gridBagConstraints.weightx = 1.0;
1046: gridBagConstraints.weighty = 1.0;
1047: gridBagConstraints.insets = new java.awt.Insets(2, 4, 4, 4);
1048: jPanel6.add(jRTextExpressionAreaTextConnectionExpression,
1049: gridBagConstraints);
1050:
1051: jTabbedPaneSubDataset.addTab("Connection/Datasource exp",
1052: jPanel6);
1053:
1054: gridBagConstraints = new java.awt.GridBagConstraints();
1055: gridBagConstraints.gridy = 1;
1056: gridBagConstraints.gridwidth = 2;
1057: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1058: gridBagConstraints.weightx = 1.0;
1059: gridBagConstraints.weighty = 1.0;
1060: gridBagConstraints.insets = new java.awt.Insets(4, 0, 0, 0);
1061: jPanel7.add(jTabbedPaneSubDataset, gridBagConstraints);
1062:
1063: gridBagConstraints = new java.awt.GridBagConstraints();
1064: gridBagConstraints.gridx = 0;
1065: gridBagConstraints.gridwidth = 2;
1066: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1067: gridBagConstraints.weightx = 1.0;
1068: gridBagConstraints.weighty = 1.0;
1069: jPanel1.add(jPanel7, gridBagConstraints);
1070:
1071: gridBagConstraints = new java.awt.GridBagConstraints();
1072: gridBagConstraints.gridy = 100;
1073: gridBagConstraints.gridwidth = 2;
1074: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1075: gridBagConstraints.weightx = 1.0;
1076: gridBagConstraints.weighty = 1.0;
1077: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
1078: jPanelDataset.add(jPanel1, gridBagConstraints);
1079:
1080: jPanel2.setLayout(new java.awt.GridBagLayout());
1081:
1082: jButtonCopy.setText("Copy dataset");
1083: jButtonCopy
1084: .addActionListener(new java.awt.event.ActionListener() {
1085: public void actionPerformed(
1086: java.awt.event.ActionEvent evt) {
1087: jButtonCopyActionPerformed(evt);
1088: }
1089: });
1090:
1091: gridBagConstraints = new java.awt.GridBagConstraints();
1092: gridBagConstraints.insets = new java.awt.Insets(0, 0, 0, 4);
1093: jPanel2.add(jButtonCopy, gridBagConstraints);
1094:
1095: jButtonPaste.setText("Paste dataset");
1096: jButtonPaste
1097: .addActionListener(new java.awt.event.ActionListener() {
1098: public void actionPerformed(
1099: java.awt.event.ActionEvent evt) {
1100: jButtonPasteActionPerformed(evt);
1101: }
1102: });
1103:
1104: jPanel2.add(jButtonPaste, new java.awt.GridBagConstraints());
1105:
1106: gridBagConstraints = new java.awt.GridBagConstraints();
1107: gridBagConstraints.weightx = 1.0;
1108: jPanel2.add(jPanel3, gridBagConstraints);
1109:
1110: gridBagConstraints = new java.awt.GridBagConstraints();
1111: gridBagConstraints.gridx = 0;
1112: gridBagConstraints.gridy = 101;
1113: gridBagConstraints.gridwidth = 2;
1114: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1115: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 0);
1116: jPanelDataset.add(jPanel2, gridBagConstraints);
1117:
1118: jRTextExpressionAreaFilterExpression
1119: .setBorder(javax.swing.BorderFactory
1120: .createEtchedBorder());
1121: jRTextExpressionAreaFilterExpression.setCaretVisible(false);
1122: jRTextExpressionAreaFilterExpression.setElectricScroll(0);
1123: jRTextExpressionAreaFilterExpression
1124: .setMinimumSize(new java.awt.Dimension(400, 50));
1125: jRTextExpressionAreaFilterExpression
1126: .setPreferredSize(new java.awt.Dimension(400, 50));
1127: gridBagConstraints = new java.awt.GridBagConstraints();
1128: gridBagConstraints.gridx = 0;
1129: gridBagConstraints.gridy = 9;
1130: gridBagConstraints.gridwidth = 2;
1131: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1132: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTHWEST;
1133: gridBagConstraints.weightx = 1.0;
1134: gridBagConstraints.insets = new java.awt.Insets(0, 3, 3, 3);
1135: jPanelDataset.add(jRTextExpressionAreaFilterExpression,
1136: gridBagConstraints);
1137:
1138: jTabbedPaneData.addTab("Dataset", jPanelDataset);
1139:
1140: jPanelDataDefinition.setLayout(new java.awt.GridBagLayout());
1141:
1142: jTabbedPaneData.addTab("Details", jPanelDataDefinition);
1143:
1144: gridBagConstraints = new java.awt.GridBagConstraints();
1145: gridBagConstraints.gridx = 0;
1146: gridBagConstraints.gridy = 1;
1147: gridBagConstraints.gridwidth = 2;
1148: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1149: gridBagConstraints.weightx = 1.0;
1150: gridBagConstraints.weighty = 1.0;
1151: gridBagConstraints.insets = new java.awt.Insets(2, 4, 4, 4);
1152: jPanelData.add(jTabbedPaneData, gridBagConstraints);
1153:
1154: jTabbedPane1.addTab("Chart data", jPanelData);
1155:
1156: jPanelMultiAxis.setLayout(new java.awt.GridBagLayout());
1157:
1158: jTable1.setModel(new javax.swing.table.DefaultTableModel(
1159: new Object[][] {
1160:
1161: }, new String[] { "Chart", "Axis position" }) {
1162: boolean[] canEdit = new boolean[] { false, true };
1163:
1164: public boolean isCellEditable(int rowIndex, int columnIndex) {
1165: return canEdit[columnIndex];
1166: }
1167: });
1168: jTable1.addMouseListener(new java.awt.event.MouseAdapter() {
1169: public void mouseClicked(java.awt.event.MouseEvent evt) {
1170: jTable1MouseClicked1(evt);
1171: }
1172: });
1173:
1174: jScrollPane1.setViewportView(jTable1);
1175:
1176: gridBagConstraints = new java.awt.GridBagConstraints();
1177: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1178: gridBagConstraints.weightx = 1.0;
1179: gridBagConstraints.weighty = 1.0;
1180: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
1181: jPanelMultiAxis.add(jScrollPane1, gridBagConstraints);
1182:
1183: jPanel9.setLayout(new java.awt.GridBagLayout());
1184:
1185: jButtonAdd.setText("Add");
1186: jButtonAdd.setMargin(new java.awt.Insets(2, 8, 2, 8));
1187: jButtonAdd
1188: .addActionListener(new java.awt.event.ActionListener() {
1189: public void actionPerformed(
1190: java.awt.event.ActionEvent evt) {
1191: jButtonAddActionPerformed(evt);
1192: }
1193: });
1194:
1195: gridBagConstraints = new java.awt.GridBagConstraints();
1196: gridBagConstraints.gridx = 0;
1197: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1198: gridBagConstraints.weightx = 1.0;
1199: gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 4);
1200: jPanel9.add(jButtonAdd, gridBagConstraints);
1201:
1202: jButtonModify.setText("Edit chart");
1203: jButtonModify.setEnabled(false);
1204: jButtonModify.setMargin(new java.awt.Insets(2, 8, 2, 8));
1205: jButtonModify
1206: .addActionListener(new java.awt.event.ActionListener() {
1207: public void actionPerformed(
1208: java.awt.event.ActionEvent evt) {
1209: jButtonModifyActionPerformed(evt);
1210: }
1211: });
1212:
1213: gridBagConstraints = new java.awt.GridBagConstraints();
1214: gridBagConstraints.gridx = 0;
1215: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1216: gridBagConstraints.weightx = 1.0;
1217: gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 4);
1218: jPanel9.add(jButtonModify, gridBagConstraints);
1219:
1220: jButtonDelete.setText("Delete");
1221: jButtonDelete.setEnabled(false);
1222: jButtonDelete.setMargin(new java.awt.Insets(2, 8, 2, 8));
1223: jButtonDelete
1224: .addActionListener(new java.awt.event.ActionListener() {
1225: public void actionPerformed(
1226: java.awt.event.ActionEvent evt) {
1227: jButtonDeleteActionPerformed(evt);
1228: }
1229: });
1230:
1231: gridBagConstraints = new java.awt.GridBagConstraints();
1232: gridBagConstraints.gridx = 0;
1233: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1234: gridBagConstraints.weightx = 1.0;
1235: gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 4);
1236: jPanel9.add(jButtonDelete, gridBagConstraints);
1237:
1238: jButtonMoveUp.setText("Move up");
1239: jButtonMoveUp.setEnabled(false);
1240: jButtonMoveUp.setMargin(new java.awt.Insets(2, 8, 2, 8));
1241: jButtonMoveUp
1242: .addActionListener(new java.awt.event.ActionListener() {
1243: public void actionPerformed(
1244: java.awt.event.ActionEvent evt) {
1245: jButtonMoveUpActionPerformed(evt);
1246: }
1247: });
1248:
1249: gridBagConstraints = new java.awt.GridBagConstraints();
1250: gridBagConstraints.gridx = 0;
1251: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1252: gridBagConstraints.weightx = 1.0;
1253: gridBagConstraints.insets = new java.awt.Insets(0, 4, 4, 4);
1254: jPanel9.add(jButtonMoveUp, gridBagConstraints);
1255:
1256: jButtonMoveDown.setText("Move down");
1257: jButtonMoveDown.setEnabled(false);
1258: jButtonMoveDown.setMargin(new java.awt.Insets(2, 8, 2, 8));
1259: jButtonMoveDown
1260: .addActionListener(new java.awt.event.ActionListener() {
1261: public void actionPerformed(
1262: java.awt.event.ActionEvent evt) {
1263: jButtonMoveDownActionPerformed(evt);
1264: }
1265: });
1266:
1267: gridBagConstraints = new java.awt.GridBagConstraints();
1268: gridBagConstraints.gridx = 0;
1269: gridBagConstraints.fill = java.awt.GridBagConstraints.HORIZONTAL;
1270: gridBagConstraints.anchor = java.awt.GridBagConstraints.NORTH;
1271: gridBagConstraints.weightx = 1.0;
1272: gridBagConstraints.weighty = 1.0;
1273: gridBagConstraints.insets = new java.awt.Insets(0, 4, 14, 4);
1274: jPanel9.add(jButtonMoveDown, gridBagConstraints);
1275:
1276: gridBagConstraints = new java.awt.GridBagConstraints();
1277: gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
1278: gridBagConstraints.weighty = 1.0;
1279: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
1280: jPanelMultiAxis.add(jPanel9, gridBagConstraints);
1281:
1282: jTabbedPane1.addTab("Multiaxis charts", jPanelMultiAxis);
1283:
1284: getContentPane()
1285: .add(jTabbedPane1, java.awt.BorderLayout.CENTER);
1286:
1287: jPanel8.setLayout(new java.awt.GridBagLayout());
1288:
1289: jButtonClose.setText("Close");
1290: jButtonClose
1291: .addActionListener(new java.awt.event.ActionListener() {
1292: public void actionPerformed(
1293: java.awt.event.ActionEvent evt) {
1294: jButtonCloseActionPerformed(evt);
1295: }
1296: });
1297:
1298: gridBagConstraints = new java.awt.GridBagConstraints();
1299: gridBagConstraints.anchor = java.awt.GridBagConstraints.EAST;
1300: gridBagConstraints.weightx = 1.0;
1301: gridBagConstraints.insets = new java.awt.Insets(2, 4, 2, 4);
1302: jPanel8.add(jButtonClose, gridBagConstraints);
1303:
1304: getContentPane().add(jPanel8, java.awt.BorderLayout.SOUTH);
1305:
1306: pack();
1307: }// </editor-fold>//GEN-END:initComponents
1308:
1309: private void formWindowOpened(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowOpened
1310:
1311: try {
1312: ((ChartDatasetPanel) jPanelDataDefinition.getComponent(0))
1313: .containerWindowOpened();
1314: } catch (Exception ex) {
1315: }
1316:
1317: if (meterIntervalsHilightExpression != null) {
1318: MeterIntervalsSheetProperty misp = (MeterIntervalsSheetProperty) this .sheetPanel
1319: .getSheetProperty("meterIntervalsMeterPlot");
1320: if (misp != null) {
1321: misp
1322: .setFocusedExpression(meterIntervalsHilightExpression);
1323: }
1324: } else if (subdatasetParameterHighlightExpression != null) {
1325: jButtonModParameterActionPerformed(new ActionEvent(
1326: jButtonModParameter, 0, ""));
1327: }
1328:
1329: }//GEN-LAST:event_formWindowOpened
1330:
1331: private void jTable1MouseClicked1(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTable1MouseClicked1
1332:
1333: if (evt.getButton() == evt.BUTTON1 && evt.getClickCount() == 2) {
1334: jButtonModifyActionPerformed(null);
1335: }
1336: }//GEN-LAST:event_jTable1MouseClicked1
1337:
1338: private void jButtonMoveDownActionPerformed(
1339: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonMoveDownActionPerformed
1340:
1341: if (jTable1.getSelectedRowCount() > 0) {
1342: DefaultTableModel dtm = (DefaultTableModel) jTable1
1343: .getModel();
1344: int[] indices = jTable1.getSelectedRows();
1345: java.util.List axes = ((MultiAxisPlot) currentSelectedChartElement
1346: .getChart().getPlot()).getAxis();
1347:
1348: for (int i = indices.length - 1; i >= 0; --i) {
1349: if (indices[i] >= (jTable1.getRowCount() - 1))
1350: continue;
1351:
1352: Axis axis = (Axis) jTable1.getValueAt(indices[i], 0);
1353: dtm.removeRow(indices[i]);
1354: axes.remove(indices[i]);
1355: dtm.insertRow(indices[i] + 1, new Object[] { axis,
1356: axis.getPosition() });
1357: axes.add(indices[i] + 1, axis);
1358: indices[i]++;
1359: }
1360:
1361: DefaultListSelectionModel dlsm = (DefaultListSelectionModel) jTable1
1362: .getSelectionModel();
1363: dlsm.setValueIsAdjusting(true);
1364: dlsm.clearSelection();
1365: for (int i = 0; i < indices.length; ++i) {
1366: dlsm.addSelectionInterval(indices[i], indices[i]);
1367: }
1368: dlsm.setValueIsAdjusting(false);
1369: jTable1.updateUI();
1370: }
1371: }//GEN-LAST:event_jButtonMoveDownActionPerformed
1372:
1373: private void jButtonMoveUpActionPerformed(
1374: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonMoveUpActionPerformed
1375: if (jTable1.getSelectedRow() > 0) {
1376: DefaultTableModel dtm = (DefaultTableModel) jTable1
1377: .getModel();
1378: java.util.List axes = ((MultiAxisPlot) currentSelectedChartElement
1379: .getChart().getPlot()).getAxis();
1380:
1381: int[] indices = jTable1.getSelectedRows();
1382: for (int i = 0; i < indices.length; ++i) {
1383: if (indices[i] == 0)
1384: continue;
1385:
1386: Axis axis = (Axis) jTable1.getValueAt(indices[i], 0);
1387: dtm.removeRow(indices[i]);
1388: axes.remove(indices[i]);
1389: dtm.insertRow(indices[i] - 1, new Object[] { axis,
1390: axis.getPosition() });
1391: axes.add(indices[i] - 1, axis);
1392: indices[i]--;
1393: }
1394:
1395: DefaultListSelectionModel dlsm = (DefaultListSelectionModel) jTable1
1396: .getSelectionModel();
1397: dlsm.setValueIsAdjusting(true);
1398: dlsm.clearSelection();
1399: for (int i = 0; i < indices.length; ++i) {
1400: dlsm.addSelectionInterval(indices[i], indices[i]);
1401: }
1402: dlsm.setValueIsAdjusting(false);
1403: }
1404: }//GEN-LAST:event_jButtonMoveUpActionPerformed
1405:
1406: private void jButtonDeleteActionPerformed(
1407: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonDeleteActionPerformed
1408: int[] indexes = jTable1.getSelectedRows();
1409: java.util.List axes = ((MultiAxisPlot) currentSelectedChartElement
1410: .getChart().getPlot()).getAxis();
1411:
1412: for (int i = indexes.length - 1; i >= 0; --i) {
1413: ((DefaultTableModel) jTable1.getModel())
1414: .removeRow(indexes[i]);
1415: axes.remove(indexes[i]);
1416: }
1417: jTable1.updateUI();
1418: }//GEN-LAST:event_jButtonDeleteActionPerformed
1419:
1420: private void jButtonModifyActionPerformed(
1421: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonModifyActionPerformed
1422: int index = jTable1.getSelectedRow();
1423: if (index >= 0) {
1424: Axis c = (Axis) jTable1.getValueAt(
1425: jTable1.getSelectedRow(), 0);
1426: ChartPropertiesDialog cpd = new ChartPropertiesDialog(this ,
1427: true);
1428: cpd.setChartElement(c.getChartReportElement());
1429: cpd.setVisible(true);
1430: }
1431: }//GEN-LAST:event_jButtonModifyActionPerformed
1432:
1433: private void jButtonAddActionPerformed(
1434: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAddActionPerformed
1435: ChartSelectionJDialog chartSelector = new ChartSelectionJDialog(
1436: this , true);
1437: chartSelector.setMultiAxisMode(true);
1438: chartSelector.setVisible(true);
1439:
1440: if (chartSelector.getDialogResult() == JOptionPane.OK_OPTION) {
1441:
1442: Axis axis = new Axis();
1443: axis.getChartReportElement().setChart(
1444: chartSelector.getChart());
1445:
1446: ((DefaultTableModel) jTable1.getModel())
1447: .addRow(new Object[] { axis, axis.getPosition() });
1448:
1449: java.util.List axes = ((MultiAxisPlot) currentSelectedChartElement
1450: .getChart().getPlot()).getAxis();
1451: axes.add(axis);
1452: }
1453: }//GEN-LAST:event_jButtonAddActionPerformed
1454:
1455: private void formWindowClosing(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_formWindowClosing
1456: this .notifyChange();
1457:
1458: }//GEN-LAST:event_formWindowClosing
1459:
1460: private void jButtonCloseActionPerformed(
1461: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCloseActionPerformed
1462:
1463: this .notifyChange();
1464: this .setVisible(false);
1465: this .dispose();
1466: }//GEN-LAST:event_jButtonCloseActionPerformed
1467:
1468: private void jTableDatasetParametersMouseClicked(
1469: java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jTableDatasetParametersMouseClicked
1470:
1471: if (evt.getClickCount() == 2 && evt.getButton() == evt.BUTTON1) {
1472: if (jTableDatasetParameters.getSelectedRowCount() > 0) {
1473: jButtonModParameterActionPerformed(null);
1474: }
1475: }
1476:
1477: }//GEN-LAST:event_jTableDatasetParametersMouseClicked
1478:
1479: private void jButtonRemParameterActionPerformed(
1480: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonRemParameterActionPerformed
1481: if (this .isInit())
1482: return;
1483:
1484: if (currentSelectedChartElement == null)
1485: return;
1486:
1487: javax.swing.table.DefaultTableModel dtm = (javax.swing.table.DefaultTableModel) jTableDatasetParameters
1488: .getModel();
1489:
1490: while (jTableDatasetParameters.getSelectedRowCount() > 0) {
1491: int i = jTableDatasetParameters.getSelectedRow();
1492: currentSelectedChartElement.getChart().getDataset()
1493: .getSubreportParameters().removeElement(
1494: jTableDatasetParameters.getValueAt(i, 0));
1495: dtm.removeRow(i);
1496: }
1497: }//GEN-LAST:event_jButtonRemParameterActionPerformed
1498:
1499: private void jButtonModParameterActionPerformed(
1500: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonModParameterActionPerformed
1501:
1502: if (this .isInit())
1503: return;
1504:
1505: if (currentSelectedChartElement == null)
1506: return;
1507: int rowNumber = jTableDatasetParameters.getSelectedRow();
1508: JRSubreportParameter parameter = (JRSubreportParameter) jTableDatasetParameters
1509: .getValueAt(jTableDatasetParameters.getSelectedRow(), 0);
1510:
1511: JRSubreportParameterDialog jrpd = new JRSubreportParameterDialog(
1512: this , true);
1513: jrpd.setParameter(parameter);
1514: if (subdatasetParameterHighlightExpression != null) {
1515: jrpd
1516: .setFocusedExpression(((Integer) subdatasetParameterHighlightExpression[0])
1517: .intValue());
1518: }
1519: jrpd.setVisible(true);
1520:
1521: if (jrpd.getDialogResult() == javax.swing.JOptionPane.OK_OPTION) {
1522: parameter.setName(jrpd.getParameter().getName());
1523: parameter
1524: .setExpression(jrpd.getParameter().getExpression());
1525: javax.swing.table.DefaultTableModel dtm = (javax.swing.table.DefaultTableModel) jTableDatasetParameters
1526: .getModel();
1527: dtm.setValueAt(parameter, rowNumber, 0);
1528: dtm.setValueAt(parameter.getExpression(), rowNumber, 1);
1529: jTableDatasetParameters.updateUI();
1530: }
1531: }//GEN-LAST:event_jButtonModParameterActionPerformed
1532:
1533: private void jButtonAddParameterActionPerformed(
1534: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonAddParameterActionPerformed
1535: if (this .isInit())
1536: return;
1537:
1538: if (currentSelectedChartElement == null)
1539: return;
1540: // Set the new value for all selected elements...
1541:
1542: JRSubreportParameterDialog jrpd = new JRSubreportParameterDialog(
1543: this , true);
1544: jrpd.setVisible(true);
1545:
1546: if (jrpd.getDialogResult() == javax.swing.JOptionPane.OK_OPTION) {
1547: it.businesslogic.ireport.JRSubreportParameter parameter = jrpd
1548: .getParameter();
1549: currentSelectedChartElement.getChart().getDataset()
1550: .getSubreportParameters().addElement(parameter);
1551: javax.swing.table.DefaultTableModel dtm = (javax.swing.table.DefaultTableModel) jTableDatasetParameters
1552: .getModel();
1553: dtm.addRow(new Object[] { parameter,
1554: parameter.getExpression() });
1555: }
1556: }//GEN-LAST:event_jButtonAddParameterActionPerformed
1557:
1558: private void jComboBoxSubDatasetActionPerformed(
1559: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxSubDatasetActionPerformed
1560:
1561: if (this .isInit())
1562: return;
1563:
1564: if (currentSelectedChartElement != null) {
1565: if (this .jComboBoxSubDataset.getSelectedIndex() > 0) {
1566: if (currentSelectedChartElement.getChart().getDataset()
1567: .getSubDataset() != jComboBoxSubDataset
1568: .getSelectedItem()) {
1569: currentSelectedChartElement.getChart().getDataset()
1570: .setSubDataset(
1571: (SubDataset) jComboBoxSubDataset
1572: .getSelectedItem());
1573: setDatasetSubDataset(currentSelectedChartElement
1574: .getChart().getDataset().getSubDataset());
1575:
1576: jTabbedPaneSubDataset.setVisible(true);
1577: }
1578: jRTextExpressionAreaFilterExpression
1579: .setSubDataset((SubDataset) jComboBoxSubDataset
1580: .getSelectedItem());
1581: // Check subdataset parameters.... (TODO)
1582: } else {
1583: jRTextExpressionAreaFilterExpression
1584: .setSubDataset(null);
1585: currentSelectedChartElement.getChart().getDataset()
1586: .setSubDataset(null);
1587: currentSelectedChartElement.getChart().getDataset()
1588: .getSubreportParameters().removeAllElements();
1589: currentSelectedChartElement.getChart().getDataset()
1590: .setParametersMapExpression("");
1591: currentSelectedChartElement.getChart().getDataset()
1592: .setConnectionExpression("");
1593: currentSelectedChartElement.getChart().getDataset()
1594: .setDataSourceExpression("");
1595: currentSelectedChartElement.getChart().getDataset()
1596: .setUseConnection(false);
1597:
1598: setDatasetSubDataset(null);
1599:
1600: javax.swing.table.DefaultTableModel dtm = (javax.swing.table.DefaultTableModel) jTableDatasetParameters
1601: .getModel();
1602: dtm.setRowCount(0);
1603: this .jComboBoxDatasetConnectionType.setSelectedIndex(0);
1604: this .jRTextExpressionAreaTextConnectionExpression
1605: .setEnabled(false);
1606: this .jRTextExpressionAreaTextConnectionExpression
1607: .setBackground(Color.LIGHT_GRAY);
1608: this .jRTextExpressionAreaTextConnectionExpression
1609: .setText("");
1610: jRTextExpressionAreaMapExpression.setText("");
1611:
1612: jTabbedPaneSubDataset.setVisible(false);
1613: jTabbedPaneSubDataset.updateUI();
1614: }
1615: }
1616: }//GEN-LAST:event_jComboBoxSubDatasetActionPerformed
1617:
1618: private void jComboBoxDatasetConnectionTypeActionPerformed(
1619: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxDatasetConnectionTypeActionPerformed
1620: if (isInit() || currentSelectedChartElement == null)
1621: return;
1622:
1623: if (jComboBoxDatasetConnectionType.getSelectedIndex() == 0) {
1624: currentSelectedChartElement.getChart().getDataset()
1625: .setUseConnection(false);
1626: currentSelectedChartElement.getChart().getDataset()
1627: .setConnectionExpression("");
1628: currentSelectedChartElement.getChart().getDataset()
1629: .setDataSourceExpression("");
1630: jRTextExpressionAreaTextConnectionExpression.setText("");
1631: jRTextExpressionAreaTextConnectionExpression
1632: .setEnabled(false);
1633: jRTextExpressionAreaTextConnectionExpression
1634: .setBackground(Color.LIGHT_GRAY);
1635: } else if (jComboBoxDatasetConnectionType.getSelectedIndex() == 1) {
1636: currentSelectedChartElement.getChart().getDataset()
1637: .setUseConnection(true);
1638: currentSelectedChartElement.getChart().getDataset()
1639: .setDataSourceExpression("");
1640: currentSelectedChartElement.getChart().getDataset()
1641: .setConnectionExpression("$P{REPORT_CONNECTION}");
1642: jRTextExpressionAreaTextConnectionExpression
1643: .setText("$P{REPORT_CONNECTION}");
1644: jRTextExpressionAreaTextConnectionExpression
1645: .setEnabled(true);
1646: jRTextExpressionAreaTextConnectionExpression
1647: .setBackground(Color.WHITE);
1648: } else if (jComboBoxDatasetConnectionType.getSelectedIndex() == 2) {
1649: currentSelectedChartElement.getChart().getDataset()
1650: .setUseConnection(false);
1651: currentSelectedChartElement.getChart().getDataset()
1652: .setDataSourceExpression("$P{MyDataource}");
1653: currentSelectedChartElement.getChart().getDataset()
1654: .setConnectionExpression("");
1655: jRTextExpressionAreaTextConnectionExpression
1656: .setText("$P{MyDataource}");
1657: jRTextExpressionAreaTextConnectionExpression
1658: .setEnabled(true);
1659: jRTextExpressionAreaTextConnectionExpression
1660: .setBackground(Color.WHITE);
1661: }
1662: }//GEN-LAST:event_jComboBoxDatasetConnectionTypeActionPerformed
1663:
1664: private void jButtonPasteActionPerformed(
1665: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonPasteActionPerformed
1666:
1667: if (currentSelectedChartElement == null)
1668: return;
1669: if (it.businesslogic.ireport.gui.MainFrame.getMainInstance()
1670: .getChartDatasetClipBoard() == null)
1671: return;
1672:
1673: Dataset theDataset = it.businesslogic.ireport.gui.MainFrame
1674: .getMainInstance().getChartDatasetClipBoard();
1675:
1676: currentSelectedChartElement.getChart().getDataset()
1677: .setIncrementType(
1678: it.businesslogic.ireport.gui.MainFrame
1679: .getMainInstance()
1680: .getChartDatasetClipBoard()
1681: .getIncrementType());
1682: currentSelectedChartElement.getChart().getDataset()
1683: .setIncrementGroup(
1684: it.businesslogic.ireport.gui.MainFrame
1685: .getMainInstance()
1686: .getChartDatasetClipBoard()
1687: .getIncrementGroup());
1688: currentSelectedChartElement.getChart().getDataset()
1689: .setResetType(
1690: it.businesslogic.ireport.gui.MainFrame
1691: .getMainInstance()
1692: .getChartDatasetClipBoard()
1693: .getResetType());
1694: currentSelectedChartElement.getChart().getDataset()
1695: .setResetGroup(
1696: it.businesslogic.ireport.gui.MainFrame
1697: .getMainInstance()
1698: .getChartDatasetClipBoard()
1699: .getResetGroup());
1700:
1701: currentSelectedChartElement.getChart().getDataset()
1702: .setUseConnection(theDataset.isUseConnection());
1703: currentSelectedChartElement.getChart().getDataset()
1704: .setSubDataset(theDataset.getSubDataset());
1705: currentSelectedChartElement.getChart().getDataset()
1706: .setParametersMapExpression(
1707: theDataset.getParametersMapExpression());
1708: currentSelectedChartElement.getChart().getDataset()
1709: .setConnectionExpression(
1710: theDataset.getConnectionExpression());
1711: currentSelectedChartElement.getChart().getDataset()
1712: .setDataSourceExpression(
1713: theDataset.getDataSourceExpression());
1714:
1715: for (int i = 0; i < theDataset.getSubreportParameters().size(); ++i) {
1716: currentSelectedChartElement.getChart().getDataset()
1717: .getSubreportParameters().add(
1718: ((JRSubreportParameter) theDataset
1719: .getSubreportParameters()
1720: .elementAt(i)).cloneMe());
1721: }
1722:
1723: if (it.businesslogic.ireport.gui.MainFrame.getMainInstance()
1724: .getChartDatasetClipBoard().getClass().getName()
1725: .equals(
1726: currentSelectedChartElement.getChart()
1727: .getDataset().getClass().getName())) {
1728: currentSelectedChartElement.getChart().setDataset(
1729: it.businesslogic.ireport.gui.MainFrame
1730: .getMainInstance()
1731: .getChartDatasetClipBoard().cloneMe());
1732: this .setDatasetPanel(currentSelectedChartElement.getChart()
1733: .getDataset());
1734: }
1735:
1736: init = true;
1737:
1738: Misc.setComboboxSelectedTagValue(jComboBoxIncrementType,
1739: currentSelectedChartElement.getChart().getDataset()
1740: .getIncrementType());
1741: jComboBoxIncrementGroup
1742: .setSelectedItem(currentSelectedChartElement.getChart()
1743: .getDataset().getIncrementGroup());
1744: Misc.setComboboxSelectedTagValue(jComboBoxResetType,
1745: currentSelectedChartElement.getChart().getDataset()
1746: .getResetType());
1747: jComboBoxResetGroup.setSelectedItem(currentSelectedChartElement
1748: .getChart().getDataset().getResetGroup());
1749:
1750: if (currentSelectedChartElement.getChart().getDataset()
1751: .getSubDataset() != null) {
1752: jComboBoxSubDataset
1753: .setSelectedItem(currentSelectedChartElement
1754: .getChart().getDataset().getSubDataset());
1755: jTabbedPaneSubDataset.setVisible(true);
1756:
1757: jRTextExpressionAreaMapExpression
1758: .setText(currentSelectedChartElement.getChart()
1759: .getDataset().getParametersMapExpression());
1760: if (!currentSelectedChartElement.getChart().getDataset()
1761: .isUseConnection()
1762: && Misc.nvl(
1763: currentSelectedChartElement.getChart()
1764: .getDataset()
1765: .getDataSourceExpression(), "")
1766: .trim().equals("")) {
1767: this .jComboBoxDatasetConnectionType.setSelectedIndex(0);
1768: this .jRTextExpressionAreaTextConnectionExpression
1769: .setEnabled(false);
1770: this .jRTextExpressionAreaTextConnectionExpression
1771: .setBackground(Color.LIGHT_GRAY);
1772: this .jRTextExpressionAreaTextConnectionExpression
1773: .setText("");
1774: } else if (currentSelectedChartElement.getChart()
1775: .getDataset().isUseConnection()) {
1776: this .jComboBoxDatasetConnectionType.setSelectedIndex(1);
1777: this .jRTextExpressionAreaTextConnectionExpression
1778: .setEnabled(true);
1779: this .jRTextExpressionAreaTextConnectionExpression
1780: .setBackground(Color.WHITE);
1781: this .jRTextExpressionAreaTextConnectionExpression
1782: .setText(currentSelectedChartElement.getChart()
1783: .getDataset().getConnectionExpression());
1784: } else {
1785: this .jComboBoxDatasetConnectionType.setSelectedIndex(2);
1786: this .jRTextExpressionAreaTextConnectionExpression
1787: .setEnabled(true);
1788: this .jRTextExpressionAreaTextConnectionExpression
1789: .setBackground(Color.WHITE);
1790: this .jRTextExpressionAreaTextConnectionExpression
1791: .setText(currentSelectedChartElement.getChart()
1792: .getDataset().getDataSourceExpression());
1793: }
1794:
1795: //Add parameters...
1796: javax.swing.table.DefaultTableModel dtm = (javax.swing.table.DefaultTableModel) jTableDatasetParameters
1797: .getModel();
1798: dtm.setRowCount(0);
1799:
1800: java.util.Enumeration enum_parameters = currentSelectedChartElement
1801: .getChart().getDataset().getSubreportParameters()
1802: .elements();
1803: while (enum_parameters.hasMoreElements()) {
1804: it.businesslogic.ireport.JRSubreportParameter parameter = (it.businesslogic.ireport.JRSubreportParameter) enum_parameters
1805: .nextElement();
1806: Vector row = new Vector();
1807: row.addElement(parameter);
1808: row.addElement(parameter.getExpression());
1809: dtm.addRow(row);
1810: }
1811:
1812: } else {
1813: javax.swing.table.DefaultTableModel dtm = (javax.swing.table.DefaultTableModel) jTableDatasetParameters
1814: .getModel();
1815: dtm.setRowCount(0);
1816: this .jComboBoxDatasetConnectionType.setSelectedIndex(0);
1817: this .jRTextExpressionAreaTextConnectionExpression
1818: .setEnabled(false);
1819: this .jRTextExpressionAreaTextConnectionExpression
1820: .setBackground(Color.LIGHT_GRAY);
1821: this .jRTextExpressionAreaTextConnectionExpression
1822: .setText("");
1823: jRTextExpressionAreaMapExpression.setText("");
1824:
1825: jComboBoxSubDataset.setSelectedIndex(0);
1826: jTabbedPaneSubDataset.setVisible(false);
1827: }
1828:
1829: init = false;
1830:
1831: }//GEN-LAST:event_jButtonPasteActionPerformed
1832:
1833: private void jButtonCopyActionPerformed(
1834: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButtonCopyActionPerformed
1835:
1836: if (currentSelectedChartElement == null)
1837: return;
1838: it.businesslogic.ireport.gui.MainFrame.getMainInstance()
1839: .setChartDatasetClipBoard(
1840: currentSelectedChartElement.getChart()
1841: .getDataset().cloneMe());
1842: jButtonPaste.setEnabled(true);
1843: }//GEN-LAST:event_jButtonCopyActionPerformed
1844:
1845: private void jComboBoxTypeOfDataActionPerformed(
1846: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxTypeOfDataActionPerformed
1847:
1848: if (isInit()
1849: || currentSelectedChartElement == null
1850: || !(currentSelectedChartElement.getChart() instanceof XYBarChart))
1851: return;
1852:
1853: if (jComboBoxTypeOfData.getSelectedItem() != null) {
1854: String typeOfDataset = ((Tag) jComboBoxTypeOfData
1855: .getSelectedItem()).getValue()
1856: + "";
1857: if (currentSelectedChartElement.getChart().getDataset()
1858: .getClass().getName().equals(typeOfDataset))
1859: return;
1860:
1861: try {
1862: jPanelDataDefinition.removeAll();
1863: Dataset dataset = (Dataset) this .getClass().forName(
1864: typeOfDataset).newInstance();
1865: currentSelectedChartElement.getChart().setDataset(
1866: dataset);
1867:
1868: } catch (Exception ex) {
1869: currentSelectedChartElement.getChart().setDataset(
1870: new Dataset());
1871: }
1872: setDatasetPanel(currentSelectedChartElement.getChart()
1873: .getDataset());
1874:
1875: this .notifyChange();
1876: }
1877:
1878: }//GEN-LAST:event_jComboBoxTypeOfDataActionPerformed
1879:
1880: private void jComboBoxIncrementGroupActionPerformed(
1881: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxIncrementGroupActionPerformed
1882: if (isInit() || currentSelectedChartElement == null)
1883: return;
1884: currentSelectedChartElement.getChart().getDataset()
1885: .setIncrementGroup(
1886: "" + jComboBoxIncrementGroup.getSelectedItem());
1887: }//GEN-LAST:event_jComboBoxIncrementGroupActionPerformed
1888:
1889: private void jComboBoxIncrementTypeActionPerformed(
1890: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxIncrementTypeActionPerformed
1891:
1892: if (isInit() || currentSelectedChartElement == null)
1893: return;
1894: currentSelectedChartElement
1895: .getChart()
1896: .getDataset()
1897: .setIncrementType(
1898: ((Tag) jComboBoxIncrementType.getSelectedItem())
1899: .getValue()
1900: + "");
1901:
1902: if (currentSelectedChartElement.getChart().getDataset()
1903: .getIncrementType().equals("Group")) {
1904: // We have to removethe null entry...
1905: if (jComboBoxIncrementGroup.getItemAt(0).equals("")) {
1906: jComboBoxIncrementGroup.removeItemAt(0);
1907: }
1908: jComboBoxIncrementGroup.setSelectedIndex(0);
1909: } else {
1910: if (!jComboBoxIncrementGroup.getItemAt(0).equals("")) {
1911: jComboBoxIncrementGroup.insertItemAt("", 0);
1912: }
1913: jComboBoxIncrementGroup.setSelectedIndex(0);
1914: }
1915: }//GEN-LAST:event_jComboBoxIncrementTypeActionPerformed
1916:
1917: private void jComboBoxResetGroupActionPerformed(
1918: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxResetGroupActionPerformed
1919:
1920: if (isInit() || currentSelectedChartElement == null)
1921: return;
1922: currentSelectedChartElement.getChart().getDataset()
1923: .setResetGroup(
1924: "" + jComboBoxResetGroup.getSelectedItem());
1925:
1926: }//GEN-LAST:event_jComboBoxResetGroupActionPerformed
1927:
1928: private void jComboBoxResetTypeActionPerformed(
1929: java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jComboBoxResetTypeActionPerformed
1930:
1931: if (isInit() || currentSelectedChartElement == null)
1932: return;
1933: currentSelectedChartElement.getChart().getDataset()
1934: .setResetType(
1935: ((Tag) jComboBoxResetType.getSelectedItem())
1936: .getValue()
1937: + "");
1938:
1939: if (currentSelectedChartElement.getChart().getDataset()
1940: .getResetType().equals("Group")) {
1941: // We have to remove the null entry...
1942: if (jComboBoxResetGroup.getItemAt(0).equals("")) {
1943: jComboBoxResetGroup.removeItemAt(0);
1944: }
1945: jComboBoxResetGroup.setSelectedIndex(0);
1946: } else {
1947: if (!jComboBoxResetGroup.getItemAt(0).equals("")) {
1948: jComboBoxResetGroup.insertItemAt("", 0);
1949: }
1950: jComboBoxResetGroup.setSelectedIndex(0);
1951: }
1952:
1953: }//GEN-LAST:event_jComboBoxResetTypeActionPerformed
1954:
1955: // Variables declaration - do not modify//GEN-BEGIN:variables
1956: private javax.swing.JButton jButtonAdd;
1957: private javax.swing.JButton jButtonAddParameter;
1958: private javax.swing.JButton jButtonClose;
1959: private javax.swing.JButton jButtonCopy;
1960: private javax.swing.JButton jButtonDelete;
1961: private javax.swing.JButton jButtonModParameter;
1962: private javax.swing.JButton jButtonModify;
1963: private javax.swing.JButton jButtonMoveDown;
1964: private javax.swing.JButton jButtonMoveUp;
1965: private javax.swing.JButton jButtonPaste;
1966: private javax.swing.JButton jButtonRemParameter;
1967: private javax.swing.JComboBox jComboBoxDatasetConnectionType;
1968: private javax.swing.JComboBox jComboBoxIncrementGroup;
1969: private javax.swing.JComboBox jComboBoxIncrementType;
1970: private javax.swing.JComboBox jComboBoxResetGroup;
1971: private javax.swing.JComboBox jComboBoxResetType;
1972: private javax.swing.JComboBox jComboBoxSubDataset;
1973: private javax.swing.JComboBox jComboBoxTypeOfData;
1974: private javax.swing.JLabel jLabel26;
1975: private javax.swing.JLabel jLabel41;
1976: private javax.swing.JLabel jLabelIncrementGroup;
1977: private javax.swing.JLabel jLabelIncrementType;
1978: private javax.swing.JLabel jLabelIncrementType1;
1979: private javax.swing.JLabel jLabelIncrementType2;
1980: private javax.swing.JLabel jLabelResetGroup;
1981: private javax.swing.JLabel jLabelResetType;
1982: private javax.swing.JLabel jLabelTypeOfData;
1983: private javax.swing.JPanel jPanel1;
1984: private javax.swing.JPanel jPanel10;
1985: private javax.swing.JPanel jPanel16;
1986: private javax.swing.JPanel jPanel2;
1987: private javax.swing.JPanel jPanel3;
1988: private javax.swing.JPanel jPanel4;
1989: private javax.swing.JPanel jPanel5;
1990: private javax.swing.JPanel jPanel6;
1991: private javax.swing.JPanel jPanel7;
1992: private javax.swing.JPanel jPanel8;
1993: private javax.swing.JPanel jPanel9;
1994: private javax.swing.JPanel jPanelData;
1995: private javax.swing.JPanel jPanelDataDefinition;
1996: private javax.swing.JPanel jPanelDataset;
1997: private javax.swing.JPanel jPanelMultiAxis;
1998: private javax.swing.JPanel jPanelProperties;
1999: private it.businesslogic.ireport.gui.JRTextExpressionArea jRTextExpressionAreaFilterExpression;
2000: private it.businesslogic.ireport.gui.JRTextExpressionArea jRTextExpressionAreaMapExpression;
2001: private it.businesslogic.ireport.gui.JRTextExpressionArea jRTextExpressionAreaTextConnectionExpression;
2002: private javax.swing.JScrollPane jScrollPane1;
2003: private javax.swing.JScrollPane jScrollPane2;
2004: private javax.swing.JTabbedPane jTabbedPane1;
2005: private javax.swing.JTabbedPane jTabbedPaneData;
2006: private javax.swing.JTabbedPane jTabbedPaneSubDataset;
2007: private javax.swing.JTable jTable1;
2008: private javax.swing.JTable jTableDatasetParameters;
2009:
2010: // End of variables declaration//GEN-END:variables
2011:
2012: /**
2013: * This method add entries in the properties sheet to edit all common chart properties.
2014: * The common chart properties are all the ones listed in the chart tag:
2015: * isShowLegend
2016: * evaluationTime
2017: *
2018: */
2019: public void addCommonChartProperties() {
2020: if (currentSelectedChartElement != null) {
2021: ExpressionSheetProperty chartTitleProperty = new ExpressionSheetProperty(
2022: "chartTitle",
2023: I18n
2024: .getString(
2025: "chartPropertiesDialog.property.chartTitle",
2026: "Chart title expression"));
2027: chartTitleProperty.setValue(currentSelectedChartElement
2028: .getChart().getTitle().getTitleExpression());
2029:
2030: sheetPanel.addSheetProperty(I18n.getString(
2031: "chartPropertiesDialog.propertySet.Common",
2032: "Common"), chartTitleProperty);
2033:
2034: FontSheetProperty chartTitleFontProperty = new FontSheetProperty(
2035: "chartTitleFont",
2036: I18n
2037: .getString(
2038: "chartPropertiesDialog.property.chartTitleFont",
2039: "Chart title font"));
2040: chartTitleFontProperty.setValue(currentSelectedChartElement
2041: .getChart().getTitle().getFont());
2042: sheetPanel.addSheetProperty(I18n.getString(
2043: "chartPropertiesDialog.propertySet.Common",
2044: "Common"), chartTitleFontProperty);
2045:
2046: SheetProperty chartTitleColorProperty = new SheetProperty(
2047: "chartTitleColor",
2048: I18n
2049: .getString(
2050: "chartPropertiesDialog.property.chartTitleColor",
2051: "Chart title color"),
2052: SheetProperty.COLOR);
2053: chartTitleColorProperty
2054: .setValue(currentSelectedChartElement.getChart()
2055: .getTitle().getColor());
2056: sheetPanel.addSheetProperty(I18n.getString(
2057: "chartPropertiesDialog.propertySet.Common",
2058: "Common"), chartTitleColorProperty);
2059:
2060: SheetProperty chartTitlePositionProperty = new SheetProperty(
2061: "chartTitlePosition",
2062: I18n
2063: .getString(
2064: "chartPropertiesDialog.property.chartTitlePosition",
2065: "Chart title position"),
2066: SheetProperty.COMBOBOX);
2067: chartTitlePositionProperty
2068: .setTags(new Tag[] { new Tag("Top", "Top"),
2069: new Tag("Bottom", "Bottom"),
2070: new Tag("Left", "Left"),
2071: new Tag("Right", "Right") });
2072: chartTitlePositionProperty
2073: .setValue(currentSelectedChartElement.getChart()
2074: .getTitle().getPosition());
2075: sheetPanel.addSheetProperty(I18n.getString(
2076: "chartPropertiesDialog.propertySet.Common",
2077: "Common"), chartTitlePositionProperty);
2078:
2079: ExpressionSheetProperty chartSubTitleProperty = new ExpressionSheetProperty(
2080: "chartSubTitle",
2081: I18n
2082: .getString(
2083: "chartPropertiesDialog.property.chartSubTitle",
2084: "Chart subtitle expression"));
2085: chartSubTitleProperty.setValue(currentSelectedChartElement
2086: .getChart().getSubTitle().getTitleExpression());
2087: sheetPanel.addSheetProperty(I18n.getString(
2088: "chartPropertiesDialog.propertySet.Common",
2089: "Common"), chartSubTitleProperty);
2090:
2091: FontSheetProperty chartSubTitleFontProperty = new FontSheetProperty(
2092: "chartSubTitleFont",
2093: I18n
2094: .getString(
2095: "chartPropertiesDialog.property.chartSubTitleFont",
2096: "Chart subtitle font"));
2097: chartSubTitleFontProperty
2098: .setValue(currentSelectedChartElement.getChart()
2099: .getSubTitle().getFont());
2100: sheetPanel.addSheetProperty(I18n.getString(
2101: "chartPropertiesDialog.propertySet.Common",
2102: "Common"), chartSubTitleFontProperty);
2103:
2104: SheetProperty chartSubTitleColorProperty = new SheetProperty(
2105: "chartSubTitleColor",
2106: I18n
2107: .getString(
2108: "chartPropertiesDialog.property.chartSubTitleColor",
2109: "Chart subtitle color"),
2110: SheetProperty.COLOR);
2111: chartSubTitleColorProperty
2112: .setValue(currentSelectedChartElement.getChart()
2113: .getSubTitle().getColor());
2114: sheetPanel.addSheetProperty(I18n.getString(
2115: "chartPropertiesDialog.propertySet.Common",
2116: "Common"), chartSubTitleColorProperty);
2117:
2118: SheetProperty isShowLegendProperty = new SheetProperty(
2119: "isShowLegend",
2120: I18n
2121: .getString(
2122: "chartPropertiesDialog.property.isShowLegend",
2123: "Show legend"),
2124: SheetProperty.BOOLEAN);
2125: isShowLegendProperty.setValue(new Boolean(
2126: currentSelectedChartElement.getChart()
2127: .isShowLegend()));
2128: sheetPanel.addSheetProperty(I18n.getString(
2129: "chartPropertiesDialog.propertySet.Common",
2130: "Common"), isShowLegendProperty);
2131:
2132: // From jr 1.2.7 -------
2133: FontSheetProperty chartLegendFontProperty = new FontSheetProperty(
2134: "chartLegendFont",
2135: I18n
2136: .getString(
2137: "chartPropertiesDialog.property.chartLegendFont",
2138: "Legend font"));
2139: chartLegendFontProperty.setShowResetButton(true);
2140: chartLegendFontProperty
2141: .setValue(currentSelectedChartElement.getChart()
2142: .getLegend().getFont());
2143: sheetPanel.addSheetProperty(I18n.getString(
2144: "chartPropertiesDialog.propertySet.Common",
2145: "Common"), chartLegendFontProperty);
2146:
2147: SheetProperty chartLegendTextColorProperty = new SheetProperty(
2148: "chartLegendTextColor",
2149: I18n
2150: .getString(
2151: "chartPropertiesDialog.property.chartLegendTextColor",
2152: "Legend text color"),
2153: SheetProperty.COLOR);
2154: chartLegendTextColorProperty
2155: .setValue(currentSelectedChartElement.getChart()
2156: .getLegend().getTextColor());
2157: sheetPanel.addSheetProperty(I18n.getString(
2158: "chartPropertiesDialog.propertySet.Common",
2159: "Common"), chartLegendTextColorProperty);
2160:
2161: SheetProperty chartLegendBackgroundColorProperty = new SheetProperty(
2162: "chartLegendBackgroundColor",
2163: I18n
2164: .getString(
2165: "chartPropertiesDialog.property.chartLegendBackgroundColor",
2166: "Legend background color"),
2167: SheetProperty.COLOR);
2168: chartLegendBackgroundColorProperty
2169: .setValue(currentSelectedChartElement.getChart()
2170: .getLegend().getBackgroundColor());
2171: sheetPanel.addSheetProperty(I18n.getString(
2172: "chartPropertiesDialog.propertySet.Common",
2173: "Common"), chartLegendBackgroundColorProperty);
2174: // end from jr 1.2.7 ------
2175:
2176: SheetProperty plotOrientationProperty = new SheetProperty(
2177: "orientation",
2178: I18n
2179: .getString(
2180: "chartPropertiesDialog.property.orientation",
2181: "Orientation"),
2182: SheetProperty.COMBOBOX);
2183: plotOrientationProperty.setTags(new Tag[] {
2184: new Tag("Vertical", "Vertical"),
2185: new Tag("Horizontal", "Horizontal") });
2186: plotOrientationProperty
2187: .setValue(currentSelectedChartElement.getChart()
2188: .getPlot().getOrientation());
2189: sheetPanel.addSheetProperty(I18n.getString(
2190: "chartPropertiesDialog.propertySet.Common",
2191: "Common"), plotOrientationProperty);
2192:
2193: SheetProperty chartBackcolorProperty = new SheetProperty(
2194: "chartBackcolor",
2195: I18n
2196: .getString(
2197: "chartPropertiesDialog.property.chartBackcolor",
2198: "Backcolor"), SheetProperty.COLOR);
2199: chartBackcolorProperty.setValue(currentSelectedChartElement
2200: .getChart().getPlot().getBackcolor());
2201: sheetPanel.addSheetProperty(I18n.getString(
2202: "chartPropertiesDialog.propertySet.Common",
2203: "Common"), chartBackcolorProperty);
2204:
2205: SheetProperty backgroundAlphaProperty = new DoubleSheetProperty(
2206: "backgroundAlpha",
2207: I18n
2208: .getString(
2209: "chartPropertiesDialog.property.backgroundAlpha",
2210: "Background Alpha (%)"));
2211: backgroundAlphaProperty.setValue(new Double(
2212: currentSelectedChartElement.getChart().getPlot()
2213: .getBackgroundAlpha()));
2214: sheetPanel.addSheetProperty(I18n.getString(
2215: "chartPropertiesDialog.propertySet.Common",
2216: "Common"), backgroundAlphaProperty);
2217:
2218: SheetProperty foregroundAlphaProperty = new DoubleSheetProperty(
2219: "foregroundAlpha",
2220: I18n
2221: .getString(
2222: "chartPropertiesDialog.property.foregroundAlpha",
2223: "Foreground Alpha (%)"));
2224: foregroundAlphaProperty.setValue(new Double(
2225: currentSelectedChartElement.getChart().getPlot()
2226: .getForegroundAlpha()));
2227: sheetPanel.addSheetProperty(I18n.getString(
2228: "chartPropertiesDialog.propertySet.Common",
2229: "Common"), foregroundAlphaProperty);
2230:
2231: SheetProperty labelRotationProperty = new DoubleSheetProperty(
2232: "labelRotation",
2233: I18n
2234: .getString(
2235: "chartPropertiesDialog.property.labelRotation",
2236: "Label rotation"));
2237: labelRotationProperty.setValue(new Double(
2238: currentSelectedChartElement.getChart().getPlot()
2239: .getLabelRotation()));
2240: sheetPanel.addSheetProperty(I18n.getString(
2241: "chartPropertiesDialog.propertySet.Common",
2242: "Common"), labelRotationProperty);
2243:
2244: SheetProperty seriesColorsProperty = new SeriesColorsSheetProperty(
2245: "seriesColors",
2246: I18n
2247: .getString(
2248: "chartPropertiesDialog.property.seriesColors",
2249: "Series colors"));
2250: seriesColorsProperty.setValue(currentSelectedChartElement
2251: .getChart().getPlot().getSeriesColors());
2252: sheetPanel.addSheetProperty(I18n.getString(
2253: "chartPropertiesDialog.propertySet.Common",
2254: "Common"), seriesColorsProperty);
2255:
2256: SheetProperty customizerClassProperty = new SheetProperty(
2257: "customizerClass",
2258: I18n
2259: .getString(
2260: "chartPropertiesDialog.property.customizerClass",
2261: "Customizer class"),
2262: SheetProperty.STRING);
2263: customizerClassProperty
2264: .setValue(currentSelectedChartElement.getChart()
2265: .getCustomizerClass());
2266: sheetPanel.addSheetProperty(I18n.getString(
2267: "chartPropertiesDialog.propertySet.Common",
2268: "Common"), customizerClassProperty);
2269:
2270: }
2271: }
2272:
2273: public int getDialogResult() {
2274: return dialogResult;
2275: }
2276:
2277: public void setDialogResult(int dialogResult) {
2278: this .dialogResult = dialogResult;
2279: }
2280:
2281: public JReportFrame getJReportFrame() {
2282: return jReportFrame;
2283: }
2284:
2285: public void setJReportFrame(JReportFrame jReportFrame) {
2286: this .jReportFrame = jReportFrame;
2287:
2288: }
2289:
2290: public void sheetPropertyValueChanged(
2291: SheetPropertyValueChangedEvent evt) {
2292: if (currentSelectedChartElement == null)
2293: return;
2294:
2295: String property = evt.getPropertyName();
2296: Plot currentPlot = currentSelectedChartElement.getChart()
2297: .getPlot();
2298:
2299: if (property.equals("chartTitle"))
2300: currentSelectedChartElement.getChart().getTitle()
2301: .setTitleExpression("" + evt.getNewValue());
2302: else if (property.equals("chartTitleFont"))
2303: currentSelectedChartElement.getChart().getTitle().setFont(
2304: (it.businesslogic.ireport.IReportFont) evt
2305: .getNewValue());
2306: else if (property.equals("chartTitleColor"))
2307: currentSelectedChartElement.getChart().getTitle().setColor(
2308: (java.awt.Color) ColorSelectorPanel
2309: .parseColorString("" + evt.getNewValue()));
2310: else if (property.equals("chartTitlePosition"))
2311: currentSelectedChartElement.getChart().getTitle()
2312: .setPosition("" + evt.getNewValue());
2313: else if (property.equals("chartSubTitle"))
2314: currentSelectedChartElement.getChart().getSubTitle()
2315: .setTitleExpression("" + evt.getNewValue());
2316: else if (property.equals("chartSubTitleFont"))
2317: currentSelectedChartElement.getChart().getSubTitle()
2318: .setFont(
2319: (it.businesslogic.ireport.IReportFont) evt
2320: .getNewValue());
2321: else if (property.equals("chartSubTitleColor"))
2322: currentSelectedChartElement.getChart().getSubTitle()
2323: .setColor(
2324: (java.awt.Color) ColorSelectorPanel
2325: .parseColorString(""
2326: + evt.getNewValue()));
2327: else if (property.equals("isShowLegend"))
2328: currentSelectedChartElement.getChart().setShowLegend(
2329: ((Boolean) evt.getNewValue()).booleanValue());
2330: else if (property.equals("chartLegendFont"))
2331: currentSelectedChartElement.getChart().getLegend().setFont(
2332: (it.businesslogic.ireport.IReportFont) evt
2333: .getNewValue());
2334: else if (property.equals("chartLegendTextColor"))
2335: currentSelectedChartElement.getChart().getLegend()
2336: .setTextColor(
2337: (java.awt.Color) ColorSelectorPanel
2338: .parseColorString(""
2339: + evt.getNewValue()));
2340: else if (property.equals("chartLegendBackgroundColor"))
2341: currentSelectedChartElement.getChart().getLegend()
2342: .setBackgroundColor(
2343: (java.awt.Color) ColorSelectorPanel
2344: .parseColorString(""
2345: + evt.getNewValue()));
2346: else if (property.equals("chartBackcolor"))
2347: currentPlot
2348: .setBackcolor((java.awt.Color) ColorSelectorPanel
2349: .parseColorString("" + evt.getNewValue()));
2350: else if (property.equals("orientation"))
2351: currentPlot.setOrientation("" + evt.getNewValue());
2352: else if (property.equals("seriesColors"))
2353: currentPlot.setSeriesColors((java.util.List) evt
2354: .getNewValue());
2355: else if (property.equals("customizerClass"))
2356: currentSelectedChartElement.getChart().setCustomizerClass(
2357: "" + evt.getNewValue());
2358: else if (property.equals("backgroundAlpha")) {
2359: double newval = ((Double) evt.getNewValue()).doubleValue();
2360: if (newval < 0.0 || newval > 1.0) {
2361: JOptionPane
2362: .showMessageDialog(
2363: this ,
2364: I18n
2365: .getString(
2366: "messages.error.backGroundAlphaInvalidValue",
2367: "Background Alpha must be a number between 0 and 1."),
2368: I18n.getString(
2369: "messages.error.valueNotValid",
2370: "Value not valid"),
2371: JOptionPane.ERROR_MESSAGE);
2372: sheetPanel.setPropertyValue(evt.getPropertyName(), evt
2373: .getOldValue());
2374: } else {
2375: currentPlot.setBackgroundAlpha(((Double) evt
2376: .getNewValue()).doubleValue());
2377: }
2378: } else if (property.equals("foregroundAlpha")) {
2379: double newval = ((Double) evt.getNewValue()).doubleValue();
2380: if (newval < 0.0 || newval > 1.0) {
2381: JOptionPane
2382: .showMessageDialog(
2383: this ,
2384: I18n
2385: .getString(
2386: "messages.error.foreGroundAlphaInvalidValue",
2387: "Foreground Alpha must be a number between 0 and 1."),
2388: I18n.getString(
2389: "messages.error.valueNotValid",
2390: "Value not valid"),
2391: JOptionPane.ERROR_MESSAGE);
2392: sheetPanel.setPropertyValue(evt.getPropertyName(), evt
2393: .getOldValue());
2394: } else {
2395: currentPlot.setForegroundAlpha(((Double) evt
2396: .getNewValue()).doubleValue());
2397: }
2398: } else if (property.equals("labelRotation")) {
2399: double newval = ((Double) evt.getNewValue()).doubleValue();
2400: //if (newval < 0.0 || newval > 365)
2401: //{
2402: // JOptionPane.showMessageDialog(this,"Label rotation must be a number between 0 and 365.","Value not valid",JOptionPane.ERROR_MESSAGE);
2403: // sheetPanel.setPropertyValue(evt.getPropertyName(), evt.getOldValue() );
2404: //}
2405: //else
2406: //{
2407: currentPlot.setLabelRotation(((Double) evt.getNewValue())
2408: .doubleValue());
2409: //}
2410: } else if (property.equals("isCircular")
2411: && currentPlot instanceof PiePlot)
2412: ((PiePlot) currentPlot).setCircular(((Boolean) evt
2413: .getNewValue()).booleanValue());
2414: else if (property.equals("isCircular")
2415: && currentPlot instanceof Pie3DPlot)
2416: ((Pie3DPlot) currentPlot).setCircular(((Boolean) evt
2417: .getNewValue()).booleanValue());
2418: else if (property.equals("depthFactor")
2419: && currentPlot instanceof Pie3DPlot)
2420: ((Pie3DPlot) currentPlot).setDepthFactor(((Double) evt
2421: .getNewValue()).doubleValue());
2422:
2423: else if (property.equals("isShowLabelsBarPlot")
2424: && currentPlot instanceof BarPlot)
2425: ((BarPlot) currentPlot).setShowLabels(((Boolean) evt
2426: .getNewValue()).booleanValue());
2427: else if (property.equals("isShowTickMarksBarPlot")
2428: && currentPlot instanceof BarPlot)
2429: ((BarPlot) currentPlot).setShowTickMarks(((Boolean) evt
2430: .getNewValue()).booleanValue());
2431: else if (property.equals("isShowTickLabelsBarPlot")
2432: && currentPlot instanceof BarPlot)
2433: ((BarPlot) currentPlot).setShowTickLabels(((Boolean) evt
2434: .getNewValue()).booleanValue());
2435: else if (property.equals("categoryAxisLabelExpressionBarPlot")
2436: && currentPlot instanceof BarPlot)
2437: ((BarPlot) currentPlot).setCategoryAxisLabelExpression(""
2438: + evt.getNewValue());
2439: else if (property.equals("valueAxisLabelExpressionBarPlot")
2440: && currentPlot instanceof BarPlot)
2441: ((BarPlot) currentPlot).setValueAxisLabelExpression(""
2442: + evt.getNewValue());
2443: // Bar plot > categoryAxisFormat
2444: else if (property.equals("categoryAxisLabelColorBarPlot")
2445: && currentPlot instanceof BarPlot)
2446: ((BarPlot) currentPlot).getCategoryAxisFormat()
2447: .setLabelColor(
2448: (java.awt.Color) ColorSelectorPanel
2449: .parseColorString(""
2450: + evt.getNewValue()));
2451: else if (property.equals("categoryAxisTickLabelColorBarPlot")
2452: && currentPlot instanceof BarPlot)
2453: ((BarPlot) currentPlot).getCategoryAxisFormat()
2454: .setTickLabelColor(
2455: (java.awt.Color) ColorSelectorPanel
2456: .parseColorString(""
2457: + evt.getNewValue()));
2458: else if (property.equals("categoryAxisTickLabelMaskBarPlot")
2459: && currentPlot instanceof BarPlot)
2460: ((BarPlot) currentPlot).getCategoryAxisFormat()
2461: .setTickLabelMask("" + evt.getNewValue());
2462: else if (property.equals("categoryAxisLineColorBarPlot")
2463: && currentPlot instanceof BarPlot)
2464: ((BarPlot) currentPlot).getCategoryAxisFormat()
2465: .setAxisLineColor(
2466: (java.awt.Color) ColorSelectorPanel
2467: .parseColorString(""
2468: + evt.getNewValue()));
2469: else if (property.equals("categoryAxisLabelFontBarPlot")
2470: && currentPlot instanceof BarPlot)
2471: ((BarPlot) currentPlot).getCategoryAxisFormat()
2472: .setLabelFont(
2473: (it.businesslogic.ireport.IReportFont) evt
2474: .getNewValue());
2475: else if (property.equals("categoryAxisTickLabelFontBarPlot")
2476: && currentPlot instanceof BarPlot)
2477: ((BarPlot) currentPlot).getCategoryAxisFormat()
2478: .setTickLabelFont(
2479: (it.businesslogic.ireport.IReportFont) evt
2480: .getNewValue());
2481: // Bar plot > valueAxisFormat
2482: else if (property.equals("valueAxisLabelColorBarPlot")
2483: && currentPlot instanceof BarPlot)
2484: ((BarPlot) currentPlot).getValueAxisFormat().setLabelColor(
2485: (java.awt.Color) ColorSelectorPanel
2486: .parseColorString("" + evt.getNewValue()));
2487: else if (property.equals("valueAxisTickLabelColorBarPlot")
2488: && currentPlot instanceof BarPlot)
2489: ((BarPlot) currentPlot).getValueAxisFormat()
2490: .setTickLabelColor(
2491: (java.awt.Color) ColorSelectorPanel
2492: .parseColorString(""
2493: + evt.getNewValue()));
2494: else if (property.equals("valueAxisTickLabelMaskBarPlot")
2495: && currentPlot instanceof BarPlot)
2496: ((BarPlot) currentPlot).getValueAxisFormat()
2497: .setTickLabelMask("" + evt.getNewValue());
2498: else if (property.equals("valueAxisLineColorBarPlot")
2499: && currentPlot instanceof BarPlot)
2500: ((BarPlot) currentPlot).getValueAxisFormat()
2501: .setAxisLineColor(
2502: (java.awt.Color) ColorSelectorPanel
2503: .parseColorString(""
2504: + evt.getNewValue()));
2505: else if (property.equals("valueAxisLabelFontBarPlot")
2506: && currentPlot instanceof BarPlot)
2507: ((BarPlot) currentPlot).getValueAxisFormat().setLabelFont(
2508: (it.businesslogic.ireport.IReportFont) evt
2509: .getNewValue());
2510: else if (property.equals("valueAxisTickLabelFontBarPlot")
2511: && currentPlot instanceof BarPlot)
2512: ((BarPlot) currentPlot).getValueAxisFormat()
2513: .setTickLabelFont(
2514: (it.businesslogic.ireport.IReportFont) evt
2515: .getNewValue());
2516:
2517: else if (property.equals("isShowLabelsBar3DPlot")
2518: && currentPlot instanceof Bar3DPlot)
2519: ((Bar3DPlot) currentPlot).setShowLabels(((Boolean) evt
2520: .getNewValue()).booleanValue());
2521: else if (property.equals("xOffsetBar3DPlot")
2522: && currentPlot instanceof Bar3DPlot)
2523: ((Bar3DPlot) currentPlot).setXOffset(((Double) evt
2524: .getNewValue()).doubleValue());
2525: else if (property.equals("yOffsetBar3DPlot")
2526: && currentPlot instanceof Bar3DPlot)
2527: ((Bar3DPlot) currentPlot).setYOffset(((Double) evt
2528: .getNewValue()).doubleValue());
2529: else if (property
2530: .equals("categoryAxisLabelExpressionBar3DPlot")
2531: && currentPlot instanceof Bar3DPlot)
2532: ((Bar3DPlot) currentPlot).setCategoryAxisLabelExpression(""
2533: + evt.getNewValue());
2534: else if (property.equals("valueAxisLabelExpressionBar3DPlot")
2535: && currentPlot instanceof Bar3DPlot)
2536: ((Bar3DPlot) currentPlot).setValueAxisLabelExpression(""
2537: + evt.getNewValue());
2538: // Bar3D plot > categoryAxisFormat
2539: else if (property.equals("categoryAxisLabelColorBar3DPlot")
2540: && currentPlot instanceof Bar3DPlot)
2541: ((Bar3DPlot) currentPlot).getCategoryAxisFormat()
2542: .setLabelColor(
2543: (java.awt.Color) ColorSelectorPanel
2544: .parseColorString(""
2545: + evt.getNewValue()));
2546: else if (property.equals("categoryAxisTickLabelColorBar3DPlot")
2547: && currentPlot instanceof Bar3DPlot)
2548: ((Bar3DPlot) currentPlot).getCategoryAxisFormat()
2549: .setTickLabelColor(
2550: (java.awt.Color) ColorSelectorPanel
2551: .parseColorString(""
2552: + evt.getNewValue()));
2553: else if (property.equals("categoryAxisTickLabelMaskBar3DPlot")
2554: && currentPlot instanceof Bar3DPlot)
2555: ((Bar3DPlot) currentPlot).getCategoryAxisFormat()
2556: .setTickLabelMask("" + evt.getNewValue());
2557: else if (property.equals("categoryAxisLineColorBar3DPlot")
2558: && currentPlot instanceof Bar3DPlot)
2559: ((Bar3DPlot) currentPlot).getCategoryAxisFormat()
2560: .setAxisLineColor(
2561: (java.awt.Color) ColorSelectorPanel
2562: .parseColorString(""
2563: + evt.getNewValue()));
2564: else if (property.equals("categoryAxisLabelFontBar3DPlot")
2565: && currentPlot instanceof Bar3DPlot)
2566: ((Bar3DPlot) currentPlot).getCategoryAxisFormat()
2567: .setLabelFont(
2568: (it.businesslogic.ireport.IReportFont) evt
2569: .getNewValue());
2570: else if (property.equals("categoryAxisTickLabelFontBar3DPlot")
2571: && currentPlot instanceof Bar3DPlot)
2572: ((Bar3DPlot) currentPlot).getCategoryAxisFormat()
2573: .setTickLabelFont(
2574: (it.businesslogic.ireport.IReportFont) evt
2575: .getNewValue());
2576: // Bar3D plot > valueAxisFormat
2577: else if (property.equals("valueAxisLabelColorBar3DPlot")
2578: && currentPlot instanceof Bar3DPlot)
2579: ((Bar3DPlot) currentPlot).getValueAxisFormat()
2580: .setLabelColor(
2581: (java.awt.Color) ColorSelectorPanel
2582: .parseColorString(""
2583: + evt.getNewValue()));
2584: else if (property.equals("valueAxisTickLabelColorBar3DPlot")
2585: && currentPlot instanceof Bar3DPlot)
2586: ((Bar3DPlot) currentPlot).getValueAxisFormat()
2587: .setTickLabelColor(
2588: (java.awt.Color) ColorSelectorPanel
2589: .parseColorString(""
2590: + evt.getNewValue()));
2591: else if (property.equals("valueAxisTickLabelMaskBar3DPlot")
2592: && currentPlot instanceof Bar3DPlot)
2593: ((Bar3DPlot) currentPlot).getValueAxisFormat()
2594: .setTickLabelMask("" + evt.getNewValue());
2595: else if (property.equals("valueAxisLineColorBar3DPlot")
2596: && currentPlot instanceof Bar3DPlot)
2597: ((Bar3DPlot) currentPlot).getValueAxisFormat()
2598: .setAxisLineColor(
2599: (java.awt.Color) ColorSelectorPanel
2600: .parseColorString(""
2601: + evt.getNewValue()));
2602: else if (property.equals("valueAxisLabelFontBar3DPlot")
2603: && currentPlot instanceof Bar3DPlot)
2604: ((Bar3DPlot) currentPlot).getValueAxisFormat()
2605: .setLabelFont(
2606: (it.businesslogic.ireport.IReportFont) evt
2607: .getNewValue());
2608: else if (property.equals("valueAxisTickLabelFontBar3DPlot")
2609: && currentPlot instanceof Bar3DPlot)
2610: ((Bar3DPlot) currentPlot).getValueAxisFormat()
2611: .setTickLabelFont(
2612: (it.businesslogic.ireport.IReportFont) evt
2613: .getNewValue());
2614:
2615: else if (property.equals("isShowLinesLinePlot")
2616: && currentPlot instanceof LinePlot)
2617: ((LinePlot) currentPlot).setShowLines(((Boolean) evt
2618: .getNewValue()).booleanValue());
2619: else if (property.equals("isShowShapesLinePlot")
2620: && currentPlot instanceof LinePlot)
2621: ((LinePlot) currentPlot).setShowShapes(((Boolean) evt
2622: .getNewValue()).booleanValue());
2623: else if (property.equals("categoryAxisLabelExpressionLinePlot")
2624: && currentPlot instanceof LinePlot)
2625: ((LinePlot) currentPlot).setCategoryAxisLabelExpression(""
2626: + evt.getNewValue());
2627: else if (property.equals("valueAxisLabelExpressionLinePlot")
2628: && currentPlot instanceof LinePlot)
2629: ((LinePlot) currentPlot).setValueAxisLabelExpression(""
2630: + evt.getNewValue());
2631: // Line plot > categoryAxisFormat
2632: else if (property.equals("categoryAxisLabelColorLinePlot")
2633: && currentPlot instanceof LinePlot)
2634: ((LinePlot) currentPlot).getCategoryAxisFormat()
2635: .setLabelColor(
2636: (java.awt.Color) ColorSelectorPanel
2637: .parseColorString(""
2638: + evt.getNewValue()));
2639: else if (property.equals("categoryAxisTickLabelColorLinePlot")
2640: && currentPlot instanceof LinePlot)
2641: ((LinePlot) currentPlot).getCategoryAxisFormat()
2642: .setTickLabelColor(
2643: (java.awt.Color) ColorSelectorPanel
2644: .parseColorString(""
2645: + evt.getNewValue()));
2646: else if (property.equals("categoryAxisTickLabelMaskLinePlot")
2647: && currentPlot instanceof LinePlot)
2648: ((LinePlot) currentPlot).getCategoryAxisFormat()
2649: .setTickLabelMask("" + evt.getNewValue());
2650: else if (property.equals("categoryAxisLineColorLinePlot")
2651: && currentPlot instanceof LinePlot)
2652: ((LinePlot) currentPlot).getCategoryAxisFormat()
2653: .setAxisLineColor(
2654: (java.awt.Color) ColorSelectorPanel
2655: .parseColorString(""
2656: + evt.getNewValue()));
2657: else if (property.equals("categoryAxisLabelFontLinePlot")
2658: && currentPlot instanceof LinePlot)
2659: ((LinePlot) currentPlot).getCategoryAxisFormat()
2660: .setLabelFont(
2661: (it.businesslogic.ireport.IReportFont) evt
2662: .getNewValue());
2663: else if (property.equals("categoryAxisTickLabelFontLinePlot")
2664: && currentPlot instanceof LinePlot)
2665: ((LinePlot) currentPlot).getCategoryAxisFormat()
2666: .setTickLabelFont(
2667: (it.businesslogic.ireport.IReportFont) evt
2668: .getNewValue());
2669: // Line plot > valueAxisFormat
2670: else if (property.equals("valueAxisLabelColorLinePlot")
2671: && currentPlot instanceof LinePlot)
2672: ((LinePlot) currentPlot).getValueAxisFormat()
2673: .setLabelColor(
2674: (java.awt.Color) ColorSelectorPanel
2675: .parseColorString(""
2676: + evt.getNewValue()));
2677: else if (property.equals("valueAxisTickLabelColorLinePlot")
2678: && currentPlot instanceof LinePlot)
2679: ((LinePlot) currentPlot).getValueAxisFormat()
2680: .setTickLabelColor(
2681: (java.awt.Color) ColorSelectorPanel
2682: .parseColorString(""
2683: + evt.getNewValue()));
2684: else if (property.equals("valueAxisTickLabelMaskLinePlot")
2685: && currentPlot instanceof LinePlot)
2686: ((LinePlot) currentPlot).getValueAxisFormat()
2687: .setTickLabelMask("" + evt.getNewValue());
2688: else if (property.equals("valueAxisLineColorLinePlot")
2689: && currentPlot instanceof LinePlot)
2690: ((LinePlot) currentPlot).getValueAxisFormat()
2691: .setAxisLineColor(
2692: (java.awt.Color) ColorSelectorPanel
2693: .parseColorString(""
2694: + evt.getNewValue()));
2695: else if (property.equals("valueAxisLabelFontLinePlot")
2696: && currentPlot instanceof LinePlot)
2697: ((LinePlot) currentPlot).getValueAxisFormat().setLabelFont(
2698: (it.businesslogic.ireport.IReportFont) evt
2699: .getNewValue());
2700: else if (property.equals("valueAxisTickLabelFontLinePlot")
2701: && currentPlot instanceof LinePlot)
2702: ((LinePlot) currentPlot).getValueAxisFormat()
2703: .setTickLabelFont(
2704: (it.businesslogic.ireport.IReportFont) evt
2705: .getNewValue());
2706:
2707: else if (property.equals("categoryAxisLabelExpressionAreaPlot")
2708: && currentPlot instanceof AreaPlot)
2709: ((AreaPlot) currentPlot).setCategoryAxisLabelExpression(""
2710: + evt.getNewValue());
2711: else if (property.equals("valueAxisLabelExpressionAreaPlot")
2712: && currentPlot instanceof AreaPlot)
2713: ((AreaPlot) currentPlot).setValueAxisLabelExpression(""
2714: + evt.getNewValue());
2715: // Area plot > categoryAxisFormat
2716: else if (property.equals("categoryAxisLabelColorAreaPlot")
2717: && currentPlot instanceof AreaPlot)
2718: ((AreaPlot) currentPlot).getCategoryAxisFormat()
2719: .setLabelColor(
2720: (java.awt.Color) ColorSelectorPanel
2721: .parseColorString(""
2722: + evt.getNewValue()));
2723: else if (property.equals("categoryAxisTickLabelColorAreaPlot")
2724: && currentPlot instanceof AreaPlot)
2725: ((AreaPlot) currentPlot).getCategoryAxisFormat()
2726: .setTickLabelColor(
2727: (java.awt.Color) ColorSelectorPanel
2728: .parseColorString(""
2729: + evt.getNewValue()));
2730: else if (property.equals("categoryAxisTickLabelMaskAreaPlot")
2731: && currentPlot instanceof AreaPlot)
2732: ((AreaPlot) currentPlot).getCategoryAxisFormat()
2733: .setTickLabelMask("" + evt.getNewValue());
2734: else if (property.equals("categoryAxisLineColorAreaPlot")
2735: && currentPlot instanceof AreaPlot)
2736: ((AreaPlot) currentPlot).getCategoryAxisFormat()
2737: .setAxisLineColor(
2738: (java.awt.Color) ColorSelectorPanel
2739: .parseColorString(""
2740: + evt.getNewValue()));
2741: else if (property.equals("categoryAxisLabelFontAreaPlot")
2742: && currentPlot instanceof AreaPlot)
2743: ((AreaPlot) currentPlot).getCategoryAxisFormat()
2744: .setLabelFont(
2745: (it.businesslogic.ireport.IReportFont) evt
2746: .getNewValue());
2747: else if (property.equals("categoryAxisTickLabelFontAreaPlot")
2748: && currentPlot instanceof AreaPlot)
2749: ((AreaPlot) currentPlot).getCategoryAxisFormat()
2750: .setTickLabelFont(
2751: (it.businesslogic.ireport.IReportFont) evt
2752: .getNewValue());
2753: // Area plot > valueAxisFormat
2754: else if (property.equals("valueAxisLabelColorAreaPlot")
2755: && currentPlot instanceof AreaPlot)
2756: ((AreaPlot) currentPlot).getValueAxisFormat()
2757: .setLabelColor(
2758: (java.awt.Color) ColorSelectorPanel
2759: .parseColorString(""
2760: + evt.getNewValue()));
2761: else if (property.equals("valueAxisTickLabelColorAreaPlot")
2762: && currentPlot instanceof AreaPlot)
2763: ((AreaPlot) currentPlot).getValueAxisFormat()
2764: .setTickLabelColor(
2765: (java.awt.Color) ColorSelectorPanel
2766: .parseColorString(""
2767: + evt.getNewValue()));
2768: else if (property.equals("valueAxisTickLabelMaskAreaPlot")
2769: && currentPlot instanceof AreaPlot)
2770: ((AreaPlot) currentPlot).getValueAxisFormat()
2771: .setTickLabelMask("" + evt.getNewValue());
2772: else if (property.equals("valueAxisLineColorAreaPlot")
2773: && currentPlot instanceof AreaPlot)
2774: ((AreaPlot) currentPlot).getValueAxisFormat()
2775: .setAxisLineColor(
2776: (java.awt.Color) ColorSelectorPanel
2777: .parseColorString(""
2778: + evt.getNewValue()));
2779: else if (property.equals("valueAxisLabelFontAreaPlot")
2780: && currentPlot instanceof AreaPlot)
2781: ((AreaPlot) currentPlot).getValueAxisFormat().setLabelFont(
2782: (it.businesslogic.ireport.IReportFont) evt
2783: .getNewValue());
2784: else if (property.equals("valueAxisTickLabelFontAreaPlot")
2785: && currentPlot instanceof AreaPlot)
2786: ((AreaPlot) currentPlot).getValueAxisFormat()
2787: .setTickLabelFont(
2788: (it.businesslogic.ireport.IReportFont) evt
2789: .getNewValue());
2790:
2791: else if (property.equals("isShowLinesScatterPlot")
2792: && currentPlot instanceof ScatterPlot)
2793: ((ScatterPlot) currentPlot).setShowLines(((Boolean) evt
2794: .getNewValue()).booleanValue());
2795: else if (property.equals("isShowShapesScatterPlot")
2796: && currentPlot instanceof ScatterPlot)
2797: ((ScatterPlot) currentPlot).setShowShapes(((Boolean) evt
2798: .getNewValue()).booleanValue());
2799: else if (property.equals("xAxisLabelExpressionScatterPlot")
2800: && currentPlot instanceof ScatterPlot)
2801: ((ScatterPlot) currentPlot).setXAxisLabelExpression(""
2802: + evt.getNewValue());
2803: else if (property.equals("yAxisLabelExpressionScatterPlot")
2804: && currentPlot instanceof ScatterPlot)
2805: ((ScatterPlot) currentPlot).setYAxisLabelExpression(""
2806: + evt.getNewValue());
2807: // Scatter plot > categoryAxisFormat
2808: else if (property.equals("xAxisLabelColorScatterPlot")
2809: && currentPlot instanceof ScatterPlot)
2810: ((ScatterPlot) currentPlot).getXAxisFormat().setLabelColor(
2811: (java.awt.Color) ColorSelectorPanel
2812: .parseColorString("" + evt.getNewValue()));
2813: else if (property.equals("xAxisTickLabelColorScatterPlot")
2814: && currentPlot instanceof ScatterPlot)
2815: ((ScatterPlot) currentPlot).getXAxisFormat()
2816: .setTickLabelColor(
2817: (java.awt.Color) ColorSelectorPanel
2818: .parseColorString(""
2819: + evt.getNewValue()));
2820: else if (property.equals("xAxisTickLabelMaskScatterPlot")
2821: && currentPlot instanceof ScatterPlot)
2822: ((ScatterPlot) currentPlot).getXAxisFormat()
2823: .setTickLabelMask("" + evt.getNewValue());
2824: else if (property.equals("xAxisLineColorScatterPlot")
2825: && currentPlot instanceof ScatterPlot)
2826: ((ScatterPlot) currentPlot).getXAxisFormat()
2827: .setAxisLineColor(
2828: (java.awt.Color) ColorSelectorPanel
2829: .parseColorString(""
2830: + evt.getNewValue()));
2831: else if (property.equals("xAxisLabelFontScatterPlot")
2832: && currentPlot instanceof ScatterPlot)
2833: ((ScatterPlot) currentPlot).getXAxisFormat().setLabelFont(
2834: (it.businesslogic.ireport.IReportFont) evt
2835: .getNewValue());
2836: else if (property.equals("xAxisTickLabelFontScatterPlot")
2837: && currentPlot instanceof ScatterPlot)
2838: ((ScatterPlot) currentPlot).getXAxisFormat()
2839: .setTickLabelFont(
2840: (it.businesslogic.ireport.IReportFont) evt
2841: .getNewValue());
2842: // Scatter plot > valueAxisFormat
2843: else if (property.equals("yAxisLabelColorScatterPlot")
2844: && currentPlot instanceof ScatterPlot)
2845: ((ScatterPlot) currentPlot).getYAxisFormat().setLabelColor(
2846: (java.awt.Color) ColorSelectorPanel
2847: .parseColorString("" + evt.getNewValue()));
2848: else if (property.equals("yAxisTickLabelColorScatterPlot")
2849: && currentPlot instanceof ScatterPlot)
2850: ((ScatterPlot) currentPlot).getYAxisFormat()
2851: .setTickLabelColor(
2852: (java.awt.Color) ColorSelectorPanel
2853: .parseColorString(""
2854: + evt.getNewValue()));
2855: else if (property.equals("yAxisTickLabelMaskScatterPlot")
2856: && currentPlot instanceof ScatterPlot)
2857: ((ScatterPlot) currentPlot).getYAxisFormat()
2858: .setTickLabelMask("" + evt.getNewValue());
2859: else if (property.equals("yAxisLineColorScatterPlot")
2860: && currentPlot instanceof ScatterPlot)
2861: ((ScatterPlot) currentPlot).getYAxisFormat()
2862: .setAxisLineColor(
2863: (java.awt.Color) ColorSelectorPanel
2864: .parseColorString(""
2865: + evt.getNewValue()));
2866: else if (property.equals("yAxisLabelFontScatterPlot")
2867: && currentPlot instanceof ScatterPlot)
2868: ((ScatterPlot) currentPlot).getYAxisFormat().setLabelFont(
2869: (it.businesslogic.ireport.IReportFont) evt
2870: .getNewValue());
2871: else if (property.equals("yAxisTickLabelFontScatterPlot")
2872: && currentPlot instanceof ScatterPlot)
2873: ((ScatterPlot) currentPlot).getYAxisFormat()
2874: .setTickLabelFont(
2875: (it.businesslogic.ireport.IReportFont) evt
2876: .getNewValue());
2877:
2878: else if (property.equals("scaleTypeBubblePlot")
2879: && currentPlot instanceof BubblePlot)
2880: ((BubblePlot) currentPlot).setScaleType(""
2881: + evt.getNewValue());
2882: else if (property.equals("xAxisLabelExpressionBubblePlot")
2883: && currentPlot instanceof BubblePlot)
2884: ((BubblePlot) currentPlot).setXAxisLabelExpression(""
2885: + evt.getNewValue());
2886: else if (property.equals("yAxisLabelExpressionBubblePlot")
2887: && currentPlot instanceof BubblePlot)
2888: ((BubblePlot) currentPlot).setYAxisLabelExpression(""
2889: + evt.getNewValue());
2890: // Bubble plot > categoryAxisFormat
2891: else if (property.equals("xAxisLabelColorBubblePlot")
2892: && currentPlot instanceof BubblePlot)
2893: ((BubblePlot) currentPlot).getXAxisFormat().setLabelColor(
2894: (java.awt.Color) ColorSelectorPanel
2895: .parseColorString("" + evt.getNewValue()));
2896: else if (property.equals("xAxisTickLabelColorBubblePlot")
2897: && currentPlot instanceof BubblePlot)
2898: ((BubblePlot) currentPlot).getXAxisFormat()
2899: .setTickLabelColor(
2900: (java.awt.Color) ColorSelectorPanel
2901: .parseColorString(""
2902: + evt.getNewValue()));
2903: else if (property.equals("xAxisTickLabelMaskBubblePlot")
2904: && currentPlot instanceof BubblePlot)
2905: ((BubblePlot) currentPlot).getXAxisFormat()
2906: .setTickLabelMask("" + evt.getNewValue());
2907: else if (property.equals("xAxisLineColorBubblePlot")
2908: && currentPlot instanceof BubblePlot)
2909: ((BubblePlot) currentPlot).getXAxisFormat()
2910: .setAxisLineColor(
2911: (java.awt.Color) ColorSelectorPanel
2912: .parseColorString(""
2913: + evt.getNewValue()));
2914: else if (property.equals("xAxisLabelFontBubblePlot")
2915: && currentPlot instanceof BubblePlot)
2916: ((BubblePlot) currentPlot).getXAxisFormat().setLabelFont(
2917: (it.businesslogic.ireport.IReportFont) evt
2918: .getNewValue());
2919: else if (property.equals("xAxisTickLabelFontBubblePlot")
2920: && currentPlot instanceof BubblePlot)
2921: ((BubblePlot) currentPlot).getXAxisFormat()
2922: .setTickLabelFont(
2923: (it.businesslogic.ireport.IReportFont) evt
2924: .getNewValue());
2925: // Bubble plot > valueAxisFormat
2926: else if (property.equals("yAxisLabelColorBubblePlot")
2927: && currentPlot instanceof BubblePlot)
2928: ((BubblePlot) currentPlot).getYAxisFormat().setLabelColor(
2929: (java.awt.Color) ColorSelectorPanel
2930: .parseColorString("" + evt.getNewValue()));
2931: else if (property.equals("yAxisTickLabelColorBubblePlot")
2932: && currentPlot instanceof BubblePlot)
2933: ((BubblePlot) currentPlot).getYAxisFormat()
2934: .setTickLabelColor(
2935: (java.awt.Color) ColorSelectorPanel
2936: .parseColorString(""
2937: + evt.getNewValue()));
2938: else if (property.equals("yAxisTickLabelMaskBubblePlot")
2939: && currentPlot instanceof BubblePlot)
2940: ((BubblePlot) currentPlot).getYAxisFormat()
2941: .setTickLabelMask("" + evt.getNewValue());
2942: else if (property.equals("yAxisLineColorBubblePlot")
2943: && currentPlot instanceof BubblePlot)
2944: ((BubblePlot) currentPlot).getYAxisFormat()
2945: .setAxisLineColor(
2946: (java.awt.Color) ColorSelectorPanel
2947: .parseColorString(""
2948: + evt.getNewValue()));
2949: else if (property.equals("yAxisLabelFontBubblePlot")
2950: && currentPlot instanceof BubblePlot)
2951: ((BubblePlot) currentPlot).getYAxisFormat().setLabelFont(
2952: (it.businesslogic.ireport.IReportFont) evt
2953: .getNewValue());
2954: else if (property.equals("yAxisTickLabelFontBubblePlot")
2955: && currentPlot instanceof BubblePlot)
2956: ((BubblePlot) currentPlot).getYAxisFormat()
2957: .setTickLabelFont(
2958: (it.businesslogic.ireport.IReportFont) evt
2959: .getNewValue());
2960:
2961: else if (property.equals("isShowLinesTimeSeriesPlot")
2962: && currentPlot instanceof TimeSeriesPlot)
2963: ((TimeSeriesPlot) currentPlot).setShowLines(((Boolean) evt
2964: .getNewValue()).booleanValue());
2965: else if (property.equals("isShowShapesTimeSeriesPlot")
2966: && currentPlot instanceof TimeSeriesPlot)
2967: ((TimeSeriesPlot) currentPlot).setShowShapes(((Boolean) evt
2968: .getNewValue()).booleanValue());
2969: else if (property
2970: .equals("timeAxisLabelExpressionTimeSeriesPlot")
2971: && currentPlot instanceof TimeSeriesPlot)
2972: ((TimeSeriesPlot) currentPlot)
2973: .setTimeAxisLabelExpression("" + evt.getNewValue());
2974: else if (property
2975: .equals("valueAxisLabelExpressionTimeSeriesPlot")
2976: && currentPlot instanceof TimeSeriesPlot)
2977: ((TimeSeriesPlot) currentPlot)
2978: .setValueAxisLabelExpression("" + evt.getNewValue());
2979: // TimeSeriesPlot plot > categoryAxisFormat
2980: else if (property.equals("timeAxisLabelColorTimeSeriesPlot")
2981: && currentPlot instanceof TimeSeriesPlot)
2982: ((TimeSeriesPlot) currentPlot).getTimeAxisFormat()
2983: .setLabelColor(
2984: (java.awt.Color) ColorSelectorPanel
2985: .parseColorString(""
2986: + evt.getNewValue()));
2987: else if (property
2988: .equals("timeAxisTickLabelColorTimeSeriesPlot")
2989: && currentPlot instanceof TimeSeriesPlot)
2990: ((TimeSeriesPlot) currentPlot).getTimeAxisFormat()
2991: .setTickLabelColor(
2992: (java.awt.Color) ColorSelectorPanel
2993: .parseColorString(""
2994: + evt.getNewValue()));
2995: else if (property.equals("timeAxisTickLabelMaskTimeSeriesPlot")
2996: && currentPlot instanceof TimeSeriesPlot)
2997: ((TimeSeriesPlot) currentPlot).getTimeAxisFormat()
2998: .setTickLabelMask("" + evt.getNewValue());
2999: else if (property.equals("timeAxisLineColorTimeSeriesPlot")
3000: && currentPlot instanceof TimeSeriesPlot)
3001: ((TimeSeriesPlot) currentPlot).getTimeAxisFormat()
3002: .setAxisLineColor(
3003: (java.awt.Color) ColorSelectorPanel
3004: .parseColorString(""
3005: + evt.getNewValue()));
3006: else if (property.equals("timeAxisLabelFontTimeSeriesPlot")
3007: && currentPlot instanceof TimeSeriesPlot)
3008: ((TimeSeriesPlot) currentPlot).getTimeAxisFormat()
3009: .setLabelFont(
3010: (it.businesslogic.ireport.IReportFont) evt
3011: .getNewValue());
3012: else if (property.equals("timeAxisTickLabelFontTimeSeriesPlot")
3013: && currentPlot instanceof TimeSeriesPlot)
3014: ((TimeSeriesPlot) currentPlot).getTimeAxisFormat()
3015: .setTickLabelFont(
3016: (it.businesslogic.ireport.IReportFont) evt
3017: .getNewValue());
3018: // TimeSeriesPlot plot > valueAxisFormat
3019: else if (property.equals("valueAxisLabelColorTimeSeriesPlot")
3020: && currentPlot instanceof TimeSeriesPlot)
3021: ((TimeSeriesPlot) currentPlot).getValueAxisFormat()
3022: .setLabelColor(
3023: (java.awt.Color) ColorSelectorPanel
3024: .parseColorString(""
3025: + evt.getNewValue()));
3026: else if (property
3027: .equals("valueAxisTickLabelColorTimeSeriesPlot")
3028: && currentPlot instanceof TimeSeriesPlot)
3029: ((TimeSeriesPlot) currentPlot).getValueAxisFormat()
3030: .setTickLabelColor(
3031: (java.awt.Color) ColorSelectorPanel
3032: .parseColorString(""
3033: + evt.getNewValue()));
3034: else if (property
3035: .equals("valueAxisTickLabelMaskTimeSeriesPlot")
3036: && currentPlot instanceof TimeSeriesPlot)
3037: ((TimeSeriesPlot) currentPlot).getValueAxisFormat()
3038: .setTickLabelMask("" + evt.getNewValue());
3039: else if (property.equals("valueAxisLineColorTimeSeriesPlot")
3040: && currentPlot instanceof TimeSeriesPlot)
3041: ((TimeSeriesPlot) currentPlot).getValueAxisFormat()
3042: .setAxisLineColor(
3043: (java.awt.Color) ColorSelectorPanel
3044: .parseColorString(""
3045: + evt.getNewValue()));
3046: else if (property.equals("valueAxisLabelFontTimeSeriesPlot")
3047: && currentPlot instanceof TimeSeriesPlot)
3048: ((TimeSeriesPlot) currentPlot).getValueAxisFormat()
3049: .setLabelFont(
3050: (it.businesslogic.ireport.IReportFont) evt
3051: .getNewValue());
3052: else if (property
3053: .equals("valueAxisTickLabelFontTimeSeriesPlot")
3054: && currentPlot instanceof TimeSeriesPlot)
3055: ((TimeSeriesPlot) currentPlot).getValueAxisFormat()
3056: .setTickLabelFont(
3057: (it.businesslogic.ireport.IReportFont) evt
3058: .getNewValue());
3059:
3060: else if (property.equals("isShowOpenTicksHighLowPlot")
3061: && currentPlot instanceof HighLowPlot)
3062: ((HighLowPlot) currentPlot).setShowOpenTicks(((Boolean) evt
3063: .getNewValue()).booleanValue());
3064: else if (property.equals("isShowCloseTicksHighLowPlot")
3065: && currentPlot instanceof HighLowPlot)
3066: ((HighLowPlot) currentPlot)
3067: .setShowCloseTicks(((Boolean) evt.getNewValue())
3068: .booleanValue());
3069: else if (property.equals("timeAxisLabelExpressionHighLowPlot")
3070: && currentPlot instanceof HighLowPlot)
3071: ((HighLowPlot) currentPlot).setTimeAxisLabelExpression(""
3072: + evt.getNewValue());
3073: else if (property.equals("valueAxisLabelExpressionHighLowPlot")
3074: && currentPlot instanceof HighLowPlot)
3075: ((HighLowPlot) currentPlot).setValueAxisLabelExpression(""
3076: + evt.getNewValue());
3077: // HighLowPlot plot > categoryAxisFormat
3078: else if (property.equals("timeAxisLabelColorHighLowPlot")
3079: && currentPlot instanceof HighLowPlot)
3080: ((HighLowPlot) currentPlot).getTimeAxisFormat()
3081: .setLabelColor(
3082: (java.awt.Color) ColorSelectorPanel
3083: .parseColorString(""
3084: + evt.getNewValue()));
3085: else if (property.equals("timeAxisTickLabelColorHighLowPlot")
3086: && currentPlot instanceof HighLowPlot)
3087: ((HighLowPlot) currentPlot).getTimeAxisFormat()
3088: .setTickLabelColor(
3089: (java.awt.Color) ColorSelectorPanel
3090: .parseColorString(""
3091: + evt.getNewValue()));
3092: else if (property.equals("timeAxisTickLabelMaskHighLowPlot")
3093: && currentPlot instanceof HighLowPlot)
3094: ((HighLowPlot) currentPlot).getTimeAxisFormat()
3095: .setTickLabelMask("" + evt.getNewValue());
3096: else if (property.equals("timeAxisLineColorHighLowPlot")
3097: && currentPlot instanceof HighLowPlot)
3098: ((HighLowPlot) currentPlot).getTimeAxisFormat()
3099: .setAxisLineColor(
3100: (java.awt.Color) ColorSelectorPanel
3101: .parseColorString(""
3102: + evt.getNewValue()));
3103: else if (property.equals("timeAxisLabelFontHighLowPlot")
3104: && currentPlot instanceof HighLowPlot)
3105: ((HighLowPlot) currentPlot).getTimeAxisFormat()
3106: .setLabelFont(
3107: (it.businesslogic.ireport.IReportFont) evt
3108: .getNewValue());
3109: else if (property.equals("timeAxisTickLabelFontHighLowPlot")
3110: && currentPlot instanceof HighLowPlot)
3111: ((HighLowPlot) currentPlot).getTimeAxisFormat()
3112: .setTickLabelFont(
3113: (it.businesslogic.ireport.IReportFont) evt
3114: .getNewValue());
3115: // HighLowPlot plot > valueAxisFormat
3116: else if (property.equals("valueAxisLabelColorHighLowPlot")
3117: && currentPlot instanceof HighLowPlot)
3118: ((HighLowPlot) currentPlot).getValueAxisFormat()
3119: .setLabelColor(
3120: (java.awt.Color) ColorSelectorPanel
3121: .parseColorString(""
3122: + evt.getNewValue()));
3123: else if (property.equals("valueAxisTickLabelColorHighLowPlot")
3124: && currentPlot instanceof HighLowPlot)
3125: ((HighLowPlot) currentPlot).getValueAxisFormat()
3126: .setTickLabelColor(
3127: (java.awt.Color) ColorSelectorPanel
3128: .parseColorString(""
3129: + evt.getNewValue()));
3130: else if (property.equals("valueAxisTickLabelMaskHighLowPlot")
3131: && currentPlot instanceof HighLowPlot)
3132: ((HighLowPlot) currentPlot).getValueAxisFormat()
3133: .setTickLabelMask("" + evt.getNewValue());
3134: else if (property.equals("valueAxisLineColorHighLowPlot")
3135: && currentPlot instanceof HighLowPlot)
3136: ((HighLowPlot) currentPlot).getValueAxisFormat()
3137: .setAxisLineColor(
3138: (java.awt.Color) ColorSelectorPanel
3139: .parseColorString(""
3140: + evt.getNewValue()));
3141: else if (property.equals("valueAxisLabelFontHighLowPlot")
3142: && currentPlot instanceof HighLowPlot)
3143: ((HighLowPlot) currentPlot).getValueAxisFormat()
3144: .setLabelFont(
3145: (it.businesslogic.ireport.IReportFont) evt
3146: .getNewValue());
3147: else if (property.equals("valueAxisTickLabelFontHighLowPlot")
3148: && currentPlot instanceof HighLowPlot)
3149: ((HighLowPlot) currentPlot).getValueAxisFormat()
3150: .setTickLabelFont(
3151: (it.businesslogic.ireport.IReportFont) evt
3152: .getNewValue());
3153:
3154: else if (property.equals("isShowVolumeCandlestickPlot")
3155: && currentPlot instanceof CandlestickPlot)
3156: ((CandlestickPlot) currentPlot)
3157: .setShowVolume(((Boolean) evt.getNewValue())
3158: .booleanValue());
3159: else if (property
3160: .equals("timeAxisLabelExpressionCandlestickPlot")
3161: && currentPlot instanceof CandlestickPlot)
3162: ((CandlestickPlot) currentPlot)
3163: .setTimeAxisLabelExpression("" + evt.getNewValue());
3164: else if (property
3165: .equals("valueAxisLabelExpressionCandlestickPlot")
3166: && currentPlot instanceof CandlestickPlot)
3167: ((CandlestickPlot) currentPlot)
3168: .setValueAxisLabelExpression("" + evt.getNewValue());
3169: // CandlestickPlot plot > categoryAxisFormat
3170: else if (property.equals("timeAxisLabelColorCandlestickPlot")
3171: && currentPlot instanceof CandlestickPlot)
3172: ((CandlestickPlot) currentPlot).getTimeAxisFormat()
3173: .setLabelColor(
3174: (java.awt.Color) ColorSelectorPanel
3175: .parseColorString(""
3176: + evt.getNewValue()));
3177: else if (property
3178: .equals("timeAxisTickLabelColorCandlestickPlot")
3179: && currentPlot instanceof CandlestickPlot)
3180: ((CandlestickPlot) currentPlot).getTimeAxisFormat()
3181: .setTickLabelColor(
3182: (java.awt.Color) ColorSelectorPanel
3183: .parseColorString(""
3184: + evt.getNewValue()));
3185: else if (property
3186: .equals("timeAxisTickLabelMaskCandlestickPlot")
3187: && currentPlot instanceof CandlestickPlot)
3188: ((CandlestickPlot) currentPlot).getTimeAxisFormat()
3189: .setTickLabelMask("" + evt.getNewValue());
3190: else if (property.equals("timeAxisLineColorCandlestickPlot")
3191: && currentPlot instanceof CandlestickPlot)
3192: ((CandlestickPlot) currentPlot).getTimeAxisFormat()
3193: .setAxisLineColor(
3194: (java.awt.Color) ColorSelectorPanel
3195: .parseColorString(""
3196: + evt.getNewValue()));
3197: else if (property.equals("timeAxisLabelFontCandlestickPlot")
3198: && currentPlot instanceof CandlestickPlot)
3199: ((CandlestickPlot) currentPlot).getTimeAxisFormat()
3200: .setLabelFont(
3201: (it.businesslogic.ireport.IReportFont) evt
3202: .getNewValue());
3203: else if (property
3204: .equals("timeAxisTickLabelFontCandlestickPlot")
3205: && currentPlot instanceof CandlestickPlot)
3206: ((CandlestickPlot) currentPlot).getTimeAxisFormat()
3207: .setTickLabelFont(
3208: (it.businesslogic.ireport.IReportFont) evt
3209: .getNewValue());
3210: // CandlestickPlot plot > valueAxisFormat
3211: else if (property.equals("valueAxisLabelColorCandlestickPlot")
3212: && currentPlot instanceof CandlestickPlot)
3213: ((CandlestickPlot) currentPlot).getValueAxisFormat()
3214: .setLabelColor(
3215: (java.awt.Color) ColorSelectorPanel
3216: .parseColorString(""
3217: + evt.getNewValue()));
3218: else if (property
3219: .equals("valueAxisTickLabelColorCandlestickPlot")
3220: && currentPlot instanceof CandlestickPlot)
3221: ((CandlestickPlot) currentPlot).getValueAxisFormat()
3222: .setTickLabelColor(
3223: (java.awt.Color) ColorSelectorPanel
3224: .parseColorString(""
3225: + evt.getNewValue()));
3226: else if (property
3227: .equals("valueAxisTickLabelMaskCandlestickPlot")
3228: && currentPlot instanceof CandlestickPlot)
3229: ((CandlestickPlot) currentPlot).getValueAxisFormat()
3230: .setTickLabelMask("" + evt.getNewValue());
3231: else if (property.equals("valueAxisLineColorCandlestickPlot")
3232: && currentPlot instanceof CandlestickPlot)
3233: ((CandlestickPlot) currentPlot).getValueAxisFormat()
3234: .setAxisLineColor(
3235: (java.awt.Color) ColorSelectorPanel
3236: .parseColorString(""
3237: + evt.getNewValue()));
3238: else if (property.equals("valueAxisLabelFontCandlestickPlot")
3239: && currentPlot instanceof CandlestickPlot)
3240: ((CandlestickPlot) currentPlot).getValueAxisFormat()
3241: .setLabelFont(
3242: (it.businesslogic.ireport.IReportFont) evt
3243: .getNewValue());
3244: else if (property
3245: .equals("valueAxisTickLabelFontCandlestickPlot")
3246: && currentPlot instanceof CandlestickPlot)
3247: ((CandlestickPlot) currentPlot).getValueAxisFormat()
3248: .setTickLabelFont(
3249: (it.businesslogic.ireport.IReportFont) evt
3250: .getNewValue());
3251:
3252: else if (property.equals("shapeMeterPlot")
3253: && currentPlot instanceof MeterPlot)
3254: ((MeterPlot) currentPlot).setShape("" + evt.getNewValue());
3255: else if (property.equals("angleMeterPlot")
3256: && currentPlot instanceof MeterPlot)
3257: ((MeterPlot) currentPlot).setAngle(((Integer) evt
3258: .getNewValue()).intValue());
3259: else if (property.equals("unitsMeterPlot")
3260: && currentPlot instanceof MeterPlot)
3261: ((MeterPlot) currentPlot).setUnits("" + evt.getNewValue());
3262: else if (property.equals("tickIntervalMeterPlot")
3263: && currentPlot instanceof MeterPlot)
3264: ((MeterPlot) currentPlot).setTickInterval(((Double) evt
3265: .getNewValue()).doubleValue());
3266: else if (property.equals("meterColorMaterPlot")
3267: && currentPlot instanceof MeterPlot)
3268: ((MeterPlot) currentPlot)
3269: .setMeterColor((java.awt.Color) ColorSelectorPanel
3270: .parseColorString("" + evt.getNewValue()));
3271: else if (property.equals("needleColorMaterPlot")
3272: && currentPlot instanceof MeterPlot)
3273: ((MeterPlot) currentPlot)
3274: .setNeedleColor((java.awt.Color) ColorSelectorPanel
3275: .parseColorString("" + evt.getNewValue()));
3276: else if (property.equals("tickColorMaterPlot")
3277: && currentPlot instanceof MeterPlot)
3278: ((MeterPlot) currentPlot)
3279: .setTickColor((java.awt.Color) ColorSelectorPanel
3280: .parseColorString("" + evt.getNewValue()));
3281: else if (property.equals("vdColorMeterPlot")
3282: && currentPlot instanceof MeterPlot)
3283: ((MeterPlot) currentPlot).getValueDisplay().setColor(
3284: (java.awt.Color) ColorSelectorPanel
3285: .parseColorString("" + evt.getNewValue()));
3286: else if (property.equals("vdMaskMeterPlot")
3287: && currentPlot instanceof MeterPlot)
3288: ((MeterPlot) currentPlot).getValueDisplay().setMask(
3289: "" + evt.getNewValue());
3290: else if (property.equals("vdFontMeterPlot")
3291: && currentPlot instanceof MeterPlot)
3292: ((MeterPlot) currentPlot).getValueDisplay().setFont(
3293: (it.businesslogic.ireport.IReportFont) evt
3294: .getNewValue());
3295: else if (property.equals("dataRangeLowExpressionMeterPlot")
3296: && currentPlot instanceof MeterPlot)
3297: ((MeterPlot) currentPlot).getDataRange().setLowExpression(
3298: "" + evt.getNewValue());
3299: else if (property.equals("dataRangeHighExpressionMeterPlot")
3300: && currentPlot instanceof MeterPlot)
3301: ((MeterPlot) currentPlot).getDataRange().setHighExpression(
3302: "" + evt.getNewValue());
3303: else if (property.equals("meterIntervalsMeterPlot")
3304: && currentPlot instanceof MeterPlot)
3305: ((MeterPlot) currentPlot)
3306: .setMeterIntervals((java.util.List) evt
3307: .getNewValue());
3308:
3309: else if (property.equals("valueLocationThermometerPlot")
3310: && currentPlot instanceof ThermometerPlot)
3311: ((ThermometerPlot) currentPlot).setValueLocation(""
3312: + evt.getNewValue());
3313: else if (property.equals("showValueLinesThermometerPlot")
3314: && currentPlot instanceof ThermometerPlot)
3315: ((ThermometerPlot) currentPlot)
3316: .setShowValueLines(((Boolean) evt.getNewValue())
3317: .booleanValue());
3318: else if (property.equals("mercuryColorThermometerPlot")
3319: && currentPlot instanceof ThermometerPlot)
3320: ((ThermometerPlot) currentPlot)
3321: .setMercuryColor((java.awt.Color) ColorSelectorPanel
3322: .parseColorString("" + evt.getNewValue()));
3323: else if (property.equals("vdColorThermometerPlot")
3324: && currentPlot instanceof ThermometerPlot)
3325: ((ThermometerPlot) currentPlot).getValueDisplay().setColor(
3326: (java.awt.Color) ColorSelectorPanel
3327: .parseColorString("" + evt.getNewValue()));
3328: else if (property.equals("vdMaskThermometerPlot")
3329: && currentPlot instanceof ThermometerPlot)
3330: ((ThermometerPlot) currentPlot).getValueDisplay().setMask(
3331: "" + evt.getNewValue());
3332: else if (property.equals("vdFontThermometerPlot")
3333: && currentPlot instanceof ThermometerPlot)
3334: ((ThermometerPlot) currentPlot).getValueDisplay().setFont(
3335: (it.businesslogic.ireport.IReportFont) evt
3336: .getNewValue());
3337: else if (property
3338: .equals("dataRangeLowExpressionThermometerPlot")
3339: && currentPlot instanceof ThermometerPlot)
3340: ((ThermometerPlot) currentPlot).getDataRange()
3341: .setLowExpression("" + evt.getNewValue());
3342: else if (property
3343: .equals("dataRangeHighExpressionThermometerPlot")
3344: && currentPlot instanceof ThermometerPlot)
3345: ((ThermometerPlot) currentPlot).getDataRange()
3346: .setHighExpression("" + evt.getNewValue());
3347: else if (property
3348: .equals("lowRangeLowExpressionThermometerPlot")
3349: && currentPlot instanceof ThermometerPlot)
3350: ((ThermometerPlot) currentPlot).getLowRange()
3351: .setLowExpression("" + evt.getNewValue());
3352: else if (property
3353: .equals("lowRangeHighExpressionThermometerPlot")
3354: && currentPlot instanceof ThermometerPlot)
3355: ((ThermometerPlot) currentPlot).getLowRange()
3356: .setHighExpression("" + evt.getNewValue());
3357: else if (property
3358: .equals("mediumRangeLowExpressionThermometerPlot")
3359: && currentPlot instanceof ThermometerPlot)
3360: ((ThermometerPlot) currentPlot).getMediumRange()
3361: .setLowExpression("" + evt.getNewValue());
3362: else if (property
3363: .equals("mediumRangeHighExpressionThermometerPlot")
3364: && currentPlot instanceof ThermometerPlot)
3365: ((ThermometerPlot) currentPlot).getMediumRange()
3366: .setHighExpression("" + evt.getNewValue());
3367: else if (property
3368: .equals("highRangeLowExpressionThermometerPlot")
3369: && currentPlot instanceof ThermometerPlot)
3370: ((ThermometerPlot) currentPlot).getHighRange()
3371: .setLowExpression("" + evt.getNewValue());
3372: else if (property
3373: .equals("highRangeHighExpressionThermometerPlot")
3374: && currentPlot instanceof ThermometerPlot)
3375: ((ThermometerPlot) currentPlot).getHighRange()
3376: .setHighExpression("" + evt.getNewValue());
3377:
3378: if (getJReportFrame() != null) {
3379: this .getJReportFrame().getReport().incrementReportChanges();
3380: }
3381: }
3382:
3383: /**
3384: * This method update the comboboxes where is present the goup list.
3385: */
3386: public void updateGroups() {
3387:
3388: if (it.businesslogic.ireport.gui.MainFrame.getMainInstance()
3389: .getActiveReportFrame() == null) {
3390: jComboBoxResetGroup.removeAllItems();
3391: jComboBoxResetGroup.addItem("");
3392: } else {
3393: Misc.updateStringComboBox(jComboBoxResetGroup,
3394: it.businesslogic.ireport.gui.MainFrame
3395: .getMainInstance().getActiveReportFrame()
3396: .getReport().getGroups(), true);
3397: Misc.updateStringComboBox(jComboBoxIncrementGroup,
3398: it.businesslogic.ireport.gui.MainFrame
3399: .getMainInstance().getActiveReportFrame()
3400: .getReport().getGroups(), true);
3401: }
3402:
3403: }
3404:
3405: public void updateSubDatasets() {
3406:
3407: if (it.businesslogic.ireport.gui.MainFrame.getMainInstance()
3408: .getActiveReportFrame() == null) {
3409: jComboBoxSubDataset.removeAllItems();
3410: jComboBoxSubDataset.addItem("");
3411: } else {
3412: Misc.updateComboBox(jComboBoxSubDataset,
3413: it.businesslogic.ireport.gui.MainFrame
3414: .getMainInstance().getActiveReportFrame()
3415: .getReport().getSubDatasets(), true);
3416: }
3417: }
3418:
3419: public void applyI18n() {
3420: // Start autogenerated code ----------------------
3421: jButtonAdd.setText(I18n.getString(
3422: "chartPropertiesDialog.buttonAdd", "Add"));
3423: jButtonAddParameter.setText(I18n.getString(
3424: "chartPropertiesDialog.buttonAddParameter", "Add"));
3425: jButtonClose.setText(I18n.getString(
3426: "chartPropertiesDialog.buttonClose", "Close"));
3427: jButtonDelete.setText(I18n.getString(
3428: "chartPropertiesDialog.buttonDelete", "Delete"));
3429: jButtonModParameter.setText(I18n.getString(
3430: "chartPropertiesDialog.buttonModParameter", "Modify"));
3431: jButtonModify.setText(I18n.getString(
3432: "chartPropertiesDialog.buttonModify", "Edit chart"));
3433: jButtonMoveDown.setText(I18n.getString(
3434: "chartPropertiesDialog.buttonMoveDown", "Move down"));
3435: jButtonMoveUp.setText(I18n.getString(
3436: "chartPropertiesDialog.buttonMoveUp", "Move up"));
3437: jButtonRemParameter.setText(I18n.getString(
3438: "chartPropertiesDialog.buttonRemParameter", "Remove"));
3439: jLabel26.setText(I18n.getString(
3440: "chartPropertiesDialog.label26",
3441: "Parameters Map Expression"));
3442: jLabel41.setText(I18n.getString(
3443: "chartPropertiesDialog.label41",
3444: "Connection / Datasource Expression"));
3445: jLabelIncrementType1.setText(I18n.getString(
3446: "chartPropertiesDialog.labelIncrementType1",
3447: "Sub dataset"));
3448: jLabelIncrementType2.setText(I18n.getString(
3449: "chartPropertiesDialog.labelIncrementType2",
3450: "Increment When expression"));
3451: // End autogenerated code ----------------------
3452: jTabbedPane1.setTitleAt(0, it.businesslogic.ireport.util.I18n
3453: .getString(
3454: "gui.ChartPropertiesDialog.TabChartProperties",
3455: "Chart properties"));
3456: jTabbedPane1.setTitleAt(1, it.businesslogic.ireport.util.I18n
3457: .getString("gui.ChartPropertiesDialog.TabChartData",
3458: "Chart data"));
3459: jLabelTypeOfData.setText(it.businesslogic.ireport.util.I18n
3460: .getString(
3461: "gui.ChartPropertiesDialog.LabelTypeOfDataset",
3462: "Type of dataset"));
3463: jTabbedPaneData.setTitleAt(0,
3464: it.businesslogic.ireport.util.I18n.getString(
3465: "gui.ChartPropertiesDialog.TabDataset",
3466: "Dataset"));
3467: jTabbedPaneData.setTitleAt(1,
3468: it.businesslogic.ireport.util.I18n.getString(
3469: "gui.ChartPropertiesDialog.TabDatasetDetails",
3470: "Details"));
3471:
3472: jLabelResetType.setText(it.businesslogic.ireport.util.I18n
3473: .getString("resetType", "Reset type"));
3474: jLabelResetGroup.setText(it.businesslogic.ireport.util.I18n
3475: .getString("resetGroup", "Reset group"));
3476: jLabelIncrementType.setText(it.businesslogic.ireport.util.I18n
3477: .getString("incrementType", "Increment type"));
3478: jLabelIncrementGroup.setText(it.businesslogic.ireport.util.I18n
3479: .getString("incrementGroup", "Increment group"));
3480:
3481: jButtonCopy.setText(it.businesslogic.ireport.util.I18n
3482: .getString("charts.copyDataset", "Copy dataset"));
3483: jButtonPaste.setText(it.businesslogic.ireport.util.I18n
3484: .getString("charts.pasteDataset", "Paste dataset"));
3485:
3486: this .setTitle(it.businesslogic.ireport.util.I18n.getString(
3487: "gui.ChartPropertiesDialog.title", "Chart properties"));
3488:
3489: jTableDatasetParameters
3490: .getColumnModel()
3491: .getColumn(0)
3492: .setHeaderValue(
3493: I18n
3494: .getString(
3495: "chartPropertiesDialog.tablecolumn.parameter",
3496: "Parameter"));
3497: jTableDatasetParameters
3498: .getColumnModel()
3499: .getColumn(1)
3500: .setHeaderValue(
3501: I18n
3502: .getString(
3503: "chartPropertiesDialog.tablecolumn.expression",
3504: "Expression"));
3505:
3506: jTable1.getColumnModel().getColumn(0).setHeaderValue(
3507: I18n.getString(
3508: "chartPropertiesDialog.tablecolumn.chart",
3509: "Chart"));
3510: jTable1
3511: .getColumnModel()
3512: .getColumn(1)
3513: .setHeaderValue(
3514: I18n
3515: .getString(
3516: "chartPropertiesDialog.tablecolumn.axisPosition",
3517: "Axis position"));
3518:
3519: jTabbedPaneSubDataset.setTitleAt(0,
3520: it.businesslogic.ireport.util.I18n.getString(
3521: "datasetRun.tab.Parameters", "Parameters"));
3522: jTabbedPaneSubDataset.setTitleAt(1,
3523: it.businesslogic.ireport.util.I18n.getString(
3524: "datasetRun.tab.ParametersMapExp",
3525: "Parameters map exp."));
3526: jTabbedPaneSubDataset.setTitleAt(2,
3527: it.businesslogic.ireport.util.I18n.getString(
3528: "datasetRun.tab.ConnectionDatasourceExp",
3529: "Connection/Datasource exp."));
3530:
3531: ((javax.swing.border.TitledBorder) jPanel1.getBorder())
3532: .setTitle(I18n.getString(
3533: "datasetRun.panelBorder.DatasetRun",
3534: "Dataset run"));
3535:
3536: this .getRootPane().updateUI();
3537: }
3538:
3539: private void setDatasetPanel(Dataset dataset) {
3540: jPanelDataDefinition.removeAll();
3541:
3542: java.awt.GridBagConstraints gridBagConstraints = new java.awt.GridBagConstraints();
3543: gridBagConstraints.gridx = 4;
3544: gridBagConstraints.gridy = 2;
3545: gridBagConstraints.anchor = java.awt.GridBagConstraints.WEST;
3546: gridBagConstraints.weightx = 1.0;
3547: gridBagConstraints.weighty = 1.0;
3548: gridBagConstraints.fill = gridBagConstraints.BOTH;
3549: gridBagConstraints.insets = new java.awt.Insets(4, 4, 4, 4);
3550:
3551: if (dataset instanceof TimePeriodDataset) {
3552: TimePeriodDatasetPanel pdp = new TimePeriodDatasetPanel();
3553: pdp.setTimePeriodDataset((TimePeriodDataset) dataset);
3554: this .jPanelDataDefinition.add(pdp, gridBagConstraints);
3555: } else if (dataset instanceof CategoryDataset) {
3556: CategoryDatasetPanel pdp = new CategoryDatasetPanel();
3557: pdp.setCategoryDataset((CategoryDataset) dataset);
3558: this .jPanelDataDefinition.add(pdp, gridBagConstraints);
3559: } else if (dataset instanceof PieDataset) {
3560: PieDatasetPanel pdp = new PieDatasetPanel();
3561: pdp.setPieDataset((PieDataset) dataset);
3562: this .jPanelDataDefinition.add(pdp, gridBagConstraints);
3563: } else if (dataset instanceof TimeSeriesDataset) {
3564: TimeSeriesDatasetPanel pdp = new TimeSeriesDatasetPanel();
3565: pdp.setTimeSeriesDataset((TimeSeriesDataset) dataset);
3566: this .jPanelDataDefinition.add(pdp, gridBagConstraints);
3567: } else if (dataset instanceof XYDataset) {
3568: XYDatasetPanel pdp = new XYDatasetPanel();
3569: pdp.setXYDataset((XYDataset) dataset);
3570: this .jPanelDataDefinition.add(pdp, gridBagConstraints);
3571: } else if (dataset instanceof XYZDataset) {
3572: XYZDatasetPanel pdp = new XYZDatasetPanel();
3573: pdp.setXYZDataset((XYZDataset) dataset);
3574: this .jPanelDataDefinition.add(pdp, gridBagConstraints);
3575: } else if (dataset instanceof HighLowDataset) {
3576: HighLowDatasetPanel pdp = new HighLowDatasetPanel();
3577: pdp.setHighLowDataset((HighLowDataset) dataset);
3578: this .jPanelDataDefinition.add(pdp, gridBagConstraints);
3579: } else if (dataset instanceof ValueDataset) {
3580: ValueDatasetPanel pdp = new ValueDatasetPanel();
3581: pdp.setValueDataset((ValueDataset) dataset);
3582: this .jPanelDataDefinition.add(pdp, gridBagConstraints);
3583: }
3584:
3585: Misc.setComboboxSelectedTagValue(jComboBoxTypeOfData, dataset
3586: .getClass().getName());
3587:
3588: if (dataset != null && dataset.getSubDataset() != null) {
3589: setDatasetSubDataset(dataset.getSubDataset());
3590: }
3591:
3592: jPanelDataDefinition.updateUI();
3593: }
3594:
3595: /**
3596: * this method notifies a chart dataset panel the subdataset used to fill it
3597: */
3598: public void setDatasetSubDataset(SubDataset subdataset) {
3599: Component c = this .jPanelDataDefinition.getComponent(0);
3600:
3601: ((ChartDatasetPanel) c).setSubDataset(subdataset);
3602:
3603: }
3604:
3605: private void setPlotSheetProperties(Plot plot) {
3606: if (plot instanceof PiePlot) {
3607: SheetProperty isCircularProperty = new SheetProperty(
3608: "isCircular",
3609: it.businesslogic.ireport.util.I18n.getString(
3610: "charts.isCircular", "Circular"),
3611: SheetProperty.BOOLEAN);
3612: isCircularProperty.setValue(new Boolean(((PiePlot) plot)
3613: .isCircular()));
3614: sheetPanel.addSheetProperty("Pie plot", isCircularProperty);
3615: } else if (plot instanceof Pie3DPlot) {
3616: SheetProperty isCircularProperty = new SheetProperty(
3617: "isCircular",
3618: it.businesslogic.ireport.util.I18n.getString(
3619: "charts.isCircular", "Circular"),
3620: SheetProperty.BOOLEAN);
3621: isCircularProperty.setValue(new Boolean(((Pie3DPlot) plot)
3622: .isCircular()));
3623: sheetPanel.addSheetProperty("Pie3D plot",
3624: isCircularProperty);
3625:
3626: DoubleSheetProperty chartDepthFactorProperty = new DoubleSheetProperty(
3627: "depthFactor", it.businesslogic.ireport.util.I18n
3628: .getString("charts.depthFactor",
3629: "Depth factor"));
3630: chartDepthFactorProperty.setValue(new Double(
3631: ((Pie3DPlot) plot).getDepthFactor()));
3632: sheetPanel.addSheetProperty("Pie3D plot",
3633: chartDepthFactorProperty);
3634: } else if (plot instanceof BarPlot) {
3635: SheetProperty isShowLabelsProperty = new SheetProperty(
3636: "isShowLabelsBarPlot",
3637: it.businesslogic.ireport.util.I18n
3638: .getString("charts.isShowLabelsBarPlot",
3639: "Show labels"),
3640: SheetProperty.BOOLEAN);
3641: isShowLabelsProperty.setValue(new Boolean(((BarPlot) plot)
3642: .isShowLabels()));
3643: sheetPanel.addSheetProperty("Bar plot",
3644: isShowLabelsProperty);
3645:
3646: SheetProperty isShowTickMarksProperty = new SheetProperty(
3647: "isShowTickMarksBarPlot",
3648: it.businesslogic.ireport.util.I18n.getString(
3649: "charts.isShowTickMarksBarPlot",
3650: "Show tick marks"), SheetProperty.BOOLEAN);
3651: isShowTickMarksProperty.setValue(new Boolean(
3652: ((BarPlot) plot).isShowTickMarks()));
3653: sheetPanel.addSheetProperty("Bar plot",
3654: isShowTickMarksProperty);
3655:
3656: SheetProperty isShowTickLabelsProperty = new SheetProperty(
3657: "isShowTickLabelsBarPlot",
3658: it.businesslogic.ireport.util.I18n.getString(
3659: "charts.isShowTickLabelsBarPlot",
3660: "Show tick labels"), SheetProperty.BOOLEAN);
3661: isShowTickLabelsProperty.setValue(new Boolean(
3662: ((BarPlot) plot).isShowTickLabels()));
3663: sheetPanel.addSheetProperty("Bar plot",
3664: isShowTickLabelsProperty);
3665:
3666: ExpressionSheetProperty categoryAxisLabelExpressionProperty = new ExpressionSheetProperty(
3667: "categoryAxisLabelExpressionBarPlot",
3668: it.businesslogic.ireport.util.I18n.getString(
3669: "charts.categoryAxisLabelExpressionPlot",
3670: "Category axis label expression"));
3671: categoryAxisLabelExpressionProperty
3672: .setValue(((BarPlot) plot)
3673: .getCategoryAxisLabelExpression());
3674: sheetPanel.addSheetProperty("Bar plot",
3675: categoryAxisLabelExpressionProperty);
3676:
3677: addAxisFormatEntries("category", ((BarPlot) plot)
3678: .getCategoryAxisFormat(), "Bar plot", "BarPlot");
3679:
3680: ExpressionSheetProperty valueAxisLabelExpressionProperty = new ExpressionSheetProperty(
3681: "valueAxisLabelExpressionBarPlot",
3682: it.businesslogic.ireport.util.I18n.getString(
3683: "charts.valueAxisLabelExpressionPlot",
3684: "Value axis label expression"));
3685: valueAxisLabelExpressionProperty.setValue(((BarPlot) plot)
3686: .getValueAxisLabelExpression());
3687: sheetPanel.addSheetProperty("Bar plot",
3688: valueAxisLabelExpressionProperty);
3689:
3690: addAxisFormatEntries("value", ((BarPlot) plot)
3691: .getValueAxisFormat(), "Bar plot", "BarPlot");
3692: } else if (plot instanceof Bar3DPlot) {
3693: SheetProperty isShowLabelsProperty = new SheetProperty(
3694: "isShowLabelsBar3DPlot", "Show labels",
3695: SheetProperty.BOOLEAN);
3696: isShowLabelsProperty.setValue(new Boolean(
3697: ((Bar3DPlot) plot).isShowLabels()));
3698: sheetPanel.addSheetProperty("Bar3D plot",
3699: isShowLabelsProperty);
3700:
3701: DoubleSheetProperty yOffsetProperty = new DoubleSheetProperty(
3702: "xOffsetBar3DPlot", "X offset");
3703: yOffsetProperty.setValue(new Double(((Bar3DPlot) plot)
3704: .getXOffset()));
3705: sheetPanel.addSheetProperty("Bar3D plot", yOffsetProperty);
3706:
3707: DoubleSheetProperty xOffsetProperty = new DoubleSheetProperty(
3708: "yOffsetBar3DPlot", "Y offset");
3709: xOffsetProperty.setValue(new Double(((Bar3DPlot) plot)
3710: .getYOffset()));
3711: sheetPanel.addSheetProperty("Bar3D plot", xOffsetProperty);
3712:
3713: ExpressionSheetProperty categoryAxisLabelExpressionProperty = new ExpressionSheetProperty(
3714: "categoryAxisLabelExpressionBar3DPlot",
3715: it.businesslogic.ireport.util.I18n.getString(
3716: "charts.categoryAxisLabelExpressionPlot",
3717: "Category axis label expression"));
3718: categoryAxisLabelExpressionProperty
3719: .setValue(((Bar3DPlot) plot)
3720: .getCategoryAxisLabelExpression());
3721: sheetPanel.addSheetProperty("Bar3D plot",
3722: categoryAxisLabelExpressionProperty);
3723:
3724: addAxisFormatEntries("category", ((Bar3DPlot) plot)
3725: .getCategoryAxisFormat(), "Bar3D plot", "Bar3DPlot");
3726:
3727: ExpressionSheetProperty valueAxisLabelExpressionProperty = new ExpressionSheetProperty(
3728: "valueAxisLabelExpressionBar3DPlot",
3729: it.businesslogic.ireport.util.I18n.getString(
3730: "charts.valueAxisLabelExpressionPlot",
3731: "Value axis label expression"));
3732: valueAxisLabelExpressionProperty
3733: .setValue(((Bar3DPlot) plot)
3734: .getValueAxisLabelExpression());
3735: sheetPanel.addSheetProperty("Bar3D plot",
3736: valueAxisLabelExpressionProperty);
3737:
3738: addAxisFormatEntries("value", ((Bar3DPlot) plot)
3739: .getValueAxisFormat(), "Bar3D plot", "Bar3DPlot");
3740: } else if (plot instanceof LinePlot) {
3741: SheetProperty isShowLinesProperty = new SheetProperty(
3742: "isShowLinesLinePlot",
3743: it.businesslogic.ireport.util.I18n.getString(
3744: "charts.isShowLinesPlot", "Show lines"),
3745: SheetProperty.BOOLEAN);
3746: isShowLinesProperty.setValue(new Boolean(((LinePlot) plot)
3747: .isShowLines()));
3748: sheetPanel.addSheetProperty("Line plot",
3749: isShowLinesProperty);
3750:
3751: SheetProperty isShowShapesProperty = new SheetProperty(
3752: "isShowShapesLinePlot",
3753: it.businesslogic.ireport.util.I18n.getString(
3754: "charts.isShowShapesPlot", "Show shapes"),
3755: SheetProperty.BOOLEAN);
3756: isShowShapesProperty.setValue(new Boolean(((LinePlot) plot)
3757: .isShowShapes()));
3758: sheetPanel.addSheetProperty("Line plot",
3759: isShowShapesProperty);
3760:
3761: ExpressionSheetProperty categoryAxisLabelExpressionProperty = new ExpressionSheetProperty(
3762: "categoryAxisLabelExpressionLinePlot",
3763: it.businesslogic.ireport.util.I18n.getString(
3764: "charts.categoryAxisLabelExpressionPlot",
3765: "Category axis label expression"));
3766: categoryAxisLabelExpressionProperty
3767: .setValue(((LinePlot) plot)
3768: .getCategoryAxisLabelExpression());
3769: sheetPanel.addSheetProperty("Line plot",
3770: categoryAxisLabelExpressionProperty);
3771:
3772: addAxisFormatEntries("category", ((LinePlot) plot)
3773: .getCategoryAxisFormat(), "Line plot", "LinePlot");
3774:
3775: ExpressionSheetProperty valueAxisLabelExpressionProperty = new ExpressionSheetProperty(
3776: "valueAxisLabelExpressionLinePlot",
3777: it.businesslogic.ireport.util.I18n.getString(
3778: "charts.valueAxisLabelExpressionPlot",
3779: "Value axis label expression"));
3780: valueAxisLabelExpressionProperty.setValue(((LinePlot) plot)
3781: .getValueAxisLabelExpression());
3782: sheetPanel.addSheetProperty("Line plot",
3783: valueAxisLabelExpressionProperty);
3784:
3785: addAxisFormatEntries("value", ((LinePlot) plot)
3786: .getValueAxisFormat(), "Line plot", "LinePlot");
3787:
3788: } else if (plot instanceof AreaPlot) {
3789: ExpressionSheetProperty categoryAxisLabelExpressionProperty = new ExpressionSheetProperty(
3790: "categoryAxisLabelExpressionAreaPlot",
3791: it.businesslogic.ireport.util.I18n.getString(
3792: "charts.categoryAxisLabelExpressionPlot",
3793: "Category axis label expression"));
3794: categoryAxisLabelExpressionProperty
3795: .setValue(((AreaPlot) plot)
3796: .getCategoryAxisLabelExpression());
3797: sheetPanel.addSheetProperty("Area plot",
3798: categoryAxisLabelExpressionProperty);
3799:
3800: addAxisFormatEntries("category", ((AreaPlot) plot)
3801: .getCategoryAxisFormat(), "Area plot", "AreaPlot");
3802:
3803: ExpressionSheetProperty valueAxisLabelExpressionProperty = new ExpressionSheetProperty(
3804: "valueAxisLabelExpressionAreaPlot",
3805: it.businesslogic.ireport.util.I18n.getString(
3806: "charts.valueAxisLabelExpressionPlot",
3807: "Value axis label expression"));
3808: valueAxisLabelExpressionProperty.setValue(((AreaPlot) plot)
3809: .getValueAxisLabelExpression());
3810: sheetPanel.addSheetProperty("Area plot",
3811: valueAxisLabelExpressionProperty);
3812:
3813: addAxisFormatEntries("value", ((AreaPlot) plot)
3814: .getValueAxisFormat(), "Area plot", "AreaPlot");
3815: } else if (plot instanceof ScatterPlot) {
3816: SheetProperty isShowLinesProperty = new SheetProperty(
3817: "isShowLinesScatterPlot",
3818: it.businesslogic.ireport.util.I18n.getString(
3819: "charts.isShowLinesPlot", "Show lines"),
3820: SheetProperty.BOOLEAN);
3821: isShowLinesProperty.setValue(new Boolean(
3822: ((ScatterPlot) plot).isShowLines()));
3823: sheetPanel.addSheetProperty("Scatter plot",
3824: isShowLinesProperty);
3825:
3826: SheetProperty isShowShapesProperty = new SheetProperty(
3827: "isShowShapesScatterPlot",
3828: it.businesslogic.ireport.util.I18n.getString(
3829: "charts.isShowShapesPlot", "Show shapes"),
3830: SheetProperty.BOOLEAN);
3831: isShowShapesProperty.setValue(new Boolean(
3832: ((ScatterPlot) plot).isShowShapes()));
3833: sheetPanel.addSheetProperty("Scatter plot",
3834: isShowShapesProperty);
3835:
3836: ExpressionSheetProperty categoryAxisLabelExpressionProperty = new ExpressionSheetProperty(
3837: "xAxisLabelExpressionScatterPlot",
3838: it.businesslogic.ireport.util.I18n.getString(
3839: "charts.xAxisLabelExpressionPlot",
3840: "X axis label expression"));
3841: categoryAxisLabelExpressionProperty
3842: .setValue(((ScatterPlot) plot)
3843: .getXAxisLabelExpression());
3844: sheetPanel.addSheetProperty("Scatter plot",
3845: categoryAxisLabelExpressionProperty);
3846:
3847: addAxisFormatEntries("x", ((ScatterPlot) plot)
3848: .getXAxisFormat(), "Scatter plot", "ScatterPlot");
3849:
3850: ExpressionSheetProperty valueAxisLabelExpressionProperty = new ExpressionSheetProperty(
3851: "yAxisLabelExpressionScatterPlot",
3852: it.businesslogic.ireport.util.I18n.getString(
3853: "charts.yAxisLabelExpressionPlot",
3854: "Y axis label expression"));
3855: valueAxisLabelExpressionProperty
3856: .setValue(((ScatterPlot) plot)
3857: .getYAxisLabelExpression());
3858: sheetPanel.addSheetProperty("Scatter plot",
3859: valueAxisLabelExpressionProperty);
3860:
3861: addAxisFormatEntries("y", ((ScatterPlot) plot)
3862: .getYAxisFormat(), "Scatter plot", "ScatterPlot");
3863:
3864: } else if (plot instanceof BubblePlot) {
3865: //BothAxes | DomainAxis | RangeAxis
3866: SheetProperty scaleTypeProperty = new SheetProperty(
3867: "scaleTypeBubblePlot",
3868: it.businesslogic.ireport.util.I18n.getString(
3869: "charts.scaleTypeBubblePlot", "Scale type"),
3870: SheetProperty.COMBOBOX);
3871: scaleTypeProperty
3872: .setTags(new Tag[] {
3873: new Tag(
3874: "BothAxes",
3875: it.businesslogic.ireport.util.I18n
3876: .getString(
3877: "charts.scaleType.BothAxes",
3878: "Both axes")),
3879: new Tag(
3880: "DomainAxis",
3881: it.businesslogic.ireport.util.I18n
3882: .getString(
3883: "charts.scaleType.DomainAxis",
3884: "Domain axis")),
3885: new Tag(
3886: "RangeAxis",
3887: it.businesslogic.ireport.util.I18n
3888: .getString(
3889: "charts.scaleType.RangeAxis",
3890: "Range axis")) });
3891: scaleTypeProperty.setValue(((BubblePlot) plot)
3892: .getScaleType());
3893: sheetPanel.addSheetProperty("Bubble plot",
3894: scaleTypeProperty);
3895:
3896: ExpressionSheetProperty categoryAxisLabelExpressionProperty = new ExpressionSheetProperty(
3897: "xAxisLabelExpressionBubblePlot",
3898: it.businesslogic.ireport.util.I18n.getString(
3899: "charts.xAxisLabelExpressionPlot",
3900: "X axis label expression"));
3901: categoryAxisLabelExpressionProperty
3902: .setValue(((BubblePlot) plot)
3903: .getXAxisLabelExpression());
3904: sheetPanel.addSheetProperty("Bubble plot",
3905: categoryAxisLabelExpressionProperty);
3906:
3907: addAxisFormatEntries("x", ((BubblePlot) plot)
3908: .getXAxisFormat(), "Bubble plot", "BubblePlot");
3909:
3910: ExpressionSheetProperty valueAxisLabelExpressionProperty = new ExpressionSheetProperty(
3911: "yAxisLabelExpressionBubblePlot",
3912: it.businesslogic.ireport.util.I18n.getString(
3913: "charts.yAxisLabelExpressionPlot",
3914: "Y axis label expression"));
3915: valueAxisLabelExpressionProperty
3916: .setValue(((BubblePlot) plot)
3917: .getYAxisLabelExpression());
3918: sheetPanel.addSheetProperty("Bubble plot",
3919: valueAxisLabelExpressionProperty);
3920:
3921: addAxisFormatEntries("y", ((BubblePlot) plot)
3922: .getYAxisFormat(), "Bubble plot", "BubblePlot");
3923:
3924: } else if (plot instanceof TimeSeriesPlot) {
3925: SheetProperty isShowLinesProperty = new SheetProperty(
3926: "isShowLinesTimeSeriesPlot",
3927: it.businesslogic.ireport.util.I18n.getString(
3928: "charts.isShowLinesPlot", "Show lines"),
3929: SheetProperty.BOOLEAN);
3930: isShowLinesProperty.setValue(new Boolean(
3931: ((TimeSeriesPlot) plot).isShowLines()));
3932: sheetPanel.addSheetProperty("Time series plot",
3933: isShowLinesProperty);
3934:
3935: SheetProperty isShowShapesProperty = new SheetProperty(
3936: "isShowShapesTimeSeriesPlot",
3937: it.businesslogic.ireport.util.I18n.getString(
3938: "charts.isShowShapesPlot", "Show shapes"),
3939: SheetProperty.BOOLEAN);
3940: isShowShapesProperty.setValue(new Boolean(
3941: ((TimeSeriesPlot) plot).isShowShapes()));
3942: sheetPanel.addSheetProperty("Time series plot",
3943: isShowShapesProperty);
3944:
3945: ExpressionSheetProperty timeAxisLabelExpressionProperty = new ExpressionSheetProperty(
3946: "timeAxisLabelExpressionTimeSeriesPlot",
3947: it.businesslogic.ireport.util.I18n.getString(
3948: "charts.timeAxisLabelExpressionPlot",
3949: "Time axis label expression"));
3950: timeAxisLabelExpressionProperty
3951: .setValue(((TimeSeriesPlot) plot)
3952: .getTimeAxisLabelExpression());
3953: sheetPanel.addSheetProperty("Time series plot",
3954: timeAxisLabelExpressionProperty);
3955:
3956: addAxisFormatEntries("time", ((TimeSeriesPlot) plot)
3957: .getTimeAxisFormat(), "Time series plot",
3958: "TimeSeriesPlot");
3959:
3960: ExpressionSheetProperty valueAxisLabelExpressionProperty = new ExpressionSheetProperty(
3961: "valueAxisLabelExpressionTimeSeriesPlot",
3962: it.businesslogic.ireport.util.I18n.getString(
3963: "charts.valueAxisLabelExpressionPlot",
3964: "Value axis label expression"));
3965: valueAxisLabelExpressionProperty
3966: .setValue(((TimeSeriesPlot) plot)
3967: .getValueAxisLabelExpression());
3968: sheetPanel.addSheetProperty("Time series plot",
3969: valueAxisLabelExpressionProperty);
3970:
3971: addAxisFormatEntries("value", ((TimeSeriesPlot) plot)
3972: .getValueAxisFormat(), "Time series plot",
3973: "TimeSeriesPlot");
3974:
3975: } else if (plot instanceof HighLowPlot) {
3976: SheetProperty isShowLinesProperty = new SheetProperty(
3977: "isShowCloseTicksHighLowPlot",
3978: it.businesslogic.ireport.util.I18n.getString(
3979: "charts.isShowCloseTicksPlot",
3980: "Show close ticks"), SheetProperty.BOOLEAN);
3981: isShowLinesProperty.setValue(new Boolean(
3982: ((HighLowPlot) plot).isShowCloseTicks()));
3983: sheetPanel.addSheetProperty("High low plot",
3984: isShowLinesProperty);
3985:
3986: SheetProperty isShowShapesProperty = new SheetProperty(
3987: "isShowOpenTicksHighLowPlot",
3988: it.businesslogic.ireport.util.I18n.getString(
3989: "charts.isShowOpenTicksPlot",
3990: "Show open ticks"), SheetProperty.BOOLEAN);
3991: isShowShapesProperty.setValue(new Boolean(
3992: ((HighLowPlot) plot).isShowOpenTicks()));
3993: sheetPanel.addSheetProperty("High low plot",
3994: isShowShapesProperty);
3995:
3996: ExpressionSheetProperty timeAxisLabelExpressionProperty = new ExpressionSheetProperty(
3997: "timeAxisLabelExpressionHighLowPlot",
3998: it.businesslogic.ireport.util.I18n.getString(
3999: "charts.timeAxisLabelExpressionPlot",
4000: "Time axis label expression"));
4001: timeAxisLabelExpressionProperty
4002: .setValue(((HighLowPlot) plot)
4003: .getTimeAxisLabelExpression());
4004: sheetPanel.addSheetProperty("High low plot",
4005: timeAxisLabelExpressionProperty);
4006:
4007: addAxisFormatEntries("time", ((HighLowPlot) plot)
4008: .getTimeAxisFormat(), "High low plot",
4009: "HighLowPlot");
4010:
4011: ExpressionSheetProperty valueAxisLabelExpressionProperty = new ExpressionSheetProperty(
4012: "valueAxisLabelExpressionHighLowPlot",
4013: it.businesslogic.ireport.util.I18n.getString(
4014: "charts.valueAxisLabelExpressionPlot",
4015: "Value axis label expression"));
4016: valueAxisLabelExpressionProperty
4017: .setValue(((HighLowPlot) plot)
4018: .getValueAxisLabelExpression());
4019: sheetPanel.addSheetProperty("High low plot",
4020: valueAxisLabelExpressionProperty);
4021:
4022: addAxisFormatEntries("value", ((HighLowPlot) plot)
4023: .getValueAxisFormat(), "High low plot",
4024: "HighLowPlot");
4025:
4026: } else if (plot instanceof CandlestickPlot) {
4027: SheetProperty isShowVolumeProperty = new SheetProperty(
4028: "isShowVolumeCandlestickPlot",
4029: it.businesslogic.ireport.util.I18n.getString(
4030: "charts.isShowVolumePlot", "Show volume"),
4031: SheetProperty.BOOLEAN);
4032: isShowVolumeProperty.setValue(new Boolean(
4033: ((CandlestickPlot) plot).isShowVolume()));
4034: sheetPanel.addSheetProperty("Candlestick plot",
4035: isShowVolumeProperty);
4036:
4037: ExpressionSheetProperty timeAxisLabelExpressionProperty = new ExpressionSheetProperty(
4038: "timeAxisLabelExpressionCandlestickPlot",
4039: it.businesslogic.ireport.util.I18n.getString(
4040: "charts.timeAxisLabelExpressionPlot",
4041: "Time axis label expression"));
4042: timeAxisLabelExpressionProperty
4043: .setValue(((CandlestickPlot) plot)
4044: .getTimeAxisLabelExpression());
4045: sheetPanel.addSheetProperty("Candlestick plot",
4046: timeAxisLabelExpressionProperty);
4047:
4048: addAxisFormatEntries("time", ((CandlestickPlot) plot)
4049: .getTimeAxisFormat(), "Candlestick plot",
4050: "CandlestickPlot");
4051:
4052: ExpressionSheetProperty valueAxisLabelExpressionProperty = new ExpressionSheetProperty(
4053: "valueAxisLabelExpressionCandlestickPlot",
4054: it.businesslogic.ireport.util.I18n.getString(
4055: "charts.valueAxisLabelExpressionPlot",
4056: "Value axis label expression"));
4057: valueAxisLabelExpressionProperty
4058: .setValue(((CandlestickPlot) plot)
4059: .getValueAxisLabelExpression());
4060: sheetPanel.addSheetProperty("Candlestick plot",
4061: valueAxisLabelExpressionProperty);
4062:
4063: addAxisFormatEntries("value", ((CandlestickPlot) plot)
4064: .getValueAxisFormat(), "Candlestick plot",
4065: "CandlestickPlot");
4066: } else if (plot instanceof MeterPlot) {
4067: SheetProperty shapeProperty = new SheetProperty(
4068: "shapeMeterPlot",
4069: it.businesslogic.ireport.util.I18n.getString(
4070: "charts.shapeMeterPlot", "Shape"),
4071: SheetProperty.COMBOBOX);
4072: shapeProperty.setTags(new Tag[] {
4073: new Tag("chord", it.businesslogic.ireport.util.I18n
4074: .getString("charts.shape.Chord", "Chord")),
4075: new Tag("circle",
4076: it.businesslogic.ireport.util.I18n
4077: .getString("charts.shape.Circle",
4078: "Circle")),
4079: new Tag("pie", it.businesslogic.ireport.util.I18n
4080: .getString("charts.shape.Pie", "Pie")) });
4081: shapeProperty.setValue(((MeterPlot) plot).getShape());
4082: sheetPanel.addSheetProperty("Meter plot", shapeProperty);
4083:
4084: SheetProperty angleProperty = new SheetProperty(
4085: "angleMeterPlot",
4086: it.businesslogic.ireport.util.I18n.getString(
4087: "charts.angle", "Angle"),
4088: SheetProperty.INTEGER);
4089: angleProperty.setValue(new Integer(((MeterPlot) plot)
4090: .getAngle()));
4091: sheetPanel.addSheetProperty("Meter plot", angleProperty);
4092:
4093: SheetProperty unitsProperty = new SheetProperty(
4094: "unitsMeterPlot",
4095: it.businesslogic.ireport.util.I18n.getString(
4096: "charts.units", "Units"),
4097: SheetProperty.STRING);
4098: unitsProperty.setValue(((MeterPlot) plot).getUnits());
4099: sheetPanel.addSheetProperty("Meter plot", unitsProperty);
4100:
4101: DoubleSheetProperty tickIntervalProperty = new DoubleSheetProperty(
4102: "tickIntervalMeterPlot",
4103: it.businesslogic.ireport.util.I18n.getString(
4104: "charts.tickInterval", "Tick interval"));
4105: tickIntervalProperty.setValue(new Double(((MeterPlot) plot)
4106: .getTickInterval()));
4107: sheetPanel.addSheetProperty("Meter plot",
4108: tickIntervalProperty);
4109:
4110: SheetProperty meterColorProperty = new SheetProperty(
4111: "meterColorMaterPlot",
4112: it.businesslogic.ireport.util.I18n.getString(
4113: "charts.meterColor", "Meter color"),
4114: SheetProperty.COLOR);
4115: meterColorProperty.setValue(((MeterPlot) plot)
4116: .getMeterColor());
4117: sheetPanel.addSheetProperty("Meter plot",
4118: meterColorProperty);
4119:
4120: SheetProperty needleColorProperty = new SheetProperty(
4121: "needleColorMaterPlot",
4122: it.businesslogic.ireport.util.I18n.getString(
4123: "charts.needleColor", "Needle color"),
4124: SheetProperty.COLOR);
4125: needleColorProperty.setValue(((MeterPlot) plot)
4126: .getNeedleColor());
4127: sheetPanel.addSheetProperty("Meter plot",
4128: needleColorProperty);
4129:
4130: SheetProperty tickColorProperty = new SheetProperty(
4131: "tickColorMaterPlot",
4132: it.businesslogic.ireport.util.I18n.getString(
4133: "charts.tickColor", "Tick color"),
4134: SheetProperty.COLOR);
4135: tickColorProperty.setValue(((MeterPlot) plot)
4136: .getTickColor());
4137: sheetPanel
4138: .addSheetProperty("Meter plot", tickColorProperty);
4139:
4140: addValueDisplayEntries(
4141: ((MeterPlot) plot).getValueDisplay(), "Meter plot",
4142: "MeterPlot");
4143:
4144: addDataRangeEntries("data", ((MeterPlot) plot)
4145: .getDataRange(), "Meter plot", "MeterPlot");
4146:
4147: SheetProperty meterIntervalsSheetProperty = new MeterIntervalsSheetProperty(
4148: "meterIntervalsMeterPlot",
4149: it.businesslogic.ireport.util.I18n.getString(
4150: "charts.meterIntervals", "Meter intervals"));
4151: meterIntervalsSheetProperty.setValue(((MeterPlot) plot)
4152: .getMeterIntervals());
4153: sheetPanel.addSheetProperty("Meter plot",
4154: meterIntervalsSheetProperty);
4155:
4156: } else if (plot instanceof ThermometerPlot) {
4157: SheetProperty shapeProperty = new SheetProperty(
4158: "valueLocationThermometerPlot",
4159: it.businesslogic.ireport.util.I18n.getString(
4160: "charts.valuelocation", "Value location"),
4161: SheetProperty.COMBOBOX);
4162: shapeProperty.setTags(new Tag[] {
4163: new Tag("none", it.businesslogic.ireport.util.I18n
4164: .getString("charts.valuelocation.none",
4165: "None")),
4166: new Tag("left", it.businesslogic.ireport.util.I18n
4167: .getString("charts.valuelocation.left",
4168: "Left")),
4169: new Tag("right", it.businesslogic.ireport.util.I18n
4170: .getString("charts.valuelocation.right",
4171: "Right")),
4172: new Tag("bulb", it.businesslogic.ireport.util.I18n
4173: .getString("charts.valuelocation.bulb",
4174: "Bulb")) });
4175: shapeProperty.setValue(((ThermometerPlot) plot)
4176: .getValueLocation());
4177: sheetPanel.addSheetProperty("Thermometer plot",
4178: shapeProperty);
4179:
4180: SheetProperty showValueLinesProperty = new SheetProperty(
4181: "showValueLinesThermometerPlot",
4182: it.businesslogic.ireport.util.I18n
4183: .getString("charts.showValueLines",
4184: "Show value lines"),
4185: SheetProperty.BOOLEAN);
4186: showValueLinesProperty.setValue(new Boolean(
4187: ((ThermometerPlot) plot).isShowValueLines()));
4188: sheetPanel.addSheetProperty("Thermometer plot",
4189: showValueLinesProperty);
4190:
4191: SheetProperty mercuryColorProperty = new SheetProperty(
4192: "mercuryColorThermometerPlot",
4193: it.businesslogic.ireport.util.I18n.getString(
4194: "charts.mercuryColor", "Mercury color"),
4195: SheetProperty.COLOR);
4196: mercuryColorProperty.setValue(((ThermometerPlot) plot)
4197: .getMercuryColor());
4198: sheetPanel.addSheetProperty("Thermometer plot",
4199: mercuryColorProperty);
4200:
4201: addValueDisplayEntries(((ThermometerPlot) plot)
4202: .getValueDisplay(), "Thermometer plot",
4203: "ThermometerPlot");
4204:
4205: addDataRangeEntries("data", ((ThermometerPlot) plot)
4206: .getDataRange(), "Thermometer plot",
4207: "ThermometerPlot");
4208:
4209: addDataRangeEntries("low", ((ThermometerPlot) plot)
4210: .getLowRange(), "Thermometer plot",
4211: "ThermometerPlot");
4212:
4213: addDataRangeEntries("medium", ((ThermometerPlot) plot)
4214: .getMediumRange(), "Thermometer plot",
4215: "ThermometerPlot");
4216:
4217: addDataRangeEntries("high", ((ThermometerPlot) plot)
4218: .getHighRange(), "Thermometer plot",
4219: "ThermometerPlot");
4220:
4221: }
4222:
4223: }
4224:
4225: public boolean isInit() {
4226: return init || (currentSelectedChartElement == null);
4227: }
4228:
4229: public void setInit(boolean init) {
4230: this .init = init;
4231: }
4232:
4233: /**
4234: * Quick way to add a set of properties related to a ValueDisplay.<br>
4235: * Property name: property[propertyNamePostfix]
4236: *
4237: * @param axisFormat AxisFormat, the AxisFormat object from which take values
4238: * @param categoryName String, the sheet category name. I.e. Line Plot
4239: * @param propertyNamePostfix String, the value that complets the property name, i.e. LinePlot, BarPlot, ....
4240: */
4241: public void addValueDisplayEntries(ValueDisplay valueDisplay,
4242: String categoryName, String propertyNamePostfix) {
4243: SheetProperty vdColorProperty = new SheetProperty("vdColor"
4244: + propertyNamePostfix,
4245: it.businesslogic.ireport.util.I18n.getString(
4246: "charts.valueColor", "Value color"),
4247: SheetProperty.COLOR);
4248: vdColorProperty.setValue(valueDisplay.getColor());
4249: sheetPanel.addSheetProperty(categoryName, vdColorProperty);
4250:
4251: SheetProperty vdMaskProperty = new SheetProperty("vdMask"
4252: + propertyNamePostfix,
4253: it.businesslogic.ireport.util.I18n.getString(
4254: "charts.valueMask", "Value mask"),
4255: SheetProperty.STRING);
4256: vdMaskProperty.setValue(valueDisplay.getMask());
4257: sheetPanel.addSheetProperty(categoryName, vdMaskProperty);
4258:
4259: FontSheetProperty vdFontProperty = new FontSheetProperty(
4260: "vdFont" + propertyNamePostfix,
4261: it.businesslogic.ireport.util.I18n.getString(
4262: "charts.valueFont", "Value font"));
4263: vdFontProperty.setValue(valueDisplay.getFont());
4264: sheetPanel.addSheetProperty(categoryName, vdFontProperty);
4265: }
4266:
4267: /**
4268: * Quick way to add a set of properties related to an AxisFormat.<br>
4269: * Property name: [axis]Property[propertyNamePostfix]
4270: *
4271: * @param axisType String, a name in {category, value, x, y, time}
4272: * @param axisFormat AxisFormat, the AxisFormat object from which take values
4273: * @param categoryName String, the sheet category name. I.e. Line Plot
4274: * @param propertyNamePostfix String, the value that complets the property name, i.e. LinePlot, BarPlot, ....
4275: */
4276: public void addAxisFormatEntries(String axisType,
4277: AxisFormat axisFormat, String categoryName,
4278: String propertyNamePostfix) {
4279: // ---- Category Axis Format -----
4280:
4281: SheetProperty categoryAxisLabelColorPlot = new SheetProperty(
4282: axisType + "AxisLabelColor" + propertyNamePostfix,
4283: it.businesslogic.ireport.util.I18n.getString("charts."
4284: + axisType + "AxisLabelColorPlot",
4285: "Category axis label color"),
4286: SheetProperty.COLOR);
4287: categoryAxisLabelColorPlot.setValue(axisFormat.getLabelColor());
4288: sheetPanel.addSheetProperty(categoryName,
4289: categoryAxisLabelColorPlot);
4290:
4291: SheetProperty categoryAxisTickLabelColorPlot = new SheetProperty(
4292: axisType + "AxisTickLabelColor" + propertyNamePostfix,
4293: it.businesslogic.ireport.util.I18n.getString("charts."
4294: + axisType + "AxisTickLabelColorPlot",
4295: "Category axis tick label color"),
4296: SheetProperty.COLOR);
4297: categoryAxisTickLabelColorPlot.setValue(axisFormat
4298: .getTickLabelColor());
4299: sheetPanel.addSheetProperty(categoryName,
4300: categoryAxisTickLabelColorPlot);
4301:
4302: SheetProperty categoryAxisLabelMaskPlot = new SheetProperty(
4303: axisType + "AxisTickLabelMask" + propertyNamePostfix,
4304: it.businesslogic.ireport.util.I18n.getString("charts."
4305: + axisType + "AxisTickLabelMaskPlot",
4306: "Category axis tick label mask"),
4307: SheetProperty.STRING);
4308: categoryAxisLabelMaskPlot.setValue(axisFormat
4309: .getTickLabelMask());
4310: sheetPanel.addSheetProperty(categoryName,
4311: categoryAxisLabelMaskPlot);
4312:
4313: SheetProperty categoryAxisLineColorPlot = new SheetProperty(
4314: axisType + "AxisLineColor" + propertyNamePostfix,
4315: it.businesslogic.ireport.util.I18n.getString("charts."
4316: + axisType + "AxisLineColorPlot",
4317: "Category axis line color"),
4318: SheetProperty.COLOR);
4319: categoryAxisLineColorPlot.setValue(axisFormat
4320: .getAxisLineColor());
4321: sheetPanel.addSheetProperty(categoryName,
4322: categoryAxisLineColorPlot);
4323:
4324: FontSheetProperty categoryAxisLableFontPlot = new FontSheetProperty(
4325: axisType + "AxisLabelFont" + propertyNamePostfix,
4326: it.businesslogic.ireport.util.I18n.getString("charts."
4327: + axisType + "AxisLabelFontPlot",
4328: "Category axis label font"));
4329: categoryAxisLableFontPlot.setValue(axisFormat.getLabelFont());
4330: sheetPanel.addSheetProperty(categoryName,
4331: categoryAxisLableFontPlot);
4332:
4333: FontSheetProperty categoryAxisTickLableFontPlot = new FontSheetProperty(
4334: axisType + "AxisTickLabelFont" + propertyNamePostfix,
4335: it.businesslogic.ireport.util.I18n.getString("charts."
4336: + axisType + "AxisTickLabelFontPlot",
4337: "Category axis tick label font"));
4338: categoryAxisTickLableFontPlot.setValue(axisFormat
4339: .getTickLabelFont());
4340: sheetPanel.addSheetProperty(categoryName,
4341: categoryAxisTickLableFontPlot);
4342:
4343: // ---- End Category Axis Format -----
4344: }
4345:
4346: /**
4347: * Quick way to add a set of properties related to an AxisFormat.<br>
4348: * Property name: [axis]Property[propertyNamePostfix]
4349: *
4350: * @param rangeType String, a name in {data, low, medium, high}
4351: * @param range DataRange, the DataRange object from which take values
4352: * @param categoryName String, the sheet category name. I.e. Line Plot
4353: * @param propertyNamePostfix String, the value that complets the property name, i.e. LinePlot, BarPlot, ....
4354: */
4355: public void addDataRangeEntries(String rangeType, DataRange range,
4356: String categoryName, String propertyNamePostfix) {
4357: ExpressionSheetProperty rangeLowExpressionProperty = new ExpressionSheetProperty(
4358: rangeType + "RangeLowExpression" + propertyNamePostfix,
4359: it.businesslogic.ireport.util.I18n.getString("charts."
4360: + rangeType + "RangeLow", "Data range low"));
4361: rangeLowExpressionProperty.setValue(range.getLowExpression());
4362: sheetPanel.addSheetProperty(categoryName,
4363: rangeLowExpressionProperty);
4364:
4365: ExpressionSheetProperty rangeHighExpressionProperty = new ExpressionSheetProperty(
4366: rangeType + "RangeHighExpression" + propertyNamePostfix,
4367: it.businesslogic.ireport.util.I18n.getString("charts."
4368: + rangeType + "RangeHigh", "Data range high"));
4369: rangeHighExpressionProperty.setValue(range.getHighExpression());
4370: sheetPanel.addSheetProperty(categoryName,
4371: rangeHighExpressionProperty);
4372: }
4373:
4374: public void jTable1editingStopped(ChangeEvent e) {
4375: int row = jTable1.getSelectedRow();
4376:
4377: //System.out.println("position changed!: " + jTable1.getValueAt(row,0) + " " + jTable1.getValueAt(row,1) + " " + jTable1.getValueAt(row,1).getClass().getName());
4378:
4379: ((Axis) jTable1.getValueAt(row, 0)).setPosition(""
4380: + ((Tag) jTable1.getValueAt(row, 1)).getValue());
4381:
4382: }
4383:
4384: public void notifyChange() {
4385: if (getJReportFrame() != null) {
4386: getJReportFrame().getReport().incrementReportChanges();
4387: }
4388: }
4389:
4390: /**
4391: * Set the property label error
4392: */
4393: public void setPropertyLabelError(String propertyName, String error) {
4394: this .sheetPanel.setPropertyLabelError(propertyName, error);
4395: }
4396:
4397: public static final int COMPONENT_NONE = 0;
4398: public static final int COMPONENT_DATASET_SPECIFIC_EXPRESSION = 1;
4399: public static final int COMPONENT_METER_INTERVALS = 2;
4400: public static final int COMPONENT_INCREMENT_WHEN_EXPRESSION = 70;
4401: public static final int COMPONENT_DATASETRUN_PARAMETERS = 71;
4402: public static final int COMPONENT_DATASETRUN_MAP_EXPRESSION = 72;
4403: public static final int COMPONENT_DATASETRUN_DS_CONN_EXPRESSION = 73;
4404:
4405: private Object[] meterIntervalsHilightExpression = null;
4406: private Object[] subdatasetParameterHighlightExpression = null;
4407:
4408: /**
4409: * This method set the focus on a specific component.
4410: *
4411: * expressionInfo[0] can be something like:
4412: * COMPONENT_DATASET_SPECIFIC_EXPRESSION, ...
4413: *
4414: * If it is COMPONENT_DATASET_SPECIFIC_EXPRESSION, other parameters are expected in the array...
4415: */
4416: public void setFocusedExpression(Object[] expressionInfo) {
4417: int expID = ((Integer) expressionInfo[0]).intValue();
4418:
4419: switch (expID) {
4420: case COMPONENT_INCREMENT_WHEN_EXPRESSION:
4421: jTabbedPane1.setSelectedComponent(jPanelData);
4422: jTabbedPaneData.setSelectedComponent(jPanelDataset);
4423: Misc
4424: .selectTextAndFocusArea(jRTextExpressionAreaFilterExpression);
4425: break;
4426: case COMPONENT_DATASETRUN_PARAMETERS:
4427: jTabbedPane1.setSelectedComponent(jPanelData);
4428: jTabbedPaneData.setSelectedComponent(jPanelDataset);
4429: jTabbedPaneSubDataset.setSelectedComponent(jPanel4);
4430:
4431: int index = ((Integer) expressionInfo[1]).intValue();
4432:
4433: if (index >= 0
4434: && jTableDatasetParameters.getRowCount() > index) {
4435: jTableDatasetParameters.setRowSelectionInterval(index,
4436: index);
4437: subdatasetParameterHighlightExpression = new Object[expressionInfo.length - 2];
4438: for (int i = 2; i < expressionInfo.length; ++i)
4439: subdatasetParameterHighlightExpression[i - 2] = expressionInfo[i];
4440: break;
4441: }
4442:
4443: break;
4444: case COMPONENT_DATASETRUN_MAP_EXPRESSION:
4445: jTabbedPane1.setSelectedComponent(jPanelData);
4446: jTabbedPaneData.setSelectedComponent(jPanelDataset);
4447: jTabbedPaneSubDataset.setSelectedComponent(jPanel5);
4448: Misc
4449: .selectTextAndFocusArea(jRTextExpressionAreaMapExpression);
4450: break;
4451: case COMPONENT_DATASETRUN_DS_CONN_EXPRESSION:
4452: jTabbedPane1.setSelectedComponent(jPanelData);
4453: jTabbedPaneData.setSelectedComponent(jPanelDataset);
4454: jTabbedPaneSubDataset.setSelectedComponent(jPanel6);
4455: Misc
4456: .selectTextAndFocusArea(jRTextExpressionAreaTextConnectionExpression);
4457: break;
4458: case COMPONENT_DATASET_SPECIFIC_EXPRESSION:
4459: jTabbedPane1.setSelectedComponent(jPanelData);
4460: jTabbedPaneData.setSelectedComponent(jPanelDataDefinition);
4461: if (jPanelDataDefinition.getComponentCount() > 0) {
4462: Object newInfo[] = new Object[expressionInfo.length - 1];
4463: for (int i = 1; i < expressionInfo.length; ++i)
4464: newInfo[i - 1] = expressionInfo[i];
4465:
4466: ((ChartDatasetPanel) jPanelDataDefinition
4467: .getComponent(0)).setFocusedExpression(newInfo);
4468: }
4469: break;
4470: case COMPONENT_METER_INTERVALS:
4471: this .setPropertyLabelError("meterIntervalsMeterPlot",
4472: (String) expressionInfo[1]);
4473: meterIntervalsHilightExpression = new Object[expressionInfo.length - 2];
4474: for (int i = 2; i < expressionInfo.length; ++i)
4475: meterIntervalsHilightExpression[i - 2] = expressionInfo[i];
4476: break;
4477: }
4478: }
4479: }
|