/* 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: TerminalObjectFrame.java Description: This file is displayed when the user selects the "Terminal Object" menu option in the main window. The user can select a category from a choice menu and then chose to check if one or all of the categories are terminal. The information on each object tested will be displayed in the text area. The code used to test the category for a terminal object was removed and incorporated into the InitialObject class. Before the InitialObject methods are called, the category must be 'dualled' (i.e. call the makeDual() method); then the setObjectType() method must be used to set the objectType to TERMINAL_OBJECT, in order to get the correct output (by calling the getOutput() method). This basically just reverses the category and performs the initial object algorithm. */ //import statements import java.awt.*; import java.awt.event.*; import javax.swing.*; import javax.swing.event.*; import java.beans.*; public class TerminalObjectFrame extends JInternalFrame { Category cat; CategoryInternalFrame categoryInternalFrame_; InitialObject termObj; //Objects in the Graphical User Interface(GUI) DefaultListModel objectModel = new DefaultListModel(); JList objectList = new JList(objectModel); JPanel buttonPanel = new JPanel(); JButton closeButton = new JButton(); JButton checkButton = new JButton(); JButton selectAllButton = new JButton(); JLabel objectLabel = new JLabel(); // JTextArea textArea1 = new JTextArea("", 3, 3); JTextField currentCategory = new JTextField(10); // JScrollPane areaScrollPane; public TerminalObjectFrame(CategoryInternalFrame categoryInternalFrame) { super(categoryInternalFrame.getTitle() + ": Terminal Objects", true, true, false, false); categoryInternalFrame_ = categoryInternalFrame; cat = categoryInternalFrame_.getCategory().makeDual(); termObj = new InitialObject(cat, "terminal"); try {jbInit();} catch (Exception e) {e.printStackTrace();} } private void jbInit() throws Exception //This function intializes the GUI { objectList.setBackground(Color.white); objectList.setBorder(BorderFactory.createEtchedBorder()); objectList.getSelectionModel().setSelectionMode(ListSelectionModel.MULTIPLE_INTERVAL_SELECTION); for (int i=0; i