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 |
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.
|
JavaScriptObject |
getAfterPasteCallback() |
JsArrayString |
getAllGraphicsString()
Returns all graphics representations used in the applet, either a SVG or a VML string
This is an advanced feature.
|
JavaScriptObject |
getBeforePasteCallback() |
int |
getCreationIndex()
The JSME class keeps tract of the number of instance that have been created.
|
java.lang.String |
getHelpURL() |
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() |
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() |
void |
initializationError(java.lang.String message) |
boolean |
isVisible()
Returns whether the given element is visible in a way consistent with
setVisible(boolean) . |
java.lang.String |
jmeFile() |
java.lang.String |
molFile() |
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 SDF_MOL_RXN)
Read a molecular structure encoded in MOL or SDF format, or a reaction encoded in RXN format.
|
void |
readMolecule(java.lang.String molecule)
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 |
setAfterPasteCallback(JavaScriptObject callbackFunction)
Specify a JavaScript function that will be called after a successful paste operation.
|
void |
setAfterStructureModifiedCallback(JavaScriptObject callbackFunction)
Specify a JS function that will be called each time the molecular structure in the editor has been changed.
|
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) |
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 |
setMolecularAreaAntiAlias(boolean molecularAreaAntiAlias)
Set antialias for the molecular drawing area
|
void |
setMolecularAreaLineWidth(float molecularAreaLineWidth)
Line width in pixel
|
void |
setNotifyAtomHighLightChangeJSfunction(java.lang.String notifyAtomHighLightJSfunction)
Specify a JS function that will be called each time the mouse pointer touches an atom.
|
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)
Set a JS function that will be called before the paste is performed.
|
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 t,
java.lang.String name) |
void |
setVisible(boolean visible)
Shows or hides the given element.
|
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 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 molecule)
molecule
- public void readMolFile(java.lang.String s)
molecule
- public boolean read_MOL_SDF_RXN(java.lang.String SDF_MOL_RXN)
SDF_MOL_RXN
- public java.lang.String molFile()
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 t, java.lang.String name)
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)
notifyStructuralChangeJSfunction
- the notifyStructuralChangeJSfunction to setpublic void setAfterStructureModifiedCallback(JavaScriptObject callbackFunction)
callbackFunction,
- a Javascript function - not the name of the functionsetNotifyStructuralChangeJSfunction
public void setAtomToHighLight(int molIndex, int atomIndex)
public void setNotifyAtomHighLightChangeJSfunction(java.lang.String notifyAtomHighLightJSfunction)
notifyAtomHighLightJSfunction
- must be a stringpublic void setAfterPasteCallback(JavaScriptObject callbackFunction)
callbackFunction
- with two arguments, the jsme instance and the content that was pasted.public JavaScriptObject getAfterPasteCallback()
public void setBeforePasteCallback(JavaScriptObject callbackFunction)
callbackFunction
- public JavaScriptObject getBeforePasteCallback()
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
public void setPrePasteJSfunction(java.lang.String prePasteJSfunction)
prePasteJSfunction
- 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 addMouseOverHandler(JsClosureJsme jsEventHandler)
jsEventHandler:
- a JavaScript function with two arguments.public void setAction(int action)
action
-