Here you can find the source of makeLine(Point2D.Double center, Point2D.Double north, Point2D.Double east)
Parameter | Description |
---|---|
center | the center point in screen coords |
north | the north point in screen coords |
east | the east point in screen coords |
public static Shape makeLine(Point2D.Double center, Point2D.Double north, Point2D.Double east)
//package com.java2s; //License from project: LGPL import java.awt.Shape; import java.awt.geom.Line2D; import java.awt.geom.Point2D; public class Main { /**//from ww w . ja v a2s . com * Return a Shape object for the "line" symbol. * * @param center the center point in screen coords * @param north the north point in screen coords * @param east the east point in screen coords */ public static Shape makeLine(Point2D.Double center, Point2D.Double north, Point2D.Double east) { Point2D.Double south = new Point2D.Double(center.x - (north.x - center.x), center.y - (north.y - center.y)); Line2D.Double p = new Line2D.Double(north, south); return p; } }