Add a line to the contour or hole which ends at the specified
location.

@param x The x coordinate to draw the line to
@param y The y coordiante to draw the line to
430401
public void lineTo(float x, float y) {
		if (hole != null) {
			hole.add(new float[] {x,y});
		} else {
			localPoints.add(new float[] {x,y});
		}
		cx = x;
		cy = y;
		pointsDirty = true;
	}
1286029
public void addPoint( float x , float y , float z ) {
		norm.grow().set(x/z, y/z);
	}
1066336
public void setLine (XY p1, XY p2) {
        setLine(p1.x(), p1.y(), p2.x(), p2.y());
    }
157445
public MarkPoint geoCoord(String name, String x, String y) {
        this.geoCoord().put(name, x, y);
        return this;
    }
315653
public void drawMarker(final double x, final double y) {
    	
    	//System.out.println("Add Dock Marker on => " + model().key());
    	
    	overlay.setVisible(true);
    	double space = 5.0;

		if (x > PARENT && x < node().getWidth() / 3 || x < node().getWidth() - PARENT && x > node().getWidth() * 2 / 3) {
			// left right
			r1.setLayoutX(5);
			r1.setLayoutY(5);
			r1.setWidth((overlay.getWidth() - space * 3) / 2);
			r1.setHeight((overlay.getHeight() - space * 2) / 1);

			r2.setLayoutX(overlay.getWidth() / 2 + space / 2);
			r2.setLayoutY(5);
			r2.setWidth((overlay.getWidth() - space * 3) / 2);
			r2.setHeight((overlay.getHeight() - space * 2 / 1));
			
			if (x < node().getWidth() / 3) {
				r1.setStrokeWidth(4.0);
				r2.setStrokeWidth(2.0);
			}else{
				r1.setStrokeWidth(2.0);
				r2.setStrokeWidth(4.0);
			}

		} else if (y > PARENT && y < node().getHeight() / 3 || y < node().getHeight() - PARENT && y > node().getHeight() * 2 / 3) {
			// topbottom
			r1.setLayoutX(5);
			r1.setLayoutY(5);
			r1.setWidth((overlay.getWidth() - space * 2) / 1);
			r1.setHeight((overlay.getHeight() - space * 3) / 2);

			r2.setLayoutX(5);
			r2.setLayoutY(overlay.getHeight() / 2 + space / 2);
			r2.setWidth((overlay.getWidth() - space * 2) / 1);
			r2.setHeight((overlay.getHeight() - space * 3) / 2);
			
			if (y < node().getHeight() / 3) {
				r1.setStrokeWidth(4.0);
				r2.setStrokeWidth(2.0);
			}else{
				r1.setStrokeWidth(2.0);
				r2.setStrokeWidth(4.0);
			}

		}
    	
//    	
//    	GridPane gp = new GridPane();
//    	gp.setHgap(5);
//    	gp.setVgap(5);
//    	
//    	Rectangle r1 = new Rectangle();
//    	
//    	GridPane.setRowIndex(r1, 0);
//        GridPane.setColumnIndex(r1, 0);
//        GridPane.setMargin(r1, new Insets(10));
//        
//        Rectangle r2 = new Rectangle();
//    	
//    	GridPane.setRowIndex(r2, 1);
//        GridPane.setColumnIndex(r1, 0);
//        GridPane.setMargin(r2, new Insets(10));
//        
//        gp.getChildren().addAll(r1, r2);
//        
//    	node().getChildren().add(gp);

//        final int draggedIdx = getBox().getChildren().indexOf(dragged);
//        final int markerIdx = getBox().getChildren().indexOf(this.marker);
//
//        int idx = 0;
//        Node tempHoverNode = null;
//        final int xx = 0;
//        for (final Node n : getBox().getChildren()) {
//
//            if (n.getBoundsInParent().contains(x, y)) {
//                tempHoverNode = n;
//                break;
//            }
//
//            if (n != this.marker) {
//                idx++;
//            }
//        }
//
//        if (tempHoverNode == this.hoverNode) {
//            return;
//        } else {
//            this.hoverNode = tempHoverNode;
//        }
//
//        System.out.println("marker" + markerIdx + "  idx " + idx);
//        if (markerIdx != idx) {
//
//            if (this.marker != null) {
//                getBox().getChildren().remove(this.marker);
//            }
//
//            if (draggedIdx != idx) {
//                this.marker = model().object().orientation() == TabbedPaneOrientation.bottom || model().object().orientation() == TabbedPaneOrientation.top ? new Rectangle(10, getBox().getHeight())
//                        : new Rectangle(getBox().getWidth(), 4);
//
//                this.marker.setFill(Color.LIGHTGREEN);
//
//                getBox().getChildren().add(idx, this.marker);
//            }
//        }

    }
