Class BeanConnection

  • All Implemented Interfaces:
    java.io.Serializable

    public class BeanConnection
    extends java.lang.Object
    implements java.io.Serializable
    Class for encapsulating a connection between two beans. Also maintains a list of all connections
    Version:
    $Revision: 10221 $
    Author:
    Mark Hall
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      BeanConnection​(BeanInstance source, BeanInstance target, java.beans.EventSetDescriptor esd, java.lang.Integer... tab)
      Creates a new BeanConnection instance.
    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      static void addConnections​(java.util.Vector<BeanConnection> connections)
      Add the supplied collection of connections to the end of the list.
      static void appendConnections​(java.util.Vector<BeanConnection> connections, int tab)
      Append the supplied connections to the list for the given tab index
      static java.util.Vector<BeanConnection> associatedConnections​(java.util.Vector<java.lang.Object> subFlow, java.lang.Integer... tab)
      Returns a vector of BeanConnections associated with the supplied vector of BeanInstances, i.e.
      static void doMetaConnection​(BeanInstance source, BeanInstance target, java.beans.EventSetDescriptor esd, javax.swing.JComponent displayComponent, int tab)  
      static java.util.Vector<BeanConnection> getClosestConnections​(java.awt.Point pt, int delta, java.lang.Integer... tab)
      Return a list of connections within some delta of a point
      static java.util.Vector<BeanConnection> getConnections​(java.lang.Integer... tab)
      Returns the list of connections
      java.lang.String getEventName()
      Returns the name of the event for this conncetion
      BeanInstance getSource()
      returns the source BeanInstance for this connection
      BeanInstance getTarget()
      Returns the target BeanInstance for this connection
      static void init()
      Sets up just a single collection of bean connections in the first element of the list.
      static java.util.Vector<java.lang.Object> inputs​(java.util.Vector<java.lang.Object> subset, java.lang.Integer... tab)
      Returns a vector of BeanInstances that can be considered as inputs (or the left-hand side of a sub-flow)
      boolean isHidden()
      Returns true if this connection is invisible
      static java.util.Vector<java.lang.Object> outputs​(java.util.Vector<java.lang.Object> subset, java.lang.Integer... tab)
      Returns a vector of BeanInstances that can be considered as outputs (or the right-hand side of a sub-flow)
      static void paintConnections​(java.awt.Graphics gx, java.lang.Integer... tab)
      Renders the connections and their names on the supplied graphics context
      void remove​(java.lang.Integer... tab)
      Remove this connection
      static void removeConnectionList​(java.lang.Integer tab)
      Remove the list of connections at the supplied index
      static void removeConnections​(BeanInstance instance, java.lang.Integer... tab)
      Remove all connections for a bean.
      static void setConnections​(java.util.Vector<BeanConnection> connections, java.lang.Integer... tab)
      Describe setConnections method here.
      void setHidden​(boolean hidden)
      Make this connection invisible on the display
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • BeanConnection

        public BeanConnection​(BeanInstance source,
                              BeanInstance target,
                              java.beans.EventSetDescriptor esd,
                              java.lang.Integer... tab)
        Creates a new BeanConnection instance.
        Parameters:
        source - the source bean
        target - the target bean
        esd - the EventSetDescriptor for the connection be displayed
    • Method Detail

      • init

        public static void init()
        Sets up just a single collection of bean connections in the first element of the list. This is useful for clients that are using XMLBeans to load beans.
      • getConnections

        public static java.util.Vector<BeanConnection> getConnections​(java.lang.Integer... tab)
        Returns the list of connections
        Returns:
        the list of connections
      • setConnections

        public static void setConnections​(java.util.Vector<BeanConnection> connections,
                                          java.lang.Integer... tab)
        Describe setConnections method here.
        Parameters:
        connections - a Vector value
      • addConnections

        public static void addConnections​(java.util.Vector<BeanConnection> connections)
        Add the supplied collection of connections to the end of the list.
        Parameters:
        connections - the connections to add
      • appendConnections

        public static void appendConnections​(java.util.Vector<BeanConnection> connections,
                                             int tab)
        Append the supplied connections to the list for the given tab index
        Parameters:
        connections - the connections to append
        tab - the index of the list to append to
      • associatedConnections

        public static java.util.Vector<BeanConnection> associatedConnections​(java.util.Vector<java.lang.Object> subFlow,
                                                                             java.lang.Integer... tab)
        Returns a vector of BeanConnections associated with the supplied vector of BeanInstances, i.e. all connections that exist between those BeanInstances in the subFlow.
        Parameters:
        subFlow - a Vector of BeanInstances
        Returns:
        a Vector of BeanConnections
      • inputs

        public static java.util.Vector<java.lang.Object> inputs​(java.util.Vector<java.lang.Object> subset,
                                                                java.lang.Integer... tab)
        Returns a vector of BeanInstances that can be considered as inputs (or the left-hand side of a sub-flow)
        Parameters:
        subset - the sub-flow to examine
        Returns:
        a Vector of inputs to the sub-flow
      • outputs

        public static java.util.Vector<java.lang.Object> outputs​(java.util.Vector<java.lang.Object> subset,
                                                                 java.lang.Integer... tab)
        Returns a vector of BeanInstances that can be considered as outputs (or the right-hand side of a sub-flow)
        Parameters:
        subset - the sub-flow to examine
        Returns:
        a Vector of outputs of the sub-flow
      • paintConnections

        public static void paintConnections​(java.awt.Graphics gx,
                                            java.lang.Integer... tab)
        Renders the connections and their names on the supplied graphics context
        Parameters:
        gx - a Graphics value
      • getClosestConnections

        public static java.util.Vector<BeanConnection> getClosestConnections​(java.awt.Point pt,
                                                                             int delta,
                                                                             java.lang.Integer... tab)
        Return a list of connections within some delta of a point
        Parameters:
        pt - the point at which to look for connections
        delta - connections have to be within this delta of the point
        Returns:
        a list of connections
      • removeConnectionList

        public static void removeConnectionList​(java.lang.Integer tab)
        Remove the list of connections at the supplied index
        Parameters:
        tab - the index of the list to remove (correspods to a tab in the Knowledge Flow UI)
        tab - the index of the list of connections to remove
      • removeConnections

        public static void removeConnections​(BeanInstance instance,
                                             java.lang.Integer... tab)
        Remove all connections for a bean. If the bean is a target for receiving events then it gets deregistered from the corresonding source bean. If the bean is a source of events then all targets implementing BeanCommon are notified via their disconnectionNotification methods that the source (and hence the connection) is going away.
        Parameters:
        instance - the bean to remove connections to/from
      • doMetaConnection

        public static void doMetaConnection​(BeanInstance source,
                                            BeanInstance target,
                                            java.beans.EventSetDescriptor esd,
                                            javax.swing.JComponent displayComponent,
                                            int tab)
      • setHidden

        public void setHidden​(boolean hidden)
        Make this connection invisible on the display
        Parameters:
        hidden - true to make the connection invisible
      • isHidden

        public boolean isHidden()
        Returns true if this connection is invisible
        Returns:
        true if connection is invisible
      • remove

        public void remove​(java.lang.Integer... tab)
        Remove this connection
      • getSource

        public BeanInstance getSource()
        returns the source BeanInstance for this connection
        Returns:
        a BeanInstance value
      • getTarget

        public BeanInstance getTarget()
        Returns the target BeanInstance for this connection
        Returns:
        a BeanInstance value
      • getEventName

        public java.lang.String getEventName()
        Returns the name of the event for this conncetion
        Returns:
        the name of the event for this connection