Top Inners Fields Constructors Methods
org.apache.pdfbox.debugger.ui

public final Class ZoomMenu

extends MenuBase
Class Inheritance
Imports
java.awt.Component, java.util.Arrays, javax.swing.ButtonGroup, .JMenu, .JRadioButtonMenuItem

Author
Khyrul Bashar A singleton class that provides zoom menu which can be used to show zoom menu in the menubar. To act upon the menu item selection user of the class must add ActionListener which will check for the action command and act accordingly.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class

Field Summary

Modifier and TypeField and Description
private float
private static ZoomMenu
private float
private static final int[]

Constructor Summary

AccessConstructor and Description
private
ZoomMenu()

Constructor.

Method Summary

Modifier and TypeMethod and Description
public void
changeZoomSelection(float
the zoom factor, e.g. 1, 0.25, 4.
zoomValue
)

Set the zoom selection.

public float
public static ZoomMenu

Returns:

ZoomMenu instance.
getInstance
()

Provides the ZoomMenu instance.

public float
public static float

Returns:

the current zoom scale.
getZoomScale
()

Tell the current zoom scale.

public static boolean

Returns:

true if the command is a zoom menu command, e.g. "100%", false if not.
isZoomMenu
(String
a menu command string.
actionCommand
)

Tell whether the command belongs to the zoom menu.

public void
resetZoom()

When a new file is loaded zoom values should be reset.

public void
setImageZoomScale(float imageZoomValue)

public void
setPageZoomScale(float pageZoomValue)

Inherited from org.apache.pdfbox.debugger.ui.MenuBase:
addMenuListenersgetMenusetEnableMenusetMenu

Field Detail

imageZoomScaleback to summary
private float imageZoomScale
instanceback to summary
private static ZoomMenu instance
pageZoomScaleback to summary
private float pageZoomScale
ZOOMSback to summary
private static final int[] ZOOMS

Constructor Detail

ZoomMenuback to summary
private ZoomMenu()

Constructor.

Method Detail

changeZoomSelectionback to summary
public void changeZoomSelection(float zoomValue)

Set the zoom selection.

Parameters
zoomValue:float

the zoom factor, e.g. 1, 0.25, 4.

Exceptions
IllegalArgumentException:
if the parameter doesn't belong to a zoom menu item.
getImageZoomScaleback to summary
public float getImageZoomScale()
getInstanceback to summary
public static ZoomMenu getInstance()

Provides the ZoomMenu instance.

Returns:ZoomMenu

ZoomMenu instance.

getPageZoomScaleback to summary
public float getPageZoomScale()
getZoomScaleback to summary
public static float getZoomScale()

Tell the current zoom scale.

Returns:float

the current zoom scale.

Exceptions
IllegalStateException:
if no zoom menu item is selected.
isZoomMenuback to summary
public static boolean isZoomMenu(String actionCommand)

Tell whether the command belongs to the zoom menu.

Parameters
actionCommand:String

a menu command string.

Returns:boolean

true if the command is a zoom menu command, e.g. "100%", false if not.

resetZoomback to summary
public void resetZoom()

When a new file is loaded zoom values should be reset.

setImageZoomScaleback to summary
public void setImageZoomScale(float imageZoomValue)
setPageZoomScaleback to summary
public void setPageZoomScale(float pageZoomValue)
org.apache.pdfbox.debugger.ui back to summary

private Class ZoomMenu.ZoomMenuItem

extends JRadioButtonMenuItem
Class Inheritance
Annotations
@SuppressWarnings:squid:MaximumInheritanceDepth

Field Summary

Modifier and TypeField and Description
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
ZoomMenuItem(String text, int zoom)

Method Summary

Inherited from javax.swing.JRadioButtonMenuItem:
getAccessibleContextgetUIClassIDparamString

Field Detail

zoomback to summary
private final int zoom

Constructor Detail

ZoomMenuItemback to summary
pack-priv ZoomMenuItem(String text, int zoom)