/**
   * Makes a panel for editing a classifier job
   *
   * @param classifierJob the classifier job to edit
   * @param hideAbout true if the help info is not to be displayed
   * @return a JPanel setup for editing a classifier job
   */
  protected JPanel makeClassifierJobPanel(HadoopJob classifierJob, boolean hideAbout) {
    JPanel jobHolder = new JPanel();
    jobHolder.setLayout(new BorderLayout());

    PropertySheetPanel classifierJobEditor = new PropertySheetPanel();
    classifierJobEditor.setEnvironment(m_env);
    classifierJobEditor.setTarget(classifierJob);
    jobHolder.add(classifierJobEditor, BorderLayout.NORTH);

    if (hideAbout) {
      classifierJobEditor.getAboutPanel().setVisible(false);
    }

    m_classifierMapTask = new WekaClassifierMapTask();
    try {
      m_classifierMapTask.setOptions(Utils.splitOptions(m_optionsOrig));
    } catch (Exception e) {
      e.printStackTrace();
    }
    PropertySheetPanel classifierTaskEditor = new PropertySheetPanel();
    classifierTaskEditor.setEnvironment(m_env);
    classifierTaskEditor.setTarget(m_classifierMapTask);
    jobHolder.add(classifierTaskEditor, BorderLayout.CENTER);

    return jobHolder;
  }
  /**
   * Adds a tab for the ARFF header job
   *
   * @param tabTitle the title for the tab
   * @param arffJob the ARFF job
   */
  protected void addTabForArffHeaderJob(String tabTitle, HadoopJob arffJob) {
    JPanel jobHolder = new JPanel();
    jobHolder.setLayout(new BorderLayout());

    PropertySheetPanel arffJobEditor = new PropertySheetPanel();
    arffJobEditor.setEnvironment(m_env);
    arffJobEditor.setTarget(arffJob);
    jobHolder.add(arffJobEditor, BorderLayout.NORTH);

    m_arffMapTask = new CSVToARFFHeaderMapTask();
    try {
      m_arffMapTask.setOptions(Utils.splitOptions(m_optionsOrig));
    } catch (Exception ex) {
      ex.printStackTrace();
    }
    PropertySheetPanel mapTaskEditor = new PropertySheetPanel();
    mapTaskEditor.setTarget(m_arffMapTask);

    mapTaskEditor.setEnvironment(m_env);
    jobHolder.add(mapTaskEditor, BorderLayout.CENTER);

    // JScrollPane scroller = new JScrollPane(jobHolder);

    m_configTabs.addTab(tabTitle, jobHolder);
  }
 /**
  * Set the SubstringLabeler to edit
  *
  * @param o the SubtringLabeler to edit
  */
 @Override
 public void setObject(Object o) {
   if (o instanceof SubstringLabeler) {
     m_labeler = (SubstringLabeler) o;
     m_tempEditor.setTarget(o);
     setup();
     initialize();
   }
 }
  /**
   * Add a tab for editing the scoring job
   *
   * @param tabTitle the title of the tab
   * @param scoringJob the scoring job to edit
   */
  public void addTabForScoringJob(String tabTitle, HadoopJob scoringJob) {
    JPanel jobHolder = new JPanel();
    jobHolder.setLayout(new BorderLayout());

    PropertySheetPanel scoringJobEditor = new PropertySheetPanel();
    scoringJobEditor.setEnvironment(m_env);
    scoringJobEditor.setTarget(scoringJob);
    jobHolder.add(scoringJobEditor, BorderLayout.NORTH);

    m_configTabs.addTab(tabTitle, jobHolder);
  }
Пример #5
0
  /**
   * Set the Clusterer object to be edited
   *
   * @param object an <code>Object</code> value
   */
  public void setObject(Object object) {
    m_dsClusterer = (weka.gui.beans.Clusterer) object;
    try {
      m_backup =
          (weka.clusterers.Clusterer) GenericObjectEditor.makeCopy(m_dsClusterer.getClusterer());
    } catch (Exception ex) {
      // ignore
    }

    m_ClustererEditor.setTarget(m_dsClusterer.getClusterer());
  }
Пример #6
0
 /**
  * Set the loader to be customized
  *
  * @param object a weka.gui.beans.Loader
  */
 public void setObject(Object object) {
   m_dsLoader = (weka.gui.beans.Loader) object;
   m_LoaderEditor.setTarget(m_dsLoader.getLoader());
   //    m_fileEditor.setValue(m_dsLoader.getDataSetFile());
   if (m_dsLoader.getLoader() instanceof FileSourcedConverter) {
     setUpFile();
   } else {
     if (m_dsLoader.getLoader() instanceof DatabaseConverter) {
       setUpDatabase();
     } else setUpOther();
   }
 }
