import javax.swing.event.InternalFrameEvent;
import javax.swing.event.InternalFrameListener;
+import jalview.util.ChannelProperties;
import jalview.util.Platform;
import jalview.util.dialogrunner.DialogRunnerI;
public JvOptionPane(final Component parent)
{
this.parentComponent = Platform.isJS() ? this : parent;
+ this.setIcon(null);
}
public static int showConfirmDialog(Component parentComponent,
if (!isInteractiveMode())
{
handleResponse(getMockResponse());
+ return;
}
// two uses:
//
Platform.isJS() ? initialValue : initialValue_btn);
JDialog dialog = joptionpane.createDialog(parentComponent, title);
- dialog.setIconImage(WindowIcons.logoIcon.getImage());
+ dialog.setIconImages(ChannelProperties.getIconList());
dialog.setModalityType(modal ? ModalityType.APPLICATION_MODAL
: ModalityType.MODELESS);
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);
if (parentComponent != this)
{
JInternalFrame jif = this.createInternalFrame(parentComponent, title);
- jif.setFrameIcon(WindowIcons.logoIcon);
+ jif.setFrameIcon(null);
jif.addInternalFrameListener(new InternalFrameListener()
{
@Override
else
{
JDialog dialog = this.createDialog(parentComponent, title);
- dialog.setIconImage(WindowIcons.logoIcon.getImage());
+ dialog.setIconImages(ChannelProperties.getIconList());
dialog.setVisible(true); // blocking
this.internalDialogHandleResponse();
return;
public static int showDialogOnTop(String label, String actionString,
int JOPTIONPANE_OPTION, int JOPTIONPANE_MESSAGETYPE)
{
+ if (!isInteractiveMode())
+ {
+ return (int) getMockResponse();
+ }
// Ensure Jalview window is brought to front (primarily for Quit
// confirmation window to be visible)
// A better hack which works is to create a new JFrame parent with
// setAlwaysOnTop(true)
JFrame dialogParent = new JFrame();
- dialogParent.setIconImage(WindowIcons.logoIcon.getImage());
+ dialogParent.setIconImages(ChannelProperties.getIconList());
dialogParent.setAlwaysOnTop(true);
int answer = JOptionPane.showConfirmDialog(dialogParent, label,
Object[] options, Object initialValue, boolean modal)
{
JFrame frame = new JFrame();
- frame.setIconImage(WindowIcons.logoIcon.getImage());
+ frame.setIconImages(ChannelProperties.getIconList());
showDialogOnTopAsync(frame, label, actionString, JOPTIONPANE_OPTION,
JOPTIONPANE_MESSAGETYPE, icon, options, initialValue, modal);
}
int JOPTIONPANE_MESSAGETYPE, Icon icon, Object[] options,
Object initialValue, boolean modal, JButton[] buttons)
{
+ if (!isInteractiveMode())
+ {
+ handleResponse(getMockResponse());
+ return;
+ }
// Ensure Jalview window is brought to front (primarily for Quit
// confirmation window to be visible)
Object[] options, Object initialValue, boolean modal,
JButton[] buttons)
{
+ if (!isInteractiveMode())
+ {
+ handleResponse(getMockResponse());
+ return null;
+ }
JButton[] optionsButtons = null;
Object initialValueButton = null;
JOptionPane joptionpane = new JOptionPane();
Platform.isJS() ? initialValue : initialValueButton);
JDialog dialog = joptionpane.createDialog(parentComponent, title);
- dialog.setIconImage(WindowIcons.logoIcon.getImage());
+ dialog.setIconImages(ChannelProperties.getIconList());
dialog.setModalityType(
modal ? ModalityType.APPLICATION_MODAL : ModalityType.MODELESS);
dialog.setDefaultCloseOperation(JDialog.DISPOSE_ON_CLOSE);