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
FieldsModifier and TypeFieldDescriptionprotected boolean
protected Object
protected String
protected PopupHelper
protected boolean
protected boolean
protected boolean
protected boolean
protected boolean
protected String
protected SC
private javajs.util.Lst<SC>
protected String
protected SC
int
int
protected boolean
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static void
addItemText
(javajs.util.SB sb, char type, int level, String name, String label, String script, String flags) protected 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) private boolean
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) private void
menuAddItem
(SC menu, SC item) 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) private void
menuGetAsText
(javajs.util.SB sb, int level, SC menu, String menuName) 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) private SC
private void
rememberCheckbox
(String key, SC checkboxMenuItem) private void
runCheckBoxScript
(SC item, String what, boolean TF) protected SC
protected void
show
(int x, int y, boolean doPopup) protected void
updateButton
(SC b, String entry, String script) private void
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
-
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:
jpiGetMenuAsString
in interfaceGenericMenuInterface
-
appGetMenuAsString
- Parameters:
title
-- Returns:
- null
-
addItemText
-
convertToMegabytes
protected static int convertToMegabytes(long num) -
jpiDispose
public void jpiDispose()- Specified by:
jpiDispose
in interfaceGenericMenuInterface
-