Interface ConnectProvider


public interface ConnectProvider
This interface controls a connect action.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    createConnection(Widget sourceWidget, Widget targetWidget)
    Called for creating a new connection between a specified source and target widget.
    boolean
    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.
    isTargetWidget(Widget sourceWidget, Widget targetWidget)
    Called for checking whether a connection could be created between a specified source and target widget.
    resolveTargetWidget(Scene scene, Point sceneLocation)
    Called to find the target widget of a possible connection.
  • Method Details

    • 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