[]
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();
voidbeginConnect(IShape connectedShape,
int connectionSite) voidvoidendConnect(IShape connectedShape,
int connectionSite) voidbooleantrue if the beginning of the specified connector is connected to a shape).IShape object that represents the shape that the beginning of the specified connector is attached to.intbooleanIShape object that represents the shape that the end of the specified connector is attached to.intgetType()voidsetType(ConnectorType value) 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();
true if the beginning of the connector is connected to a shape; otherwise, false.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();
IShape object that represents the shape that the beginning of the specified connector is attached 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 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();
true if the end of the specified connector is connected to a shape; otherwise, false.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();
IShape object that the end of the connector is attached 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 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();
ConnectorType of the connector.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);
value - The connector type to apply.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);
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();
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);
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();