import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
+import java.awt.FontMetrics;
import java.awt.GridBagConstraints;
import java.awt.GridBagLayout;
import java.awt.GridLayout;
private static final Font LABEL_FONT_ITALIC = JvSwingUtils
.getLabelFont(false, true);
+ private static final Font LABEL_FONT_BOLD = JvSwingUtils
+ .getLabelFont(true, false);
+
/*
* Visual tab components
*/
private JPanel initBackupsTab()
{
JPanel backupsTab = new JPanel();
- // backupsTab.setBorder(new TitledBorder(MessageManager
- // .getString("label.backup_files")));
+ backupsTab.setBorder(new TitledBorder(MessageManager
+ .getString("label.backup_files")));
backupsTab.setLayout(new GridBagLayout());
- enableBackupFiles.setFont(LABEL_FONT);
+ GridBagConstraints gbc = new GridBagConstraints();
+ gbc.weightx = 1.0;
+ gbc.weighty = 0.0;
+ gbc.anchor = GridBagConstraints.NORTHWEST;
+ gbc.fill = GridBagConstraints.NONE;
+
+ initBackupsTabSuffixPanel();
+ initBackupsTabKeepFilesPanel();
+ initBackupsTabFilenameExamplesPanel();
+
+ gbc.weightx = 0.5;
+ enableBackupFiles.setFont(LABEL_FONT_BOLD);
enableBackupFiles.setText(
MessageManager.getString("label.enable_backupfiles"));
enableBackupFiles.addActionListener(new ActionListener()
}
});
- GridBagConstraints gbc = new GridBagConstraints();
- gbc.weightx = 1.0;
- gbc.weighty = 0.0;
- gbc.anchor = GridBagConstraints.NORTHWEST;
- gbc.fill = GridBagConstraints.NONE;
-
// enable checkbox 1 row
gbc.gridwidth = 1;
gbc.gridy = 0;
backupsTab.add(enableBackupFiles, gbc);
+ gbc.gridx = 1;
+ gbc.weightx = 1.0;
+ //gbc.anchor = GridBagConstraints.NORTHEAST;
+ //gbc.fill = GridBagConstraints.HORIZONTAL;
+ backupsTab.add(exampleFilesPanel, gbc);
- initBackupsTabSuffixPanel();
- initBackupsTabKeepFilesPanel();
- initBackupsTabFilenameExamplesPanel();
-
- /*
- // set widths of the panels to the max one
- int maxw = suffixPanel.getWidth();
- if (maxw < keepfilesPanel.getWidth())
- {
- maxw = keepfilesPanel.getWidth();
- }
- if (maxw < exampleFilesPanel.getWidth())
- {
- maxw = exampleFilesPanel.getWidth();
- }
- suffixPanel.setSize(suffixPanel.getHeight(), maxw);
- keepfilesPanel.setSize(keepfilesPanel.getHeight(), maxw);
- exampleFilesPanel.setSize(exampleFilesPanel.getHeight(), maxw);
- */
-
+ gbc.anchor = GridBagConstraints.NORTHWEST;
+ gbc.fill = GridBagConstraints.NONE;
+ gbc.gridwidth = 2;
// whole suffix panel next row
+ gbc.gridx = 0;
gbc.gridy = 1;
backupsTab.add(suffixPanel, gbc);
gbc.gridy = 2;
backupsTab.add(keepfilesPanel, gbc);
+ /*
// whole examples panel next row
gbc.gridy = 3;
backupsTab.add(exampleFilesPanel, gbc);
gbc.gridy = 4;
gbc.weighty = 1.0;
backupsTab.add(new JPanel(), gbc);
+ */
backupsOptionsSetEnabled(enableBackupFiles.isSelected());
return backupsTab;
private JPanel initBackupsTabFilenameExamplesPanel()
{
- exampleFilesPanel.setBorder(new TitledBorder(
- MessageManager.getString("label.example_filenames")));
+ String title = MessageManager.getString("label.example_filenames");
+ TitledBorder tb = new TitledBorder(title);
+ //tb.setTitleFont(LABEL_FONT);
+ exampleFilesPanel.setBorder(tb);
exampleFilesPanel.setLayout(new GridBagLayout());
+ //inordinately difficult to get this titledborder the right size for the title
+
backupfilesExampleLabel.setEditable(false);
- backupfilesExampleLabel.setPreferredSize(new Dimension(400, 85));
+ backupfilesExampleLabel.setPreferredSize(new Dimension(280, 85));
backupfilesExampleLabel.setAlignmentX(LEFT_ALIGNMENT);
backupfilesExampleLabel.setAlignmentY(TOP_ALIGNMENT);
.setBackground(exampleFilesPanel.getBackground());
updateBackupFilesExampleLabel();
+ exampleFilesPanel.setMinimumSize(new Dimension(280, 85));
GridBagConstraints gbc = new GridBagConstraints();
- gbc.anchor = GridBagConstraints.WEST;
- gbc.fill = GridBagConstraints.NONE;
+ gbc.anchor = GridBagConstraints.EAST;
gbc.gridy = 0;
exampleFilesPanel.add(backupfilesExampleLabel, gbc);