ColumnSelection cs = MappingUtils.mapColumnSelection(colsel, sourceAv,
av);
av.setColumnSelection(cs);
- av.isColSelChanged(true);
ap.scalePanelHolder.repaint();
ap.repaint();
import javax.swing.ToolTipManager;
/**
- * DOCUMENT ME!
- *
- * @author $author$
- * @version $Revision$
+ * The panel containing the sequence ruler (when not in wrapped mode), and
+ * supports a range of mouse operations to select, hide or reveal columns.
*/
public class ScalePanel extends JPanel implements MouseMotionListener,
MouseListener
{
protected int offy = 4;
- /** DOCUMENT ME!! */
public int width;
protected AlignViewport av;
boolean stretchingGroup = false;
- int min; // used by mouseDragged to see if user
+ /*
+ * min, max hold the extent of a mouse drag action
+ */
+ int min;
- int max; // used by mouseDragged to see if user
+ int max;
boolean mouseDragging = false;
- // wants to delete columns
+ /*
+ * holds a hidden column range when the mouse is over an adjacent column
+ */
+ int[] reveal;
+
+ /**
+ * Constructor
+ *
+ * @param av
+ * @param ap
+ */
public ScalePanel(AlignViewport av, AlignmentPanel ap)
{
this.av = av;
@Override
public void mouseMoved(MouseEvent evt)
{
+ this.setToolTipText(null);
+ reveal = null;
if (!av.hasHiddenColumns())
{
return;
res = av.getColumnSelection().adjustForHiddenColumns(res);
- reveal = null;
if (av.getColumnSelection().getHiddenColumns() != null)
{
for (int[] region : av.getColumnSelection().getHiddenColumns())
.getString("label.reveal_hidden_columns"));
break;
}
- else
- {
- this.setToolTipText(null);
- }
}
}
repaint();
}
- int[] reveal;
-
/**
* DOCUMENT ME!
*
ColumnSelection cs = MappingUtils.mapColumnSelection(colsel, sourceAv,
av);
av.setColumnSelection(cs);
- av.isColSelChanged(true);
PaintRefresher.Refresh(this, av.getSequenceSetId());
{
updateHiddenColumns();
}
+ isColSelChanged(true);
}
/**
*/
public boolean isColSelChanged(boolean b)
{
- int hc = (colSel == null || colSel.isEmpty()) ? -1 : colSel
- .hashCode();
+ int hc = (colSel == null || colSel.isEmpty()) ? -1 : colSel.hashCode();
if (hc != -1 && hc != colselhash)
{
if (b)
colSel.hideSelectedColumns();
setSelectionGroup(null);
-
+ isColSelChanged(true);
}
public void hideColumns(int start, int end)
{
colSel.hideColumns(start, end);
}
+ isColSelChanged(true);
}
public void showColumn(int col)
{
colSel.revealHiddenColumns(col);
-
+ isColSelChanged(true);
}
public void showAllHiddenColumns()
{
colSel.revealAllHiddenColumns();
+ isColSelChanged(true);
}
// common hide/show seq stuff