Package org.jmol.popup
Class GenericPopup
java.lang.Object
org.jmol.popup.GenericPopup
- All Implemented Interfaces:
GenericMenuInterface
- Direct Known Subclasses:
JmolGenericPopup
,JSVGenericPopup
The overall parent of all popup classes in Jmol and JSmol.
Contains methods and fields common to the "SwingComponent" SC class,
which allows for both JavaScript (org.jmol.awtjs.swing) and Java (java.awt) components.
This solution predates Jmol-SwingJS by about six years (2012 vs. 2018)
abstract GenericPopop -- abstract JmolGenericPopup -- abstract JmolPopup -- AwtJmolPopup -- JSJmolPopup -- abstract ModelKitPopup -- AwtModelKitPopup -- JSModelKitPopup -- abstract JSVGenericPopup -- AwtPopup -- JsPopup
- Author:
- Bob Hanson
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected void
protected SC
addMenuItem
(SC menuItem, String entry) void
addMenuItems
(String parentId, String key, SC menu, PopupResource popupResourceBundle) protected void
appCheckItem
(String item, SC newMenu) Opportunity to do something special with an item.void
appCheckSpecialMenu
(String item, SC subMenu, String word) Opportunity to do something special with a given submenu is createdprotected abstract String
appFixLabel
(String label) protected abstract boolean
appGetBooleanProperty
(String name) protected String
appGetMenuAsString
(String title) protected abstract void
protected abstract void
appRunScript
(String script) protected abstract boolean
appRunSpecialCheckBox
(SC item, String basename, String what, boolean TF) protected abstract void
protected abstract void
appUpdateSpecialCheckBoxValue
(SC source, String actionCommand, boolean selected) protected static int
convertToMegabytes
(long num) protected void
doMenuCheckBoxCallback
(SC source) protected void
doMenuClickCallback
(SC source, String script) protected Object
getEntryIcon
(String[] ret) protected abstract Object
getImageIcon
(String fileName) protected abstract String
getScriptForCallback
(SC source, String name, String script) protected abstract String
getUnknownCheckBoxScriptToRun
(SC item, String name, String what, boolean TF) protected void
initSwing
(String title, PopupResource bundle, Object applet, boolean isJS, boolean isSigned, boolean isWebGL) void
jpiGetMenuAsString
(String title) protected void
menuAddSeparator
(SC menu) protected void
menuAddSubMenu
(SC menu, SC subMenu) void
menuCheckBoxCallback
(SC source) void
menuClickCallback
(SC source, String script) protected SC
menuCreateCheckboxItem
(SC menu, String entry, String basename, String id, boolean state, boolean isRadio) protected SC
menuCreateItem
(SC menu, String entry, String script, String id) protected void
menuEnable
(SC component, boolean enable) abstract void
menuFocusCallback
(String name, String actionCommand, boolean gained) protected String
protected int
menuGetListPosition
(SC item) protected SC
menuNewSubMenu
(String entry, String id) protected void
menuRemoveAll
(SC menu, int indexFrom) protected void
menuSetAutoscrolls
(SC menu) protected void
menuSetLabel
(SC m, String entry) protected abstract void
menuShowPopup
(SC popup, int x, int y) protected SC
protected void
show
(int x, int y, boolean doPopup) protected void
updateButton
(SC b, String entry, String script) protected void
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.jmol.api.GenericMenuInterface
jpiGetMenuAsObject, jpiInitialize, jpiShow, jpiUpdateComputedMenus
-
Field Details
-
helper
-
strMenuStructure
-
allowSignedFeatures
protected boolean allowSignedFeatures -
isJS
protected boolean isJS -
isApplet
protected boolean isApplet -
isSigned
protected boolean isSigned -
isWebGL
protected boolean isWebGL -
thisx
public int thisx -
thisy
public int thisy -
isTainted
protected boolean isTainted -
popupMenu
-
thisPopup
-
htCheckbox
-
buttonGroup
-
currentMenuItemId
-
htMenus
-
updatingForShow
protected boolean updatingForShow
-
-
Constructor Details
-
GenericPopup
public GenericPopup()
-
-
Method Details
-
getImageIcon
-
getUnknownCheckBoxScriptToRun
-
appCheckItem
Opportunity to do something special with an item.- Parameters:
item
-newMenu
-
-
appCheckSpecialMenu
Opportunity to do something special with a given submenu is created- Parameters:
item
-subMenu
-word
-
-
appFixLabel
-
getScriptForCallback
-
appGetBooleanProperty
-
appRunSpecialCheckBox
-
appRestorePopupMenu
protected abstract void appRestorePopupMenu() -
appRunScript
-
appUpdateSpecialCheckBoxValue
-
appUpdateForShow
protected abstract void appUpdateForShow() -
initSwing
protected void initSwing(String title, PopupResource bundle, Object applet, boolean isJS, boolean isSigned, boolean isWebGL) -
addMenuItems
-
addMenu
protected void addMenu(String id, String item, SC subMenu, String label, PopupResource popupResourceBundle) -
updateSignedAppletItems
protected void updateSignedAppletItems() -
updateButton
-
getEntryIcon
-
addMenuItem
-
doMenuClickCallback
-
doMenuCheckBoxCallback
-
setText
-
show
protected void show(int x, int y, boolean doPopup) - Parameters:
x
-y
-doPopup
-
-
jpiGetMenuAsString
- Specified by:
jpiGetMenuAsString
in interfaceGenericMenuInterface
-
appGetMenuAsString
- Parameters:
title
-- Returns:
- null
-
convertToMegabytes
protected static int convertToMegabytes(long num) -
jpiDispose
public void jpiDispose()- Specified by:
jpiDispose
in interfaceGenericMenuInterface
-