79 |
pages = new SpanPage[sp.length()]; |
pages = new SpanPage[sp.length()]; |
80 |
} |
} |
81 |
SpanPage getPage(int i) { |
SpanPage getPage(int i) { |
82 |
pa("getPage: "+i+" "+pages.length); |
if(dbg) |
83 |
|
pa("getPage: "+i+" "+pages.length); |
84 |
if(i < 0 || i >= pages.length) return null; |
if(i < 0 || i >= pages.length) return null; |
85 |
if(pages[i] == null) { |
if(pages[i] == null) { |
86 |
pages[i] = new SpanPage(sb, i); |
pages[i] = new SpanPage(sb, i); |
87 |
pa("created: "+i); |
if(dbg) |
88 |
|
pa("created: "+i); |
89 |
} |
} |
90 |
pa("returning: "+pages[i]); |
if(dbg) |
91 |
|
pa("returning: "+pages[i]); |
92 |
return pages[i]; |
return pages[i]; |
93 |
} |
} |
94 |
} |
} |
147 |
|
|
148 |
try { |
try { |
149 |
path = MipzipCache.getPageFiles(sb)[page]; |
path = MipzipCache.getPageFiles(sb)[page]; |
150 |
pa("Loading mipzip path: "+path); |
if(dbg) |
151 |
|
pa("Loading mipzip path: "+path); |
152 |
|
|
153 |
l = new MipzipLoader(new File(path)); |
l = new MipzipLoader(new File(path)); |
154 |
} catch(IOException e) { |
} catch(IOException e) { |
220 |
* @param pixScale The number of pixels per imagespan unit: the resolution needed. |
* @param pixScale The number of pixels per imagespan unit: the resolution needed. |
221 |
*/ |
*/ |
222 |
public static SpanRect getSpanRect(PageImageSpan sp) { |
public static SpanRect getSpanRect(PageImageSpan sp) { |
223 |
pa("getSpanRect: "+sp+" "+sp.getPageIndex()); |
if(dbg) |
224 |
|
pa("getSpanRect: "+sp+" "+sp.getPageIndex()); |
225 |
SpanRect r = (SpanRect)span2rect.get(sp); |
SpanRect r = (SpanRect)span2rect.get(sp); |
226 |
if(r == null) { |
if(r == null) { |
227 |
PageImageScroll sb = (PageImageScroll)sp.getScrollBlock(); |
PageImageScroll sb = (PageImageScroll)sp.getScrollBlock(); |