Search in sources :

Example 1 with Plugin

use of nars.plugin.Plugin in project opennars by opennars.

the class PluginPanel method addPlugin.

protected void addPlugin(Class c) {
    try {
        Plugin p = (Plugin) c.newInstance();
        nar.addPlugin(p);
    } catch (Exception ex) {
        JOptionPane.showMessageDialog(this, ex.toString());
    }
}
Also used : Plugin(nars.plugin.Plugin)

Example 2 with Plugin

use of nars.plugin.Plugin in project opennars by opennars.

the class NAR method removePlugin.

public void removePlugin(PluginState ps) {
    if (plugins.remove(ps)) {
        Plugin p = ps.plugin;
        if (p instanceof Operator) {
            memory.removeOperator((Operator) p);
        }
        // TODO sensory channels can be plugins
        ps.setEnabled(false);
        emit(Events.PluginsChange.class, null, p);
    }
}
Also used : Operator(nars.operator.Operator) Events(nars.io.events.Events) Plugin(nars.plugin.Plugin)

Aggregations

Plugin (nars.plugin.Plugin)2 Events (nars.io.events.Events)1 Operator (nars.operator.Operator)1