/* Research Project: Graphical Database for Category Theory J. Bradbury, Dr. R. Rosebrugh, I. Rutherford Mount Allison University 2001 File: SettingsFuncGraphical.java Description: This file creates a frame that allows the user to change the graphical setttings associated with the display of categories A and B in the current functor. */ //import statements import java.awt.*; import java.awt.event.*; public class SettingsFuncGraphical extends Dialog { Category c = new Category(); CategoryList l = new CategoryList(); int check_enter = 0; //Objects in the Graphical User Interface(GUI) Button exit = new Button(); Panel button_panel = new Panel(); BorderLayout borderLayout1 = new BorderLayout(); Button okButton = new Button(); Checkbox setFontB = new Checkbox(); CheckboxGroup AScaleGroup = new CheckboxGroup(); CheckboxGroup BScaleGroup = new CheckboxGroup(); CheckboxGroup LayoutGroup = new CheckboxGroup(); Checkbox scaleDecreaseB = new Checkbox("", BScaleGroup, false); Checkbox scaleIncreaseB = new Checkbox("", BScaleGroup, false); Checkbox scaleOneB = new Checkbox("", BScaleGroup, false); Checkbox centerOffsetB = new Checkbox(); MainWindow ed; Panel panel1 = new Panel(); Panel panel2 = new Panel(); Panel panel3 = new Panel(); Panel panel4 = new Panel(); Panel panel5 = new Panel(); Panel panel6 = new Panel(); Label label1 = new Label(); Label label2 = new Label(); Label label3 = new Label(); Label label4 = new Label(); Label label5 = new Label(); Label label6 = new Label(); Checkbox vertLayout = new Checkbox("", LayoutGroup, false); Checkbox horizLayout = new Checkbox("", LayoutGroup, false); Checkbox aOnlyLayout = new Checkbox("", LayoutGroup, false); Checkbox bOnlyLayout = new Checkbox("", LayoutGroup, false); Checkbox scaleDecreaseA = new Checkbox("", AScaleGroup, false); Checkbox scaleOneA = new Checkbox("", AScaleGroup, false); Checkbox scaleIncreaseA = new Checkbox("", AScaleGroup, false); Checkbox setFontA = new Checkbox(); Checkbox centerOffsetA = new Checkbox(); Panel panel7 = new Panel(); Label displayLabel = new Label(); GridBagLayout gridBagLayout1 = new GridBagLayout(); GridBagLayout gridBagLayout2 = new GridBagLayout(); GridBagLayout gridBagLayout3 = new GridBagLayout(); GridBagLayout gridBagLayout4 = new GridBagLayout(); GridBagLayout gridBagLayout5 = new GridBagLayout(); GridBagLayout gridBagLayout6 = new GridBagLayout(); GridBagLayout gridBagLayout7 = new GridBagLayout(); GBConstraintsEditor g = new GBConstraintsEditor(); Panel panel8 = new Panel(); Label label7 = new Label(); GridBagLayout gridBagLayout8 = new GridBagLayout(); Panel panel9 = new Panel(); Label label8 = new Label(); GridBagLayout gridBagLayout9 = new GridBagLayout(); GridBagLayout gridBagLayout10 = new GridBagLayout(); public SettingsFuncGraphical(MainWindow edit) //Default Constructor with the parent frame as a parameter { super(edit);//mkgrvs ed = edit; ed.enableMenus(false); try { jbInit(); } catch (Exception e) { e.printStackTrace(); } } public boolean handleEvent(Event e) { if ((e.id == Event.WINDOW_DESTROY) || (e.id == Event.ACTION_EVENT)) { ed.enableMenus(true); hide(); //hide frame dispose(); //free resources return true; } else if (e.key == Event.ENTER) { if (check_enter == 0) check_enter++; else { ed.enableMenus(true); hide(); //hide frame dispose(); //free resources } return true; } return super.handleEvent(e); } public boolean action(Event e, Object o) { if ((e.target == exit) || (e.key == Event.ENTER)) { ed.enableMenus(true); hide(); //hide frame dispose(); //free resources return true; } return false; } private void jbInit() throws Exception //This function intializes the GUI { //Set Frame Properties and Layout this.setTitle("GDCT: Graphical Functor Settings"); this.setBackground(new Color(192,192,192)); this.setSize(new Dimension(455, 412)); this.setLayout(gridBagLayout10); //GUI for Functor Display Settings okButton.setLabel("OK"); panel1.setBackground(Color.white); panel1.setLayout(gridBagLayout6); panel2.setBackground(Color.white); panel2.setLayout(gridBagLayout5); panel3.setBackground(Color.white); panel3.setLayout(gridBagLayout4); panel4.setBackground(Color.white); panel4.setLayout(gridBagLayout3); panel5.setBackground(Color.white); panel5.setLayout(gridBagLayout2); panel6.setBackground(Color.white); panel6.setLayout(gridBagLayout1); label1.setFont(new Font("Dialog", 1, 12)); label1.setText("A"); label2.setText("B"); label3.setText("A"); label4.setText("A"); label5.setFont(new Font("Dialog", 1, 12)); label5.setText("B"); label6.setFont(new Font("Dialog", 1, 12)); label6.setText("B"); vertLayout.setLabel("A B Vertical"); vertLayout.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { vertLayout_itemStateChanged(e); } }); horizLayout.setLabel("A B Horizontal"); horizLayout.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { horizLayout_itemStateChanged(e); } }); horizLayout.setEnabled(false); aOnlyLayout.setLabel("A Only"); aOnlyLayout.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { aOnlyLayout_itemStateChanged(e); } }); bOnlyLayout.setLabel("B Only"); bOnlyLayout.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { bOnlyLayout_itemStateChanged(e); } }); //GUI for Category B Properties centerOffsetB.setLabel("Center Offset"); centerOffsetB.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { centerOffsetB_itemStateChanged(e); } }); scaleOneB.setLabel("Scale = 1"); scaleOneB.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { scaleOneB_itemStateChanged(e); } }); scaleIncreaseB.setLabel("Scale*2"); scaleIncreaseB.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { scaleIncreaseB_itemStateChanged(e); } }); scaleDecreaseB.setLabel("Scale/2"); scaleDecreaseB.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { scaleDecreaseB_itemStateChanged(e); } }); //GUI for Category A Properties panel7.setBackground(new Color(164, 164, 164)); panel7.setLayout(gridBagLayout7); displayLabel.setText("Category Display Layout:"); panel8.setBackground(new Color(164, 164, 164)); panel8.setLayout(gridBagLayout8); label7.setText("Category B:"); panel9.setBackground(new Color(164, 164, 164)); panel9.setLayout(gridBagLayout9); label8.setText("Category A:"); scaleDecreaseA.setLabel("Scale/2"); scaleDecreaseA.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { scaleDecreaseA_itemStateChanged(e); } }); scaleOneA.setLabel("Scale = 1"); scaleOneA.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { scaleOneA_itemStateChanged(e); } }); scaleIncreaseA.setLabel("Scale*2"); scaleIncreaseA.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { scaleIncreaseA_itemStateChanged(e); } }); setFontA.setLabel("Set Font"); setFontA.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { setFontA_itemStateChanged(e); } }); centerOffsetA.setLabel("Center Offset"); centerOffsetA.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { centerOffsetA_itemStateChanged(e); } }); //Location of GUI Components in Functor //Graphical Settings label4.setFont(new Font("Dialog", 1, 12)); label3.setFont(new Font("Dialog", 1, 12)); label2.setFont(new Font("Dialog", 1, 12)); this.add(okButton, g.getConstraints(1, 2, 1, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(6, 34, 11, 14), 180, 8)); this.add(panel7, g.getConstraints(0, 1, 2, 1, 1.0, 1.0 ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(13, 20, 0, 16), -47, -3)); panel7.add(displayLabel, g.getConstraints(0, 0, 4, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 2, 0, 0), 0, 0)); panel7.add(panel1, g.getConstraints(0, 1, 1, 2, 1.0, 1.0 ,GridBagConstraints.CENTER, GridBagConstraints.VERTICAL, new Insets(13, 9, 0, 0), -1, 0)); panel1.add(label4, g.getConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(20, 13, 20, 5), -3, 0)); panel7.add(panel2, g.getConstraints(1, 1, 1, 2, 1.0, 1.0 ,GridBagConstraints.SOUTHWEST, GridBagConstraints.VERTICAL, new Insets(14, 3, 0, 8), -2, 0)); panel2.add(label6, g.getConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(21, 14, 19, 9), -7, 0)); panel7.add(panel3, g.getConstraints(4, 1, 1, 1, 1.0, 1.0 ,GridBagConstraints.CENTER, GridBagConstraints.VERTICAL, new Insets(13, 0, 0, 6), 2, 0)); panel3.add(label3, g.getConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(4, 32, 2, 24), -3, 0)); panel7.add(panel4, g.getConstraints(4, 2, 1, 1, 1.0, 1.0 ,GridBagConstraints.SOUTH, GridBagConstraints.VERTICAL, new Insets(7, 0, 0, 7), -13, 0)); panel4.add(label5, g.getConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 47, 0, 30), -8, 0)); panel7.add(panel5, g.getConstraints(6, 1, 1, 2, 1.0, 1.0 ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(13, 0, 0, 0), 0, 0)); panel5.add(label1, g.getConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(22, 33, 21, 24), -3, 0)); panel7.add(panel6, g.getConstraints(7, 1, 1, 2, 1.0, 1.0 ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(13, 19, 0, 23), 0, 0)); panel6.add(label2, g.getConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(22, 32, 21, 29), -7, 0)); panel7.add(vertLayout, g.getConstraints(0, 3, 3, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(9, 13, 12, 0), -3, 0)); panel7.add(horizLayout, g.getConstraints(3, 3, 3, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(9, 8, 12, 0), 26, 0)); panel7.add(aOnlyLayout, g.getConstraints(6, 3, 1, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(10, 11, 11, 0), 0, 0)); panel7.add(bOnlyLayout, g.getConstraints(7, 3, 1, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(13, 26, 8, 27), 0, 0)); this.add(panel8, g.getConstraints(1, 0, 1, 1, 1.0, 1.0 ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(21, 29, 0, 18), 8, 3)); panel8.add(label7, g.getConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 4, 0, 0), 0, 0)); panel8.add(scaleDecreaseB, g.getConstraints(0, 1, 2, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 27, 0, 0), 0, 0)); panel8.add(scaleOneB, g.getConstraints(0, 2, 3, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 27, 0, 0), 0, 0)); panel8.add(scaleIncreaseB, g.getConstraints(0, 3, 2, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 28, 0, 0), 0, 0)); panel8.add(centerOffsetB, g.getConstraints(0, 4, 4, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 29, 0, 73), 0, 0)); panel8.add(setFontB, g.getConstraints(0, 5, 3, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 29, 14, 0), 0, 0)); this.add(panel9, g.getConstraints(0, 0, 1, 1, 1.0, 1.0 ,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(21, 20, 0, 0), 0, -4)); panel9.add(label8, g.getConstraints(0, 0, 1, 1, 0.0, 0.0 ,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 6, 0, 0), 0, 0)); panel9.add(scaleDecreaseA, g.getConstraints(0, 1, 2, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 27, 0, 0), 0, 0)); panel9.add(scaleOneA, g.getConstraints(0, 2, 3, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 28, 0, 0), 0, 0)); panel9.add(scaleIncreaseA, g.getConstraints(0, 3, 2, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 27, 0, 0), 0, 0)); panel9.add(centerOffsetA, g.getConstraints(0, 4, 4, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 26, 0, 66), 0, 0)); panel9.add(setFontA, g.getConstraints(0, 5, 2, 1, 0.0, 0.0 ,GridBagConstraints.CENTER, GridBagConstraints.NONE, new Insets(0, 25, 16, 0), 0, 0)); if (ed.functorFromScale == 1) { scaleOneA.setState(true); } else if (ed.functorFromScale > 1) { scaleIncreaseA.setState(true); } else { scaleDecreaseA.setState(true); } if (ed.functorToScale == 1) { scaleOneB.setState(true); } else if (ed.functorToScale > 1) { scaleIncreaseB.setState(true); } else { scaleDecreaseB.setState(true); } setFontB.setLabel("Set Font"); setFontB.addItemListener(new java.awt.event.ItemListener() { public void itemStateChanged(ItemEvent e) { setFontB_itemStateChanged(e); } }); if (ed.displayType == 'v') LayoutGroup.setCurrent(vertLayout); else if (ed.displayType == 'h') LayoutGroup.setCurrent(horizLayout); else if (ed.displayType == 'a') LayoutGroup.setCurrent(aOnlyLayout); else if (ed.displayType == 'b') LayoutGroup.setCurrent(bOnlyLayout); } void centerOffsetA_itemStateChanged(ItemEvent e) //This function is called when the center offset option //is selected for Category A { DDimension port_dim = ed.functorFromPanel.getPortSize(); DDimension cont_dim = ed.functorFromPanel.getContentSize(); double x = (cont_dim.width - port_dim.width) / 2.0; double y = (cont_dim.height - port_dim.height) / 2.0; ed.functorFromPanel.scrollTo((int)x, (int)y); } void centerOffsetB_itemStateChanged(ItemEvent e) //This function is called when the center offset option //is selected for Category B { DDimension port_dim = ed.functorToPanel.getPortSize(); DDimension cont_dim = ed.functorToPanel.getContentSize(); double x = (cont_dim.width - port_dim.width) / 2.0; double y = (cont_dim.height - port_dim.height) / 2.0; ed.functorToPanel.scrollTo((int)x, (int)y); } void setFontA_itemStateChanged(ItemEvent e) //This option displays a font dialog window when the Font //Settings option is selected for Category A { if(ed.functorFromFont == null) ed.functorFromFont = new FontPropDialog(ed, ed.functorFromCanvas); else ed.functorFromFont.showMe(); //Set Category A font information in initialization file ed.ini.setCatAFont(ed.functorFromCanvas.getFont()); } void setFontB_itemStateChanged(ItemEvent e) //This option displays a font dialog window when the Font //Settings option is selected for Category B { if(ed.functorToFont == null) ed.functorToFont = new FontPropDialog(ed, ed.functorToCanvas); else ed.functorToFont.showMe(); //Set Category B font information in initialization file ed.ini.setCatBFont(ed.functorToCanvas.getFont()); } void scaleDecreaseA_itemStateChanged(ItemEvent e) //Selected when the user decides to make scale = scale/2 //for Category A { ed.functorFromScale /= 2.0; ed.functorFromCanvas.setScale(ed.functorFromScale); //Update scale for Category A in initialzation file ed.ini.setCatAScale(ed.functorFromScale); } void scaleDecreaseB_itemStateChanged(ItemEvent e) //Selected when the user decides to make scale = scale/2 //for Category B { ed.functorToScale /= 2.0; ed.functorToCanvas.setScale(ed.functorToScale); //Update scale for Category B in initialzation file ed.ini.setCatBScale(ed.functorToScale); } void scaleOneA_itemStateChanged(ItemEvent e) //Selected when the user decides to make scale = 1 //for Category B { ed.functorFromScale = 1.0; ed.functorFromCanvas.setScale(ed.functorFromScale); //Update scale for Category A in initialzation file ed.ini.setCatAScale(ed.functorFromScale); } void scaleOneB_itemStateChanged(ItemEvent e) //Selected when the user decides to make scale = 1 //for Category B { ed.functorToScale = 1.0; ed.functorToCanvas.setScale(ed.functorToScale); //Update scale for Category B in initialzation file ed.ini.setCatBScale(ed.functorToScale); } void scaleIncreaseA_itemStateChanged(ItemEvent e) //Selected when the user decides to make scale = scale*2 //for Category A { ed.functorFromScale *= 2.0; ed.functorFromCanvas.setScale(ed.functorFromScale); //Update scale for Category A in initialzation file ed.ini.setCatAScale(ed.functorFromScale); } void scaleIncreaseB_itemStateChanged(ItemEvent e) //Selected when the user decides to make scale = scale*2 //for Category B { ed.functorToScale *= 2.0; ed.functorToCanvas.setScale(ed.functorToScale); //Update scale for Category B in initialzation file ed.ini.setCatBScale(ed.functorToScale); } void horizLayout_itemStateChanged(ItemEvent e) //Display categories a and b one on top of the other for //functor category display { ed.functorFromCanvas.unselectItems(); GraphEdit geA = new GraphEdit(ed.functorFromGraph, ed.functorFromCanvas); ed.fnode.A.gml = geA.getGMLText(); ed.functorToCanvas.unselectItems(); GraphEdit geB = new GraphEdit(ed.functorToGraph, ed.functorToCanvas); ed.fnode.B.gml = geB.getGMLText(); if (ed.displayType != 'h') { //Make categories a and b visible if necessary if (ed.displayType == 'a') { ed.funcPanel1.setVisible(true); ed.validate(); } else if (ed.displayType == 'b') { ed.funcPanel2.setVisible(true); ed.validate(); } //Redraw Layout of categories horizontally ed.createFunctorDisplay.removeAll(); ed.createFunctorDisplay.add(ed.funcPanel1, g.getConstraints(0, 0, 1, 1, 1.0, 1.0,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(6, 5, 0, 4), 639, 227)); ed.createFunctorDisplay.add(ed.funcPanel2, g.getConstraints(0, 1, 1, 1, 1.0, 1.0,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(0, 5, 0, 3), 638, 245)); ed.createFunctorDisplay.add(ed.funcDisplayControls, g.getConstraints(0, 2, 1, 1, 0.0, 0.0,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(6, 5, 3, 4), 183, 4)); ed.validate(); ed.displayType = 'h'; //Set functor display layout in initialization file ed.ini.setFunDisplayLayout("ABHorizontal"); } } void vertLayout_itemStateChanged(ItemEvent e) //Display categories a and b side by side for functor category display { ed.functorFromCanvas.unselectItems(); GraphEdit geA = new GraphEdit(ed.functorFromGraph, ed.functorFromCanvas); ed.fnode.A.gml = geA.getGMLText(); ed.functorToCanvas.unselectItems(); GraphEdit geB = new GraphEdit(ed.functorToGraph, ed.functorToCanvas); ed.fnode.B.gml = geB.getGMLText(); if (ed.displayType == 'a') ed.funcPanel2.setVisible(true); else if (ed.displayType == 'b') ed.funcPanel1.setVisible(true); else if (ed.displayType == 'h') { ed.createFunctorDisplay.removeAll(); ed.createFunctorDisplay.add(ed.funcPanel1, g.getConstraints(0, 0, 1, 1, 1.0, 1.0,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(6, 5, 0, 0), 314, 487)); ed.createFunctorDisplay.add(ed.funcPanel2, g.getConstraints(1, 0, 1, 1, 1.0, 1.0,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(6, 14, 0, 3), 302, 487)); ed.createFunctorDisplay.add(ed.funcDisplayControls, g.getConstraints(0, 1, 2, 1, 0.0, 0.0,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(6, 5, 3, 4), 182, 4)); } ed.validate(); ed.displayType = 'v'; //Set functor display layout in initialization file ed.ini.setFunDisplayLayout("ABVertical"); } void bOnlyLayout_itemStateChanged(ItemEvent e) //Display category B only for functor category display { ed.functorFromCanvas.unselectItems(); GraphEdit geA = new GraphEdit(ed.functorFromGraph, ed.functorFromCanvas); ed.fnode.A.gml = geA.getGMLText(); ed.functorToCanvas.unselectItems(); GraphEdit geB = new GraphEdit(ed.functorToGraph, ed.functorToCanvas); ed.fnode.B.gml = geB.getGMLText(); if (ed.displayType == 'h') { ed.createFunctorDisplay.removeAll(); ed.createFunctorDisplay.add(ed.funcPanel1, g.getConstraints(0, 0, 1, 1, 1.0, 1.0,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(6, 5, 0, 0), 314, 487)); ed.createFunctorDisplay.add(ed.funcPanel2, g.getConstraints(1, 0, 1, 1, 1.0, 1.0,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(6, 14, 0, 3), 302, 487)); ed.createFunctorDisplay.add(ed.funcDisplayControls, g.getConstraints(0, 1, 2, 1, 0.0, 0.0,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(6, 5, 3, 4), 182, 4)); ed.funcPanel1.setVisible(false); } else if (ed.displayType == 'a') { ed.funcPanel2.setVisible(true); ed.funcPanel1.setVisible(false); } else if (ed.displayType == 'v') ed.funcPanel1.setVisible(false); ed.validate(); ed.displayType = 'b'; //Set functor display layout in initialization file ed.ini.setFunDisplayLayout("BOnly"); } void aOnlyLayout_itemStateChanged(ItemEvent e) //Display category A only for functor category display { ed.functorFromCanvas.unselectItems(); GraphEdit geA = new GraphEdit(ed.functorFromGraph, ed.functorFromCanvas); ed.fnode.A.gml = geA.getGMLText(); ed.functorToCanvas.unselectItems(); GraphEdit geB = new GraphEdit(ed.functorToGraph, ed.functorToCanvas); ed.fnode.B.gml = geB.getGMLText(); if (ed.displayType == 'h') { ed.createFunctorDisplay.removeAll(); ed.createFunctorDisplay.add(ed.funcPanel1, g.getConstraints(0, 0, 1, 1, 1.0, 1.0,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(6, 5, 0, 0), 314, 487)); ed.createFunctorDisplay.add(ed.funcPanel2, g.getConstraints(1, 0, 1, 1, 1.0, 1.0,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(6, 14, 0, 3), 302, 487)); ed.createFunctorDisplay.add(ed.funcDisplayControls, g.getConstraints(0, 1, 2, 1, 0.0, 0.0,GridBagConstraints.CENTER, GridBagConstraints.BOTH, new Insets(6, 5, 3, 4), 182, 4)); ed.funcPanel2.setVisible(false); } if (ed.displayType == 'b') { ed.funcPanel1.setVisible(true); ed.funcPanel2.setVisible(false); } else if (ed.displayType == 'v') ed.funcPanel2.setVisible(false); ed.validate(); ed.displayType = 'a'; //Set functor display layout in initialization file ed.ini.setFunDisplayLayout("AOnly"); } }