106497
public static void assignLine(List<Point2D_I32> contour, int indexA, int indexB, LineParametric2D_F64 line) {
		Point2D_I32 endA = contour.get(indexA);
		Point2D_I32 endB = contour.get(indexB);

		line.p.x = endA.x;
		line.p.y = endA.y;
		line.slope.x = endB.x-endA.x;
		line.slope.y = endB.y-endA.y;
	}
1220133
public int addPoint(double x, double y, int groupIndex) {
		final int groupCount = getGroupCount();

		if (groupIndex < 0) {
			throw new IndexOutOfBoundsException(groupIndex + "<0"); //$NON-NLS-1$
		}
		if (groupIndex >= groupCount) {
			throw new IndexOutOfBoundsException(groupIndex + ">=" + groupCount); //$NON-NLS-1$
		}

		int pointIndex;

		if (this.pointCoordinates == null) {
			this.pointCoordinates = new double[] {x, y};
			this.partIndexes = null;
			pointIndex = 0;
		} else {
			pointIndex = lastInGroup(groupIndex);
			double[] pts = new double[this.pointCoordinates.length + 2];

			pointIndex += 2;

			System.arraycopy(this.pointCoordinates, 0, pts, 0, pointIndex);
			System.arraycopy(this.pointCoordinates, pointIndex, pts, pointIndex + 2, this.pointCoordinates.length - pointIndex);
			pts[pointIndex] = x;
			pts[pointIndex + 1] = y;
			this.pointCoordinates = pts;
			pts = null;

			//Shift the following groups's indexes
			if (this.partIndexes != null) {
				for (int idx = groupIndex; idx < this.partIndexes.length; ++idx) {
					this.partIndexes[idx] += 2;
				}
			}

			pointIndex /= 2.;
		}

		fireShapeChanged();
		fireElementChanged();

		return pointIndex;
	}
8657
public void addAndSimplify(double x, double y) {
    // simplify curve when possible:
    final int len = data.size();
    if (len >= 4) {
      // Look at the previous 2 points
      final double l1x = data.get(len - 4);
      final double l1y = data.get(len - 3);
      final double l2x = data.get(len - 2);
      final double l2y = data.get(len - 1);
      // Differences:
      final double ldx = l2x - l1x;
      final double ldy = l2y - l1y;
      final double cdx = x - l2x;
      final double cdy = y - l2y;
      // X simplification
      if ((ldx == 0) && (cdx == 0)) {
        data.remove(len - 2, 2);
      }
      // horizontal simplification
      else if ((ldy == 0) && (cdy == 0)) {
        data.remove(len - 2, 2);
      }
      // diagonal simplification
      else if (ldy > 0 && cdy > 0) {
        if (Math.abs((ldx / ldy) - (cdx / cdy)) < THRESHOLD) {
          data.remove(len - 2, 2);
        }
      }
    }
    add(x, y);
  }
29369
public void add(double x, double y) {
		resize(m_pointCount + 1);
		Point2D pt = new Point2D();
		pt.setCoords(x, y);
		setXY(m_pointCount - 1, pt);
	}
413059
private void drawPath(Canvas canvas, final Line line) {
        prepareLinePaint(line);

        int valueIndex = 0;
        for (PointValue pointValue : line.getValues()) {

            final float rawX = computator.computeRawX(pointValue.getX());
            final float rawY = computator.computeRawY(pointValue.getY());

            if (valueIndex == 0) {
                path.moveTo(rawX, rawY);
            } else {
                path.lineTo(rawX, rawY);
            }

            ++valueIndex;

        }

        canvas.drawPath(path, linePaint);

        if (line.isFilled()) {
            drawArea(canvas, line);
        }

        path.reset();
    }
