View Javadoc

1   /*
2    * Copyright (c) 2005, the JUNG Project and the Regents of the University of
3    * California All rights reserved.
4    *
5    * This software is open-source under the BSD license; see either "license.txt"
6    * or http://jung.sourceforge.net/license.txt for a description.
7    *
8    * 
9    */
10  package edu.uci.ics.jung.visualization.annotations;
11  
12  import java.awt.Paint;
13  import java.awt.geom.Point2D;
14  
15  /**
16   * stores an annotation, either a shape or a string
17   * 
18   * @author Tom Nelson - tomnelson@dev.java.net
19   *
20   * @param <T>
21   */
22  public class Annotation<T> {
23  	
24  	protected T annotation;
25  	protected Paint paint;
26  	protected Point2D location;
27  	protected Layer layer;
28  	protected boolean fill;
29  	public static enum Layer { LOWER, UPPER }
30  	
31  	
32  	
33  	public Annotation(T annotation, Layer layer, Paint paint, 
34  			boolean fill, Point2D location) {
35  		this.annotation = annotation;
36  		this.layer = layer;
37  		this.paint = paint;
38  		this.fill = fill;
39  		this.location = location;
40  	}
41  	/**
42  	 * @return the annotation
43  	 */
44  	public T getAnnotation() {
45  		return annotation;
46  	}
47  	/**
48  	 * @param annotation the annotation to set
49  	 */
50  	public void setAnnotation(T annotation) {
51  		this.annotation = annotation;
52  	}
53  	/**
54  	 * @return the location
55  	 */
56  	public Point2D getLocation() {
57  		return location;
58  	}
59  	/**
60  	 * @return the layer
61  	 */
62  	public Layer getLayer() {
63  		return layer;
64  	}
65  	/**
66  	 * @param layer the layer to set
67  	 */
68  	public void setLayer(Layer layer) {
69  		this.layer = layer;
70  	}
71  	/**
72  	 * @param location the location to set
73  	 */
74  	public void setLocation(Point2D location) {
75  		this.location = location;
76  	}
77  	/**
78  	 * @return the paint
79  	 */
80  	public Paint getPaint() {
81  		return paint;
82  	}
83  	/**
84  	 * @param paint the paint to set
85  	 */
86  	public void setPaint(Paint paint) {
87  		this.paint = paint;
88  	}
89  	/**
90  	 * @return the fill
91  	 */
92  	public boolean isFill() {
93  		return fill;
94  	}
95  	/**
96  	 * @param fill the fill to set
97  	 */
98  	public void setFill(boolean fill) {
99  		this.fill = fill;
100 	}
101 	
102 
103 }