View Javadoc
1 /*** 2 * GraphFactory.java 3 * 4 * Project: Dependency Tool 5 * 6 * WHEN WHO WHAT 7 * 06.06.2003 pko initial public release 8 * 9 * Copyright 2003 ELCA Informatique SA 10 * Av. de la Harpe 22-24, 1000 Lausanne 13, Switzerland 11 * www.elca.ch 12 * 13 * This library is free software; you can redistribute it and/or 14 * modify it under the terms of the GNU Lesser General Public License 15 * as published by the Free Software Foundation; either version 2.1 of 16 * the License, or (at your option) any later version. 17 * 18 * This library is distributed in the hope that it will be useful, but 19 * WITHOUT ANY WARRANTY; without even the implied warranty of 20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 21 * Lesser General Public License for more details. 22 * 23 * You should have received a copy of the GNU Lesser General Public 24 * License along with this library; if not, write to the Free Software 25 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 26 * USA 27 */ 28 29 package ch.elca.dependency.adapter.grappa; 30 31 import java.util.Hashtable; 32 import att.grappa.Graph; 33 import att.grappa.GrappaConstants; 34 35 /*** 36 * The <code>att.grappa.Graph</code> needs to be adapted to the needs 37 * of the Dependency Tool. This class <code>GraphAdapter</code> 38 * presets some properties of the <code>att.grappa.Graph</code>, so 39 * that it can be used by the Dependency Tool. 40 * 41 * @author Pawel Kowalski 42 * @version 1.0-beta 43 */ 44 public class GraphFactory implements GrappaConstants { 45 46 /*** 47 * Create a new <code>att.grappa.Graph</code> with values preset, 48 * so that we can use it within the Dependency Tool. 49 * 50 * @param graphName a <code>String</code> value 51 * @param directed a <code>boolean</code> value 52 * @param strict a <code>boolean</code> value 53 * @return a <code>Graph</code> value 54 */ 55 public static Graph createNewGraph(String graphName, boolean directed, boolean strict) { 56 Graph graph = new Graph(graphName, directed, strict); 57 graph.object = new Hashtable(); 58 graph.setGrappaAttribute(GRAPPA_SELECTION_STYLE_ATTR,"lineColor(steelblue3),lineWidth(3)"); 59 graph.setGrappaAttribute(GRAPPA_BACKGROUND_COLOR_ATTR,"white"); 60 return graph; 61 } 62 }

This page was automatically generated by Maven