diff options
author | fred ross-perry <fredross-perry@Fred-Ross-Perrys-Computer.local> | 2016-07-14 16:14:21 -0700 |
---|---|---|
committer | fred ross-perry <fred.ross-perry@artifex.com> | 2016-07-15 10:08:57 -0700 |
commit | 6fb868c1cdbae2864f1ad866f6c9422153dbd031 (patch) | |
tree | 08ef496983c863e2fcaace5ad404182a44d50db6 /platform/java/example/Viewer.java | |
parent | cb78b5c6782f14a699f90bd5621cd3656a1e02ea (diff) | |
download | mupdf-6fb868c1cdbae2864f1ad866f6c9422153dbd031.tar.xz |
android desktop view - add a button to toggle annotations on/off.
Diffstat (limited to 'platform/java/example/Viewer.java')
-rw-r--r-- | platform/java/example/Viewer.java | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/platform/java/example/Viewer.java b/platform/java/example/Viewer.java index d70a82e3..abd13067 100644 --- a/platform/java/example/Viewer.java +++ b/platform/java/example/Viewer.java @@ -29,7 +29,7 @@ public class Viewer extends Frame implements WindowListener, ActionListener protected Panel toolbar; protected PageCanvas pageCanvas; protected Label pageLabel; - protected Button firstButton, prevButton, nextButton, lastButton, zoomInButton, zoomOutButton, fontIncButton, fontDecButton; + protected Button firstButton, prevButton, nextButton, lastButton, zoomInButton, zoomOutButton, fontIncButton, fontDecButton, toggleAnnotsButton; protected int pageCount; protected int pageNumber; protected int layoutWidth; @@ -70,6 +70,9 @@ public class Viewer extends Frame implements WindowListener, ActionListener zoomOutButton = new Button("-"); zoomOutButton.addActionListener(this); + toggleAnnotsButton = new Button("toggle annots"); + toggleAnnotsButton.addActionListener(this); + if (doc.isReflowable()) { fontIncButton = new Button("FONT"); fontIncButton.addActionListener(this); @@ -85,6 +88,7 @@ public class Viewer extends Frame implements WindowListener, ActionListener toolbar.add(lastButton); toolbar.add(zoomInButton); toolbar.add(zoomOutButton); + toolbar.add(toggleAnnotsButton); if (doc.isReflowable()) { toolbar.add(fontIncButton); toolbar.add(fontDecButton); @@ -147,6 +151,10 @@ public class Viewer extends Frame implements WindowListener, ActionListener if (layoutEm != oldLayoutEm) doc.layout(layoutWidth, layoutHeight, layoutEm); + if (source == toggleAnnotsButton) { + pageCanvas.toggleAnnots(); + } + if (pageNumber != oldPageNumber || layoutEm != oldLayoutEm) stuff(); } |