43 public class MultipleSelectionHelper { 44 45 public Point focus = new Point(-1, 0); 46 public Point anchor = null; 47 public boolean multiple = false; 48 public boolean singleCell = false; 49 public Collection<Point> selectedSet = new ArrayList<Point>(); 50 public int rows; 51 public int columns; 52 public int pageHeight = -1; 53 public int pageWidth = -1; 54 public boolean ctrlA = false; 55 public int topVisible = -1; 56 public int bottomVisible = -1; 57 58 public MultipleSelectionHelper(int columns, int rows) { 59 this.rows = rows; 60 this.columns = columns; 61 } 62 63 /** 64 * ALARM: must be called before pushing key combination, from code, which 65 * knows, how to understand, which area is visible now. And this visible 66 * area must be passed as argument. 67 * 68 * @param area - range [begin, end] - current fully visible range of lines. 69 * Checks, that begin <= end. 70 */ 71 public void setVisibleRange(Range area) { 72 Assert.assertTrue(area.begin <= area.end); 73 this.topVisible = area.begin; 74 this.bottomVisible = area.end; 75 this.pageHeight = this.bottomVisible - this.topVisible + 1; 76 } 77 78 public void setPageHeight(int height) { 79 this.pageHeight = height; 80 } 81 82 public void setPageWidth(int width) { | 43 public class MultipleSelectionHelper { 44 45 public Point focus = new Point(-1, 0); 46 public Point anchor = null; 47 public boolean multiple = false; 48 public boolean singleCell = false; 49 public Collection<Point> selectedSet = new ArrayList<Point>(); 50 public int rows; 51 public int columns; 52 public int pageHeight = -1; 53 public int pageWidth = -1; 54 public boolean ctrlA = false; 55 public int topVisible = -1; 56 public int bottomVisible = -1; 57 58 public MultipleSelectionHelper(int columns, int rows) { 59 this.rows = rows; 60 this.columns = columns; 61 } 62 63 public void setColumnsNum(int columns) { 64 this.columns = columns; 65 } 66 67 public void setRowsNum(int rows) { 68 this.rows = rows; 69 } 70 71 /** 72 * ALARM: must be called before pushing key combination, from code, which 73 * knows, how to understand, which area is visible now. And this visible 74 * area must be passed as argument. 75 * 76 * @param area - range [begin, end] - current fully visible range of lines. 77 * Checks, that begin <= end. 78 */ 79 public void setVisibleRange(Range area) { 80 Assert.assertTrue(area.begin <= area.end); 81 this.topVisible = area.begin; 82 this.bottomVisible = area.end; 83 this.pageHeight = this.bottomVisible - this.topVisible + 1; 84 } 85 86 public void setPageHeight(int height) { 87 this.pageHeight = height; 88 } 89 90 public void setPageWidth(int width) { |