public interface AlignCalcManagerI
{
-
+
/**
* tell manager that a worker is initialised and has started to run
* @param worker
void workerCannotRun(AlignCalcWorkerI worker);
/**
- * indicate that a worker like this may be run on the platform.
+ * indicate that a worker like this may be run on the platform.
* @param worker of class to be removed from the execution blacklist
*/
void workerMayRun(AlignCalcWorkerI worker);
void startWorker(AlignCalcWorkerI worker);
/**
- *
+ *
* @param worker
* @return
*/
*/
boolean isWorking();
-
+
/**
* register a restartable worker
* @param worker
void registerWorker(AlignCalcWorkerI worker);
/**
- * restart any registered workers
+ * restart any registered workers
*/
void restartWorkers();
/**
- *
+ *
* @param alignmentAnnotation
* @return true if a currently registered and working worker indicates its involvement with the given alignmentAnnotation
*/
boolean workingInvolvedWith(AlignmentAnnotation alignmentAnnotation);
/**
- * kick any known instances of the given worker class to update their annotation
+ * kick any known instances of the given worker class to update their annotation
* @param workerClass
*/
void updateAnnotationFor(Class workerClass);
/**
- * return any registered workers of the given class
+ * return any registered workers of the given class
* @param workerClass
* @return null or one or more workers of the given class
*/
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
* Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
- *
+ *
* This file is part of Jalview.
- *
+ *
* Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
+ * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * Jalview is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
*/
package jalview.appletgui;
sr.forOverview = true;
fr = new FeatureRenderer(av);
fr.overview = true;
-
+
// scale the initial size of overviewpanel to shape of alignment
float initialScale = (float) av.getAlignment().getWidth()
/ (float) av.getAlignment().getHeight();
addComponentListener(new ComponentAdapter()
{
+ @Override
public void componentResized(ComponentEvent evt)
{
if (getSize().width != width
}
+ @Override
public void mouseEntered(MouseEvent evt)
{
}
+ @Override
public void mouseExited(MouseEvent evt)
{
}
+ @Override
public void mouseClicked(MouseEvent evt)
{
}
+ @Override
public void mouseMoved(MouseEvent evt)
{
}
+ @Override
public void mousePressed(MouseEvent evt)
{
boxX = evt.getX();
checkValid();
}
+ @Override
public void mouseReleased(MouseEvent evt)
{
boxX = evt.getX();
checkValid();
}
+ @Override
public void mouseDragged(MouseEvent evt)
{
boxX = evt.getX();
// the overview is being calculated
boolean resizeAgain = false;
+ @Override
public void run()
{
miniMe = null;
repaint();
}
+ @Override
public void update(Graphics g)
{
paint(g);
}
+ @Override
public void paint(Graphics g)
{
Graphics og = offscreen.getGraphics();
private FontMetrics fm;
- private boolean MAC = new jalview.util.Platform().isAMac();
+ private final boolean MAC = new jalview.util.Platform().isAMac();
boolean av_renderHistogram = true, av_renderProfile = true,
av_normaliseProfile = false;
/**
* DOCUMENT ME!
- *
+ *
* @param annotationPanel
* TODO
* @param g
/*
* else if (annotationPanel.av.updatingConservation &&
* aa[i].label.equals("Conservation")) {
- *
+ *
* y += charHeight; g.drawImage(annotationPanel.fadedImage, 0, y -
* row.height, annotationPanel.imgWidth, y, 0, y - row.height,
* annotationPanel.imgWidth, y, annotationPanel);
- *
+ *
* g.setColor(Color.black); //
* g.drawString("Calculating Conservation.....",20, y-row.height/2);
- *
+ *
* continue; } else if (annotationPanel.av.updatingConservation &&
* aa[i].label.equals("Quality")) {
- *
+ *
* y += charHeight; g.drawImage(annotationPanel.fadedImage, 0, y -
* row.height, annotationPanel.imgWidth, y, 0, y - row.height,
* annotationPanel.imgWidth, y, annotationPanel); g.setColor(Color.black);
* // / g.drawString("Calculating Quality....",20, y-row.height/2);
- *
+ *
* continue; }
*/
// first pass sets up state for drawing continuation from left-hand column
}
}
- private Color GLYPHLINE_COLOR = Color.gray;
+ private final Color GLYPHLINE_COLOR = Color.gray;
- private Color SHEET_COLOUR = Color.green;
+ private final Color SHEET_COLOUR = Color.green;
- private Color HELIX_COLOUR = Color.red;
+ private final Color HELIX_COLOUR = Color.red;
- private Color STEM_COLOUR = Color.blue;
+ private final Color STEM_COLOUR = Color.blue;
public void drawGlyphLine(Graphics g, Annotation[] row,
int lastSSX, int x, int y, int iconOffset, int startRes,
/*
* Jalview - A Sequence Alignment Editor and Viewer (Version 2.7)
* Copyright (C) 2011 J Procter, AM Waterhouse, J Engelhardt, LM Lui, G Barton, M Clamp, S Searle
- *
+ *
* This file is part of Jalview.
- *
+ *
* Jalview is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
+ * modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
- *
- * Jalview is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty
- * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+ *
+ * Jalview is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty
+ * of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
- *
+ *
* You should have received a copy of the GNU General Public License along with Jalview. If not, see <http://www.gnu.org/licenses/>.
*/
package jalview.workers;
{
private int ConsPercGaps = 25; // JBPNote : This should be a configurable property!
-
+
public ConservationThread(AlignViewportI alignViewport, AlignmentViewPanel alignPanel)
{
super(alignViewport, alignPanel);
ConsPercGaps = alignViewport.getConsPercGaps();
}
-
+
private Conservation cons;
AlignmentAnnotation conservation,quality;
int alWidth;
+ @Override
public void run()
{
try
{
calcMan.notifyStart(this); // updatingConservation = true;
- while (!calcMan.notifyWorking(this))
+ while (!calcMan.notifyWorking(this))
{
try
{
ourAnnot.add(conservation);
ourAnnot.add(quality);
ourAnnots = ourAnnot;
-
+
// AlignViewport.UPDATING_CONSERVATION = true;
-
+
if (alignment==null || (alWidth=alignment.getWidth())< 0)
{
calcMan.workerComplete(this);
//.updatingConservation = false;
//AlignViewport.UPDATING_CONSERVATION = false;
-
+
return;
}
public void updateAnnotation()
{
updateResultAnnotation(false);
-
+
}
}
import jalview.datamodel.AlignmentI;
import jalview.datamodel.Annotation;
-public class StrucConsensusThread extends AlignCalcWorker implements AlignCalcWorkerI
+public class StrucConsensusThread extends AlignCalcWorker implements
+ AlignCalcWorkerI
{
public StrucConsensusThread(AlignViewportI alignViewport,
AlignmentViewPanel alignPanel)
{
super(alignViewport, alignPanel);
}
+
AlignmentAnnotation strucConsensus;
+
Hashtable[] hStrucConsensus;
+ @Override
public void run()
{
try
calcMan.workerComplete(this);
return;
}
- strucConsensus=alignViewport.getAlignmentStrucConsensusAnnotation();
- hStrucConsensus=alignViewport.getRnaStructureConsensusHash();
+ strucConsensus = alignViewport.getAlignmentStrucConsensusAnnotation();
+ hStrucConsensus = alignViewport.getRnaStructureConsensusHash();
strucConsensus.annotations = null;
strucConsensus.annotations = new Annotation[aWidth];
}
}
// check to see if its valid
-
- if (rnaStruc==null || !rnaStruc.isValidStruc())
+
+ if (rnaStruc == null || !rnaStruc.isValidStruc())
{
calcMan.workerComplete(this);
return;
}
-
- jalview.analysis.StructureFrequency.calculate(alignment.getSequencesArray(), 0,
- alignment.getWidth(), hStrucConsensus, true, rnaStruc);
+
+ jalview.analysis.StructureFrequency.calculate(
+ alignment.getSequencesArray(), 0, alignment.getWidth(),
+ hStrucConsensus, true, rnaStruc);
alignViewport.setRnaStructureConsensusHash(hStrucConsensus);
// TODO AlignmentAnnotation rnaStruc!!!
updateResultAnnotation(true);
- if (alignViewport.getGlobalColourScheme()!= null)
+ if (alignViewport.getGlobalColourScheme() != null)
{
alignViewport.getGlobalColourScheme().setConsensus(hStrucConsensus);
}
}
}
+
/**
* update the consensus annotation from the sequence profile data using
* current visualization settings.
*/
+ @Override
public void updateAnnotation()
{
updateResultAnnotation(false);
public void updateResultAnnotation(boolean immediate)
{
- if (immediate || !calcMan.isWorking(this) && strucConsensus!=null && hStrucConsensus!=null)
+ if (immediate || !calcMan.isWorking(this) && strucConsensus != null
+ && hStrucConsensus != null)
{
- StructureFrequency.completeConsensus(strucConsensus,
- hStrucConsensus, 0, hStrucConsensus.length,
+ StructureFrequency.completeConsensus(strucConsensus, hStrucConsensus,
+ 0, hStrucConsensus.length,
alignViewport.getIgnoreGapsConsensus(),
- alignViewport.isShowSequenceLogo());
+ alignViewport.isShowSequenceLogo());
}
}