Author: EvaV Date: 2010-02-15 17:25:37 +0100 (Mon, 15 Feb 2010) New Revision: 1736 Modified: trunk/layouteditor/LayoutDesigner/src/applet/ActionsMemory.java trunk/layouteditor/LayoutDesigner/src/applet/LayoutDesigner.java trunk/layouteditor/LayoutDesigner/src/applet/ServerSideContext.java Log: Modified: trunk/layouteditor/LayoutDesigner/src/applet/ActionsMemory.java =================================================================== --- trunk/layouteditor/LayoutDesigner/src/applet/ActionsMemory.java 2010-02-15 16:23:41 UTC (rev 1735) +++ trunk/layouteditor/LayoutDesigner/src/applet/ActionsMemory.java 2010-02-15 16:25:37 UTC (rev 1736) @@ -9,6 +9,7 @@ * */ public class ActionsMemory { + private final static int MAX = 100; private Stack<Layout> backward; /** backward actions stack */ private Stack<Layout> forward; /** forward actions stack */ @@ -33,6 +34,15 @@ // actual state of the actual design area is stored as backward action actualBackward.push(layout.clone()); + if(actualBackward.size() > MAX) { + Stack<Layout> backwardCopy = new Stack<Layout>(); + for(int i = 1; i < actualBackward.size(); ++i) { + backwardCopy.push(actualBackward.get(i)); + } + actualBackward = backwardCopy; + + } + // if new action is done, it isn't possible to go forward actualForward.clear(); @@ -58,6 +68,15 @@ Layout actualLayout = designArea.getMyLayout().clone(); actualForward.push(actualLayout); + if(actualForward.size() > MAX) { + Stack<Layout> forwardCopy = new Stack<Layout>(); + for(int i = 1; i < actualForward.size(); ++i) { + forwardCopy.push(actualForward.get(i)); + } + actualForward = forwardCopy; + + } + // sets new actual state of the actual design area if (actualBackward.size() >= 2) { actualBackward.pop(); @@ -101,6 +120,15 @@ // actual state of the actual design area is stored as backward action Layout oldLayout = designArea.getMyLayout().clone(); actualBackward.push(oldLayout); + + if(actualBackward.size() > MAX) { + Stack<Layout> backwardCopy = new Stack<Layout>(); + for(int i = 1; i < actualBackward.size(); ++i) { + backwardCopy.push(actualBackward.get(i)); + } + actualBackward = backwardCopy; + + } // enables or disables forward action button, whatever there is some forward action left ToolBar toolBar = designArea.getTabbedPane().getToolBar(); Modified: trunk/layouteditor/LayoutDesigner/src/applet/LayoutDesigner.java =================================================================== --- trunk/layouteditor/LayoutDesigner/src/applet/LayoutDesigner.java 2010-02-15 16:23:41 UTC (rev 1735) +++ trunk/layouteditor/LayoutDesigner/src/applet/LayoutDesigner.java 2010-02-15 16:25:37 UTC (rev 1736) @@ -55,9 +55,9 @@ /** name of file with properties */ private final static String PROPERTIES_FILE_PATH = "/webServer2/applets/"; /** file path to properties file */ - private final static int APPLET_WIDTH = 1000; + private final static int APPLET_WIDTH = 950; /** width of applet */ - private final static int APPLET_HEIGHT = 500; + private final static int APPLET_HEIGHT = 650; /** height of applet */ private final static int BAR_HEIGHT = 35; /** height of all bars */ Modified: trunk/layouteditor/LayoutDesigner/src/applet/ServerSideContext.java =================================================================== --- trunk/layouteditor/LayoutDesigner/src/applet/ServerSideContext.java 2010-02-15 16:23:41 UTC (rev 1735) +++ trunk/layouteditor/LayoutDesigner/src/applet/ServerSideContext.java 2010-02-15 16:25:37 UTC (rev 1736) @@ -115,8 +115,8 @@ String userID = applet.getParameter(PROPREF_USER_ID); instance.userID = Integer.parseInt(userID); - instance.isLayoutLocked(); + // set permitted document types instance.permittedDocumentTypes = instance.preparePermittedDocumentTypes(); @@ -126,16 +126,20 @@ instance .setSupportedResolutions(instance.prepareSupportedResolutions()); - if(!isLocked) { - try { instance.layoutID = Integer.parseInt(layoutID); - instance.layout = instance.getLayoutToEdit(tabbedPane); + instance.isLayoutLocked(); + + if(!isLocked) { + instance.layout = instance.getLayoutToEdit(tabbedPane); + } + else { + instance.layout = null; + } + } catch (Exception e) { instance.layout = null; - instance.isLocked = false; } - } } /**