Package weka.gui

Examples of weka.gui.GenericPropertiesCreator


      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");
        }
      }
View Full Code Here


      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");
        }
      }
View Full Code Here

   * @param property    the property to get the classnames for
   * @return            the classnames of the given property
   * @see               GenericPropertiesCreator
   */
  protected static Vector getClassnames(String property) {
    GenericPropertiesCreator  gpc;
    String                    classes;
    Vector                    result;
    StringTokenizer           tok;
    String                    classname;
   
    result = new Vector();

    try {
      gpc = new GenericPropertiesCreator();
      gpc.execute(false);
     
      classes = gpc.getOutputProperties().getProperty(property);
      tok     = new StringTokenizer(classes, ",");
     
      while (tok.hasMoreTokens()) {
        classname = tok.nextToken();
        // skip non-public classes
View Full Code Here

  if (methods[i].getName().startsWith("test"))
    testMethods.add(methods[i].getName());
      }
     
      // get all classes that are accessible through the GUI
      GenericPropertiesCreator creator = new GenericPropertiesCreator();
      creator.execute(false);
      Properties props = creator.getOutputProperties();
     
      // traverse all super-classes
      Enumeration names = props.propertyNames();
      while (names.hasMoreElements()) {
  String name = names.nextElement().toString();
View Full Code Here

  private static void init() {
    System.out.println(Messages.getInstance().getString("KnowledgeFlowApp_Init_Text_First"));

    try {
      TreeMap wrapList = new TreeMap();
      GenericPropertiesCreator creator = new GenericPropertiesCreator();
      Properties GEOProps = null;

      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();
View Full Code Here

  private static void init() {
    System.out.println("[KnowledgeFlow] Initializing KF...");

    try {
      TreeMap wrapList = new TreeMap();
      GenericPropertiesCreator creator = new GenericPropertiesCreator();
      Properties GEOProps = null;

      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();
View Full Code Here

    String          tmpStr;
    Class      cls;
    CapabilitiesHandler    handler;
    boolean      initialized;
    StringTokenizer    tok;
    GenericPropertiesCreator  creator;
    Properties      props;

    m_Capabilities = new Capabilities(this);
    initialized    = false;

    tmpStr = Utils.getOption('W', options);
    if (tmpStr.length() != 0) {
      cls = Class.forName(tmpStr);
      if (ClassDiscovery.hasInterface(CapabilitiesHandler.class, cls)) {
  initialized = true;
  handler = (CapabilitiesHandler) cls.newInstance();
  if (handler instanceof OptionHandler)
    ((OptionHandler) handler).setOptions(Utils.partitionOptions(options));
  setHandler(handler);
      }
      else {
  throw new IllegalArgumentException("Class '" + tmpStr + "' is not a CapabilitiesHandler!");
      }
    }
    else {
      tmpStr = Utils.getOption('c', options);
      if (tmpStr.length() != 0)
  setClassIndex(tmpStr);
      else
  setClassIndex("last");

      tmpStr = Utils.getOption('t', options);
      setFilename(tmpStr);
    }

    tmpStr = Utils.getOption("num-instances", options);
    if (tmpStr.length() != 0)
      m_Capabilities.setMinimumNumberInstances(Integer.parseInt(tmpStr));
    else if (!initialized)
      m_Capabilities.setMinimumNumberInstances(1);

    // allowed
    if (Utils.getFlag("no-class", options))
      enable(Capability.NO_CLASS);
    // not allowed
    if (Utils.getFlag("not-no-class", options))
      enableNot(Capability.NO_CLASS);

    if (!m_Capabilities.handles(Capability.NO_CLASS)) {
      // allowed
      if (Utils.getFlag("nominal-class", options)) {
  enable(Capability.NOMINAL_CLASS);
  disable(Capability.BINARY_CLASS);
      }
      if (Utils.getFlag("binary-class", options)) {
  enable(Capability.BINARY_CLASS);
  disable(Capability.UNARY_CLASS);
      }
      if (Utils.getFlag("unary-class", options))
  enable(Capability.UNARY_CLASS);
      if (Utils.getFlag("numeric-class", options))
  enable(Capability.NUMERIC_CLASS);
      if (Utils.getFlag("string-class", options))
  enable(Capability.STRING_CLASS);
      if (Utils.getFlag("date-class", options))
  enable(Capability.DATE_CLASS);
      if (Utils.getFlag("relational-class", options))
  enable(Capability.RELATIONAL_CLASS);
      if (Utils.getFlag("missing-class-values", options))
  enable(Capability.MISSING_CLASS_VALUES);
    }
    // not allowed
    if (Utils.getFlag("not-nominal-class", options)) {
      enableNot(Capability.NOMINAL_CLASS);
      disableNot(Capability.BINARY_CLASS);
    }
    if (Utils.getFlag("not-binary-class", options)) {
      enableNot(Capability.BINARY_CLASS);
      disableNot(Capability.UNARY_CLASS);
    }
    if (Utils.getFlag("not-unary-class", options))
      enableNot(Capability.UNARY_CLASS);
    if (Utils.getFlag("not-numeric-class", options))
      enableNot(Capability.NUMERIC_CLASS);
    if (Utils.getFlag("not-string-class", options))
      enableNot(Capability.STRING_CLASS);
    if (Utils.getFlag("not-date-class", options))
      enableNot(Capability.DATE_CLASS);
    if (Utils.getFlag("not-relational-class", options))
      enableNot(Capability.RELATIONAL_CLASS);
    if (Utils.getFlag("not-relational-class", options))
      enableNot(Capability.RELATIONAL_CLASS);
    if (Utils.getFlag("not-missing-class-values", options))
      enableNot(Capability.MISSING_CLASS_VALUES);

    // allowed
    if (Utils.getFlag("nominal-atts", options)) {
      enable(Capability.NOMINAL_ATTRIBUTES);
      disable(Capability.BINARY_ATTRIBUTES);
    }
    if (Utils.getFlag("binary-atts", options)) {
      enable(Capability.BINARY_ATTRIBUTES);
      disable(Capability.UNARY_ATTRIBUTES);
    }
    if (Utils.getFlag("unary-atts", options))
      enable(Capability.UNARY_ATTRIBUTES);
    if (Utils.getFlag("numeric-atts", options))
      enable(Capability.NUMERIC_ATTRIBUTES);
    if (Utils.getFlag("string-atts", options))
      enable(Capability.STRING_ATTRIBUTES);
    if (Utils.getFlag("date-atts", options))
      enable(Capability.DATE_ATTRIBUTES);
    if (Utils.getFlag("relational-atts", options))
      enable(Capability.RELATIONAL_ATTRIBUTES);
    if (Utils.getFlag("missing-att-values", options))
      enable(Capability.MISSING_VALUES);
    // not allowed
    if (Utils.getFlag("not-nominal-atts", options)) {
      enableNot(Capability.NOMINAL_ATTRIBUTES);
      disableNot(Capability.BINARY_ATTRIBUTES);
    }
    if (Utils.getFlag("not-binary-atts", options)) {
      enableNot(Capability.BINARY_ATTRIBUTES);
      disableNot(Capability.UNARY_ATTRIBUTES);
    }
    if (Utils.getFlag("not-unary-atts", options))
      enableNot(Capability.UNARY_ATTRIBUTES);
    if (Utils.getFlag("not-numeric-atts", options))
      enableNot(Capability.NUMERIC_ATTRIBUTES);
    if (Utils.getFlag("not-string-atts", options))
      enableNot(Capability.STRING_ATTRIBUTES);
    if (Utils.getFlag("not-date-atts", options))
      enableNot(Capability.DATE_ATTRIBUTES);
    if (Utils.getFlag("not-relational-atts", options))
      enableNot(Capability.RELATIONAL_ATTRIBUTES);
    if (Utils.getFlag("not-missing-att-values", options))
      enableNot(Capability.MISSING_VALUES);

    if (Utils.getFlag("only-multiinstance", options))
      enable(Capability.ONLY_MULTIINSTANCE);

    tmpStr = Utils.getOption("superclass", options);
    if (tmpStr.length() != 0)
      m_Superclass = tmpStr;
    else
      throw new IllegalArgumentException("A superclass has to be specified!");

    tmpStr = Utils.getOption("packages", options);
    if (tmpStr.length() != 0) {
      tok        = new StringTokenizer(tmpStr, ",");
      m_Packages = new Vector();
      while (tok.hasMoreTokens())
  m_Packages.add(tok.nextToken());
    }

    if (Utils.getFlag("generic", options)) {
      creator    = new GenericPropertiesCreator();
      creator.execute(false);
      props   = creator.getInputProperties();
      tok        = new StringTokenizer(props.getProperty(m_Superclass), ",");
      m_Packages = new Vector();
      while (tok.hasMoreTokens())
  m_Packages.add(tok.nextToken());
    }
View Full Code Here

    String          tmpStr;
    Class      cls;
    CapabilitiesHandler    handler;
    boolean      initialized;
    StringTokenizer    tok;
    GenericPropertiesCreator  creator;
    Properties      props;

    m_Capabilities = new Capabilities(this);
    initialized    = false;

    tmpStr = Utils.getOption('W', options);
    if (tmpStr.length() != 0) {
      cls = Class.forName(tmpStr);
      if (ClassDiscovery.hasInterface(CapabilitiesHandler.class, cls)) {
  initialized = true;
  handler = (CapabilitiesHandler) cls.newInstance();
  if (handler instanceof OptionHandler)
    ((OptionHandler) handler).setOptions(Utils.partitionOptions(options));
  setHandler(handler);
      }
      else {
  throw new IllegalArgumentException("Class '" + tmpStr + "' is not a CapabilitiesHandler!");
      }
    }
    else {
      tmpStr = Utils.getOption('c', options);
      if (tmpStr.length() != 0)
  setClassIndex(tmpStr);
      else
  setClassIndex("last");

      tmpStr = Utils.getOption('t', options);
      setFilename(tmpStr);
    }

    tmpStr = Utils.getOption("num-instances", options);
    if (tmpStr.length() != 0)
      m_Capabilities.setMinimumNumberInstances(Integer.parseInt(tmpStr));
    else if (!initialized)
      m_Capabilities.setMinimumNumberInstances(1);

    // allowed
    if (Utils.getFlag("no-class", options))
      enable(Capability.NO_CLASS);
    // not allowed
    if (Utils.getFlag("not-no-class", options))
      enableNot(Capability.NO_CLASS);

    if (!m_Capabilities.handles(Capability.NO_CLASS)) {
      // allowed
      if (Utils.getFlag("nominal-class", options)) {
  enable(Capability.NOMINAL_CLASS);
  disable(Capability.BINARY_CLASS);
      }
      if (Utils.getFlag("binary-class", options)) {
  enable(Capability.BINARY_CLASS);
  disable(Capability.UNARY_CLASS);
      }
      if (Utils.getFlag("unary-class", options))
  enable(Capability.UNARY_CLASS);
      if (Utils.getFlag("numeric-class", options))
  enable(Capability.NUMERIC_CLASS);
      if (Utils.getFlag("string-class", options))
  enable(Capability.STRING_CLASS);
      if (Utils.getFlag("date-class", options))
  enable(Capability.DATE_CLASS);
      if (Utils.getFlag("relational-class", options))
  enable(Capability.RELATIONAL_CLASS);
      if (Utils.getFlag("missing-class-values", options))
  enable(Capability.MISSING_CLASS_VALUES);
    }
    // not allowed
    if (Utils.getFlag("not-nominal-class", options)) {
      enableNot(Capability.NOMINAL_CLASS);
      disableNot(Capability.BINARY_CLASS);
    }
    if (Utils.getFlag("not-binary-class", options)) {
      enableNot(Capability.BINARY_CLASS);
      disableNot(Capability.UNARY_CLASS);
    }
    if (Utils.getFlag("not-unary-class", options))
      enableNot(Capability.UNARY_CLASS);
    if (Utils.getFlag("not-numeric-class", options))
      enableNot(Capability.NUMERIC_CLASS);
    if (Utils.getFlag("not-string-class", options))
      enableNot(Capability.STRING_CLASS);
    if (Utils.getFlag("not-date-class", options))
      enableNot(Capability.DATE_CLASS);
    if (Utils.getFlag("not-relational-class", options))
      enableNot(Capability.RELATIONAL_CLASS);
    if (Utils.getFlag("not-relational-class", options))
      enableNot(Capability.RELATIONAL_CLASS);
    if (Utils.getFlag("not-missing-class-values", options))
      enableNot(Capability.MISSING_CLASS_VALUES);

    // allowed
    if (Utils.getFlag("nominal-atts", options)) {
      enable(Capability.NOMINAL_ATTRIBUTES);
      disable(Capability.BINARY_ATTRIBUTES);
    }
    if (Utils.getFlag("binary-atts", options)) {
      enable(Capability.BINARY_ATTRIBUTES);
      disable(Capability.UNARY_ATTRIBUTES);
    }
    if (Utils.getFlag("unary-atts", options))
      enable(Capability.UNARY_ATTRIBUTES);
    if (Utils.getFlag("numeric-atts", options))
      enable(Capability.NUMERIC_ATTRIBUTES);
    if (Utils.getFlag("string-atts", options))
      enable(Capability.STRING_ATTRIBUTES);
    if (Utils.getFlag("date-atts", options))
      enable(Capability.DATE_ATTRIBUTES);
    if (Utils.getFlag("relational-atts", options))
      enable(Capability.RELATIONAL_ATTRIBUTES);
    if (Utils.getFlag("missing-att-values", options))
      enable(Capability.MISSING_VALUES);
    // not allowed
    if (Utils.getFlag("not-nominal-atts", options)) {
      enableNot(Capability.NOMINAL_ATTRIBUTES);
      disableNot(Capability.BINARY_ATTRIBUTES);
    }
    if (Utils.getFlag("not-binary-atts", options)) {
      enableNot(Capability.BINARY_ATTRIBUTES);
      disableNot(Capability.UNARY_ATTRIBUTES);
    }
    if (Utils.getFlag("not-unary-atts", options))
      enableNot(Capability.UNARY_ATTRIBUTES);
    if (Utils.getFlag("not-numeric-atts", options))
      enableNot(Capability.NUMERIC_ATTRIBUTES);
    if (Utils.getFlag("not-string-atts", options))
      enableNot(Capability.STRING_ATTRIBUTES);
    if (Utils.getFlag("not-date-atts", options))
      enableNot(Capability.DATE_ATTRIBUTES);
    if (Utils.getFlag("not-relational-atts", options))
      enableNot(Capability.RELATIONAL_ATTRIBUTES);
    if (Utils.getFlag("not-missing-att-values", options))
      enableNot(Capability.MISSING_VALUES);

    if (Utils.getFlag("only-multiinstance", options))
      enable(Capability.ONLY_MULTIINSTANCE);

    tmpStr = Utils.getOption("superclass", options);
    if (tmpStr.length() != 0)
      m_Superclass = tmpStr;
    else
      throw new IllegalArgumentException("A superclass has to be specified!");

    tmpStr = Utils.getOption("packages", options);
    if (tmpStr.length() != 0) {
      tok        = new StringTokenizer(tmpStr, ",");
      m_Packages = new Vector<String>();
      while (tok.hasMoreTokens())
  m_Packages.add(tok.nextToken());
    }

    if (Utils.getFlag("generic", options)) {
      creator    = new GenericPropertiesCreator();
      creator.execute(false);
      props   = creator.getInputProperties();
      tok        = new StringTokenizer(props.getProperty(m_Superclass), ",");
      m_Packages = new Vector<String>();
      while (tok.hasMoreTokens())
  m_Packages.add(tok.nextToken());
    }
View Full Code Here

      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");
        }
      }
View Full Code Here

      // generate properties
      // Note: does NOT work with RMI, hence m_FileLoadersCore/m_FileSaversCore
     
      Properties props = GenericPropertiesCreator.getGlobalOutputProperties();
      if (props == null) {
        GenericPropertiesCreator creator = new GenericPropertiesCreator();
       
        creator.execute(false);
        props = creator.getOutputProperties();
      }
     
      // loaders
      m_FileLoaders = getFileConverters(
                        props.getProperty(Loader.class.getName(), CORE_FILE_LOADERS),
View Full Code Here

TOP

Related Classes of weka.gui.GenericPropertiesCreator

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.