1 /* 2 * Copyright (c) 2003-2008, by Henrik Arro and Contributors 3 * 4 * This file is part of JSeq, a tool to automatically create 5 * sequence diagrams by tracing program execution. 6 * 7 * See <http://jseq.sourceforge.net> for more information. 8 * 9 * JSeq is free software: you can redistribute it and/or modify 10 * it under the terms of the GNU Lesser General Public License as 11 * published by the Free Software Foundation, either version 3 of 12 * the License, or (at your option) any later version. 13 * 14 * JSeq is distributed in the hope that it will be useful, 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 17 * GNU Lesser General Public License for more details. 18 * 19 * You should have received a copy of the GNU Lesser General Public License 20 * along with JSeq. If not, see <http://www.gnu.org/licenses/>. 21 */ 22 23 package th.co.edge.jseq; 24 25 import java.io.File; 26 import java.io.IOException; 27 28 /** 29 * A <code>Diagram</code> represents some form of sequence diagram that can be 30 * written to a file. 31 */ 32 public interface Diagram { 33 34 /** 35 * Writes this diagram to file, using whatever native format is used by that 36 * kind of diagram: text, XML, binary, ... 37 * 38 * @param file 39 * the <code>File</code> to write to 40 * 41 * @throws IOException 42 * if writing to the file failed 43 */ 44 public void save(File file) throws IOException; 45 46 /** 47 * Returns a string representation of this diagram. 48 * 49 * @return a string representation of this diagram 50 */ 51 public String toString(); 52 }