LineTo
Source: aspose.
Contains x- and y-coordinates of the ending vertex of a straight line segment. These coordinates are contained in the X and Y elements, respectively.
new LineTo()
Creates an instance of the LineTo class.
Example
var aspose = aspose || {};
aspose.diagram = require("aspose.diagram");
diagram = new aspose.diagram.Diagram("EditConnectorGeometry.vsdx");
// set connector shape id
connectorId = 4;
connector = diagram.getPages().getPage("Page-1").getShapes().getShape(connectorId);
// get connector geometry at index 0
defaultLineTo = connector.getGeoms().get(0).getCoordinateCol().getLineToCol().get(0);
// remove connector geometry from index 0
connector.getGeoms().get(0).getCoordinateCol().getLineToCol().get(0).setDel(aspose.diagram.BOOL.TRUE);
// initialize LineTo geometry object
lineTo = new aspose.diagram.LineTo();
// set X value
lineTo.getX().setValue(0);
// set Y value
lineTo.getY().setValue(defaultLineTo.getY().getValue() / 2);
// add connector geometry
connector.getGeoms().get(0).getCoordinateCol().add(lineTo);
// initialize LineTo geometry object
lineTo = new aspose.diagram.LineTo();
// set Y value
lineTo.getY().setValue(defaultLineTo.getY().getValue() / 2);
// set X value
lineTo.getX().setValue(defaultLineTo.getX().getValue());
// add connector geometry
connector.getGeoms().get(0).getCoordinateCol().add(lineTo);
// initialize LineTo geometry object
lineTo = new aspose.diagram.LineTo();
// set X value
lineTo.getX().setValue(defaultLineTo.getX().getValue());
// set Y value
lineTo.getY().setValue(defaultLineTo.getY().getValue());
// add connector geometry
connector.getGeoms().get(0).getCoordinateCol().add(lineTo);
diagram.save("out-EditConnectorGeometry.vsdx", aspose.diagram.SaveFileFormat.VSDX);
Methods
deepClone() → Object
Creates deep copy of this instance.
- Returns
-
Object
getDel()
A flag indicating whether the element has been deleted locally. A value of 1 indicates that the element was deleted locally. The value of the property is BOOL integer constant.
getIX()
The zero-based index of the element within its parent element.
getX()
The x-coordinate of the ending vertex of a straight line segment.
getY()
The y-coordinate of the ending vertex of a straight line segment.
setDel()
A flag indicating whether the element has been deleted locally. A value of 1 indicates that the element was deleted locally. The value of the property is BOOL integer constant.
setIX()
The zero-based index of the element within its parent element.
setX()
The x-coordinate of the ending vertex of a straight line segment.
setY()
The y-coordinate of the ending vertex of a straight line segment.