Пример #7
0
 /**
  * Set the saver to be customized
  *
  * @param object a weka.gui.beans.Saver
  */
 public void setObject(Object object) {
   m_dsSaver = (weka.gui.beans.Saver) object;
   m_SaverEditor.setTarget(m_dsSaver.getSaver());
   if (m_dsSaver.getSaver() instanceof DatabaseConverter) {
     setUpDatabase();
   } else {
     if (m_dsSaver.getSaver() instanceof FileSourcedConverter) {
       setUpFile();
     } else {
       setUpOther();
     }
   }
 }
  /**
   * Add a tab for editing a correlation job
   *
   * @param tabTitle the title of the tab
   * @param correlationJob the correlation job to edit
   */
  public void addTabForCorrelationMatrixJob(String tabTitle, HadoopJob correlationJob) {
    JPanel jobHolder = new JPanel();
    jobHolder.setLayout(new BorderLayout());

    PropertySheetPanel matrixJobEditor = new PropertySheetPanel();
    matrixJobEditor.setEnvironment(m_env);
    matrixJobEditor.setTarget(correlationJob);
    jobHolder.add(matrixJobEditor, BorderLayout.NORTH);

    m_correlationMapTask = new CorrelationMatrixMapTask();
    try {
      m_correlationMapTask.setOptions(Utils.splitOptions(m_optionsOrig));
    } catch (Exception e) {
      e.printStackTrace();
    }

    PropertySheetPanel matrixTaskEditor = new PropertySheetPanel();
    matrixTaskEditor.setEnvironment(m_env);
    matrixTaskEditor.setTarget(m_correlationMapTask);
    jobHolder.add(matrixTaskEditor, BorderLayout.CENTER);

    m_configTabs.addTab(tabTitle, jobHolder);
  }
  @Override
  public void setObject(Object bean) {
    m_bean = (AbstractHadoopJob) bean;

    m_job = m_bean.getUnderlyingJob();

    m_optionsOrig = m_bean.getJobOptions();

    m_mrConfig = m_job.getMapReduceJobConfig();

    m_mrConfigEditor.setEnvironment(m_env);
    m_mrConfigEditor.setTarget(m_mrConfig);

    setup();
  }
Пример #10
0
  /**
   * Set the loader to be customized
   *
   * @param object a weka.gui.beans.Loader
   */
  public void setObject(Object object) {
    m_dsLoader = (weka.gui.beans.Loader) object;

    try {
      m_backup = (weka.core.converters.Loader) GenericObjectEditor.makeCopy(m_dsLoader.getLoader());
    } catch (Exception ex) {
      // ignore
    }

    m_LoaderEditor.setTarget(m_dsLoader.getLoader());
    //    m_fileEditor.setValue(m_dsLoader.getDataSetFile());
    m_LoaderEditor.setEnvironment(m_env);
    if (m_dsLoader.getLoader() instanceof FileSourcedConverter) {
      setUpFile();
    } else {
      if (m_dsLoader.getLoader() instanceof DatabaseConverter) {
        setUpDatabase();
      } else setUpOther();
    }
  }
  /**
   * Adds a tab for editing an evaluation job
   *
   * @param tabTitle the title for the tab
   * @param evaluationJob the evaluation job to edit
   */
  public void addTabForEvaluationJob(String tabTitle, HadoopJob evaluationJob) {
    JPanel jobHolder = new JPanel();
    jobHolder.setLayout(new BorderLayout());

    PropertySheetPanel evaluationJobEditor = new PropertySheetPanel();
    evaluationJobEditor.setEnvironment(m_env);
    evaluationJobEditor.setTarget(evaluationJob);
    jobHolder.add(evaluationJobEditor, BorderLayout.NORTH);

    m_tempClassifierJob = new weka.distributed.hadoop.WekaClassifierHadoopJob();
    try {
      m_tempClassifierJob.setOptions(Utils.splitOptions(m_optionsOrig));
    } catch (Exception ex) {
      ex.printStackTrace();
    }
    JPanel classifierJobP = makeClassifierJobPanel(m_tempClassifierJob, true);

    jobHolder.add(classifierJobP, BorderLayout.CENTER);
    JScrollPane scroller = new JScrollPane(jobHolder);

    m_configTabs.addTab(tabTitle, scroller);
  }