Package org.jmol.popup
Class GenericPopup
- java.lang.Object
-
- org.jmol.popup.GenericPopup
-
- All Implemented Interfaces:
GenericMenuInterface
- Direct Known Subclasses:
JmolGenericPopup
public abstract class GenericPopup extends Object implements GenericMenuInterface
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 Modifier and Type Field Description protected booleanallowSignedFeaturesprotected ObjectbuttonGroupprotected StringcurrentMenuItemIdprotected PopupHelperhelperprotected Map<String,SC>htCheckboxprotected Map<String,SC>htMenusprotected booleanisAppletprotected booleanisJSprotected booleanisSignedprotected booleanisTaintedprotected booleanisWebGLprotected StringmenuNameprotected SCpopupMenuprivate javajs.util.Lst<SC>SignedOnlyprotected StringstrMenuStructureprotected SCthisPopupintthisxintthisyprotected booleanupdatingForShow
-
Constructor Summary
Constructors Constructor Description GenericPopup()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description private static voidaddItemText(javajs.util.SB sb, char type, int level, String name, String label, String script, String flags)protected SCaddMenuItem(SC menuItem, String entry)protected voidaddMenuItems(String parentId, String key, SC menu, PopupResource popupResourceBundle)protected voidappCheckItem(String item, SC newMenu)Opportunity to do something special with an item.protected 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 voidappRestorePopupMenu()protected abstract voidappRunScript(String script)protected abstract booleanappRunSpecialCheckBox(SC item, String basename, String what, boolean TF)protected abstract voidappUpdateForShow()protected abstract voidappUpdateSpecialCheckBoxValue(SC source, String actionCommand, boolean selected)private booleancheckKey(String key)protected 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)StringjpiGetMenuAsString(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 StringmenuGetId(SC menu)protected 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 SCnewMenuItem(SC item, SC menu, String text, String script, String id)private voidrememberCheckbox(String key, SC checkboxMenuItem)private voidrunCheckBoxScript(SC item, String what, boolean TF)protected SCsetText(String item, String text)protected voidshow(int x, int y, boolean doPopup)protected voidupdateButton(SC b, String entry, String script)private voidupdateCheckBoxesForShow()protected voidupdateSignedAppletItems()-
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
jpiDispose, jpiGetMenuAsObject, jpiInitialize, jpiShow, jpiUpdateComputedMenus
-
-
-
-
Field Detail
-
helper
protected PopupHelper helper
-
strMenuStructure
protected String 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
-
menuName
protected String menuName
-
popupMenu
protected SC popupMenu
-
thisPopup
protected SC thisPopup
-
buttonGroup
protected Object buttonGroup
-
currentMenuItemId
protected String currentMenuItemId
-
SignedOnly
private javajs.util.Lst<SC> SignedOnly
-
updatingForShow
protected boolean updatingForShow
-
-
Method Detail
-
menuShowPopup
protected abstract void menuShowPopup(SC popup, int x, int y)
-
getUnknownCheckBoxScriptToRun
protected abstract String getUnknownCheckBoxScriptToRun(SC item, String name, String what, boolean TF)
-
appCheckItem
protected void appCheckItem(String item, SC newMenu)
Opportunity to do something special with an item.- Parameters:
item-newMenu-
-
appCheckSpecialMenu
protected void appCheckSpecialMenu(String item, SC subMenu, String word)
Opportunity to do something special with a given submenu is created- Parameters:
item-subMenu-word-
-
getScriptForCallback
protected abstract String getScriptForCallback(SC source, String name, String script)
-
appGetBooleanProperty
protected abstract boolean appGetBooleanProperty(String name)
-
appRunSpecialCheckBox
protected abstract boolean appRunSpecialCheckBox(SC item, String basename, String what, boolean TF)
-
appRestorePopupMenu
protected abstract void appRestorePopupMenu()
-
appRunScript
protected abstract void appRunScript(String script)
-
appUpdateSpecialCheckBoxValue
protected abstract void appUpdateSpecialCheckBoxValue(SC source, String actionCommand, boolean selected)
-
appUpdateForShow
protected abstract void appUpdateForShow()
-
initSwing
protected void initSwing(String title, PopupResource bundle, Object applet, boolean isJS, boolean isSigned, boolean isWebGL)
-
addMenuItems
protected void addMenuItems(String parentId, String key, SC menu, PopupResource popupResourceBundle)
-
updateSignedAppletItems
protected void updateSignedAppletItems()
-
checkKey
private boolean checkKey(String key)
- Parameters:
key-- Returns:
- true unless a JAVA-only key in JavaScript
-
menuFocusCallback
public abstract void menuFocusCallback(String name, String actionCommand, boolean gained)
-
menuCheckBoxCallback
public void menuCheckBoxCallback(SC source)
-
doMenuCheckBoxCallback
protected void doMenuCheckBoxCallback(SC source)
-
menuCreateCheckboxItem
protected SC menuCreateCheckboxItem(SC menu, String entry, String basename, String id, boolean state, boolean isRadio)
-
menuAddSeparator
protected void menuAddSeparator(SC menu)
-
menuRemoveAll
protected void menuRemoveAll(SC menu, int indexFrom)
-
menuEnable
protected void menuEnable(SC component, boolean enable)
-
menuSetAutoscrolls
protected void menuSetAutoscrolls(SC menu)
-
menuGetListPosition
protected int menuGetListPosition(SC item)
-
show
protected void show(int x, int y, boolean doPopup)
-
updateCheckBoxesForShow
private void updateCheckBoxesForShow()
-
jpiGetMenuAsString
public String jpiGetMenuAsString(String title)
- Specified by:
jpiGetMenuAsStringin interfaceGenericMenuInterface
-
addItemText
private static void addItemText(javajs.util.SB sb, char type, int level, String name, String label, String script, String flags)
-
convertToMegabytes
protected static int convertToMegabytes(long num)
-
-