コード例 #1
0
  private void jButtonModifyActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButtonModifyActionPerformed

    if (jList1.getSelectedIndex() >= 0) {
      CategorySeries cs = (CategorySeries) jList1.getSelectedValue();
      CategorySeriesDialog csd =
          new CategorySeriesDialog(it.businesslogic.ireport.gui.MainFrame.getMainInstance(), true);

      csd.setSeriesExpression(cs.getSeriesExpression());
      csd.setCategoryExpression(cs.getCategoryExpression());
      csd.setValueExpression(cs.getValueExpression());
      csd.setLabelExpression(cs.getLabelExpression());
      csd.setSectionItemHyperlink(cs.getSectionItemHyperlink());
      csd.setSubDataset(this.getSubDataset());
      if (newInfo != null) {
        csd.setFocusedExpression(newInfo);
      }
      csd.setVisible(true);

      if (csd.getDialogResult() == javax.swing.JOptionPane.OK_OPTION) {
        cs.setSeriesExpression(csd.getSeriesExpression());
        cs.setCategoryExpression(csd.getCategoryExpression());
        cs.setValueExpression(csd.getValueExpression());
        cs.setLabelExpression(csd.getLabelExpression());
        cs.setSectionItemHyperlink(csd.getSectionItemHyperlink());

        jList1.updateUI();
      }
    }
  } // GEN-LAST:event_jButtonModifyActionPerformed
コード例 #2
0
  private void jButtonAddActionPerformed(
      java.awt.event.ActionEvent evt) { // GEN-FIRST:event_jButtonAddActionPerformed

    CategorySeriesDialog csd =
        new CategorySeriesDialog(it.businesslogic.ireport.gui.MainFrame.getMainInstance(), true);
    csd.setSubDataset(this.getSubDataset());
    csd.setVisible(true);
    if (csd.getDialogResult() == javax.swing.JOptionPane.OK_OPTION) {
      CategorySeries cs = new CategorySeries();
      cs.setSeriesExpression(csd.getSeriesExpression());
      cs.setCategoryExpression(csd.getCategoryExpression());
      cs.setValueExpression(csd.getValueExpression());
      cs.setLabelExpression(csd.getLabelExpression());
      cs.setSectionItemHyperlink(csd.getSectionItemHyperlink());

      categoryDataset.getCategorySeries().addElement(cs);
      ((javax.swing.DefaultListModel) jList1.getModel()).addElement(cs);
    }
  } // GEN-LAST:event_jButtonAddActionPerformed