AssociateSeqOptions assSeqOpt = (AssociateSeqOptions) fileChooserAssSeqPanel
.getCmb_assSeq().getSelectedItem();
lbl_fromFileStatus.setIcon(errorImage);
+ setPdbOptionsEnabled(false);
if (selectedSequences.length == 1 || (assSeqOpt != null && !assSeqOpt
.getName().equalsIgnoreCase("-Select Associated Seq-")))
{
{
btn_add.setEnabled(true);
lbl_fromFileStatus.setIcon(goodImage);
+ setPdbOptionsEnabled(true);
}
}
else
{
btn_pdbFromFile.setEnabled(false);
lbl_fromFileStatus.setIcon(errorImage);
+ setPdbOptionsEnabled(false);
}
}
public static void openStructureFileForSequence(AlignmentPanel ap,
SequenceI seq, File sFile)
{
- //Open the chooser headlessly. Not sure this is actually needed ?
+ // Open the chooser headlessly. Not sure this is actually needed ?
StructureChooser sc = new StructureChooser(new SequenceI[] { seq }, seq,
ap, false);
StructureSelectionManager ssm = ap.getStructureSelectionManager();
new PDBEntry[]
{ fileEntry }, ap, new SequenceI[] { seq });
- sc.mainFrame.dispose();
+ sc.mainFrame.dispose();
}
}
import java.awt.Dimension;
import java.awt.FlowLayout;
import java.awt.Font;
+import java.awt.GridBagConstraints;
+import java.awt.GridBagLayout;
import java.awt.GridLayout;
import java.awt.Insets;
import java.awt.Point;
import java.util.HashMap;
import java.util.Map;
-import javax.swing.BoxLayout;
import javax.swing.ImageIcon;
import javax.swing.JButton;
import javax.swing.JCheckBox;
protected JButton btn_pdbFromFile = new JButton();
+ protected JLabel lbl_chooseTempFacType = new JLabel();
+
protected JComboBox<StructureImportSettings.TFType> combo_tempFacAs = new JComboBox<>();
protected JButton btn_paeMatrixFile = new JButton();
try
{
jbInit();
+ mainFrame.setFrameIcon(null);
mainFrame.setVisible(false);
mainFrame.invalidate();
mainFrame.pack();
}
});
- JLabel lbl_chooseTempFacType = new JLabel(new StringBuilder()
+ lbl_chooseTempFacType.setText(new StringBuilder()
.append(MessageManager.getString("label.choose_tempfac_type"))
- .append(" ").append("label.optional").toString());
+ .append(" ").append(MessageManager.getString("label.optional"))
+ .toString());
for (TFType t : TFType.values())
{
pnl_fileChooser.add(btn_pdbFromFile);
pnl_fileChooser.add(lbl_fromFileStatus);
- JPanel pnl_pdbOptions = new JPanel();
- pnl_pdbOptions
- .setLayout(new BoxLayout(pnl_pdbOptions, BoxLayout.PAGE_AXIS));
- pnl_pdbOptions.add(lbl_chooseTempFacType);
- pnl_pdbOptions.add(combo_tempFacAs);
- pnl_pdbOptions.add(btn_paeMatrixFile);
+ JPanel pnl_fileOptions = new JPanel();
+ pnl_fileOptions.setLayout(new GridBagLayout());
+ GridBagConstraints gbc = new GridBagConstraints();
+ gbc.gridx = 0;
+ gbc.gridy = 0;
+ gbc.weightx = 0.0;
+ gbc.weighty = 0.0;
+ gbc.insets = new Insets(0, 0, 18, 0);
+ gbc.fill = GridBagConstraints.NONE;
+ gbc.anchor = GridBagConstraints.FIRST_LINE_START;
+ pnl_fileOptions.add(pnl_fileChooser, gbc);
+ gbc.gridy++;
+ gbc.insets = new Insets(0, 0, 2, 0);
+ pnl_fileOptions.add(lbl_chooseTempFacType, gbc);
+ gbc.gridy++;
+ gbc.insets = new Insets(0, 0, 18, 0);
+ pnl_fileOptions.add(combo_tempFacAs, gbc);
+ gbc.gridy++;
+ gbc.weighty = 1.0;
+ pnl_fileOptions.add(btn_paeMatrixFile, gbc);
JPanel pnl_fileChooserBL = new JPanel(new BorderLayout());
pnl_fileChooserBL.add(fileChooserAssSeqPanel, BorderLayout.PAGE_START);
- pnl_fileChooserBL.add(pnl_fileChooser, BorderLayout.CENTER);
- // pnl_fileChooserBL.add(pnl_pdbOptions, BorderLayout.PAGE_END);
+ pnl_fileChooserBL.add(pnl_fileOptions, BorderLayout.CENTER);
JPanel pnl_idInput = new JPanel(new FlowLayout());
pnl_idInput.add(txt_search);
{
return mainFrame;
}
+
+ public void setPdbOptionsEnabled(boolean b)
+ {
+ lbl_chooseTempFacType.setEnabled(b);
+ combo_tempFacAs.setEnabled(b);
+ btn_paeMatrixFile.setEnabled(b);
+ }
}