*/
public boolean isExportGroups();
- /**
- * Checks if settings/export process is cancelled
- *
- * @return
- */
- public boolean isCancelled();
}
package jalview.gui;
+import jalview.api.AlignExportSettingI;
+import jalview.jbgui.GAlignExportSettings;
+
import java.awt.event.ActionEvent;
import javax.swing.JDialog;
import javax.swing.JInternalFrame;
import javax.swing.JOptionPane;
-import jalview.api.AlignExportSettingI;
-import jalview.jbgui.GAlignExportSettings;
-
@SuppressWarnings("serial")
public class AlignExportSettings extends GAlignExportSettings implements
AlignExportSettingI
boolean cancelled = false;
- private int width = 450;
-
- private int height = 200;
-
JDialog dialog;
public AlignExportSettings(boolean hasHiddenSeq, boolean hasHiddenCols,
String alignFileFormat)
{
super(hasHiddenSeq, hasHiddenCols, alignFileFormat);
-
- // frame = new JInternalFrame();
- // frame.setContentPane(this);
- // frame.setLayer(JLayeredPane.PALETTE_LAYER);
- // Desktop.addInternalFrame(frame, "Export Settings", width, height);
-
- JOptionPane pane = new JOptionPane(null, JOptionPane.DEFAULT_OPTION,
- JOptionPane.DEFAULT_OPTION, null, new Object[]
- { this });
- dialog = pane.createDialog(Desktop.desktop, "Export Settings");
-
- // dialog = new JDialog(Desktop.instance, true);
- // dialog.setTitle("Export Settings");
-
- dialog.pack();
- dialog.setVisible(true);
-
- dialog.setContentPane(this);
- dialog.validate();
-
+ if (isShowDialog())
+ {
+ JOptionPane pane = new JOptionPane(null, JOptionPane.DEFAULT_OPTION,
+ JOptionPane.DEFAULT_OPTION, null, new Object[]
+ { this });
+ dialog = pane.createDialog(Desktop.desktop, "Export Settings");
+ dialog.pack();
+ dialog.setVisible(true);
+ dialog.setContentPane(this);
+ dialog.validate();
+ }
}
- // public static void main(String[] args)
- // {
- // new AlignExportSettings(false, false, false);
- // }
-
- // public void cancel_actionPerformed(ActionEvent e)
- // {
- // try
- // {
- // frame.setClosed(true);
- // } catch (Exception ex)
- // {
- // }
- // }
public void ok_actionPerformed(ActionEvent e)
{
return chkExportGrps.isSelected();
}
- @Override
public boolean isCancelled()
{
return cancelled;
import jalview.analysis.Dna;
import jalview.analysis.ParseProperties;
import jalview.analysis.SequenceIdMatcher;
-import jalview.api.AlignExportSettingI;
import jalview.api.AlignViewControllerGuiI;
import jalview.api.AlignViewControllerI;
import jalview.api.AlignViewportI;
{ 0, alignmentToExport.getWidth() - 1 };
boolean hasHiddenSeqs = hiddenSeqs.getSize() > 0;
- AlignExportSettingI settings = new AlignExportSettings(hasHiddenSeqs,
+ AlignExportSettings settings = new AlignExportSettings(hasHiddenSeqs,
viewport.hasHiddenColumns(), exportFomat);
settings.isExportAnnotations();
private int[] startEnd;
- private AlignExportSettingI settings;
+ private AlignExportSettings settings;
public ExportData(AlignmentI align, String[] ommit, int[] startEnd,
- AlignExportSettingI settings)
+ AlignExportSettings settings)
{
this.alignment = align;
this.omitHidden = ommit;
this.startEnd = startEnd;
}
- public AlignExportSettingI getSettings()
+ public AlignExportSettings getSettings()
{
return settings;
}
- public void setSettings(AlignExportSettingI settings)
+ public void setSettings(AlignExportSettings settings)
{
this.settings = settings;
}
JButton btnCancel = new JButton("Cancel");
- private boolean hasHiddenSeq, hasHiddenCols, isComplexAlignFile;
-
- boolean isComplexFormat = false;
+ private boolean hasHiddenSeq, hasHiddenCols, isComplexAlignFile,
+ showDialog;
public GAlignExportSettings(boolean hasHiddenSeq, boolean hasHiddenCols,
String alignFileFormat)
break;
}
}
-
+ if (this.hasHiddenCols || this.hasHiddenSeq || this.isComplexAlignFile)
+ {
+ this.showDialog = true;
+ }
init();
}
optionsPanel.add(hiddenRegionConfPanel);
}
- if (isComplexAlignFile)
+ if (this.isComplexAlignFile)
{
optionsPanel.add(complexExportPanel);
}
add(actionPanel, BorderLayout.SOUTH);
}
-
-
private void checkAllAction()
{
&& chkExportGrps.isEnabled() && isSelected);
}
+ public boolean isShowDialog()
+ {
+ return showDialog;
+ }
+
+ public void setShowDialog(boolean showDialog)
+ {
+ this.showDialog = showDialog;
+ }
+
public abstract void ok_actionPerformed(ActionEvent e);
public abstract void cancel_actionPerformed(ActionEvent e);