Line

A Line is a graphic which is a vector, potentially connecting two other graphics at its head and tail ends.

Getting Lines

Here is a script for creating an array of references to all lines on the current canvas:

cnvs = document.windows[0].selection.canvas var lines = new Array() cnvs.graphics.forEach(function(graphic){ if(graphic instanceof Line){lines.push(graphic)} })

And here’s a script for creating an array of references to all lines in the document:

var lines = new Array() canvases.forEach(function(cnvs){ cnvs.graphics.forEach(function(graphic){ if(graphic instanceof Line){lines.push(graphic)} }) })

Adding Lines

You can use either of two methods for adding a line to a document:

Line Class Properties

Line.allLineEndingTypes

Using addLine() to Create a Line

Cras mattis consectetur purus sit amet fermentum. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Donec sed odio dui. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.

cnvs = document.windows[0].selection.canvas line = cnvs.addLine(new Point(0,0),new Point(300,200)) line.lineType = LineType.Straight line.strokeThickness = 6

Using newLine() to Create a Line

Cras mattis consectetur purus sit amet fermentum. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Donec sed odio dui. Vivamus sagittis lacus vel augue laoreet rutrum faucibus dolor auctor.

cnvs = document.windows[0].selection.canvas line = cnvs.newLine() line.points = [new Point(0,0),new Point(300,200)] line.lineType = LineType.Straight line.strokeThickness = 6

Line Properties

In addition to inheriting the properties of the parent Graphic class, a Line has the following properties specific to its class:

 

Line Ending Type

A text string indicating the line ending type: Head/Tail ending types: FilledArrow, Arrow, FilledBall, Ball, FilledDoubleArrow, DoubleArrow, FilledBox, Box, FilledDiamond, Diamond, Fork, StickArrow, HalfStickArrow, DoubleStickArrow, Bar, UMLInheritance, SharpArrow, SharpBackArrow, SharpBackCross, CrowsFeet, CrowBar, CrowBall, BarBall, DoubleBar, NegativeControls, DimensionArrow, EmptyCenterBall, FilledCenterBall, UML2Socket, NonNavigable

cnvs = document.windows[0].selection.canvas line = cnvs.newLine() line.points = [new Point(72,72),new Point(144,72)] line.lineType = LineType.Straight line.strokeThickness = 1 line.shadowColor = null line.headType = 'EmptyCenterBall'

FilledArrow (String) • StickArrow

Arrow (String) • Arrow

FilledBall (String) • FilledBall

Ball (String) • Ball

FilledDoubleArrow (String) • FilledDoubleArrow

DoubleArrow (String) • DoubleArrow

FilledBox (String) • FilledBox

Box (String) • Box

FilledDiamond (String) • FilledDiamond

Diamond (String) • Diamond

Fork (String) • Fork

StickArrow (String) • StickArrow

HalfStickArrow (String) • HalfStickArrow

DoubleStickArrow (String) • DoubleStickArrow

Bar (String) • Bar

UMLInheritance (String) • UMLInheritance

SharpArrow (String) • SharpArrow

SharpBackArrow (String) • SharpBackArrow

SharpBackCross (String) • SharpBackCross

CrowsFeet (String) • CrowsFeet

CrowBar (String) • CrowBar

CrowBall (String) • CrowBall

BarBall (String) • BarBall

DoubleBar (String) • DoubleBar

NegativeControls (String) • NegativeControls

DimensionArrow (String) • DimensionArrow

EmptyCenterBall (String) • EmptyCenterBall

FilledCenterBall (String) • FilledCenterBall

UML2Socket (String) • UML2Socket

NonNavigable (String) • NonNavigable

 

Hop Type

The HopType properties are the value for the hopType property (note the lowercase h) of the Line class:

line = document.windows[0].selection.lines[0] line.hopType = HopType.Ignore
 

Line Type

The LineType properties are the value for the lineType property (note the lowercase l) of the Line class:

cnvs = document.windows[0].selection.canvas line = cnvs.addLine(new Point(0,0),new Point(300,200)) line.lineType = LineType.Straight line.strokeThickness = 6
var canvas = document.windows[0].selection.canvas var g1 = canvas.newLine() g1.strokeThickness = 8 g1.lineType = LineType.Curved g1.tailType = "FilledArrow" g1.headType = "UML2Socket" g1.geometry = new Rect(524.00, 183.00, 261.64, 261.64) g1.shadowColor = null g1.points = [new Point(785.64, 183.00), new Point(524.00, 444.64)]
UNDER CONSTRUCTION

This webpage is in the process of being developed. Any content may change and may not be accurate or complete at this time.

DISCLAIMER