+ JPanel okCancelPanel = new JPanel();
+ okCancelPanel.add(ok);
+ okCancelPanel.add(cancel);
+ return okCancelPanel;
+ }
+
+ /**
+ * Initialises the Colours tabbed panel.
+ *
+ * @return
+ */
+ private JPanel initColoursTab()
+ {
+ JPanel coloursTab = new JPanel();
+ coloursTab.setBorder(new TitledBorder(
+ MessageManager.getString("action.open_new_alignment")));
+ coloursTab.setLayout(new FlowLayout());
+ JLabel mincolourLabel = new JLabel();
+ mincolourLabel.setFont(LABEL_FONT);
+ mincolourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
+ mincolourLabel.setText(MessageManager.getString("label.min_colour"));
+ minColour.setFont(LABEL_FONT);
+ minColour.setBorder(BorderFactory.createEtchedBorder());
+ minColour.setPreferredSize(new Dimension(40, 20));
+ minColour.addMouseListener(new MouseAdapter()
+ {
+ @Override
+ public void mousePressed(MouseEvent e)
+ {
+ minColour_actionPerformed(minColour);
+ }
+ });
+ JLabel maxcolourLabel = new JLabel();
+ maxcolourLabel.setFont(LABEL_FONT);
+ maxcolourLabel.setHorizontalAlignment(SwingConstants.RIGHT);
+ maxcolourLabel.setText(MessageManager.getString("label.max_colour"));
+ maxColour.setFont(LABEL_FONT);
+ maxColour.setBorder(BorderFactory.createEtchedBorder());
+ maxColour.setPreferredSize(new Dimension(40, 20));
+ maxColour.addMouseListener(new MouseAdapter()
+ {
+ @Override
+ public void mousePressed(MouseEvent e)
+ {
+ maxColour_actionPerformed(maxColour);
+ }
+ });
+
+ protColour.setFont(LABEL_FONT);
+ protColour.setBounds(new Rectangle(172, 225, 155, 21));
+ JLabel protColourLabel = new JLabel();
+ protColourLabel.setFont(LABEL_FONT);
+ protColourLabel.setHorizontalAlignment(SwingConstants.LEFT);
+ protColourLabel.setText(
+ MessageManager.getString("label.prot_alignment_colour") + " ");
+ JvSwingUtils.addtoLayout(coloursTab,
+ MessageManager
+ .getString("label.default_colour_scheme_for_alignment"),
+ protColourLabel, protColour);
+
+ nucColour.setFont(LABEL_FONT);
+ nucColour.setBounds(new Rectangle(172, 240, 155, 21));
+ JLabel nucColourLabel = new JLabel();
+ nucColourLabel.setFont(LABEL_FONT);
+ nucColourLabel.setHorizontalAlignment(SwingConstants.LEFT);
+ nucColourLabel.setText(
+ MessageManager.getString("label.nuc_alignment_colour") + " ");
+ JvSwingUtils.addtoLayout(coloursTab,
+ MessageManager
+ .getString("label.default_colour_scheme_for_alignment"),
+ nucColourLabel, nucColour);
+
+ JPanel annotationShding = new JPanel();
+ annotationShding.setBorder(new TitledBorder(
+ MessageManager.getString("label.annotation_shading_default")));
+ annotationShding.setLayout(new GridLayout(1, 2));
+ JvSwingUtils.addtoLayout(annotationShding,
+ MessageManager.getString(
+ "label.default_minimum_colour_annotation_shading"),
+ mincolourLabel, minColour);
+ JvSwingUtils.addtoLayout(annotationShding,
+ MessageManager.getString(
+ "label.default_maximum_colour_annotation_shading"),
+ maxcolourLabel, maxColour);
+ coloursTab.add(annotationShding); // , FlowLayout.LEFT);
+ return coloursTab;
+ }
+
+ /**
+ * Initialises the Overview tabbed panel.
+ *
+ * @return
+ */
+ private JPanel initOverviewTab()
+ {
+ JPanel overviewPanel = new JPanel();
+ overviewPanel.setBorder(new TitledBorder(
+ MessageManager.getString("label.overview_settings")));
+
+ gapColour.setFont(LABEL_FONT);
+ // fixing the border colours stops apparent colour bleed from the panel
+ gapColour.setBorder(
+ BorderFactory.createEtchedBorder(Color.white, Color.lightGray));
+ gapColour.setPreferredSize(new Dimension(40, 20));
+ gapColour.addMouseListener(new MouseAdapter()
+ {
+ @Override
+ public void mousePressed(MouseEvent e)
+ {
+ gapColour_actionPerformed(gapColour);
+ }
+ });
+
+ hiddenColour.setFont(LABEL_FONT);
+ // fixing the border colours stops apparent colour bleed from the panel
+ hiddenColour.setBorder(
+ BorderFactory.createEtchedBorder(Color.white, Color.lightGray));
+ hiddenColour.setPreferredSize(new Dimension(40, 20));
+ hiddenColour.addMouseListener(new MouseAdapter()
+ {
+ @Override
+ public void mousePressed(MouseEvent e)
+ {
+ hiddenColour_actionPerformed(hiddenColour);
+ }
+ });
+
+ useLegacyGap = new JCheckBox(
+ MessageManager.getString("label.ov_legacy_gap"));
+ useLegacyGap.setFont(LABEL_FONT);
+ useLegacyGap.setHorizontalAlignment(SwingConstants.LEFT);
+ useLegacyGap.setVerticalTextPosition(SwingConstants.TOP);
+ gapLabel = new JLabel(MessageManager.getString("label.gap_colour"));
+ gapLabel.setFont(LABEL_FONT);
+ gapLabel.setHorizontalAlignment(SwingConstants.LEFT);
+ gapLabel.setVerticalTextPosition(SwingConstants.TOP);
+ showHiddenAtStart = new JCheckBox(
+ MessageManager.getString("label.ov_show_hide_default"));
+ showHiddenAtStart.setFont(LABEL_FONT);
+ showHiddenAtStart.setHorizontalAlignment(SwingConstants.LEFT);
+ showHiddenAtStart.setVerticalTextPosition(SwingConstants.TOP);
+ JLabel hiddenLabel = new JLabel(
+ MessageManager.getString("label.hidden_colour"));
+ hiddenLabel.setFont(LABEL_FONT);
+ hiddenLabel.setHorizontalAlignment(SwingConstants.LEFT);
+ hiddenLabel.setVerticalTextPosition(SwingConstants.TOP);
+
+ useLegacyGap.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ useLegacyGaps_actionPerformed(e);
+ }
+ });
+
+ overviewPanel.setLayout(new GridBagLayout());
+ GridBagConstraints c1 = new GridBagConstraints();
+
+ c1.fill = GridBagConstraints.HORIZONTAL;
+ c1.gridx = 0;
+ c1.gridy = 0;
+ c1.weightx = 1;
+ c1.ipady = 20;
+ c1.anchor = GridBagConstraints.FIRST_LINE_START;
+ overviewPanel.add(useLegacyGap, c1);
+
+ GridBagConstraints c2 = new GridBagConstraints();
+ c2.fill = GridBagConstraints.HORIZONTAL;
+ c2.gridx = 1;
+ c2.gridy = 0;
+ c2.insets = new Insets(0, 15, 0, 10);
+ overviewPanel.add(gapLabel, c2);
+
+ GridBagConstraints c3 = new GridBagConstraints();
+ c3.fill = GridBagConstraints.HORIZONTAL;
+ c3.gridx = 2;
+ c3.gridy = 0;
+ c3.insets = new Insets(0, 0, 0, 15);
+ overviewPanel.add(gapColour, c3);
+
+ GridBagConstraints c4 = new GridBagConstraints();
+ c4.fill = GridBagConstraints.HORIZONTAL;
+ c4.gridx = 0;
+ c4.gridy = 1;
+ c4.weightx = 1;
+ overviewPanel.add(showHiddenAtStart, c4);
+
+ GridBagConstraints c5 = new GridBagConstraints();
+ c5.fill = GridBagConstraints.HORIZONTAL;
+ c5.gridx = 1;
+ c5.gridy = 1;
+ c5.insets = new Insets(0, 15, 0, 10);
+ overviewPanel.add(hiddenLabel, c5);
+
+ GridBagConstraints c6 = new GridBagConstraints();
+ c6.fill = GridBagConstraints.HORIZONTAL;
+ c6.gridx = 2;
+ c6.gridy = 1;
+ c6.insets = new Insets(0, 0, 0, 15);
+ overviewPanel.add(hiddenColour, c6);
+
+ JButton resetButton = new JButton(
+ MessageManager.getString("label.reset_to_defaults"));
+
+ resetButton.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ resetOvDefaults_actionPerformed(e);
+ }
+ });
+
+ GridBagConstraints c7 = new GridBagConstraints();
+ c7.fill = GridBagConstraints.NONE;
+ c7.gridx = 0;
+ c7.gridy = 2;
+ c7.insets = new Insets(10, 0, 0, 0);
+ c7.anchor = GridBagConstraints.WEST;
+ overviewPanel.add(resetButton, c7);
+
+ // Add padding so the panel doesn't look ridiculous
+ JPanel spacePanel = new JPanel();
+ overviewPanel.add(spacePanel,
+ new GridBagConstraints(0, 3, 1, 1, 1.0, 1.0,
+ GridBagConstraints.WEST, GridBagConstraints.BOTH,
+ new Insets(0, 0, 0, 5), 0, 0));
+
+ return overviewPanel;
+ }
+
+ /**
+ * Initialises the Structure tabbed panel.
+ *
+ * @return
+ */
+ private JPanel initStructureTab()
+ {
+ structureTab = new JPanel();
+
+ structureTab.setBorder(new TitledBorder(
+ MessageManager.getString("label.structure_options")));
+ structureTab.setLayout(null);
+ final int width = 420;
+ final int height = 22;
+ final int lineSpacing = 25;
+ int ypos = 15;
+
+ structFromPdb.setFont(LABEL_FONT);
+ structFromPdb
+ .setText(MessageManager.getString("label.struct_from_pdb"));
+ structFromPdb.setBounds(new Rectangle(5, ypos, width, height));
+ structFromPdb.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ boolean selected = structFromPdb.isSelected();
+ // enable other options only when the first is checked
+ useRnaView.setEnabled(selected);
+ addSecondaryStructure.setEnabled(selected);
+ addTempFactor.setEnabled(selected);
+ }
+ });
+ structureTab.add(structFromPdb);
+
+ // indent checkboxes that are conditional on the first one
+ ypos += lineSpacing;
+ useRnaView.setFont(LABEL_FONT);
+ useRnaView.setText(MessageManager.getString("label.use_rnaview"));
+ useRnaView.setBounds(new Rectangle(25, ypos, width, height));
+ structureTab.add(useRnaView);
+
+ ypos += lineSpacing;
+ addSecondaryStructure.setFont(LABEL_FONT);
+ addSecondaryStructure
+ .setText(MessageManager.getString("label.autoadd_secstr"));
+ addSecondaryStructure.setBounds(new Rectangle(25, ypos, width, height));
+ structureTab.add(addSecondaryStructure);
+
+ ypos += lineSpacing;
+ addTempFactor.setFont(LABEL_FONT);
+ addTempFactor.setText(MessageManager.getString("label.autoadd_temp"));
+ addTempFactor.setBounds(new Rectangle(25, ypos, width, height));
+ structureTab.add(addTempFactor);
+
+ ypos += lineSpacing;
+ JLabel viewerLabel = new JLabel();
+ viewerLabel.setFont(LABEL_FONT);
+ viewerLabel.setHorizontalAlignment(SwingConstants.LEFT);
+ viewerLabel.setText(MessageManager.getString("label.structure_viewer"));
+ viewerLabel.setBounds(new Rectangle(10, ypos, 220, height));
+ structureTab.add(viewerLabel);
+
+ /*
+ * add all external viewers as options here - check
+ * when selected whether the program is installed
+ */
+ structViewer.setFont(LABEL_FONT);
+ structViewer.setBounds(new Rectangle(190, ypos, 120, height));
+ structViewer.addItem(ViewerType.JMOL.name());
+ structViewer.addItem(ViewerType.CHIMERA.name());
+ structViewer.addItem(ViewerType.CHIMERAX.name());
+ structViewer.addItem(ViewerType.PYMOL.name());
+ structViewer.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ structureViewer_actionPerformed(
+ (String) structViewer.getSelectedItem());
+ }
+ });
+ structureTab.add(structViewer);
+
+ ypos += lineSpacing;
+ structureViewerPathLabel = new JLabel();
+ structureViewerPathLabel.setFont(LABEL_FONT);// new Font("SansSerif", 0, 11));
+ structureViewerPathLabel.setHorizontalAlignment(SwingConstants.LEFT);
+ structureViewerPathLabel.setText(MessageManager
+ .formatMessage("label.viewer_path", "Chimera(X)"));
+ structureViewerPathLabel.setBounds(new Rectangle(10, ypos, 170, height));
+ structureViewerPathLabel.setEnabled(false);
+ structureTab.add(structureViewerPathLabel);
+
+ structureViewerPath.setFont(LABEL_FONT);
+ structureViewerPath.setText("");
+ structureViewerPath.setEnabled(false);
+ final String tooltip = JvSwingUtils.wrapTooltip(true,
+ MessageManager.getString("label.viewer_path_tip"));
+ structureViewerPath.setToolTipText(tooltip);
+ structureViewerPath.setBounds(new Rectangle(190, ypos, 290, height));
+ structureViewerPath.addMouseListener(new MouseAdapter()
+ {
+ @Override
+ public void mouseClicked(MouseEvent e)
+ {
+ if (structureViewerPath.isEnabled() && e.getClickCount() == 2)
+ {
+ String chosen = openFileChooser();
+ if (chosen != null)
+ {
+ structureViewerPath.setText(chosen);
+ }
+ }
+ }
+ });
+ structureTab.add(structureViewerPath);
+
+ ypos += lineSpacing;
+ nwMapping.setFont(LABEL_FONT);
+ nwMapping.setText(MessageManager.getString("label.nw_mapping"));
+ siftsMapping.setFont(LABEL_FONT);
+ siftsMapping.setText(MessageManager.getString("label.sifts_mapping"));
+ mappingMethod.add(nwMapping);
+ mappingMethod.add(siftsMapping);
+ JPanel mappingPanel = new JPanel();
+ mappingPanel.setFont(LABEL_FONT);
+ TitledBorder mmTitledBorder = new TitledBorder(
+ MessageManager.getString("label.mapping_method"));
+ mmTitledBorder.setTitleFont(LABEL_FONT);
+ mappingPanel.setBorder(mmTitledBorder);
+ mappingPanel.setBounds(new Rectangle(10, ypos, 472, 45));
+ // GridLayout mappingLayout = new GridLayout();
+ mappingPanel.setLayout(new GridLayout());
+ mappingPanel.add(nwMapping);
+ mappingPanel.add(siftsMapping);
+ structureTab.add(mappingPanel);
+
+ ypos += lineSpacing;
+ ypos += lineSpacing;
+ FTSDataColumnPreferences docFieldPref = new FTSDataColumnPreferences(
+ PreferenceSource.PREFERENCES, PDBFTSRestClient.getInstance());
+ docFieldPref.setBounds(new Rectangle(10, ypos, 470, 120));
+ structureTab.add(docFieldPref);
+
+ return structureTab;
+ }
+
+ /**
+ * Action on choosing a structure viewer from combobox options.
+ *
+ * @param selectedItem
+ */
+ protected void structureViewer_actionPerformed(String selectedItem)
+ {
+ }
+
+ /**
+ * Show a dialog for the user to choose a file. Returns the chosen path, or
+ * null on Cancel.
+ *
+ * @return
+ */
+ protected String openFileChooser()
+ {
+ String choice = null;
+ JFileChooser chooser = new JFileChooser();
+
+ // chooser.setFileView(new JalviewFileView());
+ chooser.setDialogTitle(
+ MessageManager.getString("label.open_local_file"));
+ chooser.setToolTipText(MessageManager.getString("action.open"));
+
+ int value = chooser.showOpenDialog(this);
+
+ if (value == JFileChooser.APPROVE_OPTION)
+ {
+ choice = chooser.getSelectedFile().getPath();
+ }
+ return choice;
+ }
+
+ /**
+ * Validate the structure tab preferences; if invalid, set focus on this tab.
+ *
+ * @param e
+ */
+ protected boolean validateStructure(FocusEvent e)
+ {
+ if (!validateStructure())
+ {
+ e.getComponent().requestFocusInWindow();
+ return false;
+ }
+ return true;
+ }
+
+ protected boolean validateStructure()
+ {
+ return false;
+ }
+
+ /**
+ * Initialises the Visual tabbed panel.
+ *
+ * @return
+ */
+ private JPanel initVisualTab()
+ {
+ JPanel visualTab = new JPanel();
+ visualTab.setBorder(new TitledBorder(
+ MessageManager.getString("action.open_new_alignment")));
+ visualTab.setLayout(null);
+ fullScreen.setFont(LABEL_FONT);
+ fullScreen.setHorizontalAlignment(SwingConstants.RIGHT);
+ fullScreen.setHorizontalTextPosition(SwingConstants.LEFT);
+ fullScreen.setText(MessageManager.getString("label.maximize_window"));
+ quality.setEnabled(false);
+ quality.setFont(LABEL_FONT);
+ quality.setHorizontalAlignment(SwingConstants.RIGHT);
+ quality.setHorizontalTextPosition(SwingConstants.LEFT);
+ quality.setSelected(true);
+ quality.setText(MessageManager.getString("label.quality"));
+ conservation.setEnabled(false);
+ conservation.setFont(LABEL_FONT);
+ conservation.setHorizontalAlignment(SwingConstants.RIGHT);
+ conservation.setHorizontalTextPosition(SwingConstants.LEFT);
+ conservation.setSelected(true);
+ conservation.setText(MessageManager.getString("label.conservation"));
+ identity.setEnabled(false);
+ identity.setFont(LABEL_FONT);
+ identity.setHorizontalAlignment(SwingConstants.RIGHT);
+ identity.setHorizontalTextPosition(SwingConstants.LEFT);
+ identity.setSelected(true);
+ identity.setText(MessageManager.getString("label.consensus"));
+ showOccupancy.setFont(LABEL_FONT);
+ showOccupancy.setEnabled(false);
+ showOccupancy.setHorizontalAlignment(SwingConstants.RIGHT);
+ showOccupancy.setHorizontalTextPosition(SwingConstants.LEFT);
+ showOccupancy.setSelected(true);
+ showOccupancy.setText(MessageManager.getString("label.occupancy"));
+
+ JLabel showGroupbits = new JLabel();
+ showGroupbits.setFont(LABEL_FONT);
+ showGroupbits.setHorizontalAlignment(SwingConstants.RIGHT);
+ showGroupbits.setHorizontalTextPosition(SwingConstants.LEFT);
+ showGroupbits
+ .setText(MessageManager.getString("action.show_group") + ":");
+ JLabel showConsensbits = new JLabel();
+ showConsensbits.setFont(LABEL_FONT);
+ showConsensbits.setHorizontalAlignment(SwingConstants.RIGHT);
+ showConsensbits.setHorizontalTextPosition(SwingConstants.LEFT);
+ showConsensbits
+ .setText(MessageManager.getString("label.consensus") + ":");
+ showConsensHistogram.setEnabled(false);
+ showConsensHistogram.setFont(LABEL_FONT);
+ showConsensHistogram.setHorizontalAlignment(SwingConstants.RIGHT);
+ showConsensHistogram.setHorizontalTextPosition(SwingConstants.LEFT);
+ showConsensHistogram.setSelected(true);
+ showConsensHistogram
+ .setText(MessageManager.getString("label.histogram"));
+ showConsensLogo.setEnabled(false);
+ showConsensLogo.setFont(LABEL_FONT);
+ showConsensLogo.setHorizontalAlignment(SwingConstants.RIGHT);
+ showConsensLogo.setHorizontalTextPosition(SwingConstants.LEFT);
+ showConsensLogo.setSelected(true);
+ showConsensLogo.setText(MessageManager.getString("label.logo"));
+ showGroupConsensus.setEnabled(false);
+ showGroupConsensus.setFont(LABEL_FONT);
+ showGroupConsensus.setHorizontalAlignment(SwingConstants.RIGHT);
+ showGroupConsensus.setHorizontalTextPosition(SwingConstants.LEFT);
+ showGroupConsensus.setSelected(true);
+ showGroupConsensus.setText(MessageManager.getString("label.consensus"));
+ showGroupConservation.setEnabled(false);
+ showGroupConservation.setFont(LABEL_FONT);
+ showGroupConservation.setHorizontalAlignment(SwingConstants.RIGHT);
+ showGroupConservation.setHorizontalTextPosition(SwingConstants.LEFT);
+ showGroupConservation.setSelected(true);
+ showGroupConservation
+ .setText(MessageManager.getString("label.conservation"));
+ showNpTooltip.setEnabled(true);
+ showNpTooltip.setFont(LABEL_FONT);
+ showNpTooltip.setHorizontalAlignment(SwingConstants.RIGHT);
+ showNpTooltip.setHorizontalTextPosition(SwingConstants.LEFT);
+ showNpTooltip.setSelected(true);
+ showNpTooltip.setText(
+ MessageManager.getString("label.non_positional_features"));
+ showDbRefTooltip.setEnabled(true);
+ showDbRefTooltip.setFont(LABEL_FONT);
+ showDbRefTooltip.setHorizontalAlignment(SwingConstants.RIGHT);
+ showDbRefTooltip.setHorizontalTextPosition(SwingConstants.LEFT);
+ showDbRefTooltip.setSelected(true);
+ showDbRefTooltip
+ .setText(MessageManager.getString("label.database_references"));
+ annotations.setFont(LABEL_FONT);
+ annotations.setHorizontalAlignment(SwingConstants.RIGHT);
+ annotations.setHorizontalTextPosition(SwingConstants.LEFT);
+ annotations.setSelected(true);
+ annotations.setText(MessageManager.getString("label.show_annotations"));
+ // annotations.setBounds(new Rectangle(169, 12, 200, 23));
+ annotations.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ annotations_actionPerformed(e);
+ }
+ });
+ identity.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ annotations_actionPerformed(e);
+ }
+ });
+ showGroupConsensus.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ annotations_actionPerformed(e);
+ }
+ });
+ showUnconserved.setFont(LABEL_FONT);
+ showUnconserved.setHorizontalAlignment(SwingConstants.RIGHT);
+ showUnconserved.setHorizontalTextPosition(SwingConstants.LEFT);
+ showUnconserved.setSelected(true);
+ showUnconserved
+ .setText(MessageManager.getString("action.show_unconserved"));
+ showUnconserved.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ showunconserved_actionPerformed(e);
+ }
+ });
+
+ // TODO these are not yet added to / action from Preferences
+ // JCheckBox shareSelections = new JCheckBox();
+ // shareSelections.setFont(verdana11);
+ // shareSelections.setHorizontalAlignment(SwingConstants.RIGHT);
+ // shareSelections.setHorizontalTextPosition(SwingConstants.LEFT);
+ // shareSelections.setSelected(true);
+ // shareSelections.setText(MessageManager
+ // .getString("label.share_selection_across_views"));
+ // JCheckBox followHighlight = new JCheckBox();
+ // followHighlight.setFont(verdana11);
+ // followHighlight.setHorizontalAlignment(SwingConstants.RIGHT);
+ // followHighlight.setHorizontalTextPosition(SwingConstants.LEFT);
+ // // showUnconserved.setBounds(new Rectangle(169, 40, 200, 23));
+ // followHighlight.setSelected(true);
+ // followHighlight.setText(MessageManager
+ // .getString("label.scroll_highlighted_regions"));
+
+ seqLimit.setFont(LABEL_FONT);
+ seqLimit.setHorizontalAlignment(SwingConstants.RIGHT);
+ seqLimit.setHorizontalTextPosition(SwingConstants.LEFT);
+ seqLimit.setText(MessageManager.getString("label.full_sequence_id"));
+ smoothFont.setFont(LABEL_FONT);
+ smoothFont.setHorizontalAlignment(SwingConstants.RIGHT);
+ smoothFont.setHorizontalTextPosition(SwingConstants.LEADING);
+ smoothFont.setText(MessageManager.getString("label.smooth_font"));
+ scaleProteinToCdna.setFont(LABEL_FONT);
+ scaleProteinToCdna.setHorizontalAlignment(SwingConstants.RIGHT);
+ scaleProteinToCdna.setHorizontalTextPosition(SwingConstants.LEADING);
+ scaleProteinToCdna.setText(
+ MessageManager.getString("label.scale_protein_to_cdna"));
+ scaleProteinToCdna.setToolTipText(
+ MessageManager.getString("label.scale_protein_to_cdna_tip"));
+ JLabel gapLabel = new JLabel();
+ gapLabel.setFont(LABEL_FONT);
+ gapLabel.setHorizontalAlignment(SwingConstants.RIGHT);
+ gapLabel.setText(MessageManager.getString("label.gap_symbol") + " ");
+ JLabel fontLabel = new JLabel();
+ fontLabel.setFont(LABEL_FONT);
+ fontLabel.setHorizontalAlignment(SwingConstants.RIGHT);
+ fontLabel.setText(MessageManager.getString("label.font"));
+ fontSizeCB.setFont(LABEL_FONT);
+ fontSizeCB.setBounds(new Rectangle(320, 112, 65, 23));
+ fontStyleCB.setFont(LABEL_FONT);
+ fontStyleCB.setBounds(new Rectangle(382, 112, 80, 23));
+ fontNameCB.setFont(LABEL_FONT);
+ fontNameCB.setBounds(new Rectangle(172, 112, 147, 23));
+ gapSymbolCB.setFont(LABEL_FONT);
+ gapSymbolCB.setBounds(new Rectangle(172, 215, 69, 23));
+ DefaultListCellRenderer dlcr = new DefaultListCellRenderer();
+ dlcr.setHorizontalAlignment(DefaultListCellRenderer.CENTER);
+ gapSymbolCB.setRenderer(dlcr);
+
+ startupCheckbox.setText(MessageManager.getString("action.open_file"));
+ startupCheckbox.setFont(LABEL_FONT);
+ startupCheckbox.setHorizontalAlignment(SwingConstants.RIGHT);
+ startupCheckbox.setHorizontalTextPosition(SwingConstants.LEFT);
+ startupCheckbox.setSelected(true);
+ startupFileTextfield.setFont(LABEL_FONT);
+ startupFileTextfield.setBounds(new Rectangle(172, 310, 330, 20));
+ final String tooltip = JvSwingUtils.wrapTooltip(true,
+ MessageManager.getString("label.double_click_to_browse"));
+ startupFileTextfield.setToolTipText(tooltip);
+ startupFileTextfield.addMouseListener(new MouseAdapter()
+ {
+ @Override
+ public void mouseClicked(MouseEvent e)
+ {
+ if (e.getClickCount() > 1)
+ {
+ startupFileTextfield_mouseClicked();
+ }
+ }
+ });
+
+ sortby.setFont(LABEL_FONT);
+ sortby.setBounds(new Rectangle(172, 260, 155, 21));
+ JLabel sortLabel = new JLabel();
+ sortLabel.setFont(LABEL_FONT);
+ sortLabel.setHorizontalAlignment(SwingConstants.RIGHT);
+ sortLabel.setText(MessageManager.getString("label.sort_by"));
+ sortAnnBy.setFont(LABEL_FONT);
+ sortAnnBy.setBounds(new Rectangle(172, 285, 110, 21));
+ JLabel sortAnnLabel = new JLabel();
+ sortAnnLabel.setFont(LABEL_FONT);
+ sortAnnLabel.setHorizontalAlignment(SwingConstants.RIGHT);
+ sortAnnLabel.setText(MessageManager.getString("label.sort_ann_by"));
+ sortAutocalc.setFont(LABEL_FONT);
+ sortAutocalc.setBounds(new Rectangle(290, 285, 165, 21));
+
+ JPanel annsettingsPanel = new JPanel();
+ annsettingsPanel.setBounds(new Rectangle(173, 13, 320, 96));
+ annsettingsPanel.setLayout(new FlowLayout(FlowLayout.LEFT, 0, 0));
+ annsettingsPanel.setBorder(new EtchedBorder());
+ visualTab.add(annsettingsPanel);
+ Border jb = new EmptyBorder(1, 1, 4, 5);
+ annotations.setBorder(jb);
+ showOccupancy.setBorder(jb);
+ quality.setBorder(jb);
+ conservation.setBorder(jb);
+ identity.setBorder(jb);
+ showConsensbits.setBorder(jb);
+ showGroupbits.setBorder(jb);
+ showGroupConsensus.setBorder(jb);
+ showGroupConservation.setBorder(jb);
+ showConsensHistogram.setBorder(jb);
+ showConsensLogo.setBorder(jb);
+
+ JPanel autoAnnotSettings = new JPanel();
+ annsettingsPanel.add(autoAnnotSettings);
+ autoAnnotSettings.setLayout(new GridLayout(0, 2));
+ autoAnnotSettings.add(annotations);
+ autoAnnotSettings.add(quality);
+ // second row of autoannotation box
+ autoAnnotSettings = new JPanel();
+ annsettingsPanel.add(autoAnnotSettings);
+
+ autoAnnotSettings.setLayout(new GridLayout(0, 3));
+ autoAnnotSettings.add(conservation);
+ autoAnnotSettings.add(identity);
+ autoAnnotSettings.add(showOccupancy);
+ autoAnnotSettings.add(showGroupbits);
+ autoAnnotSettings.add(showGroupConservation);
+ autoAnnotSettings.add(showGroupConsensus);
+ autoAnnotSettings.add(showConsensbits);
+ autoAnnotSettings.add(showConsensHistogram);
+ autoAnnotSettings.add(showConsensLogo);
+
+ JPanel tooltipSettings = new JPanel();
+ tooltipSettings.setBorder(new TitledBorder(
+ MessageManager.getString("label.sequence_id_tooltip")));
+ tooltipSettings.setBounds(173, 140, 220, 62);
+ tooltipSettings.setLayout(new GridLayout(2, 1));
+ tooltipSettings.add(showDbRefTooltip);
+ tooltipSettings.add(showNpTooltip);
+ visualTab.add(tooltipSettings);
+
+ wrap.setFont(LABEL_FONT);
+ wrap.setHorizontalAlignment(SwingConstants.TRAILING);
+ wrap.setHorizontalTextPosition(SwingConstants.LEADING);
+ wrap.setText(MessageManager.getString("label.wrap_alignment"));
+ rightAlign.setFont(LABEL_FONT);
+ rightAlign.setForeground(Color.black);
+ rightAlign.setHorizontalAlignment(SwingConstants.RIGHT);
+ rightAlign.setHorizontalTextPosition(SwingConstants.LEFT);
+ rightAlign.setText(MessageManager.getString("label.right_align_ids"));
+ idItalics.setFont(LABEL_FONT_ITALIC);
+ idItalics.setHorizontalAlignment(SwingConstants.RIGHT);
+ idItalics.setHorizontalTextPosition(SwingConstants.LEADING);
+ idItalics.setText(
+ MessageManager.getString("label.sequence_name_italics"));
+ openoverv.setFont(LABEL_FONT);
+ openoverv.setActionCommand(
+ MessageManager.getString("label.open_overview"));
+ openoverv.setHorizontalAlignment(SwingConstants.RIGHT);
+ openoverv.setHorizontalTextPosition(SwingConstants.LEFT);
+ openoverv.setText(MessageManager.getString("label.open_overview"));
+ JPanel jPanel2 = new JPanel();
+ jPanel2.setBounds(new Rectangle(7, 17, 158, 310));
+ jPanel2.setLayout(new GridLayout(14, 1));
+ jPanel2.add(fullScreen);
+ jPanel2.add(openoverv);
+ jPanel2.add(seqLimit);
+ jPanel2.add(rightAlign);
+ jPanel2.add(fontLabel);
+ jPanel2.add(showUnconserved);
+ jPanel2.add(idItalics);
+ jPanel2.add(smoothFont);
+ jPanel2.add(scaleProteinToCdna);
+ jPanel2.add(gapLabel);
+ jPanel2.add(wrap);
+ jPanel2.add(sortLabel);
+ jPanel2.add(sortAnnLabel);
+ jPanel2.add(startupCheckbox);
+ visualTab.add(jPanel2);
+ visualTab.add(startupFileTextfield);
+ visualTab.add(sortby);
+ visualTab.add(sortAnnBy);
+ visualTab.add(sortAutocalc);
+ visualTab.add(gapSymbolCB);
+ visualTab.add(fontNameCB);
+ visualTab.add(fontSizeCB);
+ visualTab.add(fontStyleCB);
+ return visualTab;
+ }
+
+ /**
+ * Load the saved Backups options EXCEPT "Enabled" and "Scheme"
+ */
+
+ protected void loadLastSavedBackupsOptions()
+ {
+ BackupFilesPresetEntry savedPreset = BackupFilesPresetEntry
+ .getSavedBackupEntry();
+ enableBackupFiles
+ .setSelected(Cache.getDefault(BackupFiles.ENABLED, true));
+
+ BackupFilesPresetEntry backupfilesCustomEntry = BackupFilesPresetEntry
+ .createBackupFilesPresetEntry(Cache
+ .getDefault(BackupFilesPresetEntry.CUSTOMCONFIG, null));
+ if (backupfilesCustomEntry == null)
+ {
+ backupfilesCustomEntry = BackupFilesPresetEntry.backupfilesPresetEntriesValues
+ .get(BackupFilesPresetEntry.BACKUPFILESSCHEMEDEFAULT);
+ }
+ BackupFilesPresetEntry.backupfilesPresetEntriesValues.put(
+ BackupFilesPresetEntry.BACKUPFILESSCHEMECUSTOM,
+ backupfilesCustomEntry);
+
+ setComboIntStringKey(backupfilesPresetsCombo,
+ Cache.getDefault(BackupFiles.NS + "_PRESET",
+ BackupFilesPresetEntry.BACKUPFILESSCHEMEDEFAULT));
+
+ backupsSetOptions(savedPreset);
+
+ backupsOptionsSetEnabled();
+ updateBackupFilesExampleLabel();
+ }
+
+ private boolean warnAboutSuffixReverseChange()
+ {
+ BackupFilesPresetEntry bfpe = BackupFilesPresetEntry
+ .getSavedBackupEntry();
+ boolean savedSuffixReverse = bfpe.reverse;
+ int savedSuffixDigits = bfpe.digits;
+ String savedSuffixTemplate = bfpe.suffix;
+
+ boolean nowSuffixReverse = suffixReverse.isSelected();
+ int nowSuffixDigits = getSpinnerInt(suffixDigitsSpinner, 3);
+ String nowSuffixTemplate = suffixTemplate.getText();
+ return nowSuffixReverse != savedSuffixReverse
+ && nowSuffixDigits == savedSuffixDigits
+ && nowSuffixTemplate != null
+ && nowSuffixTemplate.equals(savedSuffixTemplate);
+ }
+
+ /**
+ * Initialises the Backups tabbed panel.
+ *
+ * @return
+ */
+ private JPanel initBackupsTab()
+ {
+ JPanel backupsTab = new JPanel();
+ backupsTab.setBorder(new TitledBorder(
+ MessageManager.getString("label.backup_files")));
+ backupsTab.setLayout(new GridBagLayout());
+
+ GridBagConstraints gbc = new GridBagConstraints();
+ gbc.weightx = 0.0;
+ gbc.weighty = 0.0;
+ gbc.anchor = GridBagConstraints.FIRST_LINE_START;
+ gbc.fill = GridBagConstraints.NONE;
+
+ initBackupsTabPresetsPanel();
+ initBackupsTabSuffixPanel();
+ initBackupsTabKeepFilesPanel();
+ initBackupsTabFilenameExamplesPanel();
+
+ enableBackupFiles.setFont(LABEL_FONT_BOLD);
+ enableBackupFiles
+ .setText(MessageManager.getString("label.enable_backupfiles"));
+ enableBackupFiles.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ // enable other options only when the first is checked
+ backupsOptionsSetEnabled();
+ }
+ });
+
+
+ // enable checkbox 1 col
+ gbc.gridwidth = 1;
+ gbc.gridheight = 1;
+ gbc.gridx = 0;
+ gbc.gridy = 0; // row 0
+ backupsTab.add(enableBackupFiles, gbc);
+
+ // summary of scheme box (over two rows)
+ gbc.gridx = 1;
+ gbc.weightx = 0.0;
+ gbc.gridheight = 2;
+ gbc.anchor = GridBagConstraints.FIRST_LINE_END;
+ gbc.fill = GridBagConstraints.BOTH;
+ backupsTab.add(exampleFilesPanel, gbc);
+ gbc.gridheight = 1;
+ gbc.anchor = GridBagConstraints.FIRST_LINE_START;
+ gbc.fill = GridBagConstraints.NONE;
+
+ // fill empty space on right
+ gbc.gridx++;
+ gbc.weightx = 1.0;
+ backupsTab.add(new JPanel(), gbc);
+
+ // schemes box
+ gbc.weightx = 0.0;
+ gbc.gridx = 0;
+ gbc.gridy++; // row 1
+ backupsTab.add(presetsPanel, gbc);
+
+ // now using whole row
+ gbc.gridwidth = 2;
+ gbc.gridheight = 1;
+ // keep files box
+ gbc.gridx = 0;
+ gbc.gridy++; // row 2
+ backupsTab.add(keepfilesPanel, gbc);
+
+ // filename strategy box
+ gbc.gridy++; // row 3
+ backupsTab.add(suffixPanel, gbc);
+
+ // fill empty space
+ gbc.gridy++; // row 4
+ gbc.weighty = 1.0;
+ backupsTab.add(new JPanel(), gbc);
+
+ backupsOptionsSetEnabled();
+ return backupsTab;
+ }
+
+ private JPanel initBackupsTabPresetsPanel()
+ {
+
+ String title = MessageManager.getString("label.schemes");
+
+ presetsPanel.setLayout(new GridBagLayout());
+
+ GridBagConstraints gbc = new GridBagConstraints();
+ gbc.weightx = 0.0;
+ gbc.weighty = 0.0;
+ gbc.anchor = GridBagConstraints.BASELINE_LEADING;
+ gbc.fill = GridBagConstraints.NONE;
+ gbc.gridwidth = 1;
+ gbc.gridheight = 1;
+
+ // "Scheme: "
+ gbc.gridx = 0;
+ gbc.gridy = 0;
+
+ presetsComboLabel = new JLabel(title + ":");
+ presetsPanel.add(presetsComboLabel, gbc);
+
+ List<Object> entries = Arrays
+ .asList((Object[]) BackupFilesPresetEntry.backupfilesPresetEntries);
+ List<String> tooltips = Arrays.asList(
+ BackupFilesPresetEntry.backupfilesPresetEntryDescriptions);
+ backupfilesPresetsCombo = JvSwingUtils.buildComboWithTooltips(entries,
+ tooltips);
+ /*
+ for (int i = 0; i < BackupFilesPresetEntry.backupfilesPresetEntries.length; i++)
+ {
+ backupfilesPresetsCombo
+ .addItem(BackupFilesPresetEntry.backupfilesPresetEntries[i]);
+ }
+ */
+
+ backupfilesPresetsCombo.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ int key = getComboIntStringKey(backupfilesPresetsCombo);
+ if (!customiseCheckbox.isSelected())
+ {
+ backupfilesPresetsComboLastSelected = key;
+ }
+ if (key == BackupFilesPresetEntry.BACKUPFILESSCHEMECUSTOM)
+ {
+ if (customiseCheckbox.isSelected())
+ {
+ // got here by clicking on customiseCheckbox so don't change the values
+ backupfilesCustomOptionsSetEnabled();
+ }
+ else
+ {
+ backupsTabUpdatePresets();
+ backupfilesCustomOptionsSetEnabled();
+ }
+ }
+ else
+ {
+ customiseCheckbox.setSelected(false);
+ backupsTabUpdatePresets();
+ backupfilesCustomOptionsSetEnabled();
+ }
+ }
+ });
+
+ // dropdown list of preset schemes
+ gbc.gridx = 1;
+ presetsPanel.add(backupfilesPresetsCombo, gbc);
+
+ revertButton.setText(MessageManager.getString("label.cancel_changes"));
+ revertButton.setToolTipText(
+ MessageManager.getString("label.cancel_changes_description"));
+ revertButton.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ backupsSetOptions(
+ BackupFilesPresetEntry.backupfilesPresetEntriesValues.get(
+ BackupFilesPresetEntry.BACKUPFILESSCHEMECUSTOM));
+ backupfilesCustomOptionsSetEnabled();
+ }
+
+ });
+ revertButton.setFont(LABEL_FONT);
+
+ customiseCheckbox.setFont(LABEL_FONT);
+ customiseCheckbox.setText(MessageManager.getString("label.customise"));
+ customiseCheckbox.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ int currently = getComboIntStringKey(backupfilesPresetsCombo);
+ if (customiseCheckbox.isSelected())
+ {
+ backupfilesPresetsComboLastSelected = currently;
+ setComboIntStringKey(backupfilesPresetsCombo,
+ BackupFilesPresetEntry.BACKUPFILESSCHEMECUSTOM);
+ }
+ else
+ {
+ setComboIntStringKey(backupfilesPresetsCombo,
+ backupfilesPresetsComboLastSelected);
+
+ }
+ backupfilesCustomOptionsSetEnabled();
+ }
+ });
+ customiseCheckbox.setToolTipText(
+ MessageManager.getString("label.customise_description"));
+
+ // customise checkbox
+ gbc.gridx = 0;
+ gbc.gridy++;
+ presetsPanel.add(customiseCheckbox, gbc);
+
+ // "Cancel changes" button (aligned with combo box above)
+ gbc.gridx = 1;
+ presetsPanel.add(revertButton, gbc);
+
+ return presetsPanel;
+ }
+
+ private JPanel initBackupsTabFilenameExamplesPanel()
+ {
+ String title = MessageManager
+ .getString("label.scheme_examples");
+ TitledBorder tb = new TitledBorder(title);
+ exampleFilesPanel.setBorder(tb);
+ exampleFilesPanel.setLayout(new GridBagLayout());
+
+
+ backupfilesExampleLabel.setEditable(false);
+ backupfilesExampleLabel
+ .setBackground(exampleFilesPanel.getBackground());
+
+ updateBackupFilesExampleLabel();
+
+ GridBagConstraints gbc = new GridBagConstraints();
+ gbc.weightx = 1.0;
+ gbc.weighty = 1.0;
+ gbc.fill = GridBagConstraints.NONE;
+ gbc.anchor = GridBagConstraints.FIRST_LINE_START;
+
+ exampleFilesPanel.add(backupfilesExampleLabel, gbc);
+ return exampleFilesPanel;
+ }
+
+ private void backupsTabUpdatePresets()
+ {
+ IntKeyStringValueEntry entry = (IntKeyStringValueEntry) backupfilesPresetsCombo
+ .getSelectedItem();
+ int key = entry.k;
+ String value = entry.v;
+
+ if (BackupFilesPresetEntry.backupfilesPresetEntriesValues
+ .containsKey(key))
+ {
+ backupsSetOptions(
+ BackupFilesPresetEntry.backupfilesPresetEntriesValues
+ .get(key));
+ }
+ else
+ {
+ Cache.log.error(
+ "Preset '" + value + "' [key:" + key + "] not implemented");
+ }
+
+ // Custom options will now be enabled when the customiseCheckbox is checked
+ // (performed above)
+ // backupfilesCustomOptionsSetEnabled();
+ updateBackupFilesExampleLabel();
+ }
+
+ protected int getComboIntStringKey(
+ JComboBox<Object> backupfilesPresetsCombo2)
+ {
+ IntKeyStringValueEntry e;
+ try
+ {
+ e = (IntKeyStringValueEntry) backupfilesPresetsCombo2
+ .getSelectedItem();
+ } catch (Exception ex)
+ {
+ Cache.log.error(
+ "Problem casting Combo entry to IntKeyStringValueEntry.");
+ e = null;
+ }
+ return e != null ? e.k : 0;
+ }
+
+ protected void setComboIntStringKey(
+ JComboBox<Object> backupfilesPresetsCombo2,
+ int key)
+ {
+ for (int i = 0; i < backupfilesPresetsCombo2.getItemCount(); i++)
+ {
+ IntKeyStringValueEntry e;
+ try
+ {
+ e = (IntKeyStringValueEntry) backupfilesPresetsCombo2.getItemAt(i);
+ } catch (Exception ex)
+ {
+ Cache.log.error(
+ "Problem casting Combo entry to IntKeyStringValueEntry. Skipping item. ");
+ continue;
+ }
+ if (e.k == key)
+ {
+ backupfilesPresetsCombo2.setSelectedIndex(i);
+ break;
+ }
+ }
+ // backupsTabUpdatePresets();
+ }
+
+ private JPanel initBackupsTabSuffixPanel()
+ {
+ suffixPanel.setBorder(new TitledBorder(
+ MessageManager.getString("label.backup_filename_strategy")));
+ suffixPanel.setLayout(new GridBagLayout());
+
+ suffixTemplateLabel
+ .setText(MessageManager.getString("label.append_to_filename"));
+ suffixTemplateLabel.setHorizontalAlignment(SwingConstants.LEFT);
+ suffixTemplateLabel.setFont(LABEL_FONT);
+
+ final String tooltip = JvSwingUtils.wrapTooltip(true,
+ MessageManager.getString("label.append_to_filename_tooltip"));
+ suffixTemplate.setToolTipText(tooltip);
+ suffixTemplate.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ updateBackupFilesExampleLabel();
+ backupfilesCustomOptionsSetEnabled();
+ backupfilesRevertButtonSetEnabled(true);
+ }
+
+ });
+ suffixTemplate.addKeyListener(new KeyListener()
+ {
+ @Override
+ public void keyReleased(KeyEvent e)
+ {
+ updateBackupFilesExampleLabel();
+ backupfilesCustomOptionsSetEnabled();
+ backupfilesRevertButtonSetEnabled(true);
+ }
+
+ @Override
+ public void keyPressed(KeyEvent e)
+ {
+ }
+
+ // disable use of ':' or '/' or '\'
+ @Override
+ public void keyTyped(KeyEvent e)
+ {
+ char c = e.getKeyChar();
+ if (c == ':' || c == '/' || c == '\\')
+ {
+ // don't process ':' or '/' or '\'
+ e.consume();
+ }
+ }
+
+ });
+
+ // digits spinner
+ suffixDigitsLabel
+ .setText(MessageManager.getString("label.index_digits"));
+ suffixDigitsLabel.setHorizontalAlignment(SwingConstants.LEFT);
+ suffixDigitsLabel.setFont(LABEL_FONT);
+ ChangeListener c = new ChangeListener()
+ {
+ @Override
+ public void stateChanged(ChangeEvent e)
+ {
+ backupfilesRevertButtonSetEnabled(true);
+ updateBackupFilesExampleLabel();
+ }
+
+ };
+ setIntegerSpinner(suffixDigitsSpinner, BackupFilesPresetEntry.DIGITSMIN,
+ BackupFilesPresetEntry.DIGITSMAX, 3, c);
+
+ suffixReverse.setLabels(MessageManager.getString("label.reverse_roll"),
+ MessageManager.getString("label.increment_index"));
+ suffixReverse.addActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ boolean okay = true;
+ if (warnAboutSuffixReverseChange())
+ {
+ // Warning popup
+ okay = confirmSuffixReverseChange();
+ }
+ if (okay)
+ {
+ backupfilesRevertButtonSetEnabled(true);
+ updateBackupFilesExampleLabel();
+ }
+ else
+ {
+ boolean savedSuffixReverse = BackupFilesPresetEntry
+ .getSavedBackupEntry().reverse;
+ suffixReverse.setSelected(savedSuffixReverse);
+ }
+ }
+ });
+
+ GridBagConstraints sgbc = new GridBagConstraints();
+
+ // first row (template text box)
+ sgbc.anchor = GridBagConstraints.WEST;
+ sgbc.gridx = 0;
+ sgbc.gridy = 0;
+ sgbc.gridwidth = 1;
+ sgbc.gridheight = 1;
+ sgbc.weightx = 1.0;
+ sgbc.weighty = 0.0;
+ sgbc.fill = GridBagConstraints.NONE;
+ suffixPanel.add(suffixTemplateLabel, sgbc);
+
+ sgbc.gridx = 1;
+ sgbc.fill = GridBagConstraints.HORIZONTAL;
+ suffixPanel.add(suffixTemplate, sgbc);
+
+ // second row (number of digits spinner)
+ sgbc.gridy = 1;
+
+ sgbc.gridx = 0;
+ sgbc.fill = GridBagConstraints.NONE;
+ suffixPanel.add(suffixDigitsLabel, sgbc);
+
+ sgbc.gridx = 1;
+ sgbc.fill = GridBagConstraints.HORIZONTAL;
+ suffixPanel.add(suffixDigitsSpinner, sgbc);
+
+ // third row (forward order radio selection)
+ sgbc.gridx = 0;
+ sgbc.gridy = 2;
+ sgbc.gridwidth = GridBagConstraints.REMAINDER;
+ sgbc.fill = GridBagConstraints.HORIZONTAL;
+ suffixPanel.add(suffixReverse.getFalseButton(), sgbc);
+
+ // fourth row (reverse order radio selection)
+ sgbc.gridy = 3;
+ suffixPanel.add(suffixReverse.getTrueButton(), sgbc);
+ return suffixPanel;
+ }
+
+ private boolean confirmSuffixReverseChange()
+ {
+ boolean ret = false;
+ String warningMessage = MessageManager
+ .getString("label.warning_confirm_change_reverse");
+ int confirm = JvOptionPane.showConfirmDialog(Desktop.desktop,
+ warningMessage,
+ MessageManager.getString("label.change_increment_decrement"),
+ JvOptionPane.YES_NO_OPTION, JvOptionPane.WARNING_MESSAGE);
+
+ ret = (confirm == JvOptionPane.YES_OPTION);
+ return ret;
+ }
+
+ private JPanel initBackupsTabKeepFilesPanel()
+ {
+ keepfilesPanel.setBorder(
+ new TitledBorder(MessageManager.getString("label.keep_files")));
+ keepfilesPanel.setLayout(new GridBagLayout());
+
+ backupfilesKeepAll.setLabels(
+ MessageManager.getString("label.keep_all_backup_files"),
+ MessageManager.getString(
+ "label.keep_only_this_number_of_backup_files"));
+ backupfilesKeepAll.addTrueActionListener(new ActionListener()
+ {
+ @Override
+ public void actionPerformed(ActionEvent e)
+ {
+ backupfilesRevertButtonSetEnabled(true);
+ updateBackupFilesExampleLabel();
+ }
+ });
+ backupfilesKeepAll.addActionListener(new ActionListener()