Package org.apache.pdfbox.debugger.ui
Class ZoomMenu
- java.lang.Object
-
- org.apache.pdfbox.debugger.ui.MenuBase
-
- org.apache.pdfbox.debugger.ui.ZoomMenu
-
public final class ZoomMenu extends MenuBase
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description private static classZoomMenu.ZoomMenuItem
-
Field Summary
Fields Modifier and Type Field Description private floatimageZoomScaleprivate static ZoomMenuinstanceprivate javax.swing.JMenumenuprivate floatpageZoomScaleprivate static int[]ZOOMS
-
Constructor Summary
Constructors Modifier Constructor Description privateZoomMenu()Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidchangeZoomSelection(float zoomValue)Set the zoom selection.floatgetImageZoomScale()static ZoomMenugetInstance()Provides the ZoomMenu instance.floatgetPageZoomScale()static floatgetZoomScale()Tell the current zoom scale.static booleanisZoomMenu(java.lang.String actionCommand)Tell whether the command belongs to the zoom menu.voidresetZoom()When a new file is loaded zoom values should be reset.voidsetImageZoomScale(float imageZoomValue)voidsetPageZoomScale(float pageZoomValue)-
Methods inherited from class org.apache.pdfbox.debugger.ui.MenuBase
addMenuListeners, getMenu, setEnableMenu, setMenu
-
-
-
-
Field Detail
-
pageZoomScale
private float pageZoomScale
-
imageZoomScale
private float imageZoomScale
-
ZOOMS
private static final int[] ZOOMS
-
instance
private static ZoomMenu instance
-
menu
private final javax.swing.JMenu menu
-
-
Method Detail
-
getInstance
public static ZoomMenu getInstance()
Provides the ZoomMenu instance.- Returns:
- ZoomMenu instance.
-
changeZoomSelection
public void changeZoomSelection(float zoomValue)
Set the zoom selection.- Parameters:
zoomValue- the zoom factor, e.g. 1, 0.25, 4.- Throws:
java.lang.IllegalArgumentException- if the parameter doesn't belong to a zoom menu item.
-
isZoomMenu
public static boolean isZoomMenu(java.lang.String actionCommand)
Tell whether the command belongs to the zoom menu.- Parameters:
actionCommand- a menu command string.- Returns:
- true if the command is a zoom menu command, e.g. "100%", false if not.
-
getZoomScale
public static float getZoomScale()
Tell the current zoom scale.- Returns:
- the current zoom scale.
- Throws:
java.lang.IllegalStateException- if no zoom menu item is selected.
-
getPageZoomScale
public float getPageZoomScale()
-
setPageZoomScale
public void setPageZoomScale(float pageZoomValue)
-
getImageZoomScale
public float getImageZoomScale()
-
setImageZoomScale
public void setImageZoomScale(float imageZoomValue)
-
resetZoom
public void resetZoom()
When a new file is loaded zoom values should be reset.
-
-