mxLine (JGraph X 2.1.0.7 API Specification)
Date: 2013-07-31

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| JGraph X 2.1.0.7
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.mxgraph.util
Class mxLine

    java.lang.Object
      com.mxgraph.util.mxPoint
          com.mxgraph.util.mxLine

All Implemented Interfaces:
  Serializable, Cloneable

    public class mxLine

extends mxPoint

Implements a line with double precision coordinates.

See Also:
  Serialized Form

Field Summary
`protected mxPoint` | `endPoint` The end point of the line

Fields inherited from class com.mxgraph.util.mxPoint
`x, y`

Constructor Summary
`mxLine(double startPtX, double startPtY, mxPoint endPt)` Creates a new line
`mxLine(mxPoint startPt, mxPoint endPt)` Creates a new line

Method Summary
`mxPoint` | `getEndPoint()` Returns the end point of the line.
`double` | `ptLineDistSq(mxPoint pt)` Returns the square of the shortest distance from a point to this line.
`double` | `ptSegDistSq(mxPoint pt)` Returns the square of the shortest distance from a point to this line segment.
`void` | `setEndPoint(mxPoint value)` Sets the end point of the rectangle.
`void` | `setPoints(mxPoint startPt, mxPoint endPt)` Sets the start and end points.

Methods inherited from class com.mxgraph.util.mxPoint
`clone, equals, getPoint, getX, getY, setX, setY, toString`

Methods inherited from class java.lang.Object
`finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### endPoint

    protected mxPoint endPoint

  The end point of the line

Constructor Detail

### mxLine

    public mxLine(mxPoint startPt,
                  mxPoint endPt)

  Creates a new line

### mxLine

    public mxLine(double startPtX,
                  double startPtY,
                  mxPoint endPt)

  Creates a new line

Method Detail

### getEndPoint

    public mxPoint getEndPoint()

  Returns the end point of the line.

  Returns:
    Returns the end point of the line.

### setEndPoint

    public void setEndPoint(mxPoint value)

  Sets the end point of the rectangle.

  Parameters:
    `value` - The new end point of the line

### setPoints

    public void setPoints(mxPoint startPt,
                          mxPoint endPt)

  Sets the start and end points.

### ptLineDistSq

    public double ptLineDistSq(mxPoint pt)

  Returns the square of the shortest distance from a point to this line. The line is considered extrapolated infinitely in both directions for the purposes of the calculation.

  Parameters:
    `pt` - the point whose distance is being measured
  Returns:
    the square of the distance from the specified point to this line.

### ptSegDistSq

    public double ptSegDistSq(mxPoint pt)

  Returns the square of the shortest distance from a point to this line segment.

  Parameters:
    `pt` - the point whose distance is being measured
  Returns:
    the square of the distance from the specified point to this segment.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| JGraph X 2.1.0.7
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright (c) 2010 Gaudenz Alder. All rights reserved.