adds "overview" name for overview panel.
}
else if (source == autoCalculate)
{
- viewport.autoCalculateConsensus = autoCalculate.getState();
+ viewport.setAutoCalculateConsensusAndConservation(autoCalculate.getState());
}
else if (source == sortByTree)
{
public class ArgsParser
{
+ // BH 2019 - new
+
+ public static final String NOCALCULATION = "nocalculation";
+
+ public static final String NOMENUBAR = "nomenubar";
+
+ public static final String NOSTATUS = "nostatus";
+
+ public static final String SHOWOVERVIEW = "showoverview";
+
+ //
public static final String ANNOTATIONS = "annotations";
public static final String COLOUR = "colour";
protected JSFunctionExec jsFunctionExec;
+ private boolean noCalculation, noMenuBar, noStatus;
+
+ public boolean getStartCalculations()
+ {
+ return !noCalculation;
+ }
+
+ public boolean getAllowMenuBar()
+ {
+ return !noMenuBar;
+ }
+
+ public boolean getShowStatus()
+ {
+ return !noStatus;
+ }
+
+
public static AlignFrame getCurrentAlignFrame()
{
return getInstance().currentAlignFrame;
getInstance().doMain(args);
}
- /**
- * Allow an outside entity to initiate the second half of argument parsing
- * (only).
- *
- * @param args
- * @return null is good
- */
- @Override
- public Object parseArguments(String[] args)
- {
-
- try
- {
- ArgsParser aparser = new ArgsParser(args);
- return parseArguments(aparser, false);
- } catch (Throwable t)
- {
- return t;
- }
- }
private static void logClass(String name)
{
parseArguments(aparser, true);
}
+ /**
+ * Allow an outside entity to initiate the second half of argument parsing
+ * (only).
+ *
+ * @param args
+ * @return null is good
+ */
+ @Override
+ public Object parseArguments(String[] args)
+ {
+
+ try
+ {
+ ArgsParser aparser = new ArgsParser(args);
+ return parseArguments(aparser, false);
+ } catch (Throwable t)
+ {
+ return t;
+ }
+ }
+
+ /**
+ *
+ * @param aparser
+ * @param isStartup
+ * @return
+ */
private Object parseArguments(ArgsParser aparser, boolean isStartup)
{
boolean isJS = Platform.isJS();
String fileFormat = (isJavaAppletTag
? aparser.getAppletValue("format", null)
: null);
-
FileFormatI format = null;
DataSourceType protocol = null;
}
}
+ String data;
+
if (file != null)
{
+
if (!headless)
{
desktop.setProgressBar(
// TODO ?
}
+ if (aparser.contains(ArgsParser.SHOWOVERVIEW))
+ {
+ jalview.bin.Cache.setPropertyNoSave(Preferences.SHOW_OVERVIEW,
+ "true");
+
+ System.out.println("CMD [showoverview] executed successfully!");
+ }
+
+ if (aparser.contains(ArgsParser.NOMENUBAR))
+ {
+ noMenuBar = true;
+ System.out.println("CMD [nomenu] executed successfully!");
+ }
+
+ if (aparser.contains(ArgsParser.NOSTATUS))
+ {
+ noStatus = true;
+ System.out.println("CMD [nostatus] executed successfully!");
+ }
+
+ if (aparser.contains(ArgsParser.NOCALCULATION))
+ {
+ noCalculation = true;
+ System.out.println("CMD [nocalculation] executed successfully!");
+ }
+
AlignFrame af = new FileLoader(!headless).loadFileWaitTillLoaded(file,
protocol, format);
if (af == null)
// TODO: file2 How to implement file2 for the applet spit screen?
- String data = aparser.getValue(ArgsParser.COLOUR, true);
+ data = aparser.getValue(ArgsParser.COLOUR, true);
if (data != null)
{
data.replaceAll("%20", " ");
}
+
}
if (!Jalview.isHeadlessMode())
{
progressBar = new ProgressBar(this.statusPanel, this.statusBar);
+ statusPanel.setVisible(Jalview.getInstance().getShowStatus());
+ alignFrameMenuBar.setVisible(Jalview.getInstance().getAllowMenuBar());
}
avc = new jalview.controller.AlignViewController(this, viewport,
{
ap.av.getAlignment().padGaps();
}
- ap.av.updateConservation(ap);
- ap.av.updateConsensus(ap);
- ap.av.updateStrucConsensus(ap);
+ if (Jalview.getInstance().getStartCalculations())
+ {
+ ap.av.updateConservation(ap);
+ ap.av.updateConsensus(ap);
+ ap.av.updateStrucConsensus(ap);
+ }
}
}
applyToAllGroups.setState(av.getColourAppliesToAllGroups());
showNpFeatsMenuitem.setSelected(av.isShowNPFeats());
showDbRefsMenuitem.setSelected(av.isShowDBRefs());
- autoCalculate.setSelected(av.autoCalculateConsensus);
+ autoCalculate.setSelected(av.getAutoCalculateConsensusAndConservation());
sortByTree.setSelected(av.sortByTree);
listenToViewSelections.setSelected(av.followSelection);
Desktop.addInternalFrame(frame, MessageManager
.formatMessage("label.overview_params", new Object[]
{ this.getTitle() }), true, frame.getWidth(), frame.getHeight(),
- true, true);
+ true, true, "overview");
frame.pack();
frame.setLayer(JLayeredPane.PALETTE_LAYER);
frame.addInternalFrameListener(
@Override
public void autoCalculate_actionPerformed(ActionEvent e)
{
- viewport.autoCalculateConsensus = autoCalculate.isSelected();
- if (viewport.autoCalculateConsensus)
+ viewport.setAutoCalculateConsensusAndConservation(autoCalculate.isSelected());
+ if (viewport.getAutoCalculateConsensusAndConservation())
{
viewport.firePropertyChange("alignment", null,
viewport.getAlignment().getSequences());
setRightAlignIds(Cache.getDefault(Preferences.RIGHT_ALIGN_IDS, false));
setCentreColumnLabels(Cache.getDefault(Preferences.CENTRE_COLUMN_LABELS, false));
- autoCalculateConsensus = Cache.getDefault(Preferences.AUTO_CALC_CONSENSUS, true);
+ autoCalculateConsensusAndConservation = Cache.getDefault(Preferences.AUTO_CALC_CONSENSUS, true);
setPadGaps(Cache.getDefault(Preferences.PAD_GAPS, true));
setShowNPFeats(Cache.getDefault(Preferences.SHOW_NPFEATS_TOOLTIP, true));
final JInternalFrame frame, String title, int w, int h,
boolean resizable)
{
- addInternalFrame(frame, title, true, w, h, resizable, false);
+ addInternalFrame(frame, title, true, w, h, resizable, false, null);
}
/**
* Do not set the default minimum size for frame
*/
public static synchronized void addInternalFrame(
+ JInternalFrame frame, String title, boolean makeVisible, int w,
+ int h, boolean resizable, boolean ignoreMinSize)
+ {
+ addInternalFrame(frame, title, makeVisible, w, h, resizable,
+ ignoreMinSize, null);
+ }
+
+ /**
+ * Add an internal frame to the Jalview desktop
+ *
+ * @param frame
+ * Frame to show
+ * @param title
+ * Visible Title
+ * @param makeVisible
+ * When true, display frame immediately, otherwise, caller must call
+ * setVisible themselves.
+ * @param w
+ * width
+ * @param h
+ * height
+ * @param resizable
+ * Allow resize
+ * @param ignoreMinSize
+ * Do not set the default minimum size for frame
+ * @param name
+ * for HTML div embedding
+ */
+ public static synchronized void addInternalFrame(
final JInternalFrame frame, String title, boolean makeVisible,
- int w, int h, boolean resizable, boolean ignoreMinSize)
+ int w, int h, boolean resizable, boolean ignoreMinSize,
+ String name)
{
+
// TODO: allow callers to determine X and Y position of frame (eg. via
// bounds object).
// TODO: consider fixing method to update entries in the window submenu with
// the current window title
+ if (name != null)
+ {
+ frame.setName(Jalview.getAppID(name));
+ }
+
frame.setTitle(title);
if (frame.getWidth() < 1 || frame.getHeight() < 1)
{
protected ColumnSelection colSel = new ColumnSelection();
- public boolean autoCalculateConsensus = true;
+ protected boolean autoCalculateConsensusAndConservation = true;
+
+ public boolean getAutoCalculateConsensusAndConservation()
+ { // BH 2019.07.24
+ return autoCalculateConsensusAndConservation;
+ }
+
+ public void setAutoCalculateConsensusAndConservation(boolean b)
+ {
+ autoCalculateConsensusAndConservation = b;
+ }
protected boolean autoCalculateStrucConsensus = true;
+ public boolean getAutoCalculateStrucConsensus()
+ { // BH 2019.07.24
+ return autoCalculateStrucConsensus;
+ }
+
+ public void setAutoCalculateStrucConsensus(boolean b)
+ {
+ autoCalculateStrucConsensus = b;
+ }
+
protected boolean ignoreGapsInConsensusCalculation = false;
protected ResidueShaderI residueShading = new ResidueShader();
// see note in mantis : issue number 8585
if (alignment.isNucleotide()
|| (conservation == null && quality == null)
- || !autoCalculateConsensus)
+ || !autoCalculateConsensusAndConservation)
{
return;
}
public void updateConsensus(final AlignmentViewPanel ap)
{
// see note in mantis : issue number 8585
- if (consensus == null || !autoCalculateConsensus)
+ if (consensus == null || !autoCalculateConsensusAndConservation)
{
return;
}
{
alignment.padGaps();
}
- if (autoCalculateConsensus)
+ if (autoCalculateConsensusAndConservation)
{
updateConsensus(ap);
}
- if (hconsensus != null && autoCalculateConsensus)
+ if (hconsensus != null && autoCalculateConsensusAndConservation)
{
updateConservation(ap);
}