|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Container
javax.swing.JComponent
javax.swing.JRootPane
chemaxon.marvin.beans.MarvinPane
chemaxon.marvin.beans.MSketchPane
public class MSketchPane
The MarvinSketch Bean.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class javax.swing.JRootPane |
|---|
javax.swing.JRootPane.AccessibleJRootPane, javax.swing.JRootPane.RootLayout |
| Nested classes/interfaces inherited from class javax.swing.JComponent |
|---|
javax.swing.JComponent.AccessibleJComponent |
| Nested classes/interfaces inherited from class java.awt.Container |
|---|
java.awt.Container.AccessibleAWTContainer |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
java.awt.Component.AccessibleAWTComponent, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static int |
SM_ATOM
Atom mode. |
static int |
SM_BOND
Bond mode. |
static int |
SM_DELETE
Delete mode. |
static int |
SM_FLAGS_OFF
Offset of flags in sketch mode. |
static int |
SM_MASK
Sketch mode mask. |
static int |
SM_SELECT
Select mode. |
| Fields inherited from class chemaxon.marvin.beans.MarvinPane |
|---|
molPanel, params, topLevelContainer, VERSION |
| Fields inherited from class javax.swing.JRootPane |
|---|
COLOR_CHOOSER_DIALOG, contentPane, defaultButton, defaultPressAction, defaultReleaseAction, ERROR_DIALOG, FILE_CHOOSER_DIALOG, FRAME, glassPane, INFORMATION_DIALOG, layeredPane, menuBar, NONE, PLAIN_DIALOG, QUESTION_DIALOG, WARNING_DIALOG |
| Fields inherited from class javax.swing.JComponent |
|---|
accessibleContext, listenerList, TOOL_TIP_TEXT_KEY, ui, UNDEFINED_CONDITION, WHEN_ANCESTOR_OF_FOCUSED_COMPONENT, WHEN_FOCUSED, WHEN_IN_FOCUSED_WINDOW |
| 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 | |
|---|---|
MSketchPane()
Constructs the sketcher. |
|
MSketchPane(UserSettings settings)
Constructs the sketcher with the specified user settings object. |
|
MSketchPane(UserSettings settings,
boolean loadtmpl)
Constructs the sketcher with the specified user settings object. |
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener for a specific property. |
void |
clearHistory()
Reset undo queue. |
void |
doPaste()
Invokes Paste action. |
boolean |
getAutoScale()
Returns autoscale property. |
double[] |
getBoundRectSize()
Gets the size of the bounding rectangle. |
javax.swing.JComponent |
getCanvasComponent()
Determines canvas component of MarvinSketch. |
static double |
getDefaultScale()
Returns the default scale factor which is equivalent to 100% magnification. |
MDocument |
getDocument()
Gets the document. |
java.awt.Image |
getImage(java.awt.Dimension size)
Gets the canvas contents as an image scaled to fit in the specified rectangle. |
java.awt.Image |
getImage(double scale)
Gets the canvas contents as an image using a scale factor. |
double |
getMag()
Deprecated. As of Marvin 2.8.1, replaced by getScale() |
double |
getMergedst()
Gets the merge distance. |
Molecule |
getMol()
Returns the clone of the current molecule being on the canvas. |
java.lang.String |
getMol(java.lang.String fmt)
Gets the molecule in a text format. |
java.lang.String |
getMrvWithSettings()
Gets the molecule in the sketcher with its current settings in MRV format. |
java.lang.Object |
getObjectAtPointer()
Get the object at the mouse pointer. |
java.lang.String |
getPiece(java.lang.String fmt)
Gets the current molecule piece in the specified format. |
boolean |
getReactionSupport()
Is reaction drawing supported? |
double |
getScale()
Returns the scale factor of the current magnification. |
Molecule |
getSelection()
Gets a clone of the selection. |
int |
getSimpView()
Deprecated. as of Marvin 3.5, replaced by isBondDraggedAlong() |
int |
getSketchMode()
Gets the sketching mode. |
double |
getStickdst()
Gets the sticking distance. |
int |
getUndo()
Gets the maximum undo depth. |
boolean |
isBondDraggedAlong()
Is the currently used bond shown at the mouse cursor? |
boolean |
isCloseEnabled()
Determines if the File->Close menu item is enabled or not. |
boolean |
isConfirmExit()
Gets whether the confirmation dialog will be appear or not by exit. |
boolean |
isLoadedMolModified()
Determines whether the original molecule that is loaded in is modified or not. |
boolean |
isReactionErrorVisible()
Are reaction errors highlighted? |
boolean |
isValenceErrorVisible()
Are valence errors highlighted? |
void |
propertyChange(java.beans.PropertyChangeEvent ev)
Handles property change events. |
void |
readExternal(java.io.ObjectInput in)
Restores object state. |
void |
redo()
Invokes a redo command. |
void |
setAutoScale(boolean as)
Sets the autoscale property. |
void |
setBondDraggedAlong(boolean v)
Sets the visibility of the currently used bond at the mouse cursor. |
void |
setCloseEnabled(boolean b)
Set the accessibility of the Close menu item in the File menu. |
void |
setConfirmExit(boolean b)
Sets to drop confirmation dialog about exit or not. |
void |
setDocument(MDocument doc)
Sets the document. |
void |
setMag(double m)
Deprecated. As of Marvin 2.8.1, replaced by setScale() |
void |
setMergedst(double d)
Sets the merge distance. |
void |
setMol(java.io.File f,
java.lang.String opts)
Sets the molecule. |
void |
setMol(Molecule m)
Sets the molecule. |
void |
setMol(Molecule m,
boolean init)
Sets the molecule. |
void |
setMol(java.lang.String s)
Starts loading a molecule into the sketcher. |
void |
setMol(java.lang.String s,
java.lang.String opts)
Starts loading a molecule into the sketcher. |
void |
setMrvWithSettings(java.lang.String mrvsource)
Sets the molecule and its display settings. |
void |
setPiece(java.lang.String s)
Sets the molecule piece. |
void |
setReactionErrorVisible(boolean v)
Shows or hides reaction errors |
void |
setReactionSupport(boolean v)
Allows or disallows reaction drawing. |
void |
setScale(double m)
Sets the scale factor and changes magnification of the canvas. |
void |
setSimpView(int v)
Deprecated. as of Marvin 3.5, replaced by setBondDraggedAlong(boolean) |
void |
setSketchMode(int mode)
Sets the sketching mode. |
void |
setStickdst(double d)
Sets the sticking distance. |
void |
setUndo(int u)
Sets the maximum undo depth. |
void |
setValenceErrorVisible(boolean v)
Shows or hides valence errors |
void |
undo()
Invokes an undo command. |
void |
writeExternal(java.io.ObjectOutput out)
Saves object state. |
| Methods inherited from class javax.swing.JRootPane |
|---|
addImpl, addNotify, createContentPane, createGlassPane, createLayeredPane, createRootLayout, getAccessibleContext, getContentPane, getDefaultButton, getGlassPane, getJMenuBar, getLayeredPane, getMenuBar, getUI, getUIClassID, getWindowDecorationStyle, isOptimizedDrawingEnabled, isValidateRoot, paramString, removeNotify, setContentPane, setDefaultButton, setGlassPane, setJMenuBar, setLayeredPane, setMenuBar, setUI, setWindowDecorationStyle, updateUI |
| Methods inherited from class javax.swing.JComponent |
|---|
addAncestorListener, addVetoableChangeListener, computeVisibleRect, contains, createToolTip, disable, enable, firePropertyChange, firePropertyChange, firePropertyChange, fireVetoableChange, getActionForKeyStroke, getActionMap, getAlignmentX, getAlignmentY, getAncestorListeners, getAutoscrolls, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getPreferredSize, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isPaintingTile, isRequestFocusEnabled, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeVetoableChangeListener, repaint, repaint, requestDefaultFocus, requestFocus, requestFocus, requestFocusInWindow, requestFocusInWindow, resetKeyboardActions, reshape, revalidate, scrollRectToVisible, setActionMap, setAlignmentX, setAlignmentY, setAutoscrolls, setBackground, setBorder, setComponentPopupMenu, setDebugGraphicsOptions, setDefaultLocale, setDoubleBuffered, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update |
| Methods inherited from class java.awt.Container |
|---|
add, add, add, add, add, addContainerListener, addPropertyChangeListener, applyComponentOrientation, areFocusTraversalKeysSet, countComponents, deliverEvent, doLayout, findComponentAt, findComponentAt, getComponent, getComponentAt, getComponentAt, getComponentCount, getComponents, getComponentZOrder, getContainerListeners, getFocusTraversalKeys, getFocusTraversalPolicy, getLayout, getMousePosition, insets, invalidate, isAncestorOf, isFocusCycleRoot, isFocusCycleRoot, isFocusTraversalPolicyProvider, isFocusTraversalPolicySet, layout, list, list, locate, minimumSize, paintComponents, preferredSize, printComponents, processContainerEvent, processEvent, remove, remove, removeAll, removeContainerListener, setComponentZOrder, setFocusCycleRoot, setFocusTraversalPolicy, setFocusTraversalPolicyProvider, setLayout, transferFocusBackward, transferFocusDownCycle, validate, validateTree |
| Methods inherited from class java.awt.Component |
|---|
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addMouseWheelListener, bounds, checkImage, checkImage, coalesceEvents, contains, createImage, createImage, createVolatileImage, createVolatileImage, disableEvents, dispatchEvent, enable, enableEvents, enableInputMethods, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, firePropertyChange, getBackground, getBounds, getColorModel, getComponentListeners, getComponentOrientation, getCursor, getDropTarget, getFocusCycleRootAncestor, getFocusListeners, getFocusTraversalKeysEnabled, getFont, getForeground, getGraphicsConfiguration, getHierarchyBoundsListeners, getHierarchyListeners, getIgnoreRepaint, getInputContext, getInputMethodListeners, getInputMethodRequests, getKeyListeners, getLocale, getLocation, getLocationOnScreen, getMouseListeners, getMouseMotionListeners, getMousePosition, getMouseWheelListeners, getName, getParent, getPeer, getPropertyChangeListeners, getPropertyChangeListeners, getSize, getToolkit, getTreeLock, gotFocus, handleEvent, hasFocus, hide, imageUpdate, inside, isBackgroundSet, isCursorSet, isDisplayable, isEnabled, isFocusable, isFocusOwner, isFocusTraversable, isFontSet, isForegroundSet, isLightweight, isMaximumSizeSet, isMinimumSizeSet, isPreferredSizeSet, isShowing, isValid, isVisible, keyDown, keyUp, list, list, list, location, lostFocus, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, paintAll, postEvent, prepareImage, prepareImage, processComponentEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processMouseWheelEvent, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removeMouseWheelListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, resize, resize, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setFocusable, setFocusTraversalKeysEnabled, setIgnoreRepaint, setLocale, setLocation, setLocation, setName, setSize, setSize, show, show, size, toString, transferFocus, transferFocusUpCycle |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int SM_SELECT
public static final int SM_DELETE
public static final int SM_ATOM
setSketchMode(MSketchPane.SM_Atom | (6 << MSketchPane.SM_FLAGS_OFF));
public static final int SM_BOND
setSketchMode(MSketchPane.SM_BOND | (1 << MSketchPane.SM_FLAGS_OFF));
public static final int SM_MASK
public static final int SM_FLAGS_OFF
| Constructor Detail |
|---|
public MSketchPane()
public MSketchPane(UserSettings settings)
settings - the user settings
public MSketchPane(UserSettings settings,
boolean loadtmpl)
settings - the user settingsloadtmpl - load template structures and abbreviated groups
immediately (true) or not
(false)| Method Detail |
|---|
public javax.swing.JComponent getCanvasComponent()
MarvinPane.setPopupMenusEnabled(boolean)public void setAutoScale(boolean as)
as - set to true to enable autoscalepublic boolean getAutoScale()
public void propertyChange(java.beans.PropertyChangeEvent ev)
propertyChange in interface java.beans.PropertyChangeListenerpropertyChange in class MarvinPaneev - the event object
public void addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
PropertyChangeListener for a specific property.
The listener will be invoked only when a call on
firePropertyChange names that specific property.
If listener is null, no exception is thrown and no
action is performed.
MarvinSketch: parameters and events
addPropertyChangeListener in class java.awt.ContainerpropertyName - the name of the property to listen onlistener - the PropertyChangeListener to be addedpublic Molecule getMol()
public java.lang.String getMol(java.lang.String fmt)
s1 = msketch.getMol("mol");
s2 = msketch.getMol("smiles:a-H"); // aromatize and remove Hydrogens
fmt - the format descriptor string
public void setMol(Molecule m)
m - the molecule
public void setMol(Molecule m,
boolean init)
m - the moleculeinit - set this to false if initialization is not neededpublic void setMol(java.lang.String s)
s - molfile contents, URL or (Unix) filename
public void setMol(java.lang.String s,
java.lang.String opts)
s - molfile contents, URL or (Unix) filenameopts - options or null
public void setMol(java.io.File f,
java.lang.String opts)
f - the molecule fileopts - import options or nullpublic MDocument getDocument()
public void setDocument(MDocument doc)
doc - the documentpublic Molecule getSelection()
public java.lang.Object getObjectAtPointer()
public java.lang.String getPiece(java.lang.String fmt)
fmt - the format
getMol(java.lang.String)public void setPiece(java.lang.String s)
s - the piece in some molecule file formatpublic java.awt.Image getImage(double scale)
getImage(getDefaultScale());getImage(getScale());
scale - the absolute scale factor, see getScale()
public java.awt.Image getImage(java.awt.Dimension size)
getBoundRectSize() method.
size - the image size
public double[] getBoundRectSize()
MolBond.CCLENGTH,
getScale()public static double getDefaultScale()
public double getScale()
getDefaultScale().
MolBond.CCLENGTHpublic void setScale(double m)
getDefaultScale() is set,
the magnification of the canvas will be set to 100%.
m - displayed length of a C-C bond in pixelsMolBond.CCLENGTHpublic double getStickdst()
MolBond.CCLENGTHpublic void setStickdst(double d)
d - the stick distance in C-C bond length unitsMolBond.CCLENGTHpublic double getMergedst()
MolBond.CCLENGTHpublic void setMergedst(double d)
d - the merge distance in C-C bond length unitsMolBond.CCLENGTHpublic int getUndo()
public void setUndo(int u)
u - maximum history lengthpublic boolean getReactionSupport()
public void setReactionSupport(boolean v)
v - true to allow, false to disallowpublic boolean isReactionErrorVisible()
public void setReactionErrorVisible(boolean v)
v - True, draws red rectangles around the reaction arrows,
if reactions are invalid.public boolean isValenceErrorVisible()
public void setValenceErrorVisible(boolean v)
v - True, underlines atom symbols in case valence errors.public boolean isBondDraggedAlong()
public void setBondDraggedAlong(boolean v)
v - true to drag along the bond by the mouse cursor, false
to hide itpublic void setSketchMode(int mode)
mode - the sketching modeSM_SELECT,
SM_DELETE,
SM_ATOM,
SM_BONDpublic int getSketchMode()
SM_SELECT,
SM_DELETE,
SM_ATOM,
SM_BONDpublic int getSimpView()
isBondDraggedAlong()
public void setSimpView(int v)
setBondDraggedAlong(boolean)
v - 0 for normal behaviour, 1 to hide bond in handpublic double getMag()
public void setMag(double m)
m - the magnification
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal method of class
MSketch, which does implement it.
writeExternal in class MarvinPaneout - the stream to write the object to
java.io.IOException - Includes any I/O exceptions that may occur
public void readExternal(java.io.ObjectInput in)
throws java.io.IOException,
java.lang.ClassNotFoundException
readExternal method of class
MSketch, which does implement it.
readExternal in class MarvinPanein - the stream to read data from in order to restore the object
java.io.IOException - if I/O errors occur
java.lang.ClassNotFoundException - If the class for an object being
restored cannot be found.public java.lang.String getMrvWithSettings()
setMrvWithSettings(String)public void setMrvWithSettings(java.lang.String mrvsource)
mrvsource - the MRV sourcegetMrvWithSettings()public boolean isCloseEnabled()
setCloseEnabled(boolean)public void setCloseEnabled(boolean b)
b - True to enable close operation from the file menu. False
to set it to disabled.isCloseEnabled()public void undo()
public void redo()
public void setConfirmExit(boolean b)
b - True, confirmation dialog will be appear by exit if
modifications were not saved, else false.public boolean isConfirmExit()
public boolean isLoadedMolModified()
public void doPaste()
doPaste in class MarvinPanepublic void clearHistory()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||