|
ChemWriter v1.3.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
java.awt.Panel
java.applet.Applet
javax.swing.JApplet
com.metamolecular.chemwriter.applet.BaseApplet
com.metamolecular.chemwriter.applet.EditorApplet
public class EditorApplet
A 2D structure editor applet. When deployed, all public methods should be available through JavaScript.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.BaselineResizeBehavior |
| Field Summary |
|---|
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
EditorApplet()
Default constructor. |
|
| Method Summary | |
|---|---|
boolean |
canRedo()
Returns true if the last user action can be redone or false otherwise. |
boolean |
canUndo()
Returns true if the last user action can be undone or false otherwise. |
void |
clear()
Clears the molecule without changing any settings. |
double |
getBondLength()
Returns the bond length for new bonds, in molecule units. |
int |
getDocumentHeight()
Returns the height of the document in pixels. |
int |
getDocumentWidth()
Returns the width of the document in pixels. |
double |
getHoverRadius()
Returns the hover radius, or the radius around which atoms will be detected as being hovered over by the mouse cursor. |
java.lang.String |
getMolfile()
Returns the molfile representation of the molecule contained in this applet. |
java.lang.String |
getTool()
Returns the name of the active tool. |
double |
getZoomFactor()
Returns the zoom factor to be applied by zoomIn and zoomOut. |
void |
init()
|
boolean |
isBlank()
Returns true if this applet's canvas contains no molecule, or false otherwise. |
boolean |
isPreventStrayHeteroatoms()
Returns true if stray heteroatom protection is enabled, or false otherwise. |
void |
paint(java.awt.Graphics g)
|
void |
redo()
Redoes the last user action, or does nothing if there is nothing to redo. |
void |
resetView()
Resets the editor view by scaling to the default scale and centering the molecule to the extent possible. |
void |
setBondLength(double length)
Sets the bond length for new bonds, in molecule units. |
void |
setDocumentSize(int width,
int height)
Resizes the document. |
void |
setHoverRadius(double radius)
Sets the hover radius, or the radius around which atoms will be detected as being hovered over by the mouse cursor. |
void |
setMolfile(java.lang.String molfile)
Replaces the current molecule with one defined by molfile. |
void |
setPreventStrayHeteroatoms(boolean enabled)
Determines whether stray heteroatom protection will be enabled or not. |
void |
setTool(java.lang.String name)
Selects the drawing tool to be used. |
void |
setZoomFactor(double zoomFactor)
Sets the zoom factor to be applied by zoomIn and zoomOut. |
void |
start()
|
void |
stop()
|
void |
undo()
Performs an undo of the last user action, or does nothing if the undo limit has been reached. |
void |
zoomIn()
Magnifies the molecule display by the value returned by getZoomFactor. |
void |
zoomOut()
Reduces the molecule display by the value returned by getZoomFactor. |
| Methods inherited from class javax.swing.JApplet |
|---|
getAccessibleContext, getContentPane, getGlassPane, getGraphics, getJMenuBar, getLayeredPane, getRootPane, getTransferHandler, remove, repaint, setContentPane, setGlassPane, setJMenuBar, setLayeredPane, setLayout, setTransferHandler, update |
| Methods inherited from class java.applet.Applet |
|---|
destroy, getAppletContext, getAudioClip, getAudioClip, getCodeBase, getDocumentBase, getImage, getImage, getLocale, getParameter, isActive, newAudioClip, play, play, resize, resize, setStub, showStatus |
| Methods inherited from class java.awt.Panel |
|---|
addNotify |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addPropertyChangeListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getAlignmentX, getAlignmentY, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getInsets, getLayout, getListeners, getMaximumSize, getMinimumSize, getMousePosition, getPreferredSize, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, print, printComponents, remove, removeAll, removeContainerListener, removeNotify, setComponentZOrder, setFocusCycleRoot, setFocusTraversalKeys, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setFont, transferFocusBackward, transferFocusDownCycle, validate |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, contains, contains, createImage, createImage, createVolatileImage, createVolatileImage, disable, dispatchEvent, enable, enable, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBaseline, getBaselineResizeBehavior, getBounds, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getFontMetrics, getForeground, getGraphicsConfiguration, getHeight, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocation, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getSize, getToolkit, getTreeLock, getWidth, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isDoubleBuffered, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isOpaque, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, printAll, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, requestFocusInWindow, reshape, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFocusable, setFocusTraversalKeysEnabled, setForeground, setIgnoreRepaint, setLocale, setLocation, setLocation, setMaximumSize, setMinimumSize, setName, setPreferredSize, setSize, setSize, setVisible, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public EditorApplet()
throws java.awt.HeadlessException
java.awt.HeadlessException| Method Detail |
|---|
public boolean isBlank()
BaseApplet
isBlank in class BaseAppletpublic java.lang.String getMolfile()
BaseApplet
getMolfile in class BaseAppletpublic void redo()
public void setTool(java.lang.String name)
name - the name of the tool to selectpublic java.lang.String getTool()
public void setMolfile(java.lang.String molfile)
BaseApplet
setMolfile in class BaseAppletmolfile - the molfile representation that will replace the
current moleculepublic void undo()
public boolean canUndo()
public boolean canRedo()
public void zoomIn()
public void zoomOut()
public double getZoomFactor()
public void setZoomFactor(double zoomFactor)
zoomFactor - the new zoom factorpublic void setBondLength(double length)
length - the new bond length in molecule units - greater than zeropublic double getBondLength()
public void setHoverRadius(double radius)
radius - the hover radius - greater than zero and preferably less
than 0.5 relative to median bond lengthpublic double getHoverRadius()
public void setPreventStrayHeteroatoms(boolean enabled)
enabled - enables protection if truepublic boolean isPreventStrayHeteroatoms()
public void setDocumentSize(int width,
int height)
width - the new document width in pixelsheight - the new document height in pixelspublic int getDocumentWidth()
public int getDocumentHeight()
public void clear()
public void resetView()
public void start()
start in class java.applet.Appletpublic void paint(java.awt.Graphics g)
paint in class java.awt.Containerpublic void init()
init in class BaseAppletpublic void stop()
stop in class java.applet.Applet
|
ChemWriter v1.3.0 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||