站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > NetBeans API Javadoc (Current Development Version)

ConnectProvider (Visual Library API) - NetBeans API Javadoc (Current Development Version)

org.netbeans.api.visual 2.2

org.netbeans.api.visual.action
Interface ConnectProvider


public interface ConnectProvider

This interface controls a connect action.


Method Summary
 void createConnection(Widget sourceWidget, Widget targetWidget)
          Called for creating a new connection between a specified source and target widget.
 boolean hasCustomTargetWidgetResolver(Scene scene)
          Called to check whether the provider has a custom target widget resolver.
 boolean isSourceWidget(Widget sourceWidget)
          Called for checking whether a specified source widget is a possible source of a connection.
 ConnectorState isTargetWidget(Widget sourceWidget, Widget targetWidget)
          Called for checking whether a connection could be created between a specified source and target widget.
 Widget resolveTargetWidget(Scene scene, Point sceneLocation)
          Called to find the target widget of a possible connection.
 

Method Detail

isSourceWidget

boolean isSourceWidget(Widget sourceWidget)
Called for checking whether a specified source widget is a possible source of a connection.

Parameters:
sourceWidget - the source widget
Returns:
if true, then it is possible to create a connection for the source widget; if false, then is not allowed

isTargetWidget

ConnectorState isTargetWidget(Widget sourceWidget,
                              Widget targetWidget)
Called for checking whether a connection could be created between a specified source and target widget. Called only when a hasCustomTargetWidgetResolver returns false.

Parameters:
sourceWidget - the source widget
targetWidget - the target widget
Returns:
the connector state

hasCustomTargetWidgetResolver

boolean hasCustomTargetWidgetResolver(Scene scene)
Called to check whether the provider has a custom target widget resolver.

Parameters:
scene - the scene where the resolver will be called
Returns:
if true, then the resolveTargetWidget method is called for resolving the target widget; if false, then the isTargetWidget method is called for resolving the target widget

resolveTargetWidget

Widget resolveTargetWidget(Scene scene,
                           Point sceneLocation)
Called to find the target widget of a possible connection. Called only when a hasCustomTargetWidgetResolver returns true.

Parameters:
scene - the scene
sceneLocation - the scene location
Returns:
the target widget; null if no target widget found

createConnection

void createConnection(Widget sourceWidget,
                      Widget targetWidget)
Called for creating a new connection between a specified source and target widget. This method is called only when the possible connection is available and an user approves its creation.

Parameters:
sourceWidget - the source widget
targetWidget - the target widget

org.netbeans.api.visual 2.2

Built on May 28 2007.  |  Portions Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.