Examples of DbOutputterDescriptor


Examples of repast.simphony.data.db.outputter.engine.DbOutputterDescriptor

    /**
     * @return maximum runID over all output descriptors.
     */
    public static int getCurrentMaxRunId(String runInfoTable, DBConnectionInfo dbConInfo) {
      if (runIdCalculations.size() == 0) {
        DbOutputterDescriptor pseudoDescriptor = new DefaultDbOutputterDescriptor();
        pseudoDescriptor.setName(PSEUDO_DESCRIPTOR);
        pseudoDescriptor.setRunInfoTableName(runInfoTable);
        Connection con = getConnection(null, dbConInfo);
       
        LOG.debug("Connection in getCurrentMaxRunID: " + con, con);
        runId = getRunIDStatic(pseudoDescriptor, con);
        try {
View Full Code Here

Examples of repast.simphony.data.db.outputter.engine.DbOutputterDescriptor

   */
  @Override
  public void applyState() throws InvalidStateException {
    super.applyState();

    DbOutputterDescriptor descriptor = model.getDescriptor();

    if (descriptor == null || !(descriptor instanceof DbOutputterDescriptor)) {
      descriptor = new DefaultDbOutputterDescriptor("Name");
      model.setDescriptor(descriptor);
    }

    for (String column : descriptor.getColumns()) {
      descriptor.removeColumn(column);
    }
    descriptor.addColumns(listSelector.getSelectedItems());

    for (Object dataSet : descriptor.getDataSets()) {
      descriptor.removeDataSet(dataSet);
    }
    descriptor.setDataSetId(((DataSetWrapper) dataSetCombo.getSelectedItem()).descriptor.getDataSetId());

    descriptor.setName(nameField.getText());
    descriptor.setTableName(tableName.getText());
    descriptor.setAddRunID(addRunID.isSelected());
    descriptor.setRunInfoTableName(runInfoTableName.getText());
   
    try {
      descriptor.setWriteCacheInterval(new Integer(writeCacheInterval.getText()).intValue());
    } catch (NumberFormatException e) {
      throw new org.pietschy.wizard.InvalidStateException("Invalid input for cache interval");
    }
  }
View Full Code Here

Examples of repast.simphony.data.db.outputter.engine.DbOutputterDescriptor

  private DbOutputterDescriptorAction<DbOutputter, DbOutputterDescriptor> createAction(JFrame parentFrame,
      List<DataGathererDescriptor<?>> gathererDescriptors, Scenario scenario, Object contextID) {
    DbOutputterWizard wizard = new DbOutputterWizard(gathererDescriptors, scenario, contextID);
    wizard.showDialog(parentFrame, "Database Outputter Wizard");
    if (!wizard.wasCancelled()) {
      DbOutputterDescriptor descriptor = wizard.getModel().getDescriptor();
      return new DbOutputterDescriptorAction<DbOutputter, DbOutputterDescriptor>(descriptor);
    }
    return null;
  }
View Full Code Here

Examples of repast.simphony.data.db.outputter.engine.DbOutputterDescriptor

  @Override
  public void prepare() {
    super.prepare();

    if (model != null && model.getDescriptor() != null) {
      DbOutputterDescriptor loader = model.getDescriptor();

      if (notNull(loader.getDriverName())) {
        driverField.setText(loader.getDriverName());
      }

      if (notNull(loader.getDbURL())) {
        urlField.setText(loader.getDbURL());
      }

      if (notNull(loader.getUsername())) {
        userNameField.setText(loader.getUsername());
      }

      if (notNull(loader.getPassword())) {
        passwordField.setText(loader.getPassword());
      }

      loginBox.setSelected(loader.isStoringLoginInfo());
      loginBox.addItemListener(new ItemListener() {

        @Override
        public void itemStateChanged(ItemEvent e) {
          if (e.getStateChange() == ItemEvent.DESELECTED) {
View Full Code Here

Examples of repast.simphony.data.db.outputter.engine.DbOutputterDescriptor

   * @see repast.simphony.dataLoader.wizard.JDBCDataStep#applyState()
   */
  @Override
  public void applyState() throws InvalidStateException {
    super.applyState();
    DbOutputterDescriptor builder = model.getDescriptor();
    builder.setDriverName(driverField.getText());
    builder.setDbURL(urlField.getText());
    builder.setUsername(userNameField.getText());
    builder.setPassword(new String(passwordField.getPassword()));
    builder.setStoringLoginInfo(loginBox.isSelected());
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.