<commit_before>/***************************************************************************
  Title:      GraphBrowser/GraphBrowserFrame.java
  ID:         $Id$
  Author:     <NAME>, <NAME>
  Copyright   1997  TU Muenchen

  This class is the frame for the stand-alone application. It contains
  methods for handling menubar events.
***************************************************************************/

package GraphBrowser;

import java.awt.*;
import java.awt.event.*;
import java.io.*;
import awtUtilities.*;

public class GraphBrowserFrame extends Frame implements ActionListener {
	GraphBrowser gb;
	MenuItem i1, i2;
	String graphDir, psDir;

	public void checkMenuItems() {
		if (gb.isEmpty()) {
			i1.setEnabled(false);
			i2.setEnabled(false);
		} else {
			i1.setEnabled(true);
			i2.setEnabled(true);
		}
	}

	public void actionPerformed(ActionEvent evt) {
		String label = evt.getActionCommand();
		if (label.equals("Quit"))
			System.exit(0);
		else if (label.equals("Export to PostScript")) {
			PS(true, label);
			return;
		} else if (label.equals("Export to EPS")) {
			PS(false, label);
			return;
		} else if (label.equals("Open ...")) {
			FileDialog fd = new FileDialog(this, "Open graph file", FileDialog.LOAD);
			if (graphDir != null)
				fd.setDirectory(graphDir);
			fd.setVisible(true);
			if (fd.getFile() == null) return;
			graphDir = fd.getDirectory();
			String fname = graphDir + fd.getFile();
			GraphBrowser gb2 = new GraphBrowser(fname);
			try {
				InputStream is = new FileInputStream(fname);
				gb2.initBrowser(is);
				is.close();
			} catch (IOException exn) {
				String button[] = {"OK"};
				MessageDialog md = new MessageDialog(this, "Error",
					"Can't open file " + fname + ".", button);
				md.setSize(350, 200);
				md.setVisible(true);
				return;<commit_msg>initBrowser now has additional noAWT argument.<commit_after>/***************************************************************************
  Title:      GraphBrowser/GraphBrowserFrame.java
  ID:         $Id$
  Author:     <NAME>, <NAME>
  License:    GPL (GNU GENERAL PUBLIC LICENSE)

  This class is the frame for the stand-alone application. It contains
  methods for handling menubar events.
***************************************************************************/

package GraphBrowser;

import java.awt.*;
import java.awt.event.*;
import java.io.*;
import awtUtilities.*;

public class GraphBrowserFrame extends Frame implements ActionListener {
	GraphBrowser gb;
	MenuItem i1, i2;
	String graphDir, psDir;

	public void checkMenuItems() {
		if (gb.isEmpty()) {
			i1.setEnabled(false);
			i2.setEnabled(false);
		} else {
			i1.setEnabled(true);
			i2.setEnabled(true);
		}
	}

	public void actionPerformed(ActionEvent evt) {
		String label = evt.getActionCommand();
		if (label.equals("Quit"))
			System.exit(0);
		else if (label.equals("Export to PostScript")) {
			PS(true, label);
			return;
		} else if (label.equals("Export to EPS")) {
			PS(false, label);
			return;
		} else if (label.equals("Open ...")) {
			FileDialog fd = new FileDialog(this, "Open graph file", FileDialog.LOAD);
			if (graphDir != null)
				fd.setDirectory(graphDir);
			fd.setVisible(true);
			if (fd.getFile() == null) return;
			graphDir = fd.getDirectory();
			String fname = graphDir + fd.getFile();
			GraphBrowser gb2 = new GraphBrowser(fname);
			try {
				InputStream is = new FileInputStream(fname);
				gb2.initBrowser(is, false);
				is.close();
			} catch (IOException exn) {
				String button[] = {"OK"};
				MessageDialog md = new MessageDialog(this, "Error",
					"Can't open file " + fname + ".", button);
				md.setSize(350, 200);
				md.setVisible(true);
				return;
{'fraction_non_alphanumeric': 0.20509347060417232, 'fraction_numerical': 0.009211595773503115, 'mean_word_length': 3.8835978835978837, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '970636', 'n_tokens_mistral': 1297, 'n_tokens_neox': 1102, 'n_words': 299}