Class PageNumber
- java.lang.Object
-
- org.faceless.pdf2.viewer2.ViewerFeature
-
- org.faceless.pdf2.viewer2.ViewerWidget
-
- org.faceless.pdf2.viewer2.feature.NavigationWidget
-
- org.faceless.pdf2.viewer2.feature.PageNumber
-
- All Implemented Interfaces:
PropertyChangeListener
,EventListener
,DocumentPanelListener
public class PageNumber extends NavigationWidget
Create a widget that displays the current page number, and allows the user to enter a new pagenumber for display.The following initialization parameters can be specified to configure this feature.The name of this feature is PageNumberusePageLabels If true (the default), display the page label
for the selected page if specified. If false, display the physical page number (the default behaviour prior to 2.11.19).alignment Can be set to "right", "center" or "left" (the default) to position the page number in the box This code is copyright the Big Faceless Organization. You're welcome to use, modify and distribute it in any form in your own projects, provided those projects continue to make use of the Big Faceless PDF library.
- Since:
- 2.8
-
-
Field Summary
-
Fields inherited from class org.faceless.pdf2.viewer2.feature.NavigationWidget
docpanel, pdf
-
Fields inherited from class org.faceless.pdf2.viewer2.ViewerWidget
propertyChangeSupport
-
-
Constructor Summary
Constructors Constructor Description PageNumber()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
documentUpdated(DocumentPanelEvent event)
Called when anDocumentPanelEvent
is raisedvoid
initialize(PDFViewer viewer)
Called when the feature is first added to a viewerprotected void
pageChanged()
void
propertyChange(PropertyChangeEvent event)
void
setUsePageLabels(boolean uselabels)
Set whether to display the "page labels" if defined on this PDF, or whether to always display the physical page number.-
Methods inherited from class org.faceless.pdf2.viewer2.ViewerWidget
action, addPropertyChangeListener, createActionListener, firePropertyChange, getComponent, getIcon, getViewer, isButtonEnabledByDefault, isDocumentRequired, isMenuEnabledByDefault, removePropertyChangeListener, setButton, setComponent, setDocumentRequired, setMenu, setMenu, setToolBarEnabled, setToolBarEnabledAlways, setToolBarFloatable, setToolBarFloating, toString
-
Methods inherited from class org.faceless.pdf2.viewer2.ViewerFeature
getAllEnabledFeatures, getAllFeatures, getCustomJavaScript, getFeatureProperty, getFeatureURLProperty, getName, isEnabledByDefault, setFeatureName, teardown
-
-
-
-
Method Detail
-
initialize
public void initialize(PDFViewer viewer)
Description copied from class:ViewerFeature
Called when the feature is first added to a viewer- Overrides:
initialize
in classNavigationWidget
-
setUsePageLabels
public void setUsePageLabels(boolean uselabels)
Set whether to display the "page labels" if defined on this PDF, or whether to always display the physical page number.- Parameters:
uselabels
- if true, use the page labels if defined, otherwise use the physical page number- Since:
- 2.11.19
- See Also:
PDF.getPageLabel(int)
,ThumbnailPanel.setUsePageLabels(boolean)
-
documentUpdated
public void documentUpdated(DocumentPanelEvent event)
Description copied from interface:DocumentPanelListener
Called when anDocumentPanelEvent
is raised- Specified by:
documentUpdated
in interfaceDocumentPanelListener
- Overrides:
documentUpdated
in classNavigationWidget
-
propertyChange
public void propertyChange(PropertyChangeEvent event)
- Specified by:
propertyChange
in interfacePropertyChangeListener
- Overrides:
propertyChange
in classNavigationWidget
-
pageChanged
protected void pageChanged()
- Specified by:
pageChanged
in classNavigationWidget
-
-