[]
        
(Showing Draft Content)

IConnectorFormat

Interface IConnectorFormat


public interface IConnectorFormat
Represents properties and methods that apply to connectors.

Use this interface to inspect and modify connector-specific settings, such as the connector type and the shapes connected to the beginning or end of the connector. You can obtain an IConnectorFormat instance from a connector shape through IShape.getConnectorFormat().


 IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 20, 20, 120, 80);
 IConnectorFormat connectorFormat = connector.getConnectorFormat();
 connectorFormat.setType(ConnectorType.Elbow);
 ConnectorType type = connectorFormat.getType();
 
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    beginConnect(IShape connectedShape, int connectionSite)
    Attaches the beginning of the specified connector to a specified shape.
    void
    Detaches the beginning of the specified connector from the shape it’s attached to.
    void
    endConnect(IShape connectedShape, int connectionSite)
    Attaches the end of the specified connector to a specified shape.
    void
    Detaches the end of the specified connector from the shape it is attached to.
    boolean
    Gets whether the connector is connected to a shape ( true if the beginning of the specified connector is connected to a shape).
    Returns the IShape object that represents the shape that the beginning of the specified connector is attached to.
    int
    Returns an integer that specifies the connection site that the beginning of a connector is connected to.
    boolean
    Gets whether the end of the connector is connected to a shape.
    Returns the IShape object that represents the shape that the end of the specified connector is attached to.
    int
    Returns an integer that specifies the connection site that the end of a connector is connected to.
    Gets the connector format type.
    void
    Sets the connector format type.
  • Method Details

    • getBeginConnected

      boolean getBeginConnected()
      Gets whether the connector is connected to a shape ( true if the beginning of the specified connector is connected to a shape).

      Use this method to determine whether the beginning of the connector is currently attached to a shape. To connect the beginning of a connector, use beginConnect(IShape,int).

      
       IShape connectedShape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 20, 100, 60);
       IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 70, 50, 180, 50);
       connector.getConnectorFormat().beginConnect(connectedShape, 1);
       boolean beginConnected = connector.getConnectorFormat().getBeginConnected();
       
      Returns:
      true if the beginning of the connector is connected to a shape; otherwise, false.
    • getBeginConnectedShape

      IShape getBeginConnectedShape()
      Returns the IShape object that represents the shape that the beginning of the specified connector is attached to.

      Use this method to get the shape connected to the beginning of a connector after the connection is established by beginConnect(IShape,int).

      
       IShape connectedShape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 20, 100, 60);
       IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 70, 50, 180, 50);
       connector.getConnectorFormat().beginConnect(connectedShape, 1);
       IShape beginConnectedShape = connector.getConnectorFormat().getBeginConnectedShape();
       
      Returns:
      The IShape object that represents the shape that the beginning of the specified connector is attached to.
    • getBeginConnectionSite

      int getBeginConnectionSite()
      Returns an integer that specifies the connection site that the beginning of a connector is connected to.

      Use this method to get the connection site index at the beginning of a connector after the connection is established by beginConnect(IShape,int).

      
       IShape connectedShape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 20, 100, 60);
       IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 70, 50, 180, 50);
       connector.getConnectorFormat().beginConnect(connectedShape, 1);
       int beginConnectionSite = connector.getConnectorFormat().getBeginConnectionSite();
       
      Returns:
      The connection site index that the beginning of the connector is connected to.
    • getEndConnected

      boolean getEndConnected()
      Gets whether the end of the connector is connected to a shape.

      Returns true if the end of the specified connector is connected to a shape. Use this method after endConnect(IShape,int) to determine whether the connector's end point is currently attached.

      
       IShape connectedShape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 200, 20, 100, 60);
       IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 70, 50, 180, 50);
       connector.getConnectorFormat().endConnect(connectedShape, 1);
       boolean endConnected = connector.getConnectorFormat().getEndConnected();
       
      Returns:
      true if the end of the specified connector is connected to a shape; otherwise, false.
    • getEndConnectedShape

      IShape getEndConnectedShape()
      Returns the IShape object that represents the shape that the end of the specified connector is attached to.

      Use this method to retrieve the shape currently connected to the end of a connector after calling endConnect(IShape,int).

      
       IShape connectedShape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 20, 100, 60);
       IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 70, 50, 180, 50);
       connector.getConnectorFormat().endConnect(connectedShape, 1);
       IShape endConnectedShape = connector.getConnectorFormat().getEndConnectedShape();
       
      Returns:
      The IShape object that the end of the connector is attached to.
    • getEndConnectionSite

      int getEndConnectionSite()
      Returns an integer that specifies the connection site that the end of a connector is connected to.

      Use this method after endConnect(IShape,int) to retrieve the connection site index on the shape attached to the end of the connector.

      
       IShape connectedShape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 20, 100, 60);
       IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 70, 50, 180, 50);
       connector.getConnectorFormat().endConnect(connectedShape, 1);
       int endConnectionSite = connector.getConnectorFormat().getEndConnectionSite();
       
      Returns:
      An integer that specifies the connection site that the end of the connector is connected to.
    • getType

      ConnectorType getType()
      Gets the connector format type.

      Returns the ConnectorType that specifies whether the connector is straight, elbow, or curved.

      
       IShape connector = worksheet.getShapes().addConnector(ConnectorType.Curve, 20, 20, 180, 120);
       ConnectorType type = connector.getConnectorFormat().getType();
       
      Returns:
      The ConnectorType of the connector.
    • setType

      void setType(ConnectorType value)
      Sets the connector format type.

      Use this method to change the type of a connector shape returned by IShape.getConnectorFormat().

      
       IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 70, 50, 180, 50);
       connector.getConnectorFormat().setType(ConnectorType.Curve);
       
      Parameters:
      value - The connector type to apply.
    • beginConnect

      void beginConnect(IShape connectedShape, int connectionSite)
      Attaches the beginning of the specified connector to a specified shape.

      Use this method to connect the starting point of a connector to a connection site on a shape. The specified shape must be in the same IShapes collection as the connector.

      
       IShape connectedShape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 20, 100, 60);
       IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 70, 50, 180, 50);
       connector.getConnectorFormat().beginConnect(connectedShape, 1);
       
      Parameters:
      connectedShape - Required IShape object. The shape to attach the beginning of the connector to. The specified Shape object must be in the same IShapes collection as the connector.
      connectionSite - Required Integer. A connection site on the shape specified by connectedShape.
    • beginDisconnect

      void beginDisconnect()
      Detaches the beginning of the specified connector from the shape it’s attached to.

      Use this method to remove the connection between the beginning point of a connector and the connected shape.

      
       IShape connectedShape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 20, 20, 100, 60);
       IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 70, 50, 180, 50);
       connector.getConnectorFormat().beginConnect(connectedShape, 1);
       connector.getConnectorFormat().beginDisconnect();
       
    • endConnect

      void endConnect(IShape connectedShape, int connectionSite)
      Attaches the end of the specified connector to a specified shape.

      Use this method to connect the ending point of a connector to a connection site on a shape. The specified shape must be in the same IShapes collection as the connector.

      
       IShape connectedShape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 200, 20, 100, 60);
       IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 70, 50, 180, 50);
       connector.getConnectorFormat().endConnect(connectedShape, 1);
       
      Parameters:
      connectedShape - Required IShape object. The shape to attach the end of the connector to. The specified Shape object must be in the same IShapes collection as the connector.
      connectionSite - Required Integer. A connection site on the shape specified by connectedShape.
    • endDisconnect

      void endDisconnect()
      Detaches the end of the specified connector from the shape it is attached to.

      Use this method to remove the connection between a connector's end point and a shape while keeping the connector object available for further repositioning or reconnection.

      
       IShape connectedShape = worksheet.getShapes().addShape(AutoShapeType.Rectangle, 200, 20, 100, 60);
       IShape connector = worksheet.getShapes().addConnector(ConnectorType.Straight, 70, 50, 180, 50);
       connector.getConnectorFormat().endConnect(connectedShape, 1);
       connector.getConnectorFormat().endDisconnect();