/* Research Project: Graphical Database for Category Theory J. Bradbury, Dr. R. Rosebrugh, I. Rutherford Mount Allison University 2001 File: GBConstraintsEditor.java Description: This class provides a method to easily fill in the values of the GridBagConstraints class that are necessary to add an element to a panel or frame with a GridBagLayout. The values in the GridBagConstraints that are dealt with in this class are int gridx, int gridy, int gridwidth, int gridheight, double weightx, double weighty, int anchor, int fill, Insets insets, int ipadx ,and int ipady. */ //Import Statements import java.awt.GridBagConstraints; import java.awt.Insets; //Class Definition public class GBConstraintsEditor { public GridBagConstraints getConstraints(int gridx, int gridy, int gridwidth, int gridheight, double weightx, double weighty, int anchor, int fill, Insets insets, int ipadx ,int ipady) //This method returns the gridbag constraints for the current element //of the gridbaglayout { //Create a new GridBagConstraints class GridBagConstraints c = new GridBagConstraints(); //fill in value in new GridBagConstraints class c.gridx = gridx; c.gridy = gridy; c.gridwidth = gridwidth; c.gridheight = gridheight; c.weightx = weightx; c.weighty = weighty; c.anchor = anchor; c.fill = fill; c.insets = insets; c.ipadx = ipadx; c.ipady = ipady; //Return GridBagConstraints class return(c); } }