public class JSME
extends java.lang.Object
Constructor and Description |
---|
JSME(java.lang.String htmlId) |
JSME(java.lang.String htmlId,
JavaScriptObject parameterJso) |
JSME(java.lang.String htmlId,
java.lang.String width,
java.lang.String height) |
JSME(java.lang.String htmlId,
java.lang.String width,
java.lang.String height,
JavaScriptObject parameterJso) |
Modifier and Type | Method and Description |
---|---|
void |
addClickHandler(JsClosureJsme jsEventHandler)
Add a click handler to a JSME instance.
|
void |
addMouseDownHandler(JsClosureJsme jsEventHandler)
Add a mouse down handler to a JSME instance.
|
void |
addMouseOutHandler(JsClosureJsme jsEventHandler)
Add a mouse out handler to a JSME instance.
|
void |
addMouseOverHandler(JsClosureJsme jsEventHandler)
Add a mouse over handler to a JSME instance.
|
void |
alert(java.lang.String message)
Display an alert box with the look and feel of JSME
|
void |
clear()
Same effect as clicking on the clear icon: clear the molecular drawing area
|
void |
deferredRepaint()
Repaint the applet after the browser event loop returns.
|
java.lang.String[] |
getAlldefinedCallBackNames()
Return an array containing all possible callback names.
|
JsArrayString |
getAllGraphicsString()
Returns all graphics representations used in the applet, either a SVG or a VML string
This is an advanced feature.
|
JavaScriptObject |
getCallBack(java.lang.String callbackName)
Generic callback
|
int |
getCreationIndex()
The JSME class keeps tract of the number of instance that have been created.
|
java.lang.String |
getHelpURL() |
double |
getMenuScale() |
boolean |
getMolecularAreaAntiAlias()
Return the antialias setting for the molecular drawing area
|
java.lang.String |
getMolecularAreaGraphicsString()
Returns the graphics representation used in the molecular area, either a SVG or a VML string
This is an advanced feature.
|
float |
getMolecularAreaLineWidth() |
double |
getMolecularAreaScale() |
java.lang.String |
getNotifyStructuralChangeJSfunction()
Deprecated.
|
int |
getOffsetHeight()
Gets the object's offset height in pixels.
|
JsArrayInteger |
getOffsetSize()
Gets the object's offset width and height in pixels.
|
int |
getOffsetWidth()
Gets the object's offset width in pixels.
|
com.google.gwt.user.client.Element |
getParentContainer()
Return the parent DOM element that contains myself.
|
java.lang.String |
getPasteLabel()
|
java.lang.String |
getPrePasteJSfunction() |
java.lang.String |
getWebSearchInchiKeyBaseUrl() |
void |
initializationError(java.lang.String message) |
boolean |
isDepictMode() |
boolean |
isVisible()
Returns whether the given element is visible in a way consistent with
setVisible(boolean) . |
java.lang.String |
jmeFile() |
java.lang.String |
molFile(boolean isV3000) |
java.lang.String |
nonisomericSmiles() |
void |
options(java.lang.String options)
options is a comma separated value list - same as original JME
|
boolean |
read_MOL_SDF_RXN(java.lang.String s)
Read a molecular structure encoded in MOL or SDF format, or a reaction encoded in RXN format.
|
void |
readGenericMolecularInput(java.lang.String s) |
void |
readMolecule(java.lang.String s)
Read a molecular structure encoded in JME format
|
void |
readMolFile(java.lang.String s)
Read a molecular structure encoded in MOL format, or a reaction encoded in RXN format
|
void |
repaint()
Redraw the whole applet if it is visible
|
static int |
replaceAllAppletsByJSME()
Scan the DOM for DIV's containing an attribute code="JME.class" and install a running JSME.
|
static int |
replaceAllAppletsByJSME(JsClosure jsFunctionWithJsmeInstanceArg)
Scan the DOM for DIV's containing an attribute code="JME.class" and install a running JSME.
|
void |
reset() |
void |
resetAtomColors(int molIndex)
Reset background colors
|
void |
setAction(int action)
select one of the menu action without having to click on the menu.
|
void |
setAfterDepictEditToggleEventHandler(JsClosureJsme jsEventHandler) |
void |
setAfterPasteCallback(JavaScriptObject callbackFunction)
Deprecated.
|
void |
setAfterStructureModifiedCallback(JavaScriptObject callbackFunction)
Deprecated.
|
void |
setAntialias(boolean onOff)
Set globally antialias
|
void |
setAtomBackgroundColors(int molIndex,
java.lang.String atomAndColorCSV) |
void |
setAtomMolecularAreaFontSize(float fs) |
void |
setAtomToHighLight(int molIndex,
int atomIndex) |
void |
setBeforePasteCallback(JavaScriptObject callbackFunction)
Deprecated.
|
void |
setCallBack(java.lang.String callbackName,
JavaScriptObject callbackFunction)
Generic call back.
|
void |
setHeight(java.lang.String width)
Sets the object's height.
|
void |
setHelpURL(java.lang.String url)
set the url to display the JSME help page.
|
void |
setMenuScale(double scale) |
void |
setMolecularAreaAntiAlias(boolean molecularAreaAntiAlias)
Set antialias for the molecular drawing area
|
void |
setMolecularAreaLineWidth(float molecularAreaLineWidth)
Line width in pixel
|
void |
setMolecularAreaScale(double scale) |
void |
setNotifyAtomHighLightChangeJSfunction(java.lang.String notifyAtomHighLightJSfunction)
Deprecated.
|
void |
setNotifyStructuralChangeJSfunction(java.lang.String notifyStructuralChangeJSfunction)
Deprecated.
|
void |
setPasteLabel(java.lang.String pasteLabel)
Set the label of the context popup menu for pasting string, instead of using the default label.
|
void |
setPrePasteJSfunction(java.lang.String prePasteJSfunction)
Deprecated.
|
void |
setSize(int width,
int height)
Sets the object's size.
|
void |
setSize(int width,
int height,
boolean resizeParent)
Sets the object's size.
|
void |
setSize(java.lang.String width,
java.lang.String height)
Sets the object's size.
|
void |
setSize(java.lang.String width,
java.lang.String height,
boolean resizeParent)
Sets the object's size.
|
void |
setSubstituent(java.lang.String s)
Select the next FG to be used.
|
void |
setTemplate(java.lang.String templateAsJmeMol,
java.lang.String templateName)
Provide a template, a molecular fragment with one marked atom, in JME format.
|
void |
setVisible(boolean visible)
Shows or hides the given element.
|
void |
setWebSearchInchiKeyBaseUrl(java.lang.String webSearchInchiKeyBaseUrl)
Set the base url for inchi key search.
|
void |
setWidth(java.lang.String width)
Sets the object's width.
|
void |
showInfo(java.lang.String message)
Display a message in the bottom bar.
|
java.lang.String |
smiles() |
public JSME(java.lang.String htmlId, java.lang.String width, java.lang.String height)
public JSME(java.lang.String htmlId)
public JSME(java.lang.String htmlId, java.lang.String width, java.lang.String height, JavaScriptObject parameterJso)
public JSME(java.lang.String htmlId, JavaScriptObject parameterJso)
htmlId
- parameterJso
- public JsArrayString getAllGraphicsString()
public java.lang.String getMolecularAreaGraphicsString()
public java.lang.String getWebSearchInchiKeyBaseUrl()
setWebSearchInchiKeyBaseUrl(String webSearchInchiKeyBaseUrl)
public void setWebSearchInchiKeyBaseUrl(java.lang.String webSearchInchiKeyBaseUrl)
webSearchInchiKeyBaseUrl:
- the web search InchiKey base Url to set
Note: alternatively, one can replace the web search by a custom function call.
See setCallBack(String,JavaScriptObject)
To find the inchi key search callback name, see getAlldefinedCallBackNames()
See also see getWebSearchInchiKeyBaseUrl()
public double getMolecularAreaScale()
public void setMolecularAreaScale(double scale)
public double getMenuScale()
public void setMenuScale(double scale)
public int getCreationIndex()
public com.google.gwt.user.client.Element getParentContainer()
public void initializationError(java.lang.String message)
public void setAntialias(boolean onOff)
onOff
- public void options(java.lang.String options)
options
- public void readMolecule(java.lang.String s)
s
- public void readMolFile(java.lang.String s)
molecule
- public boolean read_MOL_SDF_RXN(java.lang.String s)
s
- public void readGenericMolecularInput(java.lang.String s)
public java.lang.String molFile(boolean isV3000)
isV3000
- public java.lang.String smiles()
public java.lang.String nonisomericSmiles()
public java.lang.String jmeFile()
public void reset()
public void clear()
public void setTemplate(java.lang.String templateAsJmeMol, java.lang.String templateName)
templateAsJmeMol
- templateName
- public void setSubstituent(java.lang.String s)
s
- public void repaint()
public void deferredRepaint()
export.client.Utils.runAfterBrowserEventLoopReturns
public java.lang.String getHelpURL()
public void setHelpURL(java.lang.String url)
url
- public void alert(java.lang.String message)
message
- public void showInfo(java.lang.String message)
message
- @Deprecated public java.lang.String getNotifyStructuralChangeJSfunction()
@Deprecated public void setNotifyStructuralChangeJSfunction(java.lang.String notifyStructuralChangeJSfunction)
setAfterStructureModifiedCallback(JavaScriptObject)
method instead.notifyStructuralChangeJSfunction
- the name of the JavaScript function
This method is deprecated. Use setCallBack(String,JavaScriptObject)
instead.@Deprecated public void setAfterStructureModifiedCallback(JavaScriptObject callbackFunction)
callbackFunction,
- a Javascript function - not the name of the function
This method is deprecated. Use setCallBack(String,JavaScriptObject)
instead.public void setCallBack(java.lang.String callbackName, JavaScriptObject callbackFunction)
getAlldefinedCallBackNames()
for all predefined callback names.callbackName
- callbackFunction
- public JavaScriptObject getCallBack(java.lang.String callbackName)
callbackName
- public java.lang.String[] getAlldefinedCallBackNames()
public void setAtomToHighLight(int molIndex, int atomIndex)
@Deprecated public void setNotifyAtomHighLightChangeJSfunction(java.lang.String notifyAtomHighLightJSfunction)
setCallBack(String,JavaScriptObject)
instead.notifyAtomHighLightJSfunction
- must be a string@Deprecated public void setAfterPasteCallback(JavaScriptObject callbackFunction)
callbackFunction
- with two arguments, the jsme instance and the content that was pasted.
This method is deprecated. Use setCallBack(String,JavaScriptObject)
instead.@Deprecated public void setBeforePasteCallback(JavaScriptObject callbackFunction)
callbackFunction
- with two arguments, the jsme instance and the content that was pasted.
This method is deprecated. Use setCallBack(String,JavaScriptObject)
instead.public void setAtomBackgroundColors(int molIndex, java.lang.String atomAndColorCSV)
molIndex
- atomAndColorCSV
- : at,c,at,c,at,c, ... at: atom index; c: color indexpublic void resetAtomColors(int molIndex)
molIndex
- public java.lang.String getPrePasteJSfunction()
setPrePasteJSfunction
@Deprecated public void setPrePasteJSfunction(java.lang.String prePasteJSfunction)
prePasteJSfunction
- This method is deprecated. Use setCallBack(String,JavaScriptObject)
instead.public java.lang.String getPasteLabel()
public void setPasteLabel(java.lang.String pasteLabel)
setPrePasteJSfunction(String)
pasteLabel
- public float getMolecularAreaLineWidth()
public void setMolecularAreaLineWidth(float molecularAreaLineWidth)
molecularAreaLineWidth
- public void setAtomMolecularAreaFontSize(float fs)
public boolean getMolecularAreaAntiAlias()
public void setMolecularAreaAntiAlias(boolean molecularAreaAntiAlias)
molecularAreaAntiAlias
- public void setSize(java.lang.String width, java.lang.String height)
width
- the applet's new width, in CSS units (e.g. "10px", "1em", "100%")height
- the applet's new height, in CSS units (e.g. "10px", "1em")public void setSize(int width, int height)
width
- the applet's new width, in pixelsheight
- the applet's new height, in pixelspublic void setSize(java.lang.String width, java.lang.String height, boolean resizeParent)
width
- the applet's new width, in CSS units (e.g. "10px", "1em", "100%")height
- the applet's new height, in CSS units (e.g. "10px", "1em")public void setSize(int width, int height, boolean resizeParent)
width
- the object's new width, in pixelsheight
- the object's new height, in pixelspublic void setWidth(java.lang.String width)
width
- the object's new width, in CSS units (e.g. "10px", "1em")public void setHeight(java.lang.String width)
height
- the object's new height, in CSS units (e.g. "10px", "1em")public JsArrayInteger getOffsetSize()
public int getOffsetWidth()
public int getOffsetHeight()
public void setVisible(boolean visible)
Warning: implemented with a heuristic based on the "display" style:
clears the "display" style to its default value if visible
is true,
else forces the style to "none". If the "display" style is set to "none"
via CSS style sheets, the element remains invisible after a call to
setVisible(true)
.
public boolean isVisible()
setVisible(boolean)
.
Warning: implemented with a heuristic. The value returned takes into account only the "display" style, ignoring CSS and Aria roles, thus may not accurately reflect whether the element is actually visible in the browser.
public static int replaceAllAppletsByJSME()
public static int replaceAllAppletsByJSME(JsClosure jsFunctionWithJsmeInstanceArg)
getCreationIndex
.jsFunction:
- a function defined in JavaScript such as : function(eachJsmeInstance){alert("JSME created. Creation index: "+ eachJsmeInstance.getCreationIndex() )};public void addClickHandler(JsClosureJsme jsEventHandler)
jsEventHandler:
- a JavaScript function with two arguments.public void addMouseDownHandler(JsClosureJsme jsEventHandler)
jsEventHandler:
- a JavaScript function with two arguments.public void addMouseOverHandler(JsClosureJsme jsEventHandler)
jsEventHandler:
- a JavaScript function with two arguments.public void addMouseOutHandler(JsClosureJsme jsEventHandler)
jsEventHandler:
- a JavaScript function with two arguments.public void setAfterDepictEditToggleEventHandler(JsClosureJsme jsEventHandler)
public void setAction(int action)
action
- public boolean isDepictMode()