From: <sh...@us...> - 2009-02-19 15:59:33
|
Revision: 14200 http://cdk.svn.sourceforge.net/cdk/?rev=14200&view=rev Author: shk3 Date: 2009-02-19 15:59:30 +0000 (Thu, 19 Feb 2009) Log Message: ----------- removed old undo-redo remains Modified Paths: -------------- cdk/branches/jchempaint-primary/src/main/org/openscience/cdk/controller/ControllerModel.java cdk/branches/jchempaint-primary/src/main/org/openscience/cdk/controller/IControllerModel.java Removed Paths: ------------- cdk/branches/jchempaint-primary/src/main/org/openscience/cdk/controller/UndoAdapter.java Modified: cdk/branches/jchempaint-primary/src/main/org/openscience/cdk/controller/ControllerModel.java =================================================================== --- cdk/branches/jchempaint-primary/src/main/org/openscience/cdk/controller/ControllerModel.java 2009-02-19 14:28:03 UTC (rev 14199) +++ cdk/branches/jchempaint-primary/src/main/org/openscience/cdk/controller/ControllerModel.java 2009-02-19 15:59:30 UTC (rev 14200) @@ -46,18 +46,10 @@ private ControllerParameters parameters; - private UndoManager undoManager; - - private UndoableEditSupport undoSupport; - private HashMap<Object, Object> merge = new HashMap<Object, Object>(); public ControllerModel() { this.parameters = new ControllerParameters(); - undoManager = new UndoManager(); - undoManager.setLimit(100); - undoSupport = new UndoableEditSupport(); - undoSupport.addUndoableEditListener(new UndoAdapter(undoManager)); } /** @@ -294,46 +286,6 @@ /* * (non-Javadoc) * - * @see org.openscience.cdk.controller.IController2DModel#getUndoSupport() - */ - public UndoableEditSupport getUndoSupport() { - return undoSupport; - } - - /* - * (non-Javadoc) - * - * @see - * org.openscience.cdk.controller.IController2DModel#setUndoSupport(javax - * .swing.undo.UndoableEditSupport) - */ - public void setUndoSupport(UndoableEditSupport undoSupport) { - this.undoSupport = undoSupport; - } - - /* - * (non-Javadoc) - * - * @see org.openscience.cdk.controller.IController2DModel#getUndoManager() - */ - public UndoManager getUndoManager() { - return undoManager; - } - - /* - * (non-Javadoc) - * - * @see - * org.openscience.cdk.controller.IController2DModel#setUndoManager(javax - * .swing.undo.UndoManager) - */ - public void setUndoManager(UndoManager undoManager) { - this.undoManager = undoManager; - } - - /* - * (non-Javadoc) - * * @see org.openscience.cdk.controller.IController2DModel#isMovingAllowed() */ public boolean isMovingAllowed() { Modified: cdk/branches/jchempaint-primary/src/main/org/openscience/cdk/controller/IControllerModel.java =================================================================== --- cdk/branches/jchempaint-primary/src/main/org/openscience/cdk/controller/IControllerModel.java 2009-02-19 14:28:03 UTC (rev 14199) +++ cdk/branches/jchempaint-primary/src/main/org/openscience/cdk/controller/IControllerModel.java 2009-02-19 15:59:30 UTC (rev 14200) @@ -155,14 +155,6 @@ */ public abstract String getDrawElement(); - public abstract UndoableEditSupport getUndoSupport(); - - public abstract void setUndoSupport(UndoableEditSupport undoSupport); - - public abstract UndoManager getUndoManager(); - - public abstract void setUndoManager(UndoManager undoManager); - /** * To retrieve the value of the isMovingAllowed flag * @return boolean isMovingAllowed Deleted: cdk/branches/jchempaint-primary/src/main/org/openscience/cdk/controller/UndoAdapter.java =================================================================== --- cdk/branches/jchempaint-primary/src/main/org/openscience/cdk/controller/UndoAdapter.java 2009-02-19 14:28:03 UTC (rev 14199) +++ cdk/branches/jchempaint-primary/src/main/org/openscience/cdk/controller/UndoAdapter.java 2009-02-19 15:59:30 UTC (rev 14200) @@ -1,62 +0,0 @@ -/* $RCSfile$ - * $Author: egonw $ - * $Date: 2008-09-10 08:13:15 +0200 (Wed, 10 Sep 2008) $ - * $Revision: 12257 $ - * - * Copyright (C) 2005-2007 The Chemistry Development Kit (CDK) project - * - * Contact: cdk...@li... - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. - */ -package org.openscience.cdk.controller; - -import javax.swing.event.UndoableEditEvent; -import javax.swing.event.UndoableEditListener; -import javax.swing.undo.UndoManager; -import javax.swing.undo.UndoableEdit; - -/** - * An undo adapter for updating the state of the undo components according to - * the new state of the undo history list Is registered as a listener to the - * undoSupport which is recieving the undo/redo events. - * - * @author tohel - * @cdk.module control - * @cdk.svnrev $Revision: 12257 $ - */ -public class UndoAdapter implements UndoableEditListener { - - private UndoManager undoManager; - - /** - * @param undoManager - * The undoManager handling the undo/redo history list - */ - public UndoAdapter(UndoManager undoManager) { - this.undoManager = undoManager; - } - - /* - * (non-Javadoc) - * - * @see javax.swing.event.UndoableEditListener#undoableEditHappened(javax.swing.event.UndoableEditEvent) - */ - public void undoableEditHappened(UndoableEditEvent arg0) { - UndoableEdit edit = arg0.getEdit(); - undoManager.addEdit(edit); - } - -} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |