MCPcopy Create free account
hub / github.com/ArtifexSoftware/mupdf / relayoutDocument

Method relayoutDocument

platform/java/example/ViewerCore.java:234–262  ·  view source on GitHub ↗
(final int width, final int height, final int em, final OnException onException)

Source from the content-addressed store, hash-verified

232 }
233
234 public void relayoutDocument(final int width, final int height, final int em, final OnException onException) {
235 worker.add(new Worker.Task() {
236 int chapterCount = 0;
237 int pageCount = 0;
238 Location newPage;
239 public void work() {
240 long mark = doc.makeBookmark(ViewerCore.this.currentPage);
241 doc.layout(width, height, em);
242 chapterCount = doc.countChapters();
243 pageCount = doc.countPages();
244 newPage = doc.findBookmark(mark);
245 }
246 public void run() {
247 callback.onLayoutChange(width, height, em);
248 callback.onChapterCountChange(chapterCount);
249 callback.onPageCountChange(pageCount);
250 gotoLocation(newPage, onException);
251 loadOutline(onException);
252 }
253 public void exception(Throwable t) {
254 callback.onLayoutChange(450, 600, 12);
255 callback.onChapterCountChange(0);
256 callback.onPageCountChange(0);
257 gotoLocation(null, onException);
258 if (onException != null)
259 onException.run(t);
260 }
261 });
262 }
263
264 protected void loadOutline(final OnException onException) {
265 worker.add(new Worker.Task() {

Callers 1

relayoutMethod · 0.80

Calls 1

addMethod · 0.45

Tested by

no test coverage detected