src/Tools/GraphBrowser/graphbrowser/GraphBrowser.java
author wenzelm
Sun, 18 Jul 2021 13:41:20 +0200
changeset 74040 aa36845ad5ad
parent 74016 027fb21bdd5d
child 79043 22c41ee13939
permissions -rw-r--r--
discontinued obsolete Apple (deprecated);
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3599
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
     1
/***************************************************************************
74015
12b1f4649ab1 clarified names;
wenzelm
parents: 74011
diff changeset
     2
  Title:      graphbrowser/GraphBrowser.java
3599
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
     3
  Author:     Stefan Berghofer, TU Muenchen
50473
ca4088bf8365 added speculative options for jEdit;
wenzelm
parents: 33686
diff changeset
     4
  Options:    :tabSize=4:
3599
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
     5
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
     6
  This is the graph browser's main class. It contains the "main(...)"
74040
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
     7
  method, which is used for the stand-alone version.
6541
d3ac35b2bfbf Updated to JDK 1.1.x
berghofe
parents: 3641
diff changeset
     8
  Note: GraphBrowser is designed for the 1.1.x version of the JDK.
3599
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
     9
***************************************************************************/
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    10
74015
12b1f4649ab1 clarified names;
wenzelm
parents: 74011
diff changeset
    11
package isabelle.graphbrowser;
3599
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    12
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    13
import java.awt.*;
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    14
import java.io.*;
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    15
import java.util.*;
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    16
import java.net.*;
74015
12b1f4649ab1 clarified names;
wenzelm
parents: 74011
diff changeset
    17
import isabelle.awt.*;
3599
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    18
74040
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    19
public class GraphBrowser extends Panel {
3599
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    20
	GraphView gv;
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    21
	TreeBrowser tb=null;
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    22
	String gfname;
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    23
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    24
	static Frame f;
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    25
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    26
	public GraphBrowser(String name) {
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    27
		gfname=name;
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    28
	}
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    29
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    30
	public GraphBrowser() {}
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    31
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    32
	public void showWaitMessage() {
74040
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    33
		f.setCursor(new Cursor(Cursor.WAIT_CURSOR));
3599
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    34
	}
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    35
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    36
	public void showReadyMessage() {
74040
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    37
		f.setCursor(new Cursor(Cursor.DEFAULT_CURSOR));
3599
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    38
	}
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    39
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    40
	public void viewFile(String fname) {
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    41
		try {
74040
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    42
            String path = gfname.substring(0, gfname.lastIndexOf('/') + 1);
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    43
            Reader rd;
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    44
            BufferedReader br;
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    45
            String line, text = "";
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    46
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    47
            try {
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    48
                rd = new BufferedReader(new InputStreamReader((new URL(fname)).openConnection().getInputStream()));
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    49
            } catch (Exception exn) {
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    50
                rd = new FileReader(path + fname);
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    51
            }
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    52
            br = new BufferedReader(rd);
3599
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    53
74040
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    54
            while ((line = br.readLine()) != null)
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    55
                text += line + "\n";
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    56
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    57
            if (fname.endsWith(".html")) {
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    58
                /**** convert HTML to text (just a quick hack) ****/
6648
d70810da5565 Added some code to enable browser to display remote documents.
berghofe
parents: 6541
diff changeset
    59
74040
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    60
                String buf="";
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    61
                char[] text2,text3;
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    62
                int i,j=0;
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    63
                boolean special=false, html=false;
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    64
                char ctrl;
3599
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    65
74040
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    66
                text2 = text.toCharArray();
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    67
                text3 = new char[text.length()];
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    68
                for (i = 0; i < text.length(); i++) {
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    69
                    char c = text2[i];
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    70
                    if (c == '&') {
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    71
                        special = true;
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    72
                        buf = "";
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    73
                    } else if (special) {
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    74
                        if (c == ';') {
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    75
                            special = false;
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    76
                            if (buf.equals("lt"))
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    77
                                text3[j++] = '<';
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    78
                            else if (buf.equals("gt"))
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    79
                                text3[j++] = '>';
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    80
                            else if (buf.equals("amp"))
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    81
                                text3[j++] = '&';
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    82
                        } else
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    83
                            buf += c;
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    84
                    } else if (c == '<') {
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    85
                        html = true;
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    86
                        ctrl = text2[i+1];
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    87
                    } else if (c == '>')
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    88
                        html = false;
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    89
                    else if (!html)
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    90
                        text3[j++] = c;
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    91
                }
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    92
                text = String.valueOf(text3);
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    93
            }
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    94
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    95
            Frame f=new TextFrame(fname.substring(fname.lastIndexOf('/')+1),text);
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    96
            f.setSize(500,600);
aa36845ad5ad discontinued obsolete Apple (deprecated);
wenzelm
parents: 74016
diff changeset
    97
            f.setVisible(true);
3599
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
    98
		} catch (Exception exn) {
11798
fbab70de9b0d Added support for batch mode layout (without X11 connection).
berghofe
parents: 9459
diff changeset
    99
			System.err.println("Can't read file "+fname);
3599
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   100
		}
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   101
	}
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   102
				
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   103
	public void PS(String fname,boolean printable) throws IOException {
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   104
		gv.PS(fname,printable);
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   105
	}
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   106
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   107
	public boolean isEmpty() {
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   108
		return tb==null;
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   109
	}
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   110
11876
6ac0627167ed Fixed problem with batch mode layout, which caused an AWT exception when
berghofe
parents: 11812
diff changeset
   111
	public void initBrowser(InputStream is, boolean noAWT) {
3599
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   112
		try {
11876
6ac0627167ed Fixed problem with batch mode layout, which caused an AWT exception when
berghofe
parents: 11812
diff changeset
   113
			Font font = noAWT ? null : new Font("Helvetica", Font.PLAIN, 12);
6ac0627167ed Fixed problem with batch mode layout, which caused an AWT exception when
berghofe
parents: 11812
diff changeset
   114
			TreeNode tn = new TreeNode("Root", "", -1, true);
6ac0627167ed Fixed problem with batch mode layout, which caused an AWT exception when
berghofe
parents: 11812
diff changeset
   115
			gv = new GraphView(new Graph(is, tn), this, font);
6ac0627167ed Fixed problem with batch mode layout, which caused an AWT exception when
berghofe
parents: 11812
diff changeset
   116
			tb = new TreeBrowser(tn, gv, font);
3599
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   117
			gv.setTreeBrowser(tb);
6541
d3ac35b2bfbf Updated to JDK 1.1.x
berghofe
parents: 3641
diff changeset
   118
			Vector v = new Vector(10,10);
3599
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   119
			tn.collapsedDirectories(v);
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   120
			gv.collapseDir(v);
6541
d3ac35b2bfbf Updated to JDK 1.1.x
berghofe
parents: 3641
diff changeset
   121
d3ac35b2bfbf Updated to JDK 1.1.x
berghofe
parents: 3641
diff changeset
   122
			ScrollPane scrollp1 = new ScrollPane();
d3ac35b2bfbf Updated to JDK 1.1.x
berghofe
parents: 3641
diff changeset
   123
			ScrollPane scrollp2 = new ScrollPane();
d3ac35b2bfbf Updated to JDK 1.1.x
berghofe
parents: 3641
diff changeset
   124
			scrollp1.add(gv);
d3ac35b2bfbf Updated to JDK 1.1.x
berghofe
parents: 3641
diff changeset
   125
			scrollp2.add(tb);
d3ac35b2bfbf Updated to JDK 1.1.x
berghofe
parents: 3641
diff changeset
   126
			scrollp1.getHAdjustable().setUnitIncrement(20);
d3ac35b2bfbf Updated to JDK 1.1.x
berghofe
parents: 3641
diff changeset
   127
			scrollp1.getVAdjustable().setUnitIncrement(20);
d3ac35b2bfbf Updated to JDK 1.1.x
berghofe
parents: 3641
diff changeset
   128
			scrollp2.getHAdjustable().setUnitIncrement(20);
d3ac35b2bfbf Updated to JDK 1.1.x
berghofe
parents: 3641
diff changeset
   129
			scrollp2.getVAdjustable().setUnitIncrement(20);
6753
43507781dc4d broder size 3;
wenzelm
parents: 6648
diff changeset
   130
			Component gv2 = new Border(scrollp1, 3);
43507781dc4d broder size 3;
wenzelm
parents: 6648
diff changeset
   131
			Component tb2 = new Border(scrollp2, 3);
3599
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   132
			GridBagLayout gridbag = new GridBagLayout();
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   133
			GridBagConstraints cnstr = new GridBagConstraints();
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   134
			setLayout(gridbag);
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   135
			cnstr.fill = GridBagConstraints.BOTH;
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   136
			cnstr.insets = new Insets(5,5,5,5);
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   137
			cnstr.weightx = 1;
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   138
			cnstr.weighty = 1;
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   139
			cnstr.gridwidth = 1;
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   140
			gridbag.setConstraints(tb2,cnstr);
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   141
			add(tb2);
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   142
			cnstr.weightx = 2.5;
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   143
			cnstr.gridwidth = GridBagConstraints.REMAINDER;
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   144
			gridbag.setConstraints(gv2,cnstr);
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   145
			add(gv2);
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   146
		} catch (IOException exn) {
11798
fbab70de9b0d Added support for batch mode layout (without X11 connection).
berghofe
parents: 9459
diff changeset
   147
			System.err.println("\nI/O error while reading graph file.");
3599
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   148
		} catch (ParseError exn) {
11798
fbab70de9b0d Added support for batch mode layout (without X11 connection).
berghofe
parents: 9459
diff changeset
   149
			System.err.println("\nParse error in graph file:");
fbab70de9b0d Added support for batch mode layout (without X11 connection).
berghofe
parents: 9459
diff changeset
   150
			System.err.println(exn.getMessage());
fbab70de9b0d Added support for batch mode layout (without X11 connection).
berghofe
parents: 9459
diff changeset
   151
			System.err.println("\nSyntax:\n<vertexname> <vertexID> <dirname> [ + ] <path> [ < | > ] [ <vertexID> [ ... [ <vertexID> ] ... ] ] ;");
3599
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   152
		}
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   153
	}		
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   154
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   155
	public static void main(String[] args) {
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   156
		try {
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   157
			GraphBrowser gb=new GraphBrowser(args.length > 0 ? args[0] : "");
11798
fbab70de9b0d Added support for batch mode layout (without X11 connection).
berghofe
parents: 9459
diff changeset
   158
			if (args.length > 0) {
3599
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   159
				InputStream is=new FileInputStream(args[0]);
11876
6ac0627167ed Fixed problem with batch mode layout, which caused an AWT exception when
berghofe
parents: 11812
diff changeset
   160
				gb.initBrowser(is, args.length > 1);
3599
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   161
				is.close();
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   162
			}
11798
fbab70de9b0d Added support for batch mode layout (without X11 connection).
berghofe
parents: 9459
diff changeset
   163
			if (args.length > 1) {
fbab70de9b0d Added support for batch mode layout (without X11 connection).
berghofe
parents: 9459
diff changeset
   164
                            try {
11876
6ac0627167ed Fixed problem with batch mode layout, which caused an AWT exception when
berghofe
parents: 11812
diff changeset
   165
			      if (args[1].endsWith(".ps"))
11798
fbab70de9b0d Added support for batch mode layout (without X11 connection).
berghofe
parents: 9459
diff changeset
   166
                                gb.gv.PS(args[1], true);
11876
6ac0627167ed Fixed problem with batch mode layout, which caused an AWT exception when
berghofe
parents: 11812
diff changeset
   167
                              else if (args[1].endsWith(".eps"))
11798
fbab70de9b0d Added support for batch mode layout (without X11 connection).
berghofe
parents: 9459
diff changeset
   168
                                gb.gv.PS(args[1], false);
11876
6ac0627167ed Fixed problem with batch mode layout, which caused an AWT exception when
berghofe
parents: 11812
diff changeset
   169
                              else
11798
fbab70de9b0d Added support for batch mode layout (without X11 connection).
berghofe
parents: 9459
diff changeset
   170
                                System.err.println("Unknown file type: " + args[1]);
fbab70de9b0d Added support for batch mode layout (without X11 connection).
berghofe
parents: 9459
diff changeset
   171
                            } catch (IOException exn) {
fbab70de9b0d Added support for batch mode layout (without X11 connection).
berghofe
parents: 9459
diff changeset
   172
                              System.err.println("Unable to write file " + args[1]);
fbab70de9b0d Added support for batch mode layout (without X11 connection).
berghofe
parents: 9459
diff changeset
   173
                            }
fbab70de9b0d Added support for batch mode layout (without X11 connection).
berghofe
parents: 9459
diff changeset
   174
                        } else {
fbab70de9b0d Added support for batch mode layout (without X11 connection).
berghofe
parents: 9459
diff changeset
   175
			    f=new GraphBrowserFrame(gb);
fbab70de9b0d Added support for batch mode layout (without X11 connection).
berghofe
parents: 9459
diff changeset
   176
			    f.setSize(700,500);
74016
027fb21bdd5d tuned --- fewer warnings;
wenzelm
parents: 74015
diff changeset
   177
			    f.setVisible(true);
11798
fbab70de9b0d Added support for batch mode layout (without X11 connection).
berghofe
parents: 9459
diff changeset
   178
                        }
3599
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   179
		} catch (IOException exn) {
11798
fbab70de9b0d Added support for batch mode layout (without X11 connection).
berghofe
parents: 9459
diff changeset
   180
			System.err.println("Can't open graph file "+args[0]);
3599
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   181
		}
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   182
	}
89cbba12863d Source files for Isabelle theory graph browser.
berghofe
parents:
diff changeset
   183
}