693964
public void appendLine(final Line line)
    {
        if (this.lineTail == null)
        {
            this.lines = this.lineTail = line;
        }
        else
        {
            this.lineTail.nextEmpty = line.isEmpty;
            line.prevEmpty = this.lineTail.isEmpty;
            line.previous = this.lineTail;
            this.lineTail.next = line;
            this.lineTail = line;
        }
    }
1112879
function (x, y, width, height) {
            var points = this._glPoints;
            points[0].x = x;
            points[0].y = y;
            points[1].x = x + width;
            points[1].y = y;
            points[2].x = x + width;
            points[2].y = y + height;
            points[3].x = x;
            points[3].y = y + height;
            this.compositor.drawLine(points, 4);
        }
1052313
public void setY(float y) {
    	if (y != this.y) {
    		float dy = y - this.y;
	        this.y = y;

	        if ((points == null) || (center == null)) {
	        	checkPoints();
	        }
	        // update the points in the special case
    		for (int i=0;i<points.length/2;i++) {
    			points[(i*2)+1] += dy;
    		}
    		center[1] += dy;
    		y += dy;
    		maxY += dy;
    		minY += dy;
	        trianglesDirty = true;
    	}
    }
718689
public void setLine (float x1, float y1, float x2, float y2) {
        this.x1 = x1;
        this.y1 = y1;
        this.x2 = x2;
        this.y2 = y2;
    }
884382
public void mergeNE(double x, double y) {
		if (xmin > x)
			xmin = x;
		else if (xmax < x)
			xmax = x;

		if (ymin > y)
			ymin = y;
		else if (ymax < y)
			ymax = y;
	}
827447
private void canvasClick(int x, int y)
    {
        //always called listeners
        for (CanvasClickListener listener : canvasClickAlwaysListeners)
            listener.canvasClicked(x, y);
        //selected listener by toggle buttons
        for (JToggleButton button : canvasClickToggleListeners.keySet())
        {
            if (button.isSelected())
                canvasClickToggleListeners.get(button).canvasClicked(x, y);
        }
        
        /*if (lookupButton.isSelected())
        {
            if (proc.getAreaTree() != null)
            {
                Area node = proc.getAreaTree().getAreaAt(x, y);
                if (node != null)
                {
                    showAreaInTree(node);
                    showAreaInLogicalTree(node);
                }
            }
            //lookupButton.setSelected(false);
        }
        if (boxLookupButton.isSelected())
        {
            Box node = proc.getPage().getBoxAt(x, y);
            if (node != null)
                showBoxInTree(node);
            //boxLookupButton.setSelected(false);
        }
        if (sepLookupButton.isSelected())
        {
            showSeparatorAt(x, y);
        }
        if (extractButton.isSelected())
        {
            AreaNode node = proc.getAreaTree().getAreaAt(x, y);
            if (node != null)
            {
                proc.getExtractor().findArticleBounds(node);
                try {
                    PrintStream exs = new PrintStream(new FileOutputStream("test/extract.html"));
                    proc.getExtractor().dumpTo(exs);
                    exs.close();
                } catch (java.io.IOException e) {
                    System.err.println("Output failed: " + e.getMessage());
                }
                
                //String s = ex.getDescriptionX(node, 2);
                //System.out.println("Extracted: " + s);
            }
            extractButton.setSelected(false);
        }*/
    }
222318
public void parameterize( int x , int y )
	{
		// put the point in a new coordinate system centered at the image's origin
		x -= originX;
		y -= originY;

		int w2 = transform.width/2;

		// The line's slope is encoded using the tangent angle.  Those bins are along the image's y-axis
		for( int i = 0; i < transform.height; i++ ) {
			// distance of closest point on line from a line defined by the point (x,y) and
			// the tangent theta=PI*i/height
			double p = x*tableTrig.c[i] + y*tableTrig.s[i];

			int col = (int)Math.floor(p * w2 / r_max) + w2;
			int index = transform.startIndex + i*transform.stride + col;
			transform.data[index]++;
		}
	}