Example usage for weka.gui GenericPropertiesCreator execute

List of usage examples for weka.gui GenericPropertiesCreator execute

Introduction

In this page you can find the example usage for weka.gui GenericPropertiesCreator execute.

Prototype

public void execute(boolean store) throws Exception 

Source Link

Document

generates the props-file for the GenericObjectEditor

Usage

From source file:meka.gui.goe.GenericObjectEditor.java

License:Open Source License

public static void determineAllClasses() {
    weka.gui.GenericObjectEditor.determineClasses();
    try {// w  w  w . ja  va 2s.com
        GenericPropertiesCreator creator = new GenericPropertiesCreator();
        try {
            creator.execute(false);
            MEKA_EDITOR_PROPERTIES = creator.getOutputProperties();
        } catch (Exception e) {
            JOptionPane.showMessageDialog(null,
                    "Could not determine the properties for the generic object\n"
                            + "editor. This exception was produced:\n" + e.toString(),
                    "MEKA GenericObjectEditor", JOptionPane.ERROR_MESSAGE);
        }

        if (MEKA_EDITOR_PROPERTIES == null) {
            JOptionPane.showMessageDialog(null, "Could not initialize the MEKA GenericPropertiesCreator. ",
                    "MEKA GenericObjectEditor", JOptionPane.ERROR_MESSAGE);
        } else {
            PluginManager.addFromProperties(MEKA_EDITOR_PROPERTIES);
            Enumeration<String> keys = (Enumeration<String>) MEKA_EDITOR_PROPERTIES.propertyNames();
            while (keys.hasMoreElements()) {
                String key = keys.nextElement();
                // merged property?
                if (EDITOR_PROPERTIES.containsKey(key))
                    EDITOR_PROPERTIES.setProperty(key,
                            EDITOR_PROPERTIES.getProperty(key) + "," + MEKA_EDITOR_PROPERTIES.getProperty(key));
                else
                    EDITOR_PROPERTIES.setProperty(key, MEKA_EDITOR_PROPERTIES.getProperty(key));
            }
        }
    } catch (Exception e) {
        JOptionPane.showMessageDialog(
                null, "Could not initialize the MEKA GenericPropertiesCreator. "
                        + "This exception was produced:\n" + e.toString(),
                "MEKA GenericObjectEditor", JOptionPane.ERROR_MESSAGE);
    }
    if (DEBUG)
        System.out.println("start<GenericObjectEditor.determineAllClasses()>\n"
                + PropsUtils.toString(EDITOR_PROPERTIES, null)
                + "end<GenericObjectEditor.determineAllClasses()>\n");
}