Package org.jmol.popup
Class GenericPopup
java.lang.Object
org.jmol.popup.GenericPopup
- All Implemented Interfaces:
GenericMenuInterface
- Direct Known Subclasses:
JmolGenericPopup
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 TypeMethodDescriptionprivate static voidaddItemText(javajs.util.SB sb, char type, int level, String name, String label, String script, String flags) protected voidprotected SCaddMenuItem(SC menuItem, String entry) voidaddMenuItems(String parentId, String key, SC menu, PopupResource popupResourceBundle) protected voidappCheckItem(String item, SC newMenu) Opportunity to do something special with an item.voidappCheckSpecialMenu(String item, SC subMenu, String word) Opportunity to do something special with a given submenu is createdprotected abstract StringappFixLabel(String label) protected abstract booleanappGetBooleanProperty(String name) protected StringappGetMenuAsString(String title) protected abstract voidprotected abstract voidappRunScript(String script) protected abstract booleanappRunSpecialCheckBox(SC item, String basename, String what, boolean TF) protected abstract voidprotected abstract voidappUpdateSpecialCheckBoxValue(SC source, String actionCommand, boolean selected) private booleanprotected static intconvertToMegabytes(long num) protected voiddoMenuCheckBoxCallback(SC source) protected voiddoMenuClickCallback(SC source, String script) protected ObjectgetEntryIcon(String[] ret) protected abstract ObjectgetImageIcon(String fileName) protected abstract StringgetScriptForCallback(SC source, String name, String script) protected abstract StringgetUnknownCheckBoxScriptToRun(SC item, String name, String what, boolean TF) protected voidinitSwing(String title, PopupResource bundle, Object applet, boolean isJS, boolean isSigned, boolean isWebGL) voidjpiGetMenuAsString(String title) private voidmenuAddItem(SC menu, SC item) protected voidmenuAddSeparator(SC menu) protected voidmenuAddSubMenu(SC menu, SC subMenu) voidmenuCheckBoxCallback(SC source) voidmenuClickCallback(SC source, String script) protected SCmenuCreateCheckboxItem(SC menu, String entry, String basename, String id, boolean state, boolean isRadio) protected SCmenuCreateItem(SC menu, String entry, String script, String id) protected voidmenuEnable(SC component, boolean enable) abstract voidmenuFocusCallback(String name, String actionCommand, boolean gained) private voidmenuGetAsText(javajs.util.SB sb, int level, SC menu, String menuName) protected Stringprotected intmenuGetListPosition(SC item) protected SCmenuNewSubMenu(String entry, String id) protected voidmenuRemoveAll(SC menu, int indexFrom) protected voidmenuSetAutoscrolls(SC menu) protected voidmenuSetLabel(SC m, String entry) protected abstract voidmenuShowPopup(SC popup, int x, int y) private SCprivate voidrememberCheckbox(String key, SC checkboxMenuItem) private voidrunCheckBoxScript(SC item, String what, boolean TF) protected SCprotected voidshow(int x, int y, boolean doPopup) protected voidupdateButton(SC b, String entry, String script) private voidprotected voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods 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
-
SignedOnly
-
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() -
checkKey
- Parameters:
key-- Returns:
- true unless a JAVA-only key in JavaScript
-
rememberCheckbox
-
updateButton
-
getEntryIcon
-
addMenuItem
-
doMenuClickCallback
-
doMenuCheckBoxCallback
-
runCheckBoxScript
-
newMenuItem
-
setText
-
show
protected void show(int x, int y, boolean doPopup) - Parameters:
x-y-doPopup-
-
updateCheckBoxesForShow
private void updateCheckBoxesForShow() -
jpiGetMenuAsString
- Specified by:
jpiGetMenuAsStringin interfaceGenericMenuInterface
-
appGetMenuAsString
- Parameters:
title-- Returns:
- null
-
addItemText
-
convertToMegabytes
protected static int convertToMegabytes(long num) -
jpiDispose
public void jpiDispose()- Specified by:
jpiDisposein interfaceGenericMenuInterface
-