public static Point2D.Double getCenter(Line2D.Double l) { final double x = (l.getX1() + l.getX2()) / 2; final double y = (l.getY1() + l.getY2()) / 2; return new Point2D.Double(x, y); }
(int)line.getX1(), (int)line.getY1(), (int)line.getX2(), (int)line.getY2() );
px2, y + ( height - ( ( nextNumber.floatValue() - min ) / scale ) ) ); lastX = line.getX2(); lastY = line.getY2(); g2.draw( line );
Line2D.Double temp = (Line2D.Double) lines.get(i); int x1 = Integer.parseInt("" + Math.round(temp.getX1())); int x2 = Integer.parseInt("" + Math.round(temp.getX2())); int y1 = Integer.parseInt("" + Math.round(temp.getY1())); int y2 = Integer.parseInt("" + Math.round(temp.getY2()));
rois.addElement(r); } else if (shape instanceof Line2D.Double) { Roi r = new ij.gui.Line((int)((Line2D.Double)shape).getX1(), (int)((Line2D.Double)shape).getY1(), (int)((Line2D.Double)shape).getX2(), (int)((Line2D.Double)shape).getY2()); rois.addElement(r); } else if (shape instanceof Polygon) {
rois.addElement(r); } else if (shape instanceof Line2D.Double) { Roi r = new ij.gui.Line((int)((Line2D.Double)shape).getX1(), (int)((Line2D.Double)shape).getY1(), (int)((Line2D.Double)shape).getX2(), (int)((Line2D.Double)shape).getY2()); rois.addElement(r); } else if (shape instanceof Polygon) {
double dx = minDistSeg.getX2() - minDistSeg.getX1(); double dy = minDistSeg.getY2() - minDistSeg.getY1();
public static Point2D.Double getCenter(Line2D.Double l) { final double x = (l.getX1() + l.getX2()) / 2; final double y = (l.getY1() + l.getY2()) / 2; return new Point2D.Double(x, y); }