Package weka.gui.beans
Class BeanConnection
java.lang.Object
weka.gui.beans.BeanConnection
- All Implemented Interfaces:
Serializable
Class for encapsulating a connection between two beans. Also maintains a list
of all connections
- Version:
- $Revision: 10221 $
- Author:
- Mark Hall
- See Also:
-
Constructor Summary
ConstructorDescriptionBeanConnection
(BeanInstance source, BeanInstance target, EventSetDescriptor esd, Integer... tab) Creates a newBeanConnection
instance. -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addConnections
(Vector<BeanConnection> connections) Add the supplied collection of connections to the end of the list.static void
appendConnections
(Vector<BeanConnection> connections, int tab) Append the supplied connections to the list for the given tab indexstatic Vector<BeanConnection>
associatedConnections
(Vector<Object> subFlow, Integer... tab) Returns a vector of BeanConnections associated with the supplied vector of BeanInstances, i.e.static void
doMetaConnection
(BeanInstance source, BeanInstance target, EventSetDescriptor esd, JComponent displayComponent, int tab) static Vector<BeanConnection>
getClosestConnections
(Point pt, int delta, Integer... tab) Return a list of connections within some delta of a pointstatic Vector<BeanConnection>
getConnections
(Integer... tab) Returns the list of connectionsReturns the name of the event for this conncetionreturns the source BeanInstance for this connectionReturns the target BeanInstance for this connectionstatic void
init()
Sets up just a single collection of bean connections in the first element of the list.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 invisibleReturns a vector of BeanInstances that can be considered as outputs (or the right-hand side of a sub-flow)static void
paintConnections
(Graphics gx, Integer... tab) Renders the connections and their names on the supplied graphics contextvoid
Remove this connectionstatic void
Remove the list of connections at the supplied indexstatic void
removeConnections
(BeanInstance instance, Integer... tab) Remove all connections for a bean.static void
setConnections
(Vector<BeanConnection> connections, Integer... tab) DescribesetConnections
method here.void
setHidden
(boolean hidden) Make this connection invisible on the display
-
Constructor Details
-
BeanConnection
public BeanConnection(BeanInstance source, BeanInstance target, EventSetDescriptor esd, Integer... tab) Creates a newBeanConnection
instance.- Parameters:
source
- the source beantarget
- the target beanesd
- the EventSetDescriptor for the connection be displayed
-
-
Method Details
-
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
Returns the list of connections- Returns:
- the list of connections
-
setConnections
DescribesetConnections
method here.- Parameters:
connections
- aVector
value
-
addConnections
Add the supplied collection of connections to the end of the list.- Parameters:
connections
- the connections to add
-
appendConnections
Append the supplied connections to the list for the given tab index- Parameters:
connections
- the connections to appendtab
- the index of the list to append to
-
associatedConnections
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
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
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
Renders the connections and their names on the supplied graphics context- Parameters:
gx
- aGraphics
value
-
getClosestConnections
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
-
removeConnectionList
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
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, EventSetDescriptor esd, 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
Remove this connection -
getSource
returns the source BeanInstance for this connection- Returns:
- a
BeanInstance
value
-
getTarget
Returns the target BeanInstance for this connection- Returns:
- a
BeanInstance
value
-
getEventName
Returns the name of the event for this conncetion- Returns:
- the name of the event for this connection
-