+/*
+ * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
+ * Copyright (C) $$Year-Rel$$ The Jalview Authors
+ *
+ * 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
+ * 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
+ * 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/>.
+ * The Jalview Authors are detailed in the 'AUTHORS' file.
+ */
package jalview.viewmodel;
import jalview.api.AlignmentColsCollectionI;
public abstract class OverviewDimensions
{
-
- private static final int DEFAULT_GRAPH_HEIGHT = 20;
protected static final int MAX_WIDTH = 400;
protected static final int MIN_WIDTH = 120;
protected static final int MIN_SEQ_HEIGHT = 40;
protected static final int MAX_SEQ_HEIGHT = 300;
+
+ private static final int DEFAULT_GRAPH_HEIGHT = 20;
+
protected int width;
protected int sequencesHeight;
protected int graphHeight = DEFAULT_GRAPH_HEIGHT;
protected int boxHeight = -1;
protected int scrollCol = -1;
protected int scrollRow = -1;
-
protected int alwidth;
-
protected int alheight;
public OverviewDimensions(ViewportRanges ranges,
sequencesHeight = h - graphHeight;
}
+ /**
+ * Update the viewport location from a mouse click in the overview panel
+ *
+ * @param mousex
+ * x location of mouse
+ * @param mousey
+ * y location of mouse
+ * @param hiddenSeqs
+ * the alignment's hidden sequences
+ * @param hiddenCols
+ * the alignment's hidden columns
+ * @param ranges
+ * the alignment's width and height ranges
+ */
public abstract void updateViewportFromMouse(int mousex, int mousey,
HiddenSequences hiddenSeqs, ColumnSelection hiddenCols,
ViewportRanges ranges);
+ /**
+ * Set the overview panel's box position to match the viewport
+ *
+ * @param hiddenSeqs
+ * the alignment's hidden sequences
+ * @param hiddenCols
+ * the alignment's hidden columns
+ * @param ranges
+ * the alignment's width and height ranges
+ */
public abstract void setBoxPosition(HiddenSequences hiddenSeqs,
ColumnSelection hiddenCols, ViewportRanges ranges);
+ /**
+ * Get the collection of columns used by this overview dimensions object
+ *
+ * @param ranges
+ * the alignment's width and height ranges
+ * @param hiddenCols
+ * the alignment's hidden columns
+ * @return a column collection
+ */
public abstract AlignmentColsCollectionI getColumns(
ViewportRanges ranges, ColumnSelection hiddenCols);
+ /**
+ * Get the collection of rows used by this overview dimensions object
+ *
+ * @param ranges
+ * the alignment's width and height ranges
+ * @param al
+ * the alignment
+ * @return a row collection
+ */
public abstract AlignmentRowsCollectionI getRows(
ViewportRanges ranges, AlignmentI al);
}
\ No newline at end of file