Coverage details for edu.uci.ics.jung.graph.decorators.AbstractVertexShapeFunction

LineHitsSource
1 /*
2  * Created on Jul 16, 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.graph.decorators;
13  
14 import edu.uci.ics.jung.visualization.VertexShapeFactory;
15  
16  
17  
18 /**
19  *
20  * @author Joshua O'Madadhain
21  */
22 public abstract class AbstractVertexShapeFunction implements SettableVertexShapeFunction
23 {
24     protected VertexSizeFunction vsf;
25     protected VertexAspectRatioFunction varf;
26     protected VertexShapeFactory factory;
27     public final static int DEFAULT_SIZE = 8;
28     public final static float DEFAULT_ASPECT_RATIO = 1.0f;
29     
30     public AbstractVertexShapeFunction(VertexSizeFunction vsf, VertexAspectRatioFunction varf)
310    {
320        this.vsf = vsf;
330        this.varf = varf;
340        factory = new VertexShapeFactory(vsf, varf);
350    }
36  
37     public AbstractVertexShapeFunction()
38     {
390        this(new ConstantVertexSizeFunction(DEFAULT_SIZE),
40                 new ConstantVertexAspectRatioFunction(DEFAULT_ASPECT_RATIO));
410    }
42     
43     public void setSizeFunction(VertexSizeFunction vsf)
44     {
450        this.vsf = vsf;
460        factory = new VertexShapeFactory(vsf, varf);
470    }
48     
49     public void setAspectRatioFunction(VertexAspectRatioFunction varf)
50     {
510        this.varf = varf;
520        factory = new VertexShapeFactory(vsf, varf);
530    }
54 }

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.