import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Arrays;
+import java.util.EnumSet;
import java.util.List;
import javax.swing.AbstractCellEditor;
import javax.swing.table.TableCellRenderer;
import jalview.bin.Cache;
+import jalview.bin.Console;
import jalview.bin.MemorySetting;
import jalview.fts.core.FTSDataColumnPreferences;
import jalview.fts.core.FTSDataColumnPreferences.PreferenceSource;
protected JCheckBox structFromPdb = new JCheckBox();
- protected JCheckBox useRnaView = new JCheckBox();
-
protected JCheckBox addSecondaryStructure = new JCheckBox();
protected JCheckBox addTempFactor = new JCheckBox();
protected JPasswordField proxyAuthPasswordPB = new JPasswordField();
- protected JTextField defaultBrowser = new JTextField();
-
protected ButtonGroup proxyType = new ButtonGroup();
protected JRadioButton noProxy = new JRadioButton();
}
}
- public final static int CONNECTIONS_TAB = 5;
+ public static enum TabRef
+ {
+ CONNECTIONS_TAB, STRUCTURE_TAB
+ };
- public void selectTab(int selectTab)
+ public void selectTab(TabRef selectTab)
{
// select a given tab - currently only for Connections
switch (selectTab)
case CONNECTIONS_TAB:
tabbedPane.setSelectedComponent(connectTab);
break;
+ case STRUCTURE_TAB:
+ tabbedPane.setSelectedComponent(structureTab);
+ break;
default:
}
}
connectTab = new JPanel();
connectTab.setLayout(new GridBagLayout());
- // Label for browser text box
- JLabel browserLabel = new JLabel();
- browserLabel.setFont(LABEL_FONT);
- browserLabel.setHorizontalAlignment(SwingConstants.TRAILING);
- browserLabel.setText(
- MessageManager.getString("label.default_browser_unix"));
- defaultBrowser.setFont(LABEL_FONT);
- defaultBrowser.setText("");
- final String tooltip = JvSwingUtils.wrapTooltip(true,
- MessageManager.getString("label.double_click_to_browse"));
- defaultBrowser.setToolTipText(tooltip);
- defaultBrowser.addMouseListener(new MouseAdapter()
- {
- @Override
- public void mouseClicked(MouseEvent e)
- {
- if (e.getClickCount() > 1)
- {
- defaultBrowser_mouseClicked(e);
- }
- }
- });
-
JPanel proxyPanel = initConnTabProxyPanel();
initConnTabCheckboxes();
- // Add default Browser text box
- connectTab.add(browserLabel,
- new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0,
- GridBagConstraints.WEST, GridBagConstraints.NONE,
- new Insets(10, 0, 5, 5), 5, 1));
- defaultBrowser.setFont(LABEL_FONT);
- defaultBrowser.setText("");
-
- connectTab.add(defaultBrowser, new GridBagConstraints(1, 0, 1, 1, 1.0,
- 0.0, GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
- new Insets(10, 0, 5, 10), 30, 1));
-
// Add proxy server panel
connectTab.add(proxyPanel, new GridBagConstraints(0, 1, 2, 1, 1.0, 0.0,
GridBagConstraints.CENTER, GridBagConstraints.HORIZONTAL,
{
boolean selected = structFromPdb.isSelected();
// enable other options only when the first is checked
- useRnaView.setEnabled(selected);
addSecondaryStructure.setEnabled(selected);
addTempFactor.setEnabled(selected);
}
// 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"));
*/
structViewer.setFont(LABEL_FONT);
structViewer.setBounds(new Rectangle(190, ypos, 120, height));
+ for (ViewerType v : EnumSet.allOf(ViewerType.class))
+ {
+ structViewer.addItem(v.name());
+ }
+ /*
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
}
else
{
- Cache.log.error(
+ Console.error(
"Preset '" + value + "' [key:" + key + "] not implemented");
}
.getSelectedItem();
} catch (Exception ex)
{
- Cache.log.error(
+ Console.error(
"Problem casting Combo entry to IntKeyStringValueEntry.");
e = null;
}
e = (IntKeyStringValueEntry) backupfilesPresetsCombo2.getItemAt(i);
} catch (Exception ex)
{
- Cache.log.error(
+ Console.error(
"Problem casting Combo entry to IntKeyStringValueEntry. Skipping item. ");
continue;
}
i = ((Integer) s.getValue()).intValue();
} catch (Exception e)
{
- Cache.log.error(
+ Console.error(
"Exception casting the initial value of s.getValue()");
}
}
i = (Integer) s.getValue();
} catch (Exception e)
{
- Cache.log.error("Failed casting (Integer) JSpinner s.getValue()");
+ Console.error("Failed casting (Integer) JSpinner s.getValue()");
}
return i;
}
}
- public void defaultBrowser_mouseClicked(MouseEvent e)
- {
-
- }
-
public void linkURLList_keyTyped(KeyEvent e)
{