1 /*
2
3 dsh-graph-io Directed graph readers and writers.
4 Copyright (c) 2008-2013 held jointly by the individual authors.
5
6 This library is free software; you can redistribute it and/or modify it
7 under the terms of the GNU Lesser General Public License as published
8 by the Free Software Foundation; either version 3 of the License, or (at
9 your option) any later version.
10
11 This library is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; with out even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
14 License for more details.
15
16 You should have received a copy of the GNU Lesser General Public License
17 along with this library; if not, write to the Free Software Foundation,
18 Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
19
20 > http://www.fsf.org/licensing/licenses/lgpl.html
21 > http://www.opensource.org/licenses/lgpl-license.php
22
23 */
24 package org.dishevelled.graph.io.ygraphml;
25
26 /**
27 * Shape node.
28 *
29 * @author Michael Heuer
30 * @version $Revision$ $Date$
31 */
32 public final class ShapeNode
33 {
34 /** Fill for this shape node. */
35 private final Fill fill;
36
37 /** Node label for this shape node. */
38 private final NodeLabel nodeLabel;
39
40 /** Border style for this shape node. */
41 private final BorderStyle borderStyle;
42
43 /** Shape for this shape node. */
44 private final Shape shape;
45
46
47 /**
48 * Create a new shape node from the specified parameters.
49 *
50 * @param fill fill for this shape node, must not be null
51 * @param nodeLabel node label for this shape node, must not be null
52 * @param borderStyle border style for this shape node, must not be null
53 * @param shape shape for this shape node, must not be null
54 */
55 public ShapeNode(final Fill fill,
56 final NodeLabel nodeLabel,
57 final BorderStyle borderStyle,
58 final Shape shape)
59 {
60 if (fill == null)
61 {
62 throw new IllegalArgumentException("fill must not be null");
63 }
64 if (nodeLabel == null)
65 {
66 throw new IllegalArgumentException("nodeLabel must not be null");
67 }
68 if (borderStyle == null)
69 {
70 throw new IllegalArgumentException("borderStyle must not be null");
71 }
72 if (shape == null)
73 {
74 throw new IllegalArgumentException("shape must not be null");
75 }
76 this.fill = fill;
77 this.nodeLabel = nodeLabel;
78 this.borderStyle = borderStyle;
79 this.shape = shape;
80 }
81
82
83 /**
84 * Return the fill for this shape node.
85 * The fill will not be null.
86 *
87 * @return the fill for this shape node
88 */
89 public Fill getFill()
90 {
91 return fill;
92 }
93
94 /**
95 * Return the node label for this shape node.
96 * The node label will not be null.
97 *
98 * @return the node label for this shape node
99 */
100 public NodeLabel getNodeLabel()
101 {
102 return nodeLabel;
103 }
104
105 /**
106 * Return the border style for this shape node.
107 * The border style will not be null.
108 *
109 * @return the border style for this shape node
110 */
111 public BorderStyle getBorderStyle()
112 {
113 return borderStyle;
114 }
115
116 /**
117 * Return the shape for this shape node.
118 * The shape will not be null.
119 *
120 * @return the shape for this shape node
121 */
122 public Shape getShape()
123 {
124 return shape;
125 }
126 }