|
Lines 42-48
Link Here
|
| 42 |
* several tiles and updating each tile individually. |
42 |
* several tiles and updating each tile individually. |
| 43 |
*/ |
43 |
*/ |
| 44 |
class ThumbnailUpdater implements Runnable { |
44 |
class ThumbnailUpdater implements Runnable { |
| 45 |
static final int MAX_BUFFER_SIZE = 256; |
45 |
private static final int NUMBER_OF_TILES = 16; |
|
|
46 |
int maxHBufferSize = 256, maxVBufferSize = 256; |
| 46 |
private int currentHTile, currentVTile; |
47 |
private int currentHTile, currentVTile; |
| 47 |
private int hTiles, vTiles; |
48 |
private int hTiles, vTiles; |
| 48 |
private boolean isActive = true; |
49 |
private boolean isActive = true; |
|
Lines 109-122
Link Here
|
| 109 |
* tile size and current tile index. |
110 |
* tile size and current tile index. |
| 110 |
*/ |
111 |
*/ |
| 111 |
public void resetTileValues() { |
112 |
public void resetTileValues() { |
|
|
113 |
maxHBufferSize = Math.max(1, getSourceRectangle().width |
| 114 |
/ NUMBER_OF_TILES); |
| 115 |
maxVBufferSize = Math.max(1, getSourceRectangle().width |
| 116 |
/ NUMBER_OF_TILES); |
| 117 |
|
| 112 |
hTiles = (int) Math.ceil((float) getSourceRectangle().width |
118 |
hTiles = (int) Math.ceil((float) getSourceRectangle().width |
| 113 |
/ (float) MAX_BUFFER_SIZE); |
119 |
/ (float) maxHBufferSize); |
| 114 |
vTiles = (int) Math.ceil((float) getSourceRectangle().height |
120 |
vTiles = (int) Math.ceil((float) getSourceRectangle().height |
| 115 |
/ (float) MAX_BUFFER_SIZE); |
121 |
/ (float) maxVBufferSize); |
| 116 |
|
122 |
|
| 117 |
tileSize = new Dimension( |
123 |
tileSize = new Dimension((int) Math |
| 118 |
(int) Math.ceil((float) getSourceRectangle().width |
124 |
.ceil((float) getSourceRectangle().width / (float) hTiles), |
| 119 |
/ (float) hTiles), |
|
|
| 120 |
(int) Math.ceil((float) getSourceRectangle().height |
125 |
(int) Math.ceil((float) getSourceRectangle().height |
| 121 |
/ (float) vTiles)); |
126 |
/ (float) vTiles)); |
| 122 |
|
127 |
|