/* Research Project: Graphical Database for Category Theory J. Bradbury, Dr. R. Rosebrugh, I. Rutherford Mount Allison University 2001 Updated: May 8th, 2003 (J. Tweedle) File: EpiFrame.java Description: This class implements a frame which allows the user to run the category tool "Epimorphism" on the current category. The algorithms used to check for epimorphisms were removed and put into the file Epi.java. */ import java.awt.*; import java.awt.event.*; import javax.swing.*; import java.beans.*; public class EpiFrame extends JInternalFrame { Category cat = new Category(); Epi epi; CategoryInternalFrame categoryInternalFrame_; JButton epiButton = new JButton(); JButton closeButton = new JButton(); JTextField epiPath = new JTextField(15); JRadioButton allPathsButton = new JRadioButton("Check All Paths", true); JRadioButton epiPathButton = new JRadioButton("Epimorphism Path"); ButtonGroup epiGroup = new ButtonGroup(); public EpiFrame(CategoryInternalFrame categoryInternalFrame) { super(categoryInternalFrame.getTitle() + ": Epimorphism", true, true, false, false); categoryInternalFrame_ = categoryInternalFrame; cat = categoryInternalFrame.getCategory().makeDual(); epi = new Epi(cat); try { jbInit(); } catch (Exception e) { e.printStackTrace(); } } private void jbInit() throws Exception { epiGroup.add(epiPathButton); epiGroup.add(allPathsButton); epiButton.setText("Epi?"); epiButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { epiButton_actionPerformed(e); } }); closeButton.setText("Close"); closeButton.addActionListener(new java.awt.event.ActionListener() { public void actionPerformed(ActionEvent e) { closeButton_actionPerformed(e); } }); Container contentPane = getContentPane(); contentPane.setLayout(new GridBagLayout()); contentPane.add(epiPathButton, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); contentPane.add(epiButton, new GridBagConstraints(0, 2, 1, 1, 1.0, 1.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); contentPane.add(closeButton, new GridBagConstraints(1, 2, 1, 1, 1.0, 1.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); contentPane.add(epiPath, new GridBagConstraints(1, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0)); contentPane.add(allPathsButton, new GridBagConstraints(0, 1, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0)); } private void epiButton_actionPerformed(ActionEvent e) { String viewbox = ""; epi.setEndoPassed(false); epi.setOutput(""); if (allPathsButton.isSelected()) { int i, j; int path[] = new int[cat.ini.getMAXARR()]; HomTree pathtree; epi.setSupressOutput(true); epi.setNumEpis(0); for (i=0; i