public final class ZoomMenu extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
ZOOM_100_PERCENT |
| Modifier and Type | Method and Description |
|---|---|
void |
addMenuListeners(ActionListener listener)
Add the ActionListener for the menuitems.
|
static ZoomMenu |
getInstance()
Provides the ZoomMenu instance.
|
JMenu |
getMenu()
Provide the JMenu instance of the ZoomMenu.
|
static float |
getZoomScale()
Tell the current zoom scale.
|
static boolean |
isZoomMenu(String actionCommand)
Tell whether the command belongs to the zoom menu.
|
void |
setEnableMenu(boolean isEnable)
Set if the menu should be enabled or disabled.
|
protected void |
setMenu(JMenu menu) |
void |
setZoomSelection(String selection)
Set the zoom selection.
|
public static final String ZOOM_100_PERCENT
public static ZoomMenu getInstance()
public void setZoomSelection(String selection)
selection - zoom menu string, e.g. "100%".IllegalArgumentException - if the parameter doesn't belong to a zoom menu item.public static boolean isZoomMenu(String actionCommand)
actionCommand - a menu command string.public static float getZoomScale()
IllegalStateException - if no zoom menu item is selected.protected void setMenu(JMenu menu)
public JMenu getMenu()
public void setEnableMenu(boolean isEnable)
isEnable - boolean instance.public void addMenuListeners(ActionListener listener)
listener - ActionListener.Copyright © 2002–2016 The Apache Software Foundation. All rights reserved.