import java.util.List;
import javax.help.HelpSetException;
-import javax.swing.JColorChooser;
import javax.swing.JFileChooser;
import javax.swing.JInternalFrame;
import javax.swing.JPanel;
JInternalFrame frame;
- DasSourceBrowser dasSource;
-
private WsPreferences wsPrefs;
private OptionsParam promptEachTimeOpt = new OptionsParam(
super();
frame = new JInternalFrame();
frame.setContentPane(this);
- dasSource = new DasSourceBrowser();
- dasTab.add(dasSource, BorderLayout.CENTER);
wsPrefs = new WsPreferences();
wsTab.add(wsPrefs, BorderLayout.CENTER);
int width = 500, height = 450;
new RowSorter.SortKey(m.getNameColumn(), SortOrder.ASCENDING));
sorter.setSortKeys(sortKeys);
- sorter.sort();
+ // BH 2018 setSortKeys will do the sort
+ // sorter.sort();
// set up filtering
ActionListener onReset;
autoIdWidth.setSelected(Cache.getDefault("FIGURE_AUTOIDWIDTH", false));
userIdWidth.setEnabled(!autoIdWidth.isSelected());
userIdWidthlabel.setEnabled(!autoIdWidth.isSelected());
- Integer wi = Cache.getIntegerProperty("FIGURE_USERIDWIDTH");
+ Integer wi = Cache.getIntegerProperty("FIGURE_FIXEDIDWIDTH");
userIdWidth.setText(wi == null ? "" : wi.toString());
// TODO: refactor to use common enum via FormatAdapter and allow extension
// for new flat file formats
Cache.applicationProperties.setProperty("FIGURE_AUTOIDWIDTH",
Boolean.toString(autoIdWidth.isSelected()));
userIdWidth_actionPerformed();
- Cache.applicationProperties.setProperty("FIGURE_USERIDWIDTH",
+ Cache.applicationProperties.setProperty("FIGURE_FIXEDIDWIDTH",
userIdWidth.getText());
/*
Cache.applicationProperties.setProperty("PAD_GAPS",
Boolean.toString(padGaps.isSelected()));
- dasSource.saveProperties(Cache.applicationProperties);
wsPrefs.updateAndRefreshWsMenuConfig(false);
Cache.saveProperties();
Desktop.instance.doConfigureStructurePrefs();
@Override
public void startupFileTextfield_mouseClicked()
{
+ // TODO: JAL-3048 not needed for Jalview-JS
String fileFormat = Cache.getProperty("DEFAULT_FILE_FORMAT");
JalviewFileChooser chooser = JalviewFileChooser
.forRead(Cache.getProperty("LAST_DIRECTORY"), fileFormat);
@Override
public void defaultBrowser_mouseClicked(MouseEvent e)
{
- JFileChooser chooser = new JFileChooser(".");
- chooser.setDialogTitle(
- MessageManager.getString("label.select_default_browser"));
+ // TODO: JAL-3048 not needed for j2s
+ /*
+ * @j2sNative
+ */
+ {
+ JFileChooser chooser = new JFileChooser(".");
+ chooser.setDialogTitle(
+ MessageManager.getString("label.select_default_browser"));
- int value = chooser.showOpenDialog(this);
+ int value = chooser.showOpenDialog(this);
- if (value == JFileChooser.APPROVE_OPTION)
- {
- defaultBrowser.setText(chooser.getSelectedFile().getAbsolutePath());
+ if (value == JFileChooser.APPROVE_OPTION)
+ {
+ defaultBrowser.setText(chooser.getSelectedFile().getAbsolutePath());
+ }
}
-
}
/*
@Override
public void minColour_actionPerformed(JPanel panel)
{
- Color col = JColorChooser.showDialog(this,
+ JalviewColourChooser.showColourChooser(this,
MessageManager.getString("label.select_colour_minimum_value"),
- minColour.getBackground());
- if (col != null)
- {
- panel.setBackground(col);
- }
- panel.repaint();
+ panel);
}
@Override
public void maxColour_actionPerformed(JPanel panel)
{
- Color col = JColorChooser.showDialog(this,
+ JalviewColourChooser.showColourChooser(this,
MessageManager.getString("label.select_colour_maximum_value"),
- maxColour.getBackground());
- if (col != null)
- {
- panel.setBackground(col);
- }
- panel.repaint();
+ panel);
}
@Override
{
if (!useLegacyGap.isSelected())
{
- Color col = JColorChooser.showDialog(this,
+ JalviewColourChooser.showColourChooser(this,
MessageManager.getString("label.select_gap_colour"),
- gapColour.getBackground());
- if (col != null)
- {
- gap.setBackground(col);
- }
- gap.repaint();
+ gap);
}
}
@Override
public void hiddenColour_actionPerformed(JPanel hidden)
{
- Color col = JColorChooser.showDialog(this,
+ JalviewColourChooser.showColourChooser(this,
MessageManager.getString("label.select_hidden_colour"),
- hiddenColour.getBackground());
- if (col != null)
- {
- hidden.setBackground(col);
- }
- hidden.repaint();
+ hidden);
}
@Override
}
} catch (NumberFormatException x)
{
+ userIdWidth.setText("");
JvOptionPane.showInternalMessageDialog(Desktop.desktop,
MessageManager
.getString("warn.user_defined_width_requirements"),
MessageManager.getString("label.invalid_id_column_width"),
JvOptionPane.WARNING_MESSAGE);
- userIdWidth.setText("");
}
}