AnnLineEnding Class

Summary

Defines the base class for all line ending styles.

Syntax
TypeScript
JavaScript
function lt.Annotations.Engine.AnnLineEnding 
class lt.Annotations.Engine.AnnLineEnding() 

Remarks

The line ending styles are the shapes that can be added to the starting and ending points of the polyline object.

The AnnLineEnding Members class provides all the basic functionality common to all LEADTOOLS line ending styles. AnnLineEnding Members is an abstract class: you cannot instantiate objects of this class directly. Instead, you create an instance of a derived class such as AnnArrowLineEnding or AnnButtLineEnding and use the methods and properties of the base AnnLineEnding class through the derived class.

Line ending styles cannot be added to closed polyline objects.

Example

This example creates a list of polyline objects, creates all ending style types and sets them to polyline objects ending styles.

TypeScript
JavaScript
// assumes _automation is valid 
var inch = 720.0; 
// Create polyline object and add it the automation container   
var polyLine = new lt.Annotations.Engine.AnnPolylineObject(); 
polyLine.points.add(lt.LeadPointD.create(1 * inch, 1 * inch)); 
polyLine.points.add(lt.LeadPointD.create(2 * inch, 1 * inch)); 
_automation.container.children.add(polyLine); 
// Create arrow line ending style and set some properties 
var arrowStyle = new lt.Annotations.Engine.AnnArrowLineEnding(); 
arrowStyle.closed = true; 
arrowStyle.reversed = true; 
arrowStyle.fill = lt.Annotations.Engine.AnnSolidColorBrush.create("Yellow"); 
// Set the created arrow style to polyline start and end style 
polyLine.startStyle = arrowStyle; 
polyLine.endStyle = arrowStyle; 
// Create another polyline object and add it the automation container   
polyLine = new lt.Annotations.Engine.AnnPolylineObject(); 
polyLine.points.add(lt.LeadPointD.create(1 * inch, 1.2 * inch)); 
polyLine.points.add(lt.LeadPointD.create(2 * inch, 1.2 * inch)); 
_automation.container.children.add(polyLine); 
// Create butt line ending style 
var buttStyle = new lt.Annotations.Engine.AnnButtLineEnding(); 
// Set the created butt style to polyline start and end style 
polyLine.startStyle = buttStyle; 
polyLine.endStyle = buttStyle; 
// Create another polyline object and add it the automation container   
polyLine = new lt.Annotations.Engine.AnnPolylineObject(); 
polyLine.points.add(lt.LeadPointD.create(1 * inch, 1.4 * inch)); 
polyLine.points.add(lt.LeadPointD.create(2 * inch, 1.4 * inch)); 
_automation.container.children.add(polyLine); 
// Create slash line ending style 
var slashStyle = new lt.Annotations.Engine.AnnSlashLineEnding(); 
// Set the created slash style to polyline start and end style 
polyLine.startStyle = slashStyle; 
polyLine.endStyle = slashStyle; 
// Create another polyline object and add it the automation container   
polyLine = new lt.Annotations.Engine.AnnPolylineObject(); 
polyLine.points.add(lt.LeadPointD.create(1 * inch, 1.6 * inch)); 
polyLine.points.add(lt.LeadPointD.create(2 * inch, 1.6 * inch)); 
_automation.container.children.add(polyLine); 
// Create square line ending style 
var squareStyle = new lt.Annotations.Engine.AnnSquareLineEnding(); 
// Set the created square style to polyline start and end style 
polyLine.startStyle = squareStyle; 
polyLine.endStyle = squareStyle; 
// Create another polyline object and add it the automation container   
polyLine = new lt.Annotations.Engine.AnnPolylineObject(); 
polyLine.points.add(lt.LeadPointD.create(1 * inch, 1.8 * inch)); 
polyLine.points.add(lt.LeadPointD.create(2 * inch, 1.8 * inch)); 
_automation.container.children.add(polyLine); 
// Create diamond line ending style 
var diamondStyle = new lt.Annotations.Engine.AnnDiamondLineEnding(); 
// Set the created diamond style to polyline start and end style 
polyLine.startStyle = diamondStyle; 
polyLine.endStyle = diamondStyle; 
// Create another polyline object and add it the automation container   
polyLine = new lt.Annotations.Engine.AnnPolylineObject(); 
polyLine.points.add(lt.LeadPointD.create(1 * inch, 2 * inch)); 
polyLine.points.add(lt.LeadPointD.create(2 * inch, 2 * inch)); 
_automation.container.children.add(polyLine); 
// Create round line ending style 
var roundStyle = new lt.Annotations.Engine.AnnRoundLineEnding(); 
// Set the created round style to polyline start and end style 
polyLine.startStyle = roundStyle; 
polyLine.endStyle = roundStyle; 
// assumes _automation is valid 
const inch = 720.0; 
 
// Create polyline object and add it the automation container   
let polyLine: lt.Annotations.Engine.AnnPolylineObject = new lt.Annotations.Engine.AnnPolylineObject(); 
polyLine.points.add(lt.LeadPointD.create(1 * inch, 1 * inch)); 
polyLine.points.add(lt.LeadPointD.create(2 * inch, 1 * inch)); 
this._automation.container.children.add(polyLine); 
 
// Create arrow line ending style and set some properties 
const arrowStyle: lt.Annotations.Engine.AnnArrowLineEnding = new lt.Annotations.Engine.AnnArrowLineEnding(); 
arrowStyle.closed = true; 
arrowStyle.reversed = true; 
arrowStyle.fill = lt.Annotations.Engine.AnnSolidColorBrush.create("Yellow"); 
 
// Set the created arrow style to polyline start and end style 
polyLine.startStyle = arrowStyle; 
polyLine.endStyle = arrowStyle; 
 
// Create another polyline object and add it the automation container   
polyLine = new lt.Annotations.Engine.AnnPolylineObject(); 
polyLine.points.add(lt.LeadPointD.create(1 * inch, 1.2 * inch)); 
polyLine.points.add(lt.LeadPointD.create(2 * inch, 1.2 * inch)); 
this._automation.container.children.add(polyLine); 
 
// Create butt line ending style 
const buttStyle: lt.Annotations.Engine.AnnButtLineEnding = new lt.Annotations.Engine.AnnButtLineEnding(); 
 
// Set the created butt style to polyline start and end style 
polyLine.startStyle = buttStyle; 
polyLine.endStyle = buttStyle; 
 
// Create another polyline object and add it the automation container   
polyLine = new lt.Annotations.Engine.AnnPolylineObject(); 
polyLine.points.add(lt.LeadPointD.create(1 * inch, 1.4 * inch)); 
polyLine.points.add(lt.LeadPointD.create(2 * inch, 1.4 * inch)); 
this._automation.container.children.add(polyLine); 
 
// Create slash line ending style 
const slashStyle: lt.Annotations.Engine.AnnSlashLineEnding = new lt.Annotations.Engine.AnnSlashLineEnding(); 
 
// Set the created slash style to polyline start and end style 
polyLine.startStyle = slashStyle; 
polyLine.endStyle = slashStyle; 
 
// Create another polyline object and add it the automation container   
polyLine = new lt.Annotations.Engine.AnnPolylineObject(); 
polyLine.points.add(lt.LeadPointD.create(1 * inch, 1.6 * inch)); 
polyLine.points.add(lt.LeadPointD.create(2 * inch, 1.6 * inch)); 
this._automation.container.children.add(polyLine); 
 
// Create square line ending style 
var squareStyle: lt.Annotations.Engine.AnnSquareLineEnding = new lt.Annotations.Engine.AnnSquareLineEnding(); 
 
// Set the created square style to polyline start and end style 
polyLine.startStyle = squareStyle; 
polyLine.endStyle = squareStyle; 
 
// Create another polyline object and add it the automation container   
polyLine = new lt.Annotations.Engine.AnnPolylineObject(); 
polyLine.points.add(lt.LeadPointD.create(1 * inch, 1.8 * inch)); 
polyLine.points.add(lt.LeadPointD.create(2 * inch, 1.8 * inch)); 
this._automation.container.children.add(polyLine); 
 
// Create diamond line ending style 
const diamondStyle: lt.Annotations.Engine.AnnDiamondLineEnding = new lt.Annotations.Engine.AnnDiamondLineEnding(); 
 
// Set the created diamond style to polyline start and end style 
polyLine.startStyle = diamondStyle; 
polyLine.endStyle = diamondStyle; 
 
// Create another polyline object and add it the automation container   
polyLine = new lt.Annotations.Engine.AnnPolylineObject(); 
polyLine.points.add(lt.LeadPointD.create(1 * inch, 2 * inch)); 
polyLine.points.add(lt.LeadPointD.create(2 * inch, 2 * inch)); 
this._automation.container.children.add(polyLine); 
 
// Create round line ending style 
const roundStyle: lt.Annotations.Engine.AnnRoundLineEnding = new lt.Annotations.Engine.AnnRoundLineEnding(); 
// Set the created round style to polyline start and end style 
polyLine.startStyle = roundStyle; 
polyLine.endStyle = roundStyle; 

Requirements

Target Platforms

Help Version 20.0.2019.3.11
Products | Support | Contact Us | Intellectual Property Notices
© 1991-2019 LEAD Technologies, Inc. All Rights Reserved.

Leadtools.Annotations.Engine Assembly