System.out.println("[KnowledgeFlow] Initializing KF...");
try {
TOOLBARS = new Vector();
TreeMap wrapList = new TreeMap();
Properties GEOProps = GenericPropertiesCreator.getGlobalOutputProperties();
if (GEOProps == null) {
GenericPropertiesCreator creator = new GenericPropertiesCreator();
if (creator.useDynamic()) {
creator.execute(false);
/* now process the keys in the GenericObjectEditor.props. For each
key that has an entry in the Beans.props associating it with a
bean component a button tool bar will be created */
GEOProps = creator.getOutputProperties();
} else {
// Read the static information from the GenericObjectEditor.props
GEOProps = Utils.readProperties("weka/gui/GenericObjectEditor.props");
}
}
Enumeration en = GEOProps.propertyNames();
while (en.hasMoreElements()) {
String geoKey = (String)en.nextElement();
// System.err.println("GEOKey " + geoKey);
// try to match this key with one in the Beans.props file
String beanCompName = BEAN_PROPERTIES.getProperty(geoKey);
if (beanCompName != null) {
// add details necessary to construct a button bar for this class
// of algorithms
Vector newV = new Vector();
// check for a naming alias for this toolbar
String toolBarNameAlias =
BEAN_PROPERTIES.getProperty(geoKey+".alias");
String toolBarName = (toolBarNameAlias != null) ?
toolBarNameAlias :
geoKey.substring(geoKey.lastIndexOf('.')+1, geoKey.length());
// look for toolbar ordering information for this wrapper type
String order =
BEAN_PROPERTIES.getProperty(geoKey+".order");
Integer intOrder = (order != null) ?
new Integer(order) :
new Integer(0);
// Name for the toolbar (name of weka algorithm class)
newV.addElement(toolBarName);
// Name of bean capable of handling this class of algorithm
newV.addElement(beanCompName);
// add the root package for this key
String rootPackage = geoKey.substring(0, geoKey.lastIndexOf('.'));
newV.addElement(rootPackage);
// All the weka algorithms of this class of algorithm
String wekaAlgs = GEOProps.getProperty(geoKey);
Hashtable roots = GenericObjectEditor.sortClassesByRoot(wekaAlgs);
Hashtable hpps = new Hashtable();
Enumeration enm = roots.keys();
while (enm.hasMoreElements()) {
String root = (String) enm.nextElement();
String classes = (String) roots.get(root);
weka.gui.HierarchyPropertyParser hpp =
new weka.gui.HierarchyPropertyParser();
hpp.build(classes, ", ");
// System.err.println(hpp.showTree());
hpps.put(root, hpp);
}
//------ test the HierarchyPropertyParser
/* weka.gui.HierarchyPropertyParser hpp =
new weka.gui.HierarchyPropertyParser();
hpp.build(wekaAlgs, ", ");
System.err.println(hpp.showTree()); */
// ----- end test the HierarchyPropertyParser
// newV.addElement(hpp); // add the hierarchical property parser
newV.addElement(hpps); // add the hierarchical property parser
StringTokenizer st = new StringTokenizer(wekaAlgs, ", ");
while (st.hasMoreTokens()) {
String current = st.nextToken().trim();
newV.addElement(current);
}
wrapList.put(intOrder, newV);
// TOOLBARS.addElement(newV);
}
}
Iterator keysetIt = wrapList.keySet().iterator();
while (keysetIt.hasNext()) {
Integer key = (Integer)keysetIt.next();
Vector newV = (Vector)wrapList.get(key);
if (newV != null) {
TOOLBARS.addElement(newV);
}
}
} catch (Exception ex) {