JChemPaintEditorApplet.GUI_APPLET) ||
JChemPaintPanel.getAllAtomContainersInOne(jcpPanel.getChemModel()).getAtomCount()==0) {
int clear = jcpPanel.showWarning();
if (clear == JOptionPane.YES_OPTION) {
try {
IChemModel chemModel = null;
chemModel = JChemPaint.readFromFile(f, null, jcpPanel);
if (jcpPanel.get2DHub().getUndoRedoFactory() != null
&& jcpPanel.get2DHub().getUndoRedoHandler() != null) {
IUndoRedoable undoredo = jcpPanel.get2DHub()
.getUndoRedoFactory().getLoadNewModelEdit(
jcpPanel.getChemModel(),
null,
jcpPanel.getChemModel()
.getMoleculeSet(),
jcpPanel.getChemModel()
.getReactionSet(),
chemModel.getMoleculeSet(),
chemModel.getReactionSet(),
"Load "
+ f.getName());
jcpPanel.get2DHub().getUndoRedoHandler().postEdit(
undoredo);
}
jcpPanel.getChemModel().setMoleculeSet(
chemModel.getMoleculeSet());
jcpPanel.getChemModel().setReactionSet(chemModel.getReactionSet());
jcpPanel.getRenderPanel().getRenderer()
.getRenderer2DModel().setSelection(
new LogicalSelection(
LogicalSelection.Type.NONE));