/** * Makes a copy of an object using serialization. * * @param source the object to copy * @return a copy of the source object, null if copying fails */ public static Object makeCopy(Object source) { Object result; try { result = GenericObjectEditor.makeCopy(source); } catch (Exception e) { result = null; } return result; }
/** * Makes a copy of an object using serialization. * * @param source the object to copy * @return a copy of the source object, null if copying fails */ public static Object makeCopy(Object source) { Object result; try { result = GenericObjectEditor.makeCopy(source); } catch (Exception e) { result = null; } return result; }
/** * Gets the current Object. * * @return the current Object */ @Override public Object getValue() { Object result = null; try { result = makeCopy(m_Object); } catch (Exception ex) { ex.printStackTrace(); } return result; }
/** * Gets the current Object. * * @return the current Object */ @Override public Object getValue() { Object result = null; try { result = makeCopy(m_Object); } catch (Exception ex) { ex.printStackTrace(); } return result; }
/** * Make a copy of the original step * * @param step the step to copy */ protected void copyOriginal(Step step) { m_manager = (StepManagerImpl) step.getStepManager(); m_stepToEdit = step; try { // copy the original config in case of cancel m_stepOriginal = (Step) GenericObjectEditor.makeCopy(step); } catch (Exception ex) { showErrorDialog(ex); } }
/** * Make a copy of the original step * * @param step the step to copy */ protected void copyOriginal(Step step) { m_manager = (StepManagerImpl) step.getStepManager(); m_stepToEdit = step; try { // copy the original config in case of cancel m_stepOriginal = (Step) GenericObjectEditor.makeCopy(step); } catch (Exception ex) { showErrorDialog(ex); } }
/** * 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()); }
/** * Set the filter bean to be edited * * @param object a Filter bean */ @Override public void setObject(Object object) { m_filter = (weka.gui.beans.Filter) object; try { m_backup = (weka.filters.Filter) GenericObjectEditor.makeCopy(m_filter .getFilter()); } catch (Exception ex) { // ignore } m_filterEditor.setTarget(m_filter.getFilter()); }
/** * 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()); }
/** * Set the classifier object to be edited * * @param object an <code>Object</code> value */ public void setObject(Object object) { m_dsAssociator = (weka.gui.beans.Associator)object; // System.err.println(Utils.joinOptions(((OptionHandler)m_dsClassifier.getClassifier()).getOptions())); try { m_backup = (weka.associations.Associator)GenericObjectEditor.makeCopy(m_dsAssociator.getAssociator()); } catch (Exception ex) { // ignore } m_AssociatorEditor.setTarget(m_dsAssociator.getAssociator()); }
/** * Set the filter bean to be edited * * @param object a Filter bean */ @Override public void setObject(Object object) { m_filter = (weka.gui.beans.Filter) object; try { m_backup = (weka.filters.Filter) GenericObjectEditor.makeCopy(m_filter .getFilter()); } catch (Exception ex) { // ignore } m_filterEditor.setTarget(m_filter.getFilter()); }
/** * Set the classifier object to be edited * * @param object an <code>Object</code> value */ public void setObject(Object object) { m_dsAssociator = (weka.gui.beans.Associator)object; // System.err.println(Utils.joinOptions(((OptionHandler)m_dsClassifier.getClassifier()).getOptions())); try { m_backup = (weka.associations.Associator)GenericObjectEditor.makeCopy(m_dsAssociator.getAssociator()); } catch (Exception ex) { // ignore } m_AssociatorEditor.setTarget(m_dsAssociator.getAssociator()); }
/** * Makes a copy of an object using serialization. * * @param source the object to copy * @return a copy of the source object */ protected Object copyObject(Object source) { Object result = null; try { result = GenericObjectEditor.makeCopy(source); setCancelButton(true); } catch (Exception ex) { setCancelButton(false); Logger.log(weka.core.logging.Logger.Level.WARNING, "GenericObjectEditor: Problem making backup object"); Logger.log(weka.core.logging.Logger.Level.WARNING, ex); } return result; }
/** * Set the classifier object to be edited * * @param object an <code>Object</code> value */ @Override public void setObject(Object object) { m_dsClassifier = (weka.gui.beans.Classifier) object; // System.err.println(Utils.joinOptions(((OptionHandler)m_dsClassifier.getClassifier()).getOptions())); try { m_backup = (weka.classifiers.Classifier) GenericObjectEditor .makeCopy(m_dsClassifier.getClassifierTemplate()); } catch (Exception ex) { // ignore } m_ClassifierEditor.setEnvironment(m_env); m_ClassifierEditor.setTarget(m_dsClassifier.getClassifierTemplate()); m_resetIncrementalClassifier.setSelected(m_dsClassifier .getResetIncrementalClassifier()); m_updateIncrementalClassifier.setSelected(m_dsClassifier .getUpdateIncrementalClassifier()); m_executionSlotsText.setText("" + m_dsClassifier.getExecutionSlots()); m_blockOnLastFold.setSelected(m_dsClassifier.getBlockOnLastFold()); checkOnClassifierType(); }
/** * Makes a copy of an object using serialization. * * @param source the object to copy * @return a copy of the source object */ protected Object copyObject(Object source) { Object result = null; try { result = GenericObjectEditor.makeCopy(source); setCancelButton(true); } catch (Exception ex) { setCancelButton(false); Logger.log(weka.core.logging.Logger.Level.WARNING, "GenericObjectEditor: Problem making backup object"); Logger.log(weka.core.logging.Logger.Level.WARNING, ex); } return result; }
/** * Set the classifier object to be edited * * @param object an <code>Object</code> value */ @Override public void setObject(Object object) { m_dsClassifier = (weka.gui.beans.Classifier) object; // System.err.println(Utils.joinOptions(((OptionHandler)m_dsClassifier.getClassifier()).getOptions())); try { m_backup = (weka.classifiers.Classifier) GenericObjectEditor .makeCopy(m_dsClassifier.getClassifierTemplate()); } catch (Exception ex) { // ignore } m_ClassifierEditor.setEnvironment(m_env); m_ClassifierEditor.setTarget(m_dsClassifier.getClassifierTemplate()); m_resetIncrementalClassifier.setSelected(m_dsClassifier .getResetIncrementalClassifier()); m_updateIncrementalClassifier.setSelected(m_dsClassifier .getUpdateIncrementalClassifier()); m_executionSlotsText.setText("" + m_dsClassifier.getExecutionSlots()); m_blockOnLastFold.setSelected(m_dsClassifier.getBlockOnLastFold()); checkOnClassifierType(); }
m_Editor.setValue(GenericObjectEditor.makeCopy(m_ElementList .getSelectedValue())); } catch (Exception ex) {
m_Editor.setValue(GenericObjectEditor.makeCopy(m_ElementList .getSelectedValue())); } catch (Exception ex) {
/** * Set the loader to be customized * * @param object a weka.gui.beans.Loader */ @Override 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(); } } }
/** * Set the loader to be customized * * @param object a weka.gui.beans.Loader */ @Override 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(); } } }