|
|||||||||
| 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.MViewPane
public class MViewPane
The MarvinView 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.BaselineResizeBehavior, java.awt.Component.BltBufferStrategy, java.awt.Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
static int |
EDITABLE
Editing mode identifier meaning the structures can be edited with the Edit > Structure menu or double click and launches MarvinView in a new window. |
static int |
SKETCHABLE
Editing mode identifier meaning the structures can be edited with the Edit > Structure menu or double click and launches MarvinSketch in a new window. |
static int |
VIEW_ONLY
Editing mode identifier meaning the structures cannot be edited. |
| 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 | |
|---|---|
MViewPane()
Constructs the viewer. |
|
MViewPane(UserSettings settings)
Constructs the viewer with the specified user settings. |
|
| Method Summary | |
|---|---|
void |
addPropertyChangeListener(java.lang.String propertyName,
java.beans.PropertyChangeListener listener)
Adds a PropertyChangeListener for a specific property. |
void |
applyRotationMatrices()
Applies the rotation part of the viewing transformation matrix on the atom coordinates in all molecule cells. |
void |
applyRotationMatrix(int cellIndex)
Applies the rotation part of the viewing transformation matrix on the atom coordinates in the specified molecule cell. |
void |
closeSketcher(int index)
Closes the sketcher window that belongs the the specified cell. |
void |
closeWindow(int index)
Closes the detached viewer window of the specified cell. |
void |
destroySketcher()
Closes all detached sketcher windows. |
void |
doPaste()
Invokes Paste action. |
int |
getAbsoluteCellIndex(int visibleIndex)
Determines the absolute cell index of a visible cell |
int |
getAbsoluteCellIndex(javax.swing.JComponent component)
Determines in which cell the specified component is located. |
java.lang.String |
getAnimated()
Gets index of animated cells of the table (or simple viewer). |
double |
getAnimDelay()
Gets the repeat delay for animations. |
double |
getAnimFPS()
Gets the frames per second for animations. |
boolean |
getAutoTabScale()
Is tab scale automatically changed? |
double |
getBestTabScale()
Gets the smallest best scale value in the molecule table. |
double |
getBestTabScale(int i)
Gets the best scale value for a molecule cell. |
int |
getBorderWidth()
Gets the width of the border between cells. |
boolean |
getC(int i)
Gets the state of a checkbox in a GridBagView table. |
javax.swing.JComponent |
getCanvasComponent(int i)
Deprecated. as of Marvin 3.0, replaced by getVisibleCellComponent |
int |
getCellCount()
Gets the number of molecule cells in the table. |
chemaxon.marvin.common.swing.CommonActions |
getCommonActions()
Gets the common actions. |
MDocStorage |
getDocStorage()
Gets the sparse dynamic document storage. |
MDocument |
getDocument(int i)
Gets the nth document. |
MDocument[] |
getDocuments()
Gets the array of documents. |
int |
getEditable()
Returns the mode that determines if the structure is editable. |
java.awt.Font |
getFieldFont(java.lang.String key)
Gets the font of a named field in a table. |
java.lang.String |
getL(int i)
Gets a label. |
Molecule |
getM(int n)
Gets the nth molecule in memory. |
java.lang.String |
getM(int n,
java.lang.String fmt)
Gets the nth molecule in a text format. |
java.lang.String |
getNavmode()
Gets the mouse drag action. |
java.awt.Dimension |
getPreferredSize()
Gets the preferred size of the component. |
java.awt.Color |
getRecordIDBackground(int k)
Gets the highlight color of a record. |
java.awt.Color |
getRecordIDForeground(int k)
Gets the foreground color of a record. |
CTransform3D |
getRotationMatrix(int cellIndex)
Gets the rotation part of the transformation matrix. |
int |
getSelectedIndex()
Gets the index of the molecule that is selected by the user. |
java.lang.String |
getT(int i)
Gets a text field value in a GridBagView table. |
TableSupport |
getTableSupport()
Gets an object that helps to build and use a viewer table. |
double |
getTabScale()
Gets the magnification in the molecule cells. |
double |
getTabScale(int i)
Gets the magnification for a molecule cell. |
int |
getTopLeftIndex()
Gets the index of the top left cell. |
javax.swing.AbstractButton |
getVisibleButtonB(int i)
Gets the i-th button in the visible area of the viewer. |
javax.swing.AbstractButton |
getVisibleButtonC(int i)
Gets the i-th checkbox in the visible area of the viewer. |
javax.swing.JComponent |
getVisibleCellComponent(int i)
Gets the canvas of the specified cell in a GridBag layout based table. |
int |
getVisibleCellCount()
Gets the number of the visible cells in a GridBag layout based table. |
int |
getVisibleCellIndex(int absoluteIndex)
Determines the visible cell index of a cell |
double |
getWinScale()
Gets the magnification in the zoom windows. |
int |
indexOfButtonB(javax.swing.AbstractButton button)
Gets the index of the button on the visible area of the viewer. |
int |
indexOfButtonC(javax.swing.AbstractButton checkbox)
Gets the index of the checkbox in the visible area of the viewer. |
boolean |
isAnimated(int index)
Selected cell is animated or not. |
boolean |
isAnimSync()
Gets the animation synchronization. |
boolean |
isDetachable()
Gets the detachable property. |
boolean |
isDraggable()
Determines whether mouse dragged evens are allowed or not. |
boolean |
isSelectable()
Are the cells selectable? |
boolean |
isSketchWindowOpened(int index)
Checks whether the molecule from the specified cell is opened in a sketcher window or not. |
boolean |
isValenceErrorVisibleInView()
Are valence errors highlighted? |
boolean |
isViewWindowOpened(int index)
Checks whether the view canvas of the specified cell is detached into a separate window or not. |
void |
makeEditMenu(java.awt.Container menu)
Adds menu items to the specified Edit menu. |
void |
makeHelpMenu(java.awt.Container menu)
Deprecated. As of Marvin 3.4, MarvinPane.addHelpMenu(java.awt.Container) should be used. |
void |
makeRecentFileListMenu(java.awt.Container menu)
Read the recent file list from marvin.properties, and add it to the specified parent menu. |
void |
makeSaveAsMenu(java.awt.Container menu)
Creates the "Save As" menu and adds it to the specified parent menu. |
void |
makeStructureMenu(java.awt.Container menu)
|
javax.swing.JMenu |
makeToolsMenu()
Deprecated. As of Marvin 3.4, MarvinPane.addToolsMenu(java.awt.Container) should be used. |
void |
makeViewMenu(java.awt.Container menu)
Adds menu items to the specified View menu. |
boolean |
openSketcher(int index)
Opens the sketcher window with the molecule from the specified cell if the viewer is editable. |
boolean |
openWindow(int index)
Detaches the view canvas of the specified cell into a separate window if the viewer is detachable. |
void |
print()
Prints the molecule table. |
void |
readExternal(java.io.ObjectInput in)
Restores object state. |
void |
setActionB(int i,
java.lang.String s)
Sets the action string (URL or JavaScript expression) of a button in a GridBagView table. |
void |
setActionC(int i,
java.lang.String s)
Sets one of the two action strings (JavaScript expressions) of a checkbox in a GridBagView table. |
void |
setAnimated(boolean animated)
Starts or stops animation in each cells of the table or in the simple viewer. |
void |
setAnimated(int index,
boolean animated)
Sets animation of a cell of the table. |
void |
setAnimDelay(double delay)
Sets the repeat delay for animations. |
void |
setAnimFPS(double r)
Sets the frames per second for animations. |
void |
setAnimSync(boolean sync)
Sets the animation synchronization. |
boolean |
setAtomSetSeq(int i,
int atom,
int id)
Sets the set sequence number of the atom. |
void |
setAutoTabScale(boolean a)
Allows or disallows automatic changing of tab scale. |
void |
setBorderWidth(int w)
Sets the width of the border between cells. |
void |
setC(int i,
boolean s)
Sets the state of a checkbox in a GridBagView table. |
void |
setDetachable(boolean b)
Sets the detachable property. |
void |
setDocument(int i,
MDocument doc)
Sets the document |
void |
setDraggable(boolean enabled)
Allows or denies mouse dragged events in cells. |
void |
setEditable(int e)
Sets the mode that determines if the structure is editable. |
void |
setEnabled(boolean enabled)
Enables or disables this component, depending on the value of the parameter b. |
void |
setFieldFont(java.lang.String key,
java.awt.Font f)
Sets the font for a named field in a table. |
void |
setL(int i,
java.lang.String s)
Sets a label in a GridBagView table. |
void |
setM(int n,
java.io.File f,
java.lang.String opts)
Deprecated. As of Marvin 5.2.5, it is recommended to import the molecule in advance, e.g. by using MolImporter, then set the
cell synchronously using setM(int, Molecule). The
reason is to simplify the public API and minimize the risk
of related concurrency problems in user codes. |
void |
setM(int n,
Molecule m)
Sets the nth molecule. |
void |
setM(int n,
Molecule[] mols)
Sets the nth animation. |
void |
setM(int n,
java.lang.String s)
Deprecated. As of Marvin 5.2.5, it is recommended to import the molecule in advance, e.g. by using MolImporter, then set the
cell synchronously using setM(int, Molecule). The
reason is to simplify the public API and minimize the risk
of related concurrency problems in user codes. |
void |
setM(int n,
java.lang.String s,
java.lang.String opts)
Deprecated. As of Marvin 5.2.5, it is recommended to import the molecule in advance, e.g. by using MolImporter, then set the
cell synchronously using setM(int, Molecule). The
reason is to simplify the public API and minimize the risk
of related concurrency problems in user codes. |
void |
setNavmode(java.lang.String s)
Sets the mouse drag action. |
void |
setPreferredSize(java.awt.Dimension sz)
Sets the preferred size of the component. |
void |
setRecordIDBackground(int k,
java.awt.Color color)
Highlights a record by setting the background of its identifier field. |
void |
setRecordIDForeground(int k,
java.awt.Color color)
Highlights a record by setting the foreground of its identifier field. |
void |
setSelectable(boolean v)
Enables the user to select a cell by clicking on it or using the cursor movement keys. |
void |
setSelectedIndex(int i)
Selects a molecule. |
boolean |
setSetSeq(int i,
int atom,
int id)
Deprecated. as of Marvin 3.3, replaced by setAtomSetSeq |
void |
setT(int i,
java.lang.String s)
Sets a text field in a GridBagView table. |
void |
setTabScale(double scale)
Sets the magnification in the molecule cells. |
void |
setTopLeftIndex(int v)
Scrolls to the specified cell. |
void |
setValenceErrorVisibleInView(boolean v)
Shows or hides valence errors |
void |
setWinScale(double scale)
Sets the magnification in the zoom windows. |
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, setDoubleBuffered, 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, getBaseline, getBaselineResizeBehavior, getBorder, getBounds, getClientProperty, getComponentGraphics, getComponentPopupMenu, getConditionForKeyStroke, getDebugGraphicsOptions, getDefaultLocale, getFontMetrics, getGraphics, getHeight, getInheritsPopupMenu, getInputMap, getInputMap, getInputVerifier, getInsets, getInsets, getListeners, getLocation, getMaximumSize, getMinimumSize, getNextFocusableComponent, getPopupLocation, getRegisteredKeyStrokes, getRootPane, getSize, getToolTipLocation, getToolTipText, getToolTipText, getTopLevelAncestor, getTransferHandler, getVerifyInputWhenFocusTarget, getVetoableChangeListeners, getVisibleRect, getWidth, getX, getY, grabFocus, isDoubleBuffered, isLightweightComponent, isManagingFocus, isOpaque, isPaintingForPrint, 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, setFocusTraversalKeys, setFont, setForeground, setInheritsPopupMenu, setInputMap, setInputVerifier, setMaximumSize, setMinimumSize, setNextFocusableComponent, setOpaque, 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 VIEW_ONLY
public static final int EDITABLE
public static final int SKETCHABLE
| Constructor Detail |
|---|
public MViewPane()
public MViewPane(UserSettings settings)
settings - the user settings| Method Detail |
|---|
public chemaxon.marvin.common.swing.CommonActions getCommonActions()
getCommonActions in class MarvinPanepublic void makeSaveAsMenu(java.awt.Container menu)
menu - the parent menupublic void makeRecentFileListMenu(java.awt.Container menu)
menu - the parent menupublic void makeEditMenu(java.awt.Container menu)
menu - the Edit menupublic void makeViewMenu(java.awt.Container menu)
menu - the View menupublic void makeStructureMenu(java.awt.Container menu)
public javax.swing.JMenu makeToolsMenu()
MarvinPane.addToolsMenu(java.awt.Container) should be used.
public void makeHelpMenu(java.awt.Container menu)
MarvinPane.addHelpMenu(java.awt.Container) should be used.
menu - the Help menupublic TableSupport getTableSupport()
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.
For the list of used properties, please visit MarvinView: parameters and events
addPropertyChangeListener in class java.awt.ContainerpropertyName - the name of the property to listen onlistener - the PropertyChangeListener to be addedpublic java.awt.Color getRecordIDBackground(int k)
k - record index
null otherwise
public void setRecordIDBackground(int k,
java.awt.Color color)
k - record indexcolor - the highlight color
or null to restore the default colorpublic java.awt.Color getRecordIDForeground(int k)
k - record index
null otherwise
public void setRecordIDForeground(int k,
java.awt.Color color)
k - record indexcolor - the highlight color
or null to restore the default color
public boolean setSetSeq(int i,
int atom,
int id)
i - molecule cell indexatom - atom indexid - a number between 0 and 63. 0 is the default set.
It contains all atoms that are not in another set.
public int getTopLeftIndex()
public void setTopLeftIndex(int v)
v - top left cell indexpublic javax.swing.JComponent getCanvasComponent(int i)
public javax.swing.JComponent getVisibleCellComponent(int i)
for (int i = 0; i < viewPane.getVisibleCellCount(); i++) {
JComponent comp = viewPane.getVisibleCellComponent(i);
comp.addMouseListener(actionListener);
comp.add(customPopupMenu);
}
Do not refer not visible cells and avoid using of absolute indexes,
they can cause false result at scrolling. If you do not know relative
index you can do this:
int visibleIndex = viewPane.getVisibleCellIndex(absoluteIndex);
if (visibleIndex != -1) {
JComponent comp = viewPane.getCanvasComponent(visibleIndex);
}
i - visible index of the cell. If Viewer is not a table, set index
to 0.
MarvinPane.setPopupMenusEnabled(boolean),
getVisibleCellCount(),
getVisibleCellIndex(int)public int getVisibleCellCount()
public int getVisibleCellIndex(int absoluteIndex)
absoluteIndex - absolute index of the cell
public int getAbsoluteCellIndex(int visibleIndex)
visibleIndex - relative index of the visible cell
public int getAbsoluteCellIndex(javax.swing.JComponent component)
component - canvas specified component where the molecule is displayed
public java.lang.String getAnimated()
public boolean isAnimated(int index)
throws java.lang.ArrayIndexOutOfBoundsException
index - Cell index. (0 for simple viewer).
java.lang.ArrayIndexOutOfBoundsException - index out of range
(index < 0 || index >= number of cells)
public boolean setAtomSetSeq(int i,
int atom,
int id)
i - molecule cell indexatom - atom indexid - a number between 0 and 63. 0 is the default set.
It contains all atoms that are not in another set.
public void setAnimated(boolean animated)
animated - True to start animation, false to stop it.
public void setAnimated(int index,
boolean animated)
index - Index of specified cell (0 for simple viewer).animated - True to start animation, false to stop it.public MDocument[] getDocuments()
The size of the array equals to the number of the last non-empty molecule cell.
Note that using this method is not recommended if the input is a
molecule file or any kind of MDocSource,
because it returns null for non-cached molecules.
The thread-safe way to query molecules in such cases is by creating
a record access task, see TableSupport.scheduler
public MDocStorage getDocStorage()
Note that MDocStorage should only be used
via record access tasks if the input is an
MDocSource,
see TableSupport.scheduler.
public Molecule getM(int n)
Note that using this method is not recommended if the input is a
molecule file or any kind of MDocSource,
because it returns null for non-cached molecules.
The thread-safe way to query molecules in such cases is by creating
a record access task, see TableSupport.scheduler.
n - molecule cell number (0 for simple viewer)
null if the record is not in cache
public void setM(int n,
Molecule m)
n - molecule cell number (0 for simple viewer)m - the molecule
public void setM(int n,
Molecule[] mols)
n - molecule cell number (0 for simple viewer)mols - the animation sequence
public java.lang.String getM(int n,
java.lang.String fmt)
For a simple viewer with only one molecule, n must be zero. Nonzero n should only be used if the viewer is a molecule table. The format descriptor string can also contain export options. Format and options are separated by a colon, multiple options can be separated by commas. See the text formats and their options on the File Formats in Marvin page. Examples:
s1 = mview.getM(0, "mol"); s2 = mview.getM(0, "smiles:a-H"); // aromatize and remove HydrogensNote that using this method is not recommended if the input is a molecule file or any kind of
MDocSource,
because it returns null for non-cached molecules.
The thread-safe way to query molecules in such cases is by creating
a record access task, see TableSupport.scheduler.
n - molecule cell numberfmt - the format descriptor string
public void setM(int n,
java.lang.String s)
MolImporter, then set the
cell synchronously using setM(int, Molecule). The
reason is to simplify the public API and minimize the risk
of related concurrency problems in user codes.
public void setM(int n,
java.lang.String s,
java.lang.String opts)
MolImporter, then set the
cell synchronously using setM(int, Molecule). The
reason is to simplify the public API and minimize the risk
of related concurrency problems in user codes.
public void setM(int n,
java.io.File f,
java.lang.String opts)
MolImporter, then set the
cell synchronously using setM(int, Molecule). The
reason is to simplify the public API and minimize the risk
of related concurrency problems in user codes.
public MDocument getDocument(int i)
Note that using this method is not recommended if the input is a
molecule file or any kind of MDocSource,
because it returns null for non-cached molecules.
The thread-safe way to query molecules in such cases is by creating
a record access task, see TableSupport.scheduler.
i - cell index
public void setDocument(int i,
MDocument doc)
i - cell number (0 for simple viewer)doc - the documentpublic java.lang.String getL(int i)
i - the label index
public void setL(int i,
java.lang.String s)
i - the label indexs - the labelpublic boolean getC(int i)
i - the checkbox index
public void setC(int i,
boolean s)
i - the checkbox indexs - the state
public void setActionB(int i,
java.lang.String s)
i - the button indexs - action string
public void setActionC(int i,
java.lang.String s)
i - two times the checkbox index plus 0 for unchecked,
1 for checked states - action stringpublic java.lang.String getT(int i)
i - text field index
public void setT(int i,
java.lang.String s)
i - text field indexs - textpublic int getCellCount()
public java.lang.String getNavmode()
public void setNavmode(java.lang.String s)
s - "translate", "zoom", "rotZ" or "rot3d"public int getEditable()
VIEW_ONLY (0) if molecules can be viewed only,
EDITABLE (1) if they are editable with MarvinView,
SKETCHABLE (2) if they are editable with MarvinSketch.public void setEditable(int e)
VIEW_ONLY: editing is disabled,
EDITABLE: editing is enabled and launches MarvinView in a new window,
SKETCHABLE: editing is enabled and launches MarvinSketch in a new window.
e - identifier of the modepublic boolean isSelectable()
getSelectedIndex(),
setSelectedIndex(int)public void setSelectable(boolean v)
v - true to enable, false to disable cell selectiongetSelectedIndex(),
setSelectedIndex(int)public int getSelectedIndex()
isSelectable(),
setSelectable(boolean)public void setSelectedIndex(int i)
i - the cell index or -1 to unselectisSelectable(),
setSelectable(boolean)public int getBorderWidth()
public void setBorderWidth(int w)
w - the border widthpublic double getAnimFPS()
public void setAnimFPS(double r)
r - frames per secondpublic double getAnimDelay()
public void setAnimDelay(double delay)
delay - secondspublic boolean isAnimSync()
public void setAnimSync(boolean sync)
sync - true to synchronize, false to omit synchronizationpublic double getWinScale()
public void setWinScale(double scale)
scale - displayed length of a C-C bond in pixelspublic double getTabScale()
public double getTabScale(int i)
i - the molecule cell index
public void setTabScale(double scale)
scale - displayed length of a C-C bond in pixels, or -1 for
automatic scalingpublic double getBestTabScale(int i)
i - the cell index
public double getBestTabScale()
public boolean getAutoTabScale()
public void setAutoTabScale(boolean a)
a - true to allow, false to disallowpublic void print()
public CTransform3D getRotationMatrix(int cellIndex)
cellIndex - the molecule cell index
null if the specified cell does not existpublic void applyRotationMatrix(int cellIndex)
cellIndex - the molecule cell indexpublic void applyRotationMatrices()
public boolean openSketcher(int index)
index - the cell index
getEditable()public boolean isViewWindowOpened(int index)
index - the cell index
public boolean isSketchWindowOpened(int index)
index - the cell index
public boolean openWindow(int index)
index - the cell index
isDetachable()public void closeWindow(int index)
index - the cell indexpublic void closeSketcher(int index)
index - the cell indexpublic void destroySketcher()
public boolean isDetachable()
getEditable()public void setDetachable(boolean b)
b - true to allow opening a new window with selected structure.
False if it is not allowed.setEditable(int)public javax.swing.AbstractButton getVisibleButtonB(int i)
i - button index
indexOfButtonB(javax.swing.AbstractButton)public javax.swing.AbstractButton getVisibleButtonC(int i)
i - checkbox index
indexOfButtonC(javax.swing.AbstractButton)public int indexOfButtonC(javax.swing.AbstractButton checkbox)
checkbox - a GUI component which implements a checkbox.
getVisibleButtonC(int)public int indexOfButtonB(javax.swing.AbstractButton button)
button - a GUI component which implements a button.
getVisibleButtonB(int)public java.awt.Font getFieldFont(java.lang.String key)
key - the field name or null to get the default font
public void setFieldFont(java.lang.String key,
java.awt.Font f)
key - the field name or null to set the default fontf - the font
public void writeExternal(java.io.ObjectOutput out)
throws java.io.IOException
writeExternal method of class
MView, 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
MView, 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 void setEnabled(boolean enabled)
setEnabled in class MarvinPaneenabled - If true, this component is enabled; otherwise this component
is disabled.public boolean isDraggable()
public void setDraggable(boolean enabled)
enabled - True to allow, false to deny.public void doPaste()
doPaste in class MarvinPanepublic boolean isValenceErrorVisibleInView()
public void setValenceErrorVisibleInView(boolean v)
v - True, underlines atom symbols in case valence errors.public void setPreferredSize(java.awt.Dimension sz)
setPreferredSize in class javax.swing.JComponentsz - the preferred sizepublic java.awt.Dimension getPreferredSize()
getPreferredSize in class javax.swing.JComponent
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||