@Test public void testRowMajor() throws Exception { FixedTableModel model = new FixedTableModel(300, 500, TableOrder.ROW_MAJOR); RectF tableRect = new RectF(0, 0, 1000, 2000); Iterator<RectF> it = model.getIterator(tableRect, 5); assertTrue(it.hasNext()); RectF cellRect = it.next(); assertEquals(0f, cellRect.left); assertEquals(0f, cellRect.top); assertEquals(300f, cellRect.right); assertEquals(500f, cellRect.bottom); assertTrue(it.hasNext()); cellRect = it.next(); assertEquals(0f, cellRect.left); assertEquals(500f, cellRect.top); assertEquals(300f, cellRect.right); assertEquals(1000f, cellRect.bottom); assertTrue(it.hasNext()); cellRect = it.next(); assertEquals(0f, cellRect.left); assertEquals(1000f, cellRect.top); assertEquals(300f, cellRect.right); assertEquals(1500f, cellRect.bottom); assertTrue(it.hasNext()); cellRect = it.next(); assertEquals(0f, cellRect.left); assertEquals(1500f, cellRect.top); assertEquals(300f, cellRect.right); assertEquals(2000f, cellRect.bottom); assertTrue(it.hasNext()); cellRect = it.next(); assertEquals(300f, cellRect.left); assertEquals(0f, cellRect.top); assertEquals(600f, cellRect.right); assertEquals(500f, cellRect.bottom); }
@Override public Iterator<RectF> getIterator(RectF tableRect, int totalElements) { return new FixedTableModelIterator(this, tableRect, totalElements); }
FixedTableModel extends TableModel { @Override public Iterator<RectF> getIterator(RectF tableRect, int totalElements) { return new FixedTableModelIterator(this, tableRect, totalElements); } }
FixedTableModel extends TableModel { @Override public Iterator<RectF> getIterator(RectF tableRect, int totalElements) { return new FixedTableModelIterator(this, tableRect, totalElements); } FixedTableModel(float cellWidth, float cellHeight, TableOrder order); }
FixedTableModel extends TableModel { @Override public Iterator<RectF> getIterator(RectF tableRect, int totalElements) { return new FixedTableModelIterator(this, tableRect, totalElements); } FixedTableModel(float cellWidth, float cellHeight, TableOrder order); @Override Iterator<RectF> getIterator(RectF tableRect, int totalElements); float getCellWidth(); void setCellWidth(float cellWidth); float getCellHeight(); void setCellHeight(float cellHeight); }
FixedTableModel extends TableModel { @Override public Iterator<RectF> getIterator(RectF tableRect, int totalElements) { return new FixedTableModelIterator(this, tableRect, totalElements); } FixedTableModel(float cellWidth, float cellHeight, TableOrder order); @Override Iterator<RectF> getIterator(RectF tableRect, int totalElements); float getCellWidth(); void setCellWidth(float cellWidth); float getCellHeight(); void setCellHeight(float cellHeight);  }