chemaxon.alchemist.utils
Class AbstractAlchemistMoleculeEditor

java.lang.Object
  extended by java.awt.Component
      extended by java.awt.Container
          extended by javax.swing.JComponent
              extended by javax.swing.JPanel
                  extended by chemaxon.alchemist.utils.AbstractAlchemistMoleculeView
                      extended by chemaxon.alchemist.utils.AlchemistMoleculeView
                          extended by chemaxon.alchemist.utils.AbstractAlchemistMoleculeEditor
All Implemented Interfaces:
java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable, javax.accessibility.Accessible
Direct Known Subclasses:
AlchemistMoleculeEditor

public abstract class AbstractAlchemistMoleculeEditor
extends AlchemistMoleculeView

See Also:
Serialized Form

Nested Class Summary
protected static class AbstractAlchemistMoleculeEditor.MoleculeIndexArray
           
 
Nested classes/interfaces inherited from class javax.swing.JPanel
javax.swing.JPanel.AccessibleJPanel
 
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
protected  javax.swing.AbstractAction ADD_MOLECULE_ACTION
          Action for perform add molecule to the editor.
protected  javax.swing.AbstractAction APPLY_MOLECULE_EDIT_ACTION
          This method applies performed molecule modification action
protected  javax.swing.AbstractAction CANCEL_MOLECULE_EDIT_ACTION
          This method cancels performed molecule modification action
protected  javax.swing.AbstractAction EDIT_MOLECULE_ACTION
          Action for perform edit selected molecule.
protected  boolean isLoading
           
protected  javax.swing.event.SwingPropertyChangeSupport notifier
           
static java.lang.String PROPERTY_KEY_ADDED
           
static java.lang.String PROPERTY_KEY_EDITED
           
static java.lang.String PROPERTY_KEY_REMOVED
           
protected  javax.swing.AbstractAction REMOVE_MOLECULE_ACTION
          This method removes the selected molecule from the table.
protected  MSketchPane sketch
           
 
Fields inherited from class chemaxon.alchemist.utils.AlchemistMoleculeView
columnComboBox, currentRowNum, DEFAULT_MAX_COLNUM, DEFAULT_MAX_ROWNUM, inputStream, isToolbarVisible, maxColNum, maxMolecules, maxRowNum, percent, rowComboBox, scrollBar, source
 
Fields inherited from class chemaxon.alchemist.utils.AbstractAlchemistMoleculeView
colNum, dataModel, holderPanel, rowNum, view
 
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
AbstractAlchemistMoleculeEditor(int defaultRowNum, int defaultColNum, int maxRowNum, int maxColNum, javax.swing.event.SwingPropertyChangeSupport notifier, MSketchPane sketch)
           
AbstractAlchemistMoleculeEditor(int defaultRowNum, int defaultColNum, javax.swing.event.SwingPropertyChangeSupport notifier, MSketchPane sketch)
          Constructor from superclass
 
Method Summary
 void addMolecule()
          AddMolecule action handler
 void applyChanges()
          Apply Changes action handler
 void cancelChanges()
          Cancel Changes action handler
 void clear()
          This method clears the editor, and closes the input stream
 void editMolecule()
          EditMolecule action handler
 javax.swing.AbstractAction getADD_MOLECULE_ACTION()
           
 javax.swing.AbstractAction getAPPLY_MOLECULE_EDIT_ACTION()
           
 javax.swing.AbstractAction getCANCEL_MOLECULE_EDIT_ACTION()
           
 javax.swing.AbstractAction getEDIT_MOLECULE_ACTION()
           
 int getMoleculeCount()
          Returns the number of the molecules in the editor
 Molecule[] getMolecules()
          This method returns all the molecules from the editor Warning!
 javax.swing.AbstractAction getREMOVE_MOLECULE_ACTION()
           
 int getScrollPosition()
           
 boolean hasModified()
           
protected abstract  void hideEditor()
           
 void importMolecules(java.io.InputStream inputStream)
          This method load the molecule from the given stream
 void importMolecules(Molecule[] molecules)
          This method imports molecules array to the editor
 void importMolecules(java.lang.String path)
          This method loads the molecule file from given path
 boolean isMoleculeSelected()
           
 boolean isNonEmptyCellSelected()
          Returns if there is a non-empty cell selected
protected  void refreshGridLayout()
           
protected  void refreshView()
          This method refreshes the molecule view depending on storage
 void removeMolecule()
          RemoveMolecule action handler
 void setEnabled(boolean enabled)
          Sets enabled property
 void setScrollPosition(int position)
           
protected abstract  void showEditor()
           
 void writeToFile(java.io.File file)
          Writes the editor's content into the given file with smiles format
 void writeToFile(java.io.File file, java.lang.String format)
          Writes the editor's content into the given file with the given format
 void writeToStream(java.io.OutputStream outputStream, java.lang.String format)
          Writes the editor's content into the given file with the given format
 
Methods inherited from class chemaxon.alchemist.utils.AlchemistMoleculeView
addListSelectionListerer, close, decreaseView, getColCount, getMaxColCount, getMaxRowCount, getProgressPercentage, getRowCount, getTopPanel, getView, increaseView, removeListSelectionListener, setColCount, setRowCount
 
Methods inherited from class chemaxon.alchemist.utils.AbstractAlchemistMoleculeView
GetDispOpts, getHolderPanel, isMoleculeLabelVisible, SetDispOpts, setMinimumSize, setMoleculeLabelVisible
 
Methods inherited from class javax.swing.JPanel
getAccessibleContext, getUI, getUIClassID, paramString, setUI, updateUI
 
Methods inherited from class javax.swing.JComponent
addAncestorListener, addNotify, 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, isOptimizedDrawingEnabled, isPaintingTile, isRequestFocusEnabled, isValidateRoot, paint, paintBorder, paintChildren, paintComponent, paintImmediately, paintImmediately, print, printAll, printBorder, printChildren, printComponent, processComponentKeyEvent, processKeyBinding, processKeyEvent, processMouseEvent, processMouseMotionEvent, putClientProperty, registerKeyboardAction, registerKeyboardAction, removeAncestorListener, removeNotify, 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, setNextFocusableComponent, setOpaque, setPreferredSize, setRequestFocusEnabled, setToolTipText, setTransferHandler, setUI, setVerifyInputWhenFocusTarget, setVisible, unregisterKeyboardAction, update
 
Methods inherited from class java.awt.Container
add, add, add, add, add, addContainerListener, addImpl, addPropertyChangeListener, 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

isLoading

protected boolean isLoading

sketch

protected MSketchPane sketch

notifier

protected javax.swing.event.SwingPropertyChangeSupport notifier

ADD_MOLECULE_ACTION

protected final javax.swing.AbstractAction ADD_MOLECULE_ACTION
Action for perform add molecule to the editor. Hides viewer panel, and shows editor panel.


EDIT_MOLECULE_ACTION

protected final javax.swing.AbstractAction EDIT_MOLECULE_ACTION
Action for perform edit selected molecule. Sets selected molecule into editor. Hides viewer panel, and shows editor pane


APPLY_MOLECULE_EDIT_ACTION

protected final javax.swing.AbstractAction APPLY_MOLECULE_EDIT_ACTION
This method applies performed molecule modification action


CANCEL_MOLECULE_EDIT_ACTION

protected final javax.swing.AbstractAction CANCEL_MOLECULE_EDIT_ACTION
This method cancels performed molecule modification action


REMOVE_MOLECULE_ACTION

protected final javax.swing.AbstractAction REMOVE_MOLECULE_ACTION
This method removes the selected molecule from the table.


PROPERTY_KEY_EDITED

public static final java.lang.String PROPERTY_KEY_EDITED
See Also:
Constant Field Values

PROPERTY_KEY_ADDED

public static final java.lang.String PROPERTY_KEY_ADDED
See Also:
Constant Field Values

PROPERTY_KEY_REMOVED

public static final java.lang.String PROPERTY_KEY_REMOVED
See Also:
Constant Field Values
Constructor Detail

AbstractAlchemistMoleculeEditor

public AbstractAlchemistMoleculeEditor(int defaultRowNum,
                                       int defaultColNum,
                                       javax.swing.event.SwingPropertyChangeSupport notifier,
                                       MSketchPane sketch)
Constructor from superclass

Parameters:
defaultRowNum -
defaultColNum -
notifier -

AbstractAlchemistMoleculeEditor

public AbstractAlchemistMoleculeEditor(int defaultRowNum,
                                       int defaultColNum,
                                       int maxRowNum,
                                       int maxColNum,
                                       javax.swing.event.SwingPropertyChangeSupport notifier,
                                       MSketchPane sketch)
Method Detail

importMolecules

public void importMolecules(java.lang.String path)
This method loads the molecule file from given path

Overrides:
importMolecules in class AlchemistMoleculeView
Parameters:
path - is the path to molecule file

importMolecules

public void importMolecules(java.io.InputStream inputStream)
Description copied from class: AlchemistMoleculeView
This method load the molecule from the given stream

Overrides:
importMolecules in class AlchemistMoleculeView

refreshView

protected void refreshView()
This method refreshes the molecule view depending on storage

Overrides:
refreshView in class AlchemistMoleculeView

refreshGridLayout

protected void refreshGridLayout()
Overrides:
refreshGridLayout in class AlchemistMoleculeView

getMoleculeCount

public int getMoleculeCount()
Returns the number of the molecules in the editor

Returns:
int

writeToFile

public void writeToFile(java.io.File file)
Writes the editor's content into the given file with smiles format

Parameters:
file -

writeToFile

public void writeToFile(java.io.File file,
                        java.lang.String format)
Writes the editor's content into the given file with the given format

Parameters:
file -
format -

writeToStream

public void writeToStream(java.io.OutputStream outputStream,
                          java.lang.String format)
                   throws MolFormatException,
                          java.io.IOException,
                          java.io.EOFException
Writes the editor's content into the given file with the given format

Parameters:
outputStream - is the stream to write into
format - is the export format string
Throws:
MolFormatException
java.io.IOException
java.io.EOFException

importMolecules

public void importMolecules(Molecule[] molecules)
This method imports molecules array to the editor

Parameters:
molecules -

getMolecules

public Molecule[] getMolecules()
This method returns all the molecules from the editor Warning! All the molecules will be cloned!

Returns:
all the molecules from the editor

showEditor

protected abstract void showEditor()

hideEditor

protected abstract void hideEditor()

hasModified

public boolean hasModified()

clear

public void clear()
This method clears the editor, and closes the input stream

Overrides:
clear in class AlchemistMoleculeView

setEnabled

public void setEnabled(boolean enabled)
Description copied from class: AlchemistMoleculeView
Sets enabled property

Overrides:
setEnabled in class AlchemistMoleculeView

getScrollPosition

public int getScrollPosition()

setScrollPosition

public void setScrollPosition(int position)

getADD_MOLECULE_ACTION

public javax.swing.AbstractAction getADD_MOLECULE_ACTION()

getEDIT_MOLECULE_ACTION

public javax.swing.AbstractAction getEDIT_MOLECULE_ACTION()

getAPPLY_MOLECULE_EDIT_ACTION

public javax.swing.AbstractAction getAPPLY_MOLECULE_EDIT_ACTION()

getCANCEL_MOLECULE_EDIT_ACTION

public javax.swing.AbstractAction getCANCEL_MOLECULE_EDIT_ACTION()

getREMOVE_MOLECULE_ACTION

public javax.swing.AbstractAction getREMOVE_MOLECULE_ACTION()

isMoleculeSelected

public boolean isMoleculeSelected()

isNonEmptyCellSelected

public boolean isNonEmptyCellSelected()
Returns if there is a non-empty cell selected

Returns:
true if there is a non-empty cell selected

addMolecule

public void addMolecule()
AddMolecule action handler


editMolecule

public void editMolecule()
EditMolecule action handler


removeMolecule

public void removeMolecule()
RemoveMolecule action handler


applyChanges

public void applyChanges()
Apply Changes action handler


cancelChanges

public void cancelChanges()
Cancel Changes action handler