*/
package jalview.bin;
+import jalview.api.AlignCalcWorkerI;
import jalview.api.AlignFrameI;
import jalview.api.AlignViewportI;
import jalview.api.JalviewApp;
// 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 [-annotations " + data + "] executed successfully!");
}
+
+ if (aparser.contains(ArgsParser.SHOWOVERVIEW))
+ {
+ af.overviewMenuItem_actionPerformed(null);
+ System.out.println("CMD [showoverview] executed successfully!");
+ }
+
// set or clear the sortbytree flag.
if (aparser.contains(ArgsParser.SORTBYTREE))
{
currentAlignFrame.overviewMenuItem_actionPerformed(null);
}
+ public void notifyWorker(AlignCalcWorkerI worker, String status)
+ {
+ System.out.println("Jalview worker " + worker.getClass().getSimpleName()
+ + " " + status);
+ }
+
}
import jalview.api.AlignCalcManagerI;
import jalview.api.AlignCalcWorkerI;
+import jalview.bin.Jalview;
import jalview.datamodel.AlignmentAnnotation;
import java.util.ArrayList;
public class AlignCalcManager implements AlignCalcManagerI
{
+ public static final String STARTED = "started";
+
+ public static final String FINISHED = "finished";
+
/*
* list of registered workers
*/
.synchronizedList(new ArrayList<AlignCalcWorkerI>());
updating = Collections.synchronizedMap(
new Hashtable<Class<? extends AlignCalcWorkerI>, List<AlignCalcWorkerI>>());
- canUpdate = new HashSet<AlignCalcWorkerI>();
+ canUpdate = new HashSet<>();
}
@Override
{
synchronized (updating)
{
+ Jalview.getInstance().notifyWorker(worker, STARTED);
List<AlignCalcWorkerI> upd = updating.get(worker.getClass());
if (upd == null)
{
{
synchronized (inProgress)
{
+ Jalview.getInstance().notifyWorker(worker, FINISHED);
// System.err.println("Worker " + worker + " marked as complete.");
inProgress.remove(worker);
List<AlignCalcWorkerI> upd = updating.get(worker.getClass());
public List<AlignCalcWorkerI> getRegisteredWorkersOfClass(
Class<? extends AlignCalcWorkerI> workerClass)
{
- List<AlignCalcWorkerI> workingClass = new ArrayList<AlignCalcWorkerI>();
+ List<AlignCalcWorkerI> workingClass = new ArrayList<>();
synchronized (canUpdate)
{
for (AlignCalcWorkerI worker : canUpdate)
public void removeRegisteredWorkersOfClass(
Class<? extends AlignCalcWorkerI> typeToRemove)
{
- List<AlignCalcWorkerI> removable = new ArrayList<AlignCalcWorkerI>();
- Set<AlignCalcWorkerI> toremovannot = new HashSet<AlignCalcWorkerI>();
+ List<AlignCalcWorkerI> removable = new ArrayList<>();
+ Set<AlignCalcWorkerI> toremovannot = new HashSet<>();
synchronized (restartable)
{
for (AlignCalcWorkerI worker : restartable)
* first just find those to remove (to avoid
* ConcurrentModificationException)
*/
- List<AlignCalcWorkerI> toRemove = new ArrayList<AlignCalcWorkerI>();
+ List<AlignCalcWorkerI> toRemove = new ArrayList<>();
for (AlignCalcWorkerI worker : restartable)
{
if (worker.involves(ann))