Logo Search packages:      
Sourcecode: cdk version File versions  Download package

void org::openscience::cdk::applications::jchempaint::action::NewAction::actionPerformed ( ActionEvent  e  )  [inline]

Opens an empty JChemPaint frame.

Parameters:
e Description of the Parameter

Reimplemented from org::openscience::cdk::applications::jchempaint::action::JCPAction.

Definition at line 51 of file NewAction.java.

References org::openscience::cdk::applications::jchempaint::JChemPaintModel::getChemModel(), org::openscience::cdk::applications::jchempaint::JChemPaintPanel::getJChemPaintModel(), org::openscience::cdk::interfaces::IChemModel::getMoleculeSet(), org::openscience::cdk::interfaces::IChemModel::getReactionSet(), org::openscience::cdk::applications::jchempaint::JChemPaintPanel::isEmbedded, org::openscience::cdk::applications::jchempaint::action::JCPAction::jcpPanel, org::openscience::cdk::interfaces::IAtomContainerSet::removeAllAtomContainers(), org::openscience::cdk::interfaces::IReactionSet::removeAllReactions(), and org::openscience::cdk::applications::jchempaint::JChemPaintPanel::showWarning().

                                               {
      if(jcpPanel.isEmbedded()){
        int clear=jcpPanel.showWarning();
        if(clear==JOptionPane.YES_OPTION){
            if(jcpPanel.getJChemPaintModel().getChemModel().getMoleculeSet()!=null)
                  jcpPanel.getJChemPaintModel().getChemModel().getMoleculeSet().removeAllAtomContainers();
            if(jcpPanel.getJChemPaintModel().getChemModel().getReactionSet()!=null)
                  jcpPanel.getJChemPaintModel().getChemModel().getReactionSet().removeAllReactions();
            jcpPanel.repaint();
        }
      }else{
        JFrame frame = JChemPaintEditorPanel.getEmptyFrameWithModel();
        frame.setVisible(true);
        frame.pack();
      }
    }


Generated by  Doxygen 1.6.0   Back to index