/*
- * Jalview - A Sequence Alignment Editor and Viewer (Version 2.8.2b1)
- * Copyright (C) 2014 The Jalview Authors
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
*
* This file is part of Jalview.
*
* @param evt
* DOCUMENT ME!
*/
+ @Override
public void mousePressed(MouseEvent evt)
{
int x = (evt.getX() / av.getCharWidth()) + av.getStartRes();
MessageManager.getString("label.reveal"));
item.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
av.showColumn(reveal[0]);
MessageManager.getString("action.reveal_all"));
item.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
av.showAllHiddenColumns();
MessageManager.getString("label.hide_columns"));
item.addActionListener(new ActionListener()
{
+ @Override
public void actionPerformed(ActionEvent e)
{
av.hideColumns(res, res);
{
ap.overviewPanel.updateOverviewImage();
}
+ av.sendSelection();
}
});
pop.add(item);
* @param evt
* DOCUMENT ME!
*/
+ @Override
public void mouseReleased(MouseEvent evt)
{
mouseDragging = false;
* @param evt
* DOCUMENT ME!
*/
+ @Override
public void mouseDragged(MouseEvent evt)
{
mouseDragging = true;
}
}
+ @Override
public void mouseEntered(MouseEvent evt)
{
if (mouseDragging)
}
}
+ @Override
public void mouseExited(MouseEvent evt)
{
if (mouseDragging)
}
}
+ @Override
public void mouseClicked(MouseEvent evt)
{
}
+ @Override
public void mouseMoved(MouseEvent evt)
{
if (!av.hasHiddenColumns())
* @param g
* DOCUMENT ME!
*/
+ @Override
public void paintComponent(Graphics g)
{
drawScale(g, av.getStartRes(), av.getEndRes(), getWidth(), getHeight());
// Fill the selected columns
ColumnSelection cs = av.getColumnSelection();
+ int avCharWidth = av.getCharWidth(), avCharHeight = av.getCharHeight();
+
int s;
if (cs != null)
{
gg.setColor(new Color(220, 0, 0));
- for (int i = 0; i < cs.size(); i++)
+ for (int sel : cs.getSelected())
{
- int sel = cs.columnAt(i);
if (av.hasHiddenColumns())
{
if (cs.isVisible(sel))
if ((sel >= startx) && (sel <= endx))
{
- gg.fillRect((sel - startx) * av.charWidth, 0, av.charWidth,
+ gg.fillRect((sel - startx) * avCharWidth, 0, avCharWidth,
getHeight());
}
}
int scalestartx = (startx / 10) * 10;
FontMetrics fm = gg.getFontMetrics(av.getFont());
- int y = av.charHeight - fm.getDescent();
+ int y = avCharHeight - fm.getDescent();
if ((scalestartx % 10) == 0)
{
{
string = String.valueOf(av.getColumnSelection()
.adjustForHiddenColumns(i));
- if ((i - startx - 1) * av.charWidth > maxX)
+ if ((i - startx - 1) * avCharWidth > maxX)
{
- gg.drawString(string, (i - startx - 1) * av.charWidth, y);
- maxX = (i - startx + 1) * av.charWidth + fm.stringWidth(string);
+ gg.drawString(string, (i - startx - 1) * avCharWidth, y);
+ maxX = (i - startx + 1) * avCharWidth + fm.stringWidth(string);
}
- gg.drawLine(
- ((i - startx - 1) * av.charWidth) + (av.charWidth / 2),
+ gg.drawLine(((i - startx - 1) * avCharWidth) + (avCharWidth / 2),
y + 2,
- ((i - startx - 1) * av.charWidth) + (av.charWidth / 2),
- y + (fm.getDescent() * 2));
-
+ ((i - startx - 1) * avCharWidth) + (avCharWidth / 2), y
+ + (fm.getDescent() * 2));
}
else
{
- gg.drawLine(
- ((i - startx - 1) * av.charWidth) + (av.charWidth / 2),
- y + fm.getDescent(),
- ((i - startx - 1) * av.charWidth) + (av.charWidth / 2),
- y + (fm.getDescent() * 2));
+ gg.drawLine(((i - startx - 1) * avCharWidth) + (avCharWidth / 2), y
+ + fm.getDescent(), ((i - startx - 1) * avCharWidth)
+ + (avCharWidth / 2), y + (fm.getDescent() * 2));
}
}
continue;
}
- gg.fillPolygon(new int[]
- { res * av.charWidth - av.charHeight / 4,
- res * av.charWidth + av.charHeight / 4, res * av.charWidth },
- new int[]
- { y - av.charHeight / 2, y - av.charHeight / 2, y + 8 },
- 3);
+ gg.fillPolygon(new int[] { res * avCharWidth - avCharHeight / 4,
+ res * avCharWidth + avCharHeight / 4, res * avCharWidth },
+ new int[] { y - avCharHeight / 2, y - avCharHeight / 2,
+ y + 8 }, 3);
}
}
if (reveal != null && reveal[0] > startx && reveal[0] < endx)
{
gg.drawString(MessageManager.getString("label.reveal_columns"),
- reveal[0] * av.charWidth, 0);
+ reveal[0] * avCharWidth, 0);
}
}