Coverage details for edu.uci.ics.jung.visualization.ArrowFactory

LineHitsSource
1 /*
2  * Created on Oct 19, 2004
3  *
4  * Copyright (c) 2004, the JUNG Project and the Regents of the University
5  * of California
6  * All rights reserved.
7  *
8  * This software is open-source under the BSD license; see either
9  * "license.txt" or
10  * http://jung.sourceforge.net/license.txt for a description.
11  */
12 package edu.uci.ics.jung.visualization;
13  
14 import java.awt.geom.GeneralPath;
15  
16 /**
17  * A utility class for creating arrowhead shapes.
18  *
19  * @author Joshua O'Madadhain
20  */
210public class ArrowFactory
22 {
23     /**
24      * Returns an arrowhead in the shape of a simple isosceles triangle
25      * with the specified base and height measurements. It is placed
26      * with the vertical axis along the negative x-axis, with its base
27      * centered on (0,0).
28      */
29     public static GeneralPath getWedgeArrow(float base, float height)
30     {
310        GeneralPath arrow = new GeneralPath();
320        arrow.moveTo(0,0);
330        arrow.lineTo( - height, base/2.0f);
340        arrow.lineTo( - height, -base/2.0f);
350        arrow.lineTo( 0, 0 );
360        return arrow;
37     }
38  
39     /**
40      * Returns an arrowhead in the shape of an isosceles triangle
41      * with an isoceles-triangle notch taken out of the base,
42      * with the specified base and height measurements. It is placed
43      * with the vertical axis along the negative x-axis, with its base
44      * centered on (0,0).
45      */
46     public static GeneralPath getNotchedArrow(float base, float height, float notch_height)
47     {
480        GeneralPath arrow = new GeneralPath();
490        arrow.moveTo(0,0);
500        arrow.lineTo(-height, base/2.0f);
510        arrow.lineTo(-(height - notch_height), 0);
520        arrow.lineTo(-height, -base/2.0f);
530        arrow.lineTo(0,0);
540        return arrow;
55     }
56 }

this report was generated by version 1.0.5 of jcoverage.
visit www.jcoverage.com for updates.

copyright © 2003, jcoverage ltd. all rights reserved.
Java is a trademark of Sun Microsystems, Inc. in the United States and other countries.