.. role:: clio-inherited
   :class: clio-flag clio-flag-inherited


####
Line
####

.. js: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.
   
   
   Index
   =====
   
   .. rubric:: Constructors
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:func:`~Markup.Shapes.Line.constructor`
   
   .. rubric:: Methods
   
   
   .. rst-class:: api-xref-list
   
   
   * :js:meth:`~Markup.Shapes.Line.getEndcapsInverted`
   * :js:meth:`~Markup.Shapes.Line.getEndEndcapColor`
   * :js:meth:`~Markup.Shapes.Line.getEndEndcapSize`
   * :js:meth:`~Markup.Shapes.Line.getEndEndcapType`
   * :js:meth:`~Markup.Shapes.Line.getP1`
   * :js:meth:`~Markup.Shapes.Line.getP2`
   * :js:meth:`~Markup.Shapes.Line.getStartEndcapColor`
   * :js:meth:`~Markup.Shapes.Line.getStartEndcapSize`
   * :js:meth:`~Markup.Shapes.Line.getStartEndcapType`
   * :js:meth:`~Markup.Shapes.Line.getStrokeColor`
   * :js:meth:`~Markup.Shapes.Line.getStrokeWidth`
   * :js:meth:`~Markup.Shapes.Line.set`
   * :js:meth:`~Markup.Shapes.Line.setEndcapsInverted`
   * :js:meth:`~Markup.Shapes.Line.setEndcapType`
   * :js:meth:`~Markup.Shapes.Line.setEndEndcapColor`
   * :js:meth:`~Markup.Shapes.Line.setEndEndcapSize`
   * :js:meth:`~Markup.Shapes.Line.setEndEndcapType`
   * :js:meth:`~Markup.Shapes.Line.setP1`
   * :js:meth:`~Markup.Shapes.Line.setP2`
   * :js:meth:`~Markup.Shapes.Line.setStartEndcapColor`
   * :js:meth:`~Markup.Shapes.Line.setStartEndcapSize`
   * :js:meth:`~Markup.Shapes.Line.setStartEndcapType`
   * :js:meth:`~Markup.Shapes.Line.setStrokeColor`
   * :js:meth:`~Markup.Shapes.Line.setStrokeWidth`
   
   




Constructors
============

.. js:method:: Markup.Shapes.Line.constructor

   .. rst-class:: sig-pretty-signature
   
      | Line(**p1**\ : :js:class:`~Point2`\ , **p2**\ : :js:class:`~Point2`\ ): :js:class:`Line <Markup.Shapes.Line>`
   
   Creates a new Line Shape
   
   **Parameters**
   
      **p1**\ : :js:class:`~Point2`
   
         Optional first point on the line. If omitted, default value of (0,0) is used.
   
   
      **p2**\ : :js:class:`~Point2`
   
         Optional second point on the line. If omitted, default value of (0,0) is used.
   
   
   
   **Returns**\ : :js:class:`Line <Markup.Shapes.Line>`
   
      new Line object.
   
   





Methods
=======

.. js:method:: Markup.Shapes.Line.getEndcapsInverted

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | getEndcapsInverted(): *boolean*
   
   Gets whether endcaps are inverted for this shape. The default value is false.
   
   **Returns**\ : *boolean*
   
      value indicating whether endcaps are inverted
   
   



.. js:method:: Markup.Shapes.Line.getEndEndcapColor

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | getEndEndcapColor(): :js:class:`~Color`
   
   Gets the color of the end endcap. Default value is black.
   
   **Returns**\ : :js:class:`~Color`
   
      color for the end endcap.
   
   



.. js:method:: Markup.Shapes.Line.getEndEndcapSize

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | getEndEndcapSize(): *number*
   
   Gets the size of the end endcap in pixels. Default value is 9.
   
   **Returns**\ : *number*
   
      size of the end endcap.
   
   



.. js:method:: Markup.Shapes.Line.getEndEndcapType

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | getEndEndcapType(): :js:data:`EndcapType <Markup.Shapes.EndcapType>`
   
   Gets the end endcap type for this shape. The default value is none.
   
   **Returns**\ : :js:data:`EndcapType <Markup.Shapes.EndcapType>`
   
      the end endcap type
   
   



.. js:method:: Markup.Shapes.Line.getP1

   .. rst-class:: sig-pretty-signature
   
      | getP1(): :js:class:`~Point2`
   
   Gets the first point of the line segment
   
   **Returns**\ : :js:class:`~Point2`
   
      the first point of the line segment
   
   



.. js:method:: Markup.Shapes.Line.getP2

   .. rst-class:: sig-pretty-signature
   
      | getP2(): :js:class:`~Point2`
   
   Gets the second point of the line segment
   
   **Returns**\ : :js:class:`~Point2`
   
      the second point of the line segment
   
   



.. js:method:: Markup.Shapes.Line.getStartEndcapColor

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | getStartEndcapColor(): :js:class:`~Color`
   
   Gets the color of the start endcap. Default value is black.
   
   **Returns**\ : :js:class:`~Color`
   
      color for the start endcap.
   
   



.. js:method:: Markup.Shapes.Line.getStartEndcapSize

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | getStartEndcapSize(): *number*
   
   Gets the size of the start endcap in pixels. Default value is 9.
   
   **Returns**\ : *number*
   
      size of the start endcap.
   
   



.. js:method:: Markup.Shapes.Line.getStartEndcapType

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | getStartEndcapType(): :js:data:`EndcapType <Markup.Shapes.EndcapType>`
   
   Gets the start endcap type for this shape. The default Value is none.
   
   **Returns**\ : :js:data:`EndcapType <Markup.Shapes.EndcapType>`
   
      the start endcap type
   
   



.. js:method:: Markup.Shapes.Line.getStrokeColor

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | getStrokeColor(): :js:class:`~Color`
   
   Gets the stroke color for this shape
   
   **Returns**\ : :js:class:`~Color`
   
      the stroke color
   
   



.. js:method:: Markup.Shapes.Line.getStrokeWidth

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | getStrokeWidth(): *number*
   
   Gets the stroke width for this shape in pixels
   
   **Returns**\ : *number*
   
      the stroke width in pixels
   
   



.. js:method:: Markup.Shapes.Line.set

   .. rst-class:: sig-pretty-signature
   
      | set(**p1**\ : :js:class:`~Point2`\ , **p2**\ : :js:class:`~Point2`\ ): *void*
   
   Sets the points that define the line segment
   
   **Parameters**
   
      **p1**\ : :js:class:`~Point2`
   
         first point of the line segment
   
   
      **p2**\ : :js:class:`~Point2`
   
         second point of the line segment
   
   
   
   **Returns**\ : *void*
   



.. js:method:: Markup.Shapes.Line.setEndcapsInverted

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | setEndcapsInverted(**inverted**\ : *boolean*\ ): *void*
   
   Sets whether endcapsare inverted for this shape.
   
   **Parameters**
   
      **inverted**\ : *boolean*
   
         value indicated whether endcaps should be inverted
   
   
   
   **Returns**\ : *void*
   



.. js:method:: Markup.Shapes.Line.setEndcapType

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | setEndcapType(**endcapType**\ : :js:data:`EndcapType <Markup.Shapes.EndcapType>`\ ): *void*
   
   Convenience for setting the start and eend endcap type for this shape
   
   **Parameters**
   
      **endcapType**\ : :js:data:`EndcapType <Markup.Shapes.EndcapType>`
   
         the new endcap type
   
   
   
   **Returns**\ : *void*
   



.. js:method:: Markup.Shapes.Line.setEndEndcapColor

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | setEndEndcapColor(**color**\ : :js:class:`~Color`\ ): *void*
   
   Sets the color for the end endcap.
   
   **Parameters**
   
      **color**\ : :js:class:`~Color`
   
         the end endcap color value.
   
   
   
   **Returns**\ : *void*
   



.. js:method:: Markup.Shapes.Line.setEndEndcapSize

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | setEndEndcapSize(**size**\ : *number*\ ): *void*
   
   Sets the size of the end endcap in pixels.
   
   **Parameters**
   
      **size**\ : *number*
   
         the end endcap.
   
   
   
   **Returns**\ : *void*
   



.. js:method:: Markup.Shapes.Line.setEndEndcapType

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | setEndEndcapType(**endcapType**\ : :js:data:`EndcapType <Markup.Shapes.EndcapType>`\ ): *void*
   
   Sets the end endcap type for this shape
   
   **Parameters**
   
      **endcapType**\ : :js:data:`EndcapType <Markup.Shapes.EndcapType>`
   
         the new endcap type
   
   
   
   **Returns**\ : *void*
   



.. js:method:: Markup.Shapes.Line.setP1

   .. rst-class:: sig-pretty-signature
   
      | setP1(**p1**\ : :js:class:`~Point2`\ ): *void*
   
   Sets the first point of the line segment
   
   **Parameters**
   
      **p1**\ : :js:class:`~Point2`
   
         first point of the line segment
   
   
   
   **Returns**\ : *void*
   



.. js:method:: Markup.Shapes.Line.setP2

   .. rst-class:: sig-pretty-signature
   
      | setP2(**p2**\ : :js:class:`~Point2`\ ): *void*
   
   sets the first point of the line segment
   
   **Parameters**
   
      **p2**\ : :js:class:`~Point2`
   
         second point of the line segment
   
   
   
   **Returns**\ : *void*
   



.. js:method:: Markup.Shapes.Line.setStartEndcapColor

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | setStartEndcapColor(**color**\ : :js:class:`~Color`\ ): *void*
   
   Sets the color for the start endcap.
   
   **Parameters**
   
      **color**\ : :js:class:`~Color`
   
         the start endcap color value.
   
   
   
   **Returns**\ : *void*
   



.. js:method:: Markup.Shapes.Line.setStartEndcapSize

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | setStartEndcapSize(**size**\ : *number*\ ): *void*
   
   Sets the size of the start endcap in pixels.
   
   **Parameters**
   
      **size**\ : *number*
   
         the start endcap.
   
   
   
   **Returns**\ : *void*
   



.. js:method:: Markup.Shapes.Line.setStartEndcapType

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | setStartEndcapType(**endcapType**\ : :js:data:`EndcapType <Markup.Shapes.EndcapType>`\ ): *void*
   
   Sets the start endcap type for this shape
   
   **Parameters**
   
      **endcapType**\ : :js:data:`EndcapType <Markup.Shapes.EndcapType>`
   
         the new endcap type
   
   
   
   **Returns**\ : *void*
   



.. js:method:: Markup.Shapes.Line.setStrokeColor

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | setStrokeColor(**color**\ : :js:class:`~Color`\ ): *void*
   
   Sets the stroke color for this shape
   
   **Parameters**
   
      **color**\ : :js:class:`~Color`
   
         the stroke color
   
   
   
   **Returns**\ : *void*
   



.. js:method:: Markup.Shapes.Line.setStrokeWidth

   .. rst-class:: clio-flags
   
      :clio-inherited:`inherited`
   
   .. rst-class:: sig-pretty-signature
   
      | setStrokeWidth(**strokeWidth**\ : *number*\ ): *void*
   
   Sets the stroke width for this shape in pixels
   
   **Parameters**
   
      **strokeWidth**\ : *number*
   
         the stroke width in pixels
   
   
   
   **Returns**\ : *void*
   





