Package weka.gui.beans
Class BeanConnection
- java.lang.Object
-
- weka.gui.beans.BeanConnection
-
- All Implemented Interfaces:
java.io.Serializable
public class BeanConnection extends java.lang.Object implements java.io.SerializableClass for encapsulating a connection between two beans. Also maintains a list of all connections- Version:
- $Revision: 7059 $
- Author:
- Mark Hall
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.util.VectorCONNECTIONSThe list of connections
-
Constructor Summary
Constructors Constructor Description BeanConnection(BeanInstance source, BeanInstance target, java.beans.EventSetDescriptor esd)Creates a newBeanConnectioninstance.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.util.VectorassociatedConnections(java.util.Vector subFlow)Returns a vector of BeanConnections associated with the supplied vector of BeanInstances, i.e.static voiddoMetaConnection(BeanInstance source, BeanInstance target, java.beans.EventSetDescriptor esd, javax.swing.JComponent displayComponent)static java.util.VectorgetClosestConnections(java.awt.Point pt, int delta)Return a list of connections within some delta of a pointstatic java.util.VectorgetConnections()Returns the list of connectionsjava.lang.StringgetEventName()Returns the name of the event for this conncetionBeanInstancegetSource()returns the source BeanInstance for this connectionBeanInstancegetTarget()Returns the target BeanInstance for this connectionstatic java.util.Vectorinputs(java.util.Vector subset)Returns a vector of BeanInstances that can be considered as inputs (or the left-hand side of a sub-flow)booleanisHidden()Returns true if this connection is invisiblestatic java.util.Vectoroutputs(java.util.Vector subset)Returns a vector of BeanInstances that can be considered as outputs (or the right-hand side of a sub-flow)static voidpaintConnections(java.awt.Graphics gx)Renders the connections and their names on the supplied graphics contextvoidremove()Remove this connectionstatic voidremoveConnections(BeanInstance instance)Remove all connections for a bean.static voidreset()Reset the list of connectionsstatic voidsetConnections(java.util.Vector connections)DescribesetConnectionsmethod here.voidsetHidden(boolean hidden)Make this connection invisible on the display
-
-
-
Constructor Detail
-
BeanConnection
public BeanConnection(BeanInstance source, BeanInstance target, java.beans.EventSetDescriptor esd)
Creates a newBeanConnectioninstance.- Parameters:
source- the source beantarget- the target beanesd- the EventSetDescriptor for the connection be displayed
-
-
Method Detail
-
reset
public static void reset()
Reset the list of connections
-
getConnections
public static java.util.Vector getConnections()
Returns the list of connections- Returns:
- the list of connections
-
setConnections
public static void setConnections(java.util.Vector connections)
DescribesetConnectionsmethod here.- Parameters:
connections- aVectorvalue
-
associatedConnections
public static java.util.Vector associatedConnections(java.util.Vector subFlow)
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 inputs(java.util.Vector subset)
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 outputs(java.util.Vector subset)
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)
Renders the connections and their names on the supplied graphics context- Parameters:
gx- aGraphicsvalue
-
getClosestConnections
public static java.util.Vector getClosestConnections(java.awt.Point pt, int delta)Return a list of connections within some delta of a point- Parameters:
pt- the point at which to look for connectionsdelta- connections have to be within this delta of the point- Returns:
- a list of connections
-
removeConnections
public static void removeConnections(BeanInstance instance)
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)
-
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()
Remove this connection
-
getSource
public BeanInstance getSource()
returns the source BeanInstance for this connection- Returns:
- a
BeanInstancevalue
-
getTarget
public BeanInstance getTarget()
Returns the target BeanInstance for this connection- Returns:
- a
BeanInstancevalue
-
getEventName
public java.lang.String getEventName()
Returns the name of the event for this conncetion- Returns:
- the name of the event for this connection
-
-