Packagecom.kraftner.justlineon
Classpublic class Segment

This class represents one segment of a line in JustLineOn. It is passed through Lineserves, Pointtransformers and Painters.

See also

com.kraftner.justlineon.lineservers.LineServer
com.kraftner.justlineon.pointtransformers.PointTransformer
com.kraftner.justlineon.painters.Painter


Public Properties
 PropertyDefined by
  angle : Number
angle of this Segment
Segment
  bisect_x : Number
[read-only] x value of the Bisection Point of this Segment.
Segment
  bisect_y : Number
[read-only] y value of the Bisection Point of this Segment.
Segment
  length : Number
length of this Segment
Segment
  prev_angle : Number
[read-only] angle of the previous Segment
Segment
  prev_bisect_x : Number
[read-only] x value of the Bisection Point of the previous Segment.
Segment
  prev_bisect_y : Number
[read-only] y value of the Bisection Point of the previous Segment.
Segment
  prev_length : Number
[read-only] length of the previous segment
Segment
  prev_rel_x : Number
[read-only] x value of the vector of the previous Segment.
Segment
  prev_rel_y : Number
[read-only] y value of the vector of the previous Segment.
Segment
  prev_start : Boolean
[read-only] true if the previous segment was the first segment of a line

(Except in the case the previous line had lust one Segment this means that this is the second segment of a line.)

Segment
  prev_x : Number
[read-only] x-coordinate of the endpoint of the previous Segment which also is the startpoint of this segment.
Segment
  prev_y : Number
[read-only] y-coordinate of the endpoint of the previous Segment which also is the startpoint of this segment.
Segment
  rel_x : Number
x value of the vector of this Segment.
Segment
  rel_y : Number
y value of the vector of this Segment.
Segment
  start : Boolean
true if this is the first segment of a line
Segment
  x : Number
x-coordinate of the endpoint of this Segment
Segment
  y : Number
y-coordinate of the endpoint of this Segment
Segment
Public Methods
 MethodDefined by
  
Segment(x:Number, y:Number, prevSegment:Segment = null, start:Boolean = false)
Segment
  
This is only in use for the RibbonPainter.
Segment
  
getRibbonDistance(min:Number = 1, max:Number = 10, maxJumpPerc:Number = 5):Number
This is only in use for the RibbonPainter.
Segment
Property detail
angleproperty
angle:Number  [read-write]

angle of this Segment

Implementation
    public function get angle():Number
    public function set angle(value:Number):void

See also

bisect_xproperty 
bisect_x:Number  [read-only]

x value of the Bisection Point of this Segment. This is the x-coordinate of the point in the middle between the endpoint and the startpoint of this Segment.

Implementation
    public function get bisect_x():Number

See also

bisect_yproperty 
bisect_y:Number  [read-only]

y value of the Bisection Point of this Segment. This is the y-coordinate of the point in the middle between the endpoint and the startpoint of this Segment.

Implementation
    public function get bisect_y():Number

See also

lengthproperty 
length:Number  [read-write]

length of this Segment

Implementation
    public function get length():Number
    public function set length(value:Number):void

See also

prev_angleproperty 
prev_angle:Number  [read-only]

angle of the previous Segment

Implementation
    public function get prev_angle():Number

See also

prev_bisect_xproperty 
prev_bisect_x:Number  [read-only]

x value of the Bisection Point of the previous Segment. This is the x-coordinate of the point in the middle between the endpoint and the startpoint of the previous Segment.

Implementation
    public function get prev_bisect_x():Number

See also

prev_bisect_yproperty 
prev_bisect_y:Number  [read-only]

y value of the Bisection Point of the previous Segment. This is the y-coordinate of the point in the middle between the endpoint and the startpoint of the previous Segment.

Implementation
    public function get prev_bisect_y():Number

See also

prev_lengthproperty 
prev_length:Number  [read-only]

length of the previous segment

Implementation
    public function get prev_length():Number

See also

prev_rel_xproperty 
prev_rel_x:Number  [read-only]

x value of the vector of the previous Segment. This is the difference between the x-coordinate of the endpoint and the startpoint of the previous Segment.

Implementation
    public function get prev_rel_x():Number

See also

prev_rel_yproperty 
prev_rel_y:Number  [read-only]

y value of the vector of the previous Segment. This is the difference between the y-coordinate of the endpoint and the startpoint of the previous Segment.

Implementation
    public function get prev_rel_y():Number

See also

prev_startproperty 
prev_start:Boolean  [read-only]

true if the previous segment was the first segment of a line

(Except in the case the previous line had lust one Segment this means that this is the second segment of a line.)

Implementation
    public function get prev_start():Boolean

See also

prev_xproperty 
prev_x:Number  [read-only]

x-coordinate of the endpoint of the previous Segment which also is the startpoint of this segment.

Implementation
    public function get prev_x():Number

See also

x
prev_yproperty 
prev_y:Number  [read-only]

y-coordinate of the endpoint of the previous Segment which also is the startpoint of this segment.

Implementation
    public function get prev_y():Number

See also

y
rel_xproperty 
rel_x:Number  [read-write]

x value of the vector of this Segment. This is the difference between the x-coordinate of the endpoint and the startpoint of this Segment.

Implementation
    public function get rel_x():Number
    public function set rel_x(value:Number):void

See also

rel_yproperty 
rel_y:Number  [read-write]

y value of the vector of this Segment. This is the difference between the y-coordinate of the endpoint and the startpoint of this Segment.

Implementation
    public function get rel_y():Number
    public function set rel_y(value:Number):void

See also

startproperty 
start:Boolean  [read-write]

true if this is the first segment of a line

Implementation
    public function get start():Boolean
    public function set start(value:Boolean):void

See also

xproperty 
x:Number  [read-write]

x-coordinate of the endpoint of this Segment

Implementation
    public function get x():Number
    public function set x(value:Number):void

See also

yproperty 
y:Number  [read-write]

y-coordinate of the endpoint of this Segment

Implementation
    public function get y():Number
    public function set y(value:Number):void

See also

Constructor detail
Segment()constructor
public function Segment(x:Number, y:Number, prevSegment:Segment = null, start:Boolean = false)Parameters
x:Number
 
y:Number
 
prevSegment:Segment (default = null)
 
start:Boolean (default = false)
Method detail
getPrevRibbonDistance()method
public function getPrevRibbonDistance():Number

This is only in use for the RibbonPainter. It defines the width of a ribbon being the distance from the original line of the previous Segment.

Returns
Number — distance from the original line of the previous Segment

See also

getRibbonDistance()method 
public function getRibbonDistance(min:Number = 1, max:Number = 10, maxJumpPerc:Number = 5):Number

This is only in use for the RibbonPainter. It defines the width of a ribbon being the distance from the original line.

Parameters
min:Number (default = 1) — Minimum distance from the original line
 
max:Number (default = 10) — Maximum distance from the original line
 
maxJumpPerc:Number (default = 5) — Maximum difference between the distance of this Segment and the distance of the previous Segment

Returns
Number — distance from the original line

See also