private void enableAndDisableBoxes() {

		// enable sub-boxes of checked main boxes
		g1Rg2CB.setEnabled(gen1CB.isSelected());
		g1Rg4CB.setEnabled(gen1CB.isSelected());
		g2Rg1CB.setEnabled(gen2CB.isSelected());
		g2Rg3CB.setEnabled(gen2CB.isSelected());
		g2Rg4CB.setEnabled(gen2CB.isSelected());
		g3Rg2CB.setEnabled(gen3CB.isSelected());
		g3Rg4CB.setEnabled(gen3CB.isSelected());
		g4Rg1CB.setEnabled(gen4CB.isSelected());
		g4Rg2CB.setEnabled(gen4CB.isSelected());
		g4Rg3CB.setEnabled(gen4CB.isSelected());

		// uncheck disabled subboxes
		if (!gen1CB.isSelected()) {
			g1Rg2CB.setSelected(false);
			g1Rg4CB.setSelected(false);
		}
		if (!gen2CB.isSelected()) {
			g2Rg1CB.setSelected(false);
			g2Rg3CB.setSelected(false);
			g2Rg4CB.setSelected(false);
		}
		if (!gen3CB.isSelected()) {
			g3Rg2CB.setSelected(false);
			g3Rg4CB.setSelected(false);
		}
		if (!gen4CB.isSelected()) {
			g4Rg1CB.setSelected(false);
			g4Rg2CB.setSelected(false);
			g4Rg3CB.setSelected(false);
		}

		// check and disable implied boxes
		if (gen1CB.isSelected()) {
			g2Rg1CB.setEnabled(false);
			g2Rg1CB.setSelected(true);
			g4Rg1CB.setEnabled(false);
			g4Rg1CB.setSelected(true);
		}

		if (gen2CB.isSelected()) {
			g1Rg2CB.setEnabled(false);
			g1Rg2CB.setSelected(true);
			g3Rg2CB.setEnabled(false);
			g3Rg2CB.setSelected(true);
			g4Rg2CB.setEnabled(false);
			g4Rg2CB.setSelected(true);
		}

		if (gen3CB.isSelected()) {
			g2Rg3CB.setEnabled(false);
			g2Rg3CB.setSelected(true);
			g4Rg3CB.setEnabled(false);
			g4Rg3CB.setSelected(true);
		}

		if (gen4CB.isSelected()) {
			g1Rg4CB.setEnabled(false);
			g1Rg4CB.setSelected(true);
			g2Rg4CB.setEnabled(false);
			g2Rg4CB.setSelected(true);
			g3Rg4CB.setEnabled(false);
			g3Rg4CB.setSelected(true);
		}
	}