Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
HCTreeNodeEntity |
|
| 1.0;1 |
1 | /* ======================================================================= | |
2 | * A visualisation library extension for JFreeChart. Please see JFreeChart | |
3 | * for further information. | |
4 | * ======================================================================= | |
5 | * Copyright (C) 2006 University of Helsinki, Department of Computer Science | |
6 | * | |
7 | * This library is free software; you can redistribute it and/or | |
8 | * modify it under the terms of the GNU Lesser General Public | |
9 | * License as published by the Free Software Foundation; either | |
10 | * version 2.1 of the License, or (at your option) any later version. | |
11 | * | |
12 | * This library is distributed in the hope that it will be useful, | |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | * Lesser General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU Lesser General Public | |
18 | * License along with this library; if not, write to the Free Software | |
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
20 | * ----------------------------- | |
21 | * Contact: ohtu@cs.helsinki.fi | |
22 | * ----------------------------- | |
23 | * | |
24 | */ | |
25 | ||
26 | package org.jfree.chart.entity; | |
27 | ||
28 | import java.awt.Graphics2D; | |
29 | import java.awt.geom.Rectangle2D; | |
30 | import java.awt.Rectangle; | |
31 | import java.awt.Shape; | |
32 | import java.awt.Point; | |
33 | ||
34 | import org.jfree.chart.plot.HCTreeNodeInfo; | |
35 | import org.jfree.chart.entity.ChartEntity; | |
36 | ||
37 | /** | |
38 | * A chart entity for nodes of clustering trees used in {@link HCPlot}. | |
39 | * @author viski project | |
40 | */ | |
41 | public class HCTreeNodeEntity extends ChartEntity { | |
42 | ||
43 | /** The subtree of this branch. */ | |
44 | private Rectangle subTreeArea; | |
45 | /** The center point of this treenode. */ | |
46 | private Point center; | |
47 | /** The node information. */ | |
48 | private HCTreeNodeInfo node; | |
49 | ||
50 | /** | |
51 | * Creates a new treenode entity. | |
52 | * | |
53 | * @param area the area. | |
54 | * @param toolTipText the tool tip text. | |
55 | * @param urlText the URL text for a HTML imagemap. | |
56 | * @param center the center point. | |
57 | * @param subTreeArea the area of the subtree. | |
58 | * @param node the nodeinformation. | |
59 | */ | |
60 | public HCTreeNodeEntity( | |
61 | Shape area, | |
62 | String toolTipText, | |
63 | String urlText, | |
64 | Point center, | |
65 | Rectangle subTreeArea, | |
66 | HCTreeNodeInfo node | |
67 | ) { | |
68 | 81 | super(area, toolTipText, urlText); |
69 | ||
70 | 80 | this.subTreeArea = subTreeArea; |
71 | 80 | this.center = center; |
72 | 80 | this.node = node; |
73 | ||
74 | 80 | } |
75 | ||
76 | /** | |
77 | * Returns the area of the subtree. | |
78 | * | |
79 | * @return The area of the subtree. | |
80 | */ | |
81 | public Rectangle getSubTreeArea() { | |
82 | 100 | return this.subTreeArea; |
83 | } | |
84 | ||
85 | /** | |
86 | * Returns the center point. | |
87 | * | |
88 | * @return The center point. | |
89 | */ | |
90 | public Point getCenter() { | |
91 | 302 | return this.center; |
92 | } | |
93 | ||
94 | /** | |
95 | * Returns the node information. | |
96 | * | |
97 | * @return The node information. | |
98 | */ | |
99 | public HCTreeNodeInfo getHCTreeNodeInfo() { | |
100 | 149 | return this.node; |
101 | } | |
102 | } |