/*
* 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.analysis;
* returns a new Hashtable[] of size maxSeqLength, if Hashtable not supplied.
* This class is used extensively in calculating alignment colourschemes that
* depend on the amount of conservation in each alignment column.
- *
+ *
* @author $author$
* @version $Revision$
*/
residueHash.put(MAXCOUNT, new Integer(maxCount));
residueHash.put(MAXRESIDUE, maxResidue);
- percentage = ((float) maxCount * 100) / (float) jSize;
+ percentage = ((float) maxCount * 100) / jSize;
residueHash.put(PID_GAPS, new Float(percentage));
- percentage = ((float) maxCount * 100) / (float) nongap;
+ percentage = ((float) maxCount * 100) / nongap;
residueHash.put(PID_NOGAPS, new Float(percentage));
result[i] = residueHash;
}
/**
* Compute all or part of the annotation row from the given consensus
* hashtable
- *
+ *
* @param consensus
* - pre-allocated annotation row
* @param hconsensus
{
for (int c = 0; c < alphabet.length; c++)
{
- tval = ((float) profile[0][alphabet[c]])
+ tval = profile[0][alphabet[c]]
* 100f
- / (float) profile[1][ignoreGapsInConsensusCalculation ? 1
+ / profile[1][ignoreGapsInConsensusCalculation ? 1
: 0];
mouseOver += ((c == 0) ? "" : "; ") + alphabet[c] + " "
+ ((int) tval) + "%";
{
ca[c] = new char[]
{ (char) c };
- vl[c] = (float) profile[0][c];
+ vl[c] = profile[0][c];
}
;
jalview.util.QuickSort.sort(vl, ca);
{
if (((char[]) ca[c])[0] != '-')
{
- tval = ((float) profile[0][((char[]) ca[c])[0]])
+ tval = profile[0][((char[]) ca[c])[0]]
* 100f
- / (float) profile[1][ignoreGapsInConsensusCalculation ? 1
+ / profile[1][ignoreGapsInConsensusCalculation ? 1
: 0];
mouseOver += ((p == 0) ? "" : "; ") + ((char[]) ca[c])[0]
+ " " + ((int) tval) + "%";
/**
* get the sorted profile for the given position of the consensus
- *
+ *
* @param hconsensus
* @return
*/
{
ca[c] = new char[]
{ (char) c };
- vl[c] = (float) profile[0][c];
+ vl[c] = profile[0][c];
}
;
jalview.util.QuickSort.sort(vl, ca);
if (((char[]) ca[c])[0] != '-')
{
rtnval[rtnval[0]++] = ((char[]) ca[c])[0];
- rtnval[rtnval[0]] = (int) (((float) profile[0][((char[]) ca[c])[0]]) * 100f / (float) profile[1][ignoreGapsInConsensusCalculation ? 1
+ rtnval[rtnval[0]] = (int) (profile[0][((char[]) ca[c])[0]] * 100f / profile[1][ignoreGapsInConsensusCalculation ? 1
: 0]);
rtnval[1]+=rtnval[rtnval[0]++];
}
/*
* 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;
SequenceNode highlightNode;
- AlignmentPanel ap;
+ AlignmentPanel ap;
public TreeCanvas(AlignmentPanel ap, ScrollPane scroller)
{
this.ap = ap;
if (node.element() instanceof SequenceI)
{
- SequenceI seq = (SequenceI) ((SequenceNode) node).element();
+ SequenceI seq = (SequenceI) node.element();
if (av.getSequenceColour(seq) == Color.white)
{
Rectangle rect = new Rectangle(xend + 10, ypos - charHeight,
charWidth, charHeight);
- nameHash.put((SequenceI) node.element(), rect);
+ nameHash.put(node.element(), rect);
// Colour selected leaves differently
SequenceGroup selected = av.getSelectionGroup();
if (selected != null
&& selected.getSequences(null).contains(
- (SequenceI) node.element()))
+ node.element()))
{
g.setColor(Color.gray);
int xend = (int) (height * scale) + offx;
int ypos = (int) (node.ycount * chunk) + offy;
- g.setColor(((SequenceNode) node).color.darker());
+ g.setColor(node.color.darker());
// Draw horizontal line
g.drawLine(xstart, ypos, xend, ypos);
}
}
+ @Override
public void update(Graphics g)
{
paint(g);
}
+ @Override
public void paint(Graphics g)
{
if (tree == null)
// for
// scrollbar
- float wscale = (float) (width - labelLength - offx * 2)
+ float wscale = (width - labelLength - offx * 2)
/ tree.getMaxHeight();
SequenceNode top = tree.getTopNode();
}
int x = (int) (threshold
- * (float) (getSize().width - labelLength - 2 * offx) + offx);
+ * (getSize().width - labelLength - 2 * offx) + offx);
g.drawLine(x, 0, x, getSize().height);
}
}
+ @Override
public void mouseReleased(MouseEvent e)
{
}
+ @Override
public void mouseEntered(MouseEvent e)
{
}
+ @Override
public void mouseExited(MouseEvent e)
{
}
+ @Override
public void mouseClicked(MouseEvent evt)
{
if (highlightNode != null)
}
}
+ @Override
public void mouseDragged(MouseEvent ect)
{
}
+ @Override
public void mouseMoved(MouseEvent evt)
{
av.setCurrentTree(tree);
}
}
+ @Override
public void mousePressed(MouseEvent e)
{
av.setCurrentTree(tree);
}
ap.updateAnnotation();
-
+
}
public void setShowDistances(boolean state)