Line

class Markup.Shapes.Line()

This class represents a single line consisting of two points. P1 is considered the start and P2 is considered the end of the line. Each Point may have its endcap settings adjusted independently.

Constructors


Constructors

Line.constructor([p1[, p2]])
Arguments
  • p1 (Point2()) – optional Optional first point on the line. If omitted, default value of (0,0) is used.

  • p2 (Point2()) – optional Optional second point on the line. If omitted, default value of (0,0) is used.

Creates a new Line Shape

Returns

new Line object.

Return type

Line

Methods

getEndEndcapColor

Line.getEndEndcapColor()

Gets the color of the end endcap. Default value is black.

Returns

color for the end endcap.

Return type

Color

getEndEndcapSize

Line.getEndEndcapSize()

Gets the size of the end endcap in pixels. Default value is 9.

Returns

size of the end endcap.

Return type

number

getEndEndcapType

Line.getEndEndcapType()

Gets the end endcap type for this shape. The default value is none.

Returns

the end endcap type

Return type

EndcapType

getEndcapsInverted

Line.getEndcapsInverted()

Gets whether endcaps are inverted for this shape. The default value is false.

Returns

value indicating whether endcaps are inverted

Return type

boolean

getP1

Line.getP1()

Gets the first point of the line segment

Returns

the first point of the line segment

Return type

Point2

getP2

Line.getP2()

Gets the second point of the line segment

Returns

the second point of the line segment

Return type

Point2

getStartEndcapColor

Line.getStartEndcapColor()

Gets the color of the start endcap. Default value is black.

Returns

color for the start endcap.

Return type

Color

getStartEndcapSize

Line.getStartEndcapSize()

Gets the size of the start endcap in pixels. Default value is 9.

Returns

size of the start endcap.

Return type

number

getStartEndcapType

Line.getStartEndcapType()

Gets the start endcap type for this shape. The default Value is none.

Returns

the start endcap type

Return type

EndcapType

getStrokeColor

Line.getStrokeColor()

Gets the stroke color for this shape

Returns

the stroke color

Return type

Color

getStrokeWidth

Line.getStrokeWidth()

Gets the stroke width for this shape in pixels

Returns

the stroke width in pixels

Return type

number

set

Line.set(p1, p2)
Arguments
  • p1 (Point2()) – first point of the line segment

  • p2 (Point2()) – second point of the line segment

Sets the points that define the line segment

Return type

void

setEndEndcapColor

Line.setEndEndcapColor(color)
Arguments
  • color (Color()) – the end endcap color value.

Sets the color for the end endcap.

Return type

void

setEndEndcapSize

Line.setEndEndcapSize(size)
Arguments
  • size (number()) – the end endcap.

Sets the size of the end endcap in pixels.

Return type

void

setEndEndcapType

Line.setEndEndcapType(endcapType)
Arguments
  • endcapType (EndcapType()) – the new endcap type

Sets the end endcap type for this shape

Return type

void

setEndcapType

Line.setEndcapType(endcapType)
Arguments
  • endcapType (EndcapType()) – the new endcap type

Convenience for setting the start and eend endcap type for this shape

Return type

void

setEndcapsInverted

Line.setEndcapsInverted(inverted)
Arguments
  • inverted (boolean()) – value indicated whether endcaps should be inverted

Sets whether endcapsare inverted for this shape.

Return type

void

setP1

Line.setP1(p1)
Arguments
  • p1 (Point2()) – first point of the line segment

Sets the first point of the line segment

Return type

void

setP2

Line.setP2(p2)
Arguments
  • p2 (Point2()) – second point of the line segment

sets the first point of the line segment

Return type

void

setStartEndcapColor

Line.setStartEndcapColor(color)
Arguments
  • color (Color()) – the start endcap color value.

Sets the color for the start endcap.

Return type

void

setStartEndcapSize

Line.setStartEndcapSize(size)
Arguments
  • size (number()) – the start endcap.

Sets the size of the start endcap in pixels.

Return type

void

setStartEndcapType

Line.setStartEndcapType(endcapType)
Arguments
  • endcapType (EndcapType()) – the new endcap type

Sets the start endcap type for this shape

Return type

void

setStrokeColor

Line.setStrokeColor(color)
Arguments
  • color (Color()) – the stroke color

Sets the stroke color for this shape

Return type

void

setStrokeWidth

Line.setStrokeWidth(strokeWidth)
Arguments
  • strokeWidth (number()) – the stroke width in pixels

Sets the stroke width for this shape in pixels

Return type

void