1 /***
2 * NodeFactory.java
3 *
4 * Project: Dependency Tool
5 *
6 * WHEN WHO WHAT
7 * 06.06.2003 pko initial public release
8 * 04.06.2003 pko creation
9 *
10 * Copyright 2003 ELCA Informatique SA
11 * Av. de la Harpe 22-24, 1000 Lausanne 13, Switzerland
12 * www.elca.ch
13 *
14 * This library is free software; you can redistribute it and/or
15 * modify it under the terms of the GNU Lesser General Public License
16 * as published by the Free Software Foundation; either version 2.1 of
17 * the License, or (at your option) any later version.
18 *
19 * This library is distributed in the hope that it will be useful, but
20 * WITHOUT ANY WARRANTY; without even the implied warranty of
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22 * Lesser General Public License for more details.
23 *
24 * You should have received a copy of the GNU Lesser General Public
25 * License along with this library; if not, write to the Free Software
26 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
27 * USA
28 */
29
30 package ch.elca.dependency.adapter.grappa;
31
32
33 import att.grappa.GrappaConstants;
34 import att.grappa.Subgraph;
35 import att.grappa.Node;
36
37
38 /***
39 * Create new Nodes by the means of this Factory. Like that they are
40 * adapted to the needs of the Dependency Tool.
41 *
42 * @author Pawel Kowalski
43 * @version 1.0-beta
44 */
45 public class NodeFactory implements GrappaConstants {
46
47 /***
48 * Create a new <code>att.grappa.Node</code> as Layer marker.
49 *
50 * @param subg a <code>Subgraph</code> value
51 * @param name a <code>String</code> value
52 * @return a <code>Node</code> value
53 */
54 public static Node createLayerNode(Subgraph subg, String name) {
55 Node node = new Node(subg, name + "_node");
56 node.setAttribute(SHAPE_ATTR, "polygon");
57 node.setAttribute(SIDES_ATTR, "4");
58 node.setAttribute(LABEL_ATTR, name);
59 return node;
60 }
61 }
This page was automatically generated by Maven