summaryrefslogtreecommitdiff
path: root/platform/java/example/Viewer.java
diff options
context:
space:
mode:
Diffstat (limited to 'platform/java/example/Viewer.java')
-rw-r--r--platform/java/example/Viewer.java10
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();
}