// Create the selector panel
final JPanel selectorPanel = new JPanel(new BorderLayout());
selectorPanel.setBorder(BorderFactory
.createBevelBorder(BevelBorder.LOWERED));
final SectorSelector selector = new SectorSelector(this.game);
this.selector = selector;
selector.addMouseListener(new MouseAdapter()
{
/** @see MouseAdapter#mouseClicked(MouseEvent) */
@Override
public void mouseClicked(final MouseEvent e)
{
if (e.getClickCount() == 2)
getRootPane().getDefaultButton().doClick(0);
}
});
selectorPanel.add(selector, BorderLayout.CENTER);
// Create the controls panel
final JPanel controlsPanel = new JPanel();
controlsPanel.setBorder(BorderFactory.createEmptyBorder(0, 0, 10, 0));
controlsPanel.setLayout(new BoxLayout(controlsPanel, BoxLayout.X_AXIS));
final JTextField quickSearch = new JTextField();
this.quickSearch = quickSearch;
quickSearch.setColumns(15);
quickSearch.addKeyListener(new KeyAdapter()
{
@Override
public void keyReleased(final KeyEvent e)
{
selector.setFilter(quickSearch.getText());
}
});
final JLabel quickSearchLabel = new JLabel(I18N
.getString("dialog.selectSector.filter"));
quickSearchLabel.setDisplayedMnemonic(I18N
.getMnemonic("dialog.selectSector.filter"));
quickSearchLabel.setLabelFor(quickSearch);
final JComboBox modeComboBox = new JComboBox(SectorSelector.Mode
.values());
modeComboBox.setSelectedItem(selector.getMode());
modeComboBox.addActionListener(new ActionListener()
{
@Override
public void actionPerformed(final ActionEvent e)
{
selector.setMode((Mode) modeComboBox.getSelectedItem());
}
});
final JLabel modeLabel = new JLabel(I18N
.getString("dialog.selectSector.viewMode"));
modeLabel.setDisplayedMnemonic(I18N