private GridBagLayout generateLayout()

in taverna-data-management-config-ui/src/main/java/org/apache/taverna/workbench/reference/config/DataManagementConfigurationPanel.java [73:209]


	private GridBagLayout generateLayout() {
		GridBagLayout gridbag = new GridBagLayout();
		GridBagConstraints c = new GridBagConstraints();

		enableProvenance = new JCheckBox("Enable provenance capture");
		DialogTextArea enableProvenanceText = new DialogTextArea(
				"Disabling provenance will prevent you from being able to view intermediate results, but does give a performance benefit.");
		Font plain = enableProvenanceText.getFont().deriveFont(PLAIN, 11);
		enableProvenanceText.setLineWrap(true);
		enableProvenanceText.setWrapStyleWord(true);
		enableProvenanceText.setEditable(false);
		enableProvenanceText.setFocusable(false);
		enableProvenanceText.setOpaque(false);
		enableProvenanceText.setFont(plain);

		enableInMemory = new JCheckBox("In-memory storage");
		DialogTextArea enableInMemoryText = new DialogTextArea(
				"Data will not be stored between workbench sessions. If you run workflows passing larger amounts of data, try disabling in-memory storage, which can reduce execution performance, but also Taverna's memory consumption. ");
		enableInMemoryText.setLineWrap(true);
		enableInMemoryText.setWrapStyleWord(true);
		enableInMemoryText.setEditable(false);
		enableInMemoryText.setFocusable(false);
		enableInMemoryText.setOpaque(false);
		enableInMemoryText.setFont(plain);

		enableInMemoryTextDisabled = new DialogTextArea(
				"If you enable in-memory storage of data when provenance collection is turned on then provenance will not be available after you shutdown Taverna as the in-memory data will be lost.");
		enableInMemoryTextDisabled.setLineWrap(true);
		enableInMemoryTextDisabled.setWrapStyleWord(true);
		enableInMemoryTextDisabled.setEditable(false);
		enableInMemoryTextDisabled.setFocusable(false);
		enableInMemoryTextDisabled.setOpaque(false);
		enableInMemoryTextDisabled.setFont(plain);
		enableInMemoryTextDisabled.setForeground(RED);
		enableInMemoryTextDisabled.setVisible(false);

		// Disable warning as inMemory is default
		// To re-enable - also see resetFields()

		if (ADD_WARNING_LISTENERS) {
			enableInMemory.addActionListener(new ActionListener() {
				@Override
				public void actionPerformed(ActionEvent e) {
					enableInMemoryTextDisabled.setVisible(enableProvenance
							.isSelected() && enableInMemory.isSelected());
				}
			});
			enableProvenance.addActionListener(new ActionListener() {
				@Override
				public void actionPerformed(ActionEvent e) {
					enableInMemoryTextDisabled.setVisible(enableProvenance
							.isSelected() && enableInMemory.isSelected());
				}
			});
		}

		storageText = new JTextArea(
				"Select how Taverna stores the data and provenance produced when a workflow is run. This includes workflow results and intermediate results.");
		storageText.setLineWrap(true);
		storageText.setWrapStyleWord(true);
		storageText.setEditable(false);
		storageText.setFocusable(false);
		storageText.setBorder(new EmptyBorder(10, 10, 10, 10));
		storageText.setFont(plain);

		JComponent portPanel = createDerbyServerStatusComponent();

		c.anchor = WEST;
		c.insets = new Insets(0, 0, 10, 0);
		c.gridx = 0;
		c.gridy = RELATIVE;
		c.weightx = 0.0;
		c.weighty = 0.0;
		c.fill = HORIZONTAL;
		gridbag.setConstraints(storageText, c);
		add(storageText);

		c.ipady = 0;
		c.insets = new Insets(0, 0, 5, 0);
		c.fill = NONE;
		gridbag.setConstraints(enableProvenance, c);
		add(enableProvenance);

		c.insets = new Insets(0, 20, 15, 20);
		c.fill = HORIZONTAL;
		gridbag.setConstraints(enableProvenanceText, c);
		add(enableProvenanceText);

		c.insets = new Insets(0, 0, 5, 0);
		c.fill = GridBagConstraints.NONE;
		gridbag.setConstraints(enableInMemory, c);
		add(enableInMemory);

		c.insets = new Insets(0, 20, 15, 20);
		c.fill = HORIZONTAL;
		gridbag.setConstraints(enableInMemoryText, c);
		add(enableInMemoryText);

		c.insets = new Insets(0, 20, 15, 20);
		c.fill = HORIZONTAL;
		gridbag.setConstraints(enableInMemoryTextDisabled, c);
		add(enableInMemoryTextDisabled);

		c.insets = new Insets(0, 20, 15, 20);
		gridbag.setConstraints(portPanel, c);
		add(portPanel);

		c.insets = new Insets(0, 0, 5, 0);
		c.fill = NONE;
		exposeDatanatureBox = new JCheckBox(
				"Allow setting of input data encoding");
		gridbag.setConstraints(exposeDatanatureBox, c);
		add(exposeDatanatureBox);

		exposeDatanatureText = new JTextArea(
				"Select if you want to control how Taverna handles files read as input data");
		exposeDatanatureText.setLineWrap(true);
		exposeDatanatureText.setWrapStyleWord(true);
		exposeDatanatureText.setEditable(false);
		exposeDatanatureText.setFocusable(false);
		exposeDatanatureText.setOpaque(false);
		exposeDatanatureText.setFont(plain);

		c.insets = new Insets(0, 20, 15, 20);
		c.fill = HORIZONTAL;
		gridbag.setConstraints(exposeDatanatureText, c);
		add(exposeDatanatureText);

		JPanel buttonPanel = createButtonPanel();
		c.weightx = 1.0;
		c.weighty = 1.0;
		c.fill = BOTH;
		c.insets = new Insets(0, 0, 5, 0);
		gridbag.setConstraints(buttonPanel, c);
		add(buttonPanel);
		return gridbag;
	}