Class KnowledgeFlowApp

All Implemented Interfaces:
ImageObserver, MenuContainer, PropertyChangeListener, Serializable, EventListener, Accessible

public class KnowledgeFlowApp extends JPanel implements PropertyChangeListener
Main GUI class for the KnowledgeFlow. Modifications to allow interoperability with swt provided by Davide Zerbetto (davide dot zerbetto at eng dot it).
Since:
1.0
Version:
$Revision: 9495 $
Author:
Mark Hall
See Also:
  • Field Details

    • FILE_EXTENSION

      public static final String FILE_EXTENSION
      the extension for the serialized setups (Java serialization)
      See Also:
    • FILE_EXTENSION_XML

      public static final String FILE_EXTENSION_XML
      the extension for the serialized setups (Java serialization)
      See Also:
    • s_startupListeners

      public static Vector s_startupListeners
  • Constructor Details

    • KnowledgeFlowApp

      public KnowledgeFlowApp(boolean showFileMenu)
      Creates a new KnowledgeFlowApp instance.
  • Method Details

    • loadProperties

      public static void loadProperties()
      Loads KnowledgeFlow properties and any plugins (adds jars to the classpath)
    • setEnvironment

      public void setEnvironment(Environment env)
      Set the environment variables to use. NOTE: loading a new layout resets back to the default set of variables
      Parameters:
      env -
    • clearLayout

      public void clearLayout()
    • propertyChange

      public void propertyChange(PropertyChangeEvent e)
      Accept property change events
      Specified by:
      propertyChange in interface PropertyChangeListener
      Parameters:
      e - a PropertyChangeEvent value
    • setFlow

      public void setFlow(Vector v) throws Exception
      Set the flow for the KnowledgeFlow to edit. Assumes that client has loaded a Vector of beans and a Vector of connections. the supplied beans and connections are deep-copied via serialization before being set in the layout.
      Parameters:
      v - a Vector containing a Vector of beans and a Vector of connections
      Throws:
      Exception - if something goes wrong
    • getFlow

      public Vector getFlow() throws Exception
      Gets the current flow being edited. The flow is returned as a single Vector containing two other Vectors: the beans and the connections. These two vectors are deep-copied via serialization before being returned.
      Returns:
      the current flow being edited
      Throws:
      Exception
    • saveLayout

      public void saveLayout(OutputStream out)
      Save the knowledge flow into the OutputStream passed at input. Only supports saving the layout data (no trained models) to XML.
      Parameters:
      out - the output stream to save the layout in
    • getGlobalInfo

      public static String getGlobalInfo(Object tempBean)
      Utility method for grabbing the global info help (if it exists) from an arbitrary object
      Parameters:
      tempBean - the object to grab global info from
      Returns:
      the global help info or null if global info does not exist
    • createSingleton

      public static void createSingleton(String[] args)
      Create the singleton instance of the KnowledgeFlow
      Parameters:
      args - can contain a file argument for loading a flow layout (format: "file=[path to layout file]") Modified by Zerbetto: you can specify the path of a knowledge flow layout file at input
    • getSingleton

      public static KnowledgeFlowApp getSingleton()
      Return the singleton instance of the KnowledgeFlow
      Returns:
      the singleton instance
    • addStartupListener

      public static void addStartupListener(StartUpListener s)
      Add a listener to be notified when startup is complete
      Parameters:
      s - a listener to add
    • loadInitialLayout

      public void loadInitialLayout(String fileName)
      Loads the specified file at input Added by Zerbetto
    • main

      public static void main(String[] args)
      Main method.
      Parameters:
      args - a String[] value