Author: linus
Date: 2007-07-10 07:56:30-0700
New Revision: 13021
Modified:
branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/AbstractProjectMember.java (contents, props changed)
branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/DelayedChangeNotify.java (contents, props changed)
branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/DelayedVChangeListener.java (contents, props changed)
branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/MemberList.java (contents, props changed)
branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/Project.java (contents, props changed)
branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectManager.java (contents, props changed)
branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectMember.java (contents, props changed)
branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectSettings.java (contents, props changed)
branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/UndoEnabler.java (contents, props changed)
branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/package.html (contents, props changed)
Log:
Attempt to understand how to get meaningful diffs.
Modified: branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/AbstractProjectMember.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/AbstractProjectMember.java?view=diff&rev=13021&p1=branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/AbstractProjectMember.java&p2=branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/AbstractProjectMember.java&r1=13020&r2=13021
==============================================================================
--- branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/AbstractProjectMember.java (original)
+++ branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/AbstractProjectMember.java 2007-07-10 07:56:30-0700
@@ -1,158 +1,158 @@
-// $Id: AbstractProjectMember.java 10734 2006-06-11 15:43:58Z mvw $
-// Copyright (c) 1996-2006 The Regents of the University of California. All
-// Rights Reserved. Permission to use, copy, modify, and distribute this
-// software and its documentation without fee, and without a written
-// agreement is hereby granted, provided that the above copyright notice
-// and this paragraph appear in all copies. This software program and
-// documentation are copyrighted by The Regents of the University of
-// California. The software program and documentation are supplied "AS
-// IS", without any accompanying services from The Regents. The Regents
-// does not warrant that the operation of the program will be
-// uninterrupted or error-free. The end-user understands that the program
-// was developed for research purposes and is advised not to rely
-// exclusively on the program for any reason. IN NO EVENT SHALL THE
-// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
-// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
-// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
-// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
-// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
-// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
-// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
-// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-
-package org.argouml.kernel;
-
-/**
- * A member of the project.
- *
- */
-public abstract class AbstractProjectMember implements ProjectMember {
-
- ////////////////////////////////////////////////////////////////
- // instance varables
-
- private String uniqueName;
- private Project project = null;
-
- ////////////////////////////////////////////////////////////////
- // constructors
-
- /**
- * The constructor.
- *
- * @param theUniqueName the name of the member, this must
- * be different for all members. Note
- * that for diagram members this is
- * not the name of the diagram.
- * @param theProject the owning project
- */
- public AbstractProjectMember(String theUniqueName, Project theProject) {
- project = theProject;
- makeUniqueName(theUniqueName);
- }
-
- /**
- * In contrast to {@link #getZipName()} returns the member's
- * name without the prepended name of the project.
- *
- * @author Steffen Zschaler
- *
- * @return the member's name without any prefix or suffix
- */
- public String getUniqueDiagramName() {
- String s = uniqueName;
-
- if (s != null) {
- if (!s.endsWith (getZipFileExtension())) {
- s += getZipFileExtension();
- }
- }
-
- return s;
- }
-
- /**
- * Returns a unique member's name for storage in a zipfile.
- * The project's base name is prepended followed by an
- * underscore '_'.
- *
- * @return the name for zip file storage
- */
- public String getZipName() {
- if (uniqueName == null) {
- return null;
- }
-
- String s = project.getBaseName();
-
- if (uniqueName.length() > 0) {
- s += "_" + uniqueName;
- }
-
- if (!s.endsWith(getZipFileExtension())) {
- s += getZipFileExtension();
- }
-
- return s;
- }
-
- /**
- * Makes a unique name for this member.
- * Note this is not the diagram name and this appears
- * to be flawed.
- * @param s a string which will make up part of this
- * unique name.
- */
- protected void makeUniqueName(String s) {
- uniqueName = s;
-
- if (uniqueName == null) {
- return;
- }
-
- if (uniqueName.startsWith (project.getBaseName())) {
- uniqueName = uniqueName.substring (project.getBaseName().length());
- int i = 0;
- for (; i < uniqueName.length(); i++) {
- if (uniqueName.charAt(i) != '_') {
- break;
- }
- }
- if (i > 0) {
- uniqueName = uniqueName.substring(i);
- }
- }
-
- if (uniqueName.endsWith(getZipFileExtension())) {
- uniqueName =
- uniqueName.substring(0,
- uniqueName.length() - getZipFileExtension().length());
- }
- }
-
- /**
- * @return a short string defining the member type.
- * Usually equals the file extension.
- */
- public abstract String getType();
-
- /**
- * @return the file extension string
- */
- public String getZipFileExtension() {
- return "." + getType();
- }
-
- ////////////////////////////////////////////////////////////////
- // actions
-
- /**
- * Remove this member from its project.
- */
- protected void remove() {
- uniqueName = null;
- project = null;
- }
-} /* end class ProjectMember */
+// $Id$
+// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.kernel;
+
+/**
+ * A member of the project.
+ *
+ */
+public abstract class AbstractProjectMember implements ProjectMember {
+
+ ////////////////////////////////////////////////////////////////
+ // instance varables
+
+ private String uniqueName;
+ private Project project = null;
+
+ ////////////////////////////////////////////////////////////////
+ // constructors
+
+ /**
+ * The constructor.
+ *
+ * @param theUniqueName the name of the member, this must
+ * be different for all members. Note
+ * that for diagram members this is
+ * not the name of the diagram.
+ * @param theProject the owning project
+ */
+ public AbstractProjectMember(String theUniqueName, Project theProject) {
+ project = theProject;
+ makeUniqueName(theUniqueName);
+ }
+
+ /**
+ * In contrast to {@link #getZipName()} returns the member's
+ * name without the prepended name of the project.
+ *
+ * @author Steffen Zschaler
+ *
+ * @return the member's name without any prefix or suffix
+ */
+ public String getUniqueDiagramName() {
+ String s = uniqueName;
+
+ if (s != null) {
+ if (!s.endsWith (getZipFileExtension())) {
+ s += getZipFileExtension();
+ }
+ }
+
+ return s;
+ }
+
+ /**
+ * Returns a unique member's name for storage in a zipfile.
+ * The project's base name is prepended followed by an
+ * underscore '_'.
+ *
+ * @return the name for zip file storage
+ */
+ public String getZipName() {
+ if (uniqueName == null) {
+ return null;
+ }
+
+ String s = project.getBaseName();
+
+ if (uniqueName.length() > 0) {
+ s += "_" + uniqueName;
+ }
+
+ if (!s.endsWith(getZipFileExtension())) {
+ s += getZipFileExtension();
+ }
+
+ return s;
+ }
+
+ /**
+ * Makes a unique name for this member.
+ * Note this is not the diagram name and this appears
+ * to be flawed.
+ * @param s a string which will make up part of this
+ * unique name.
+ */
+ protected void makeUniqueName(String s) {
+ uniqueName = s;
+
+ if (uniqueName == null) {
+ return;
+ }
+
+ if (uniqueName.startsWith (project.getBaseName())) {
+ uniqueName = uniqueName.substring (project.getBaseName().length());
+ int i = 0;
+ for (; i < uniqueName.length(); i++) {
+ if (uniqueName.charAt(i) != '_') {
+ break;
+ }
+ }
+ if (i > 0) {
+ uniqueName = uniqueName.substring(i);
+ }
+ }
+
+ if (uniqueName.endsWith(getZipFileExtension())) {
+ uniqueName =
+ uniqueName.substring(0,
+ uniqueName.length() - getZipFileExtension().length());
+ }
+ }
+
+ /**
+ * @return a short string defining the member type.
+ * Usually equals the file extension.
+ */
+ public abstract String getType();
+
+ /**
+ * @return the file extension string
+ */
+ public String getZipFileExtension() {
+ return "." + getType();
+ }
+
+ ////////////////////////////////////////////////////////////////
+ // actions
+
+ /**
+ * Remove this member from its project.
+ */
+ protected void remove() {
+ uniqueName = null;
+ project = null;
+ }
+} /* end class ProjectMember */
Modified: branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/DelayedChangeNotify.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/DelayedChangeNotify.java?view=diff&rev=13021&p1=branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/DelayedChangeNotify.java&p2=branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/DelayedChangeNotify.java&r1=13020&r2=13021
==============================================================================
--- branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/DelayedChangeNotify.java (original)
+++ branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/DelayedChangeNotify.java 2007-07-10 07:56:30-0700
@@ -1,54 +1,54 @@
-// $Id: DelayedChangeNotify.java 11516 2006-11-25 04:30:15Z tfmorris $
-// Copyright (c) 1996-2006 The Regents of the University of California. All
-// Rights Reserved. Permission to use, copy, modify, and distribute this
-// software and its documentation without fee, and without a written
-// agreement is hereby granted, provided that the above copyright notice
-// and this paragraph appear in all copies. This software program and
-// documentation are copyrighted by The Regents of the University of
-// California. The software program and documentation are supplied "AS
-// IS", without any accompanying services from The Regents. The Regents
-// does not warrant that the operation of the program will be
-// uninterrupted or error-free. The end-user understands that the program
-// was developed for research purposes and is advised not to rely
-// exclusively on the program for any reason. IN NO EVENT SHALL THE
-// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
-// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
-// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
-// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
-// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
-// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
-// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
-// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-
-package org.argouml.kernel;
-
-import java.beans.PropertyChangeEvent;
-
-/**
- * This appears to be a gui specific class, therefore it does not belong in
- * the Kernel.
- */
-public class DelayedChangeNotify implements Runnable {
- private DelayedVChangeListener listener;
- private PropertyChangeEvent pce;
-
- /**
- * The constructor.
- *
- * @param l the listener
- * @param p the event
- */
- public DelayedChangeNotify(DelayedVChangeListener l,
- PropertyChangeEvent p) {
- listener = l;
- pce = p;
- }
-
- /*
- * @see java.lang.Runnable#run()
- */
- public void run() { listener.delayedVetoableChange(pce); }
-
-} /* end class DelayedChangeNotify */
+// $Id$
+// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.kernel;
+
+import java.beans.PropertyChangeEvent;
+
+/**
+ * This appears to be a gui specific class, therefore it does not belong in
+ * the Kernel.
+ */
+public class DelayedChangeNotify implements Runnable {
+ private DelayedVChangeListener listener;
+ private PropertyChangeEvent pce;
+
+ /**
+ * The constructor.
+ *
+ * @param l the listener
+ * @param p the event
+ */
+ public DelayedChangeNotify(DelayedVChangeListener l,
+ PropertyChangeEvent p) {
+ listener = l;
+ pce = p;
+ }
+
+ /*
+ * @see java.lang.Runnable#run()
+ */
+ public void run() { listener.delayedVetoableChange(pce); }
+
+} /* end class DelayedChangeNotify */
Modified: branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/DelayedVChangeListener.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/DelayedVChangeListener.java?view=diff&rev=13021&p1=branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/DelayedVChangeListener.java&p2=branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/DelayedVChangeListener.java&r1=13020&r2=13021
==============================================================================
--- branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/DelayedVChangeListener.java (original)
+++ branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/DelayedVChangeListener.java 2007-07-10 07:56:30-0700
@@ -1,40 +1,40 @@
-// $Id: DelayedVChangeListener.java 6974 2004-11-01 10:55:24Z mkl $
-// Copyright (c) 1996-99 The Regents of the University of California. All
-// Rights Reserved. Permission to use, copy, modify, and distribute this
-// software and its documentation without fee, and without a written
-// agreement is hereby granted, provided that the above copyright notice
-// and this paragraph appear in all copies. This software program and
-// documentation are copyrighted by The Regents of the University of
-// California. The software program and documentation are supplied "AS
-// IS", without any accompanying services from The Regents. The Regents
-// does not warrant that the operation of the program will be
-// uninterrupted or error-free. The end-user understands that the program
-// was developed for research purposes and is advised not to rely
-// exclusively on the program for any reason. IN NO EVENT SHALL THE
-// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
-// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
-// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
-// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
-// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
-// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
-// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
-// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-
-package org.argouml.kernel;
-
-import java.beans.PropertyChangeEvent;
-
-/**
- * This appears to be a gui specific class, therefore it does not belong in
- * the Kernel.
- */
-public interface DelayedVChangeListener {
-
- /**
- * @param pce the event
- */
- public void delayedVetoableChange(PropertyChangeEvent pce);
-
-} /* end interface DelayedVChangeListener */
+// $Id$
+// Copyright (c) 1996-99 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.kernel;
+
+import java.beans.PropertyChangeEvent;
+
+/**
+ * This appears to be a gui specific class, therefore it does not belong in
+ * the Kernel.
+ */
+public interface DelayedVChangeListener {
+
+ /**
+ * @param pce the event
+ */
+ public void delayedVetoableChange(PropertyChangeEvent pce);
+
+} /* end interface DelayedVChangeListener */
Modified: branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/MemberList.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/MemberList.java?view=diff&rev=13021&p1=branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/MemberList.java&p2=branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/MemberList.java&r1=13020&r2=13021
==============================================================================
--- branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/MemberList.java (original)
+++ branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/MemberList.java 2007-07-10 07:56:30-0700
@@ -1,357 +1,357 @@
-// $Id: MemberList.java 12860 2007-06-16 11:57:48Z maurelio1234 $
-// Copyright (c) 2004-2006 The Regents of the University of California. All
-// Rights Reserved. Permission to use, copy, modify, and distribute this
-// software and its documentation without fee, and without a written
-// agreement is hereby granted, provided that the above copyright notice
-// and this paragraph appear in all copies. This software program and
-// documentation are copyrighted by The Regents of the University of
-// California. The software program and documentation are supplied "AS
-// IS", without any accompanying services from The Regents. The Regents
-// does not warrant that the operation of the program will be
-// uninterrupted or error-free. The end-user understands that the program
-// was developed for research purposes and is advised not to rely
-// exclusively on the program for any reason. IN NO EVENT SHALL THE
-// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
-// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
-// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
-// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
-// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
-// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
-// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
-// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-
-package org.argouml.kernel;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.argouml.uml.ProjectMemberModel;
-import org.argouml.uml.cognitive.ProjectMemberTodoList;
-import org.argouml.uml.diagram.ProjectMemberDiagram;
-import org.argouml.uml.profile.ProfileConfiguration;
-import org.tigris.gef.base.Diagram;
-
-/**
- * @author Bob Tarling
- */
-public class MemberList implements List {
-
- /**
- * Logger.
- */
- private static final Logger LOG = Logger.getLogger(MemberList.class);
-
- private AbstractProjectMember model;
- private List diagramMembers = new ArrayList(10);
- private AbstractProjectMember todoList;
- private AbstractProjectMember profileConfiguration;
-
- private Vector allMembers = new Vector();
-
- /**
- * The constructor.
- */
- public MemberList() {
- LOG.info("Creating a member list");
- }
-
- public boolean add(Object member) {
-
- if (member instanceof ProjectMemberModel) {
- // Always put the model at the top
- model = (AbstractProjectMember) member;
- return true;
- } else if (member instanceof ProjectMemberTodoList) {
- // otherwise add the diagram at the start
- setTodoList((AbstractProjectMember) member);
- return true;
- } else if (member instanceof ProfileConfiguration) {
- setProfileConfiguration((AbstractProjectMember) member);
- return true;
- } else if (member instanceof ProjectMemberDiagram) {
- // otherwise add the diagram at the start
- return diagramMembers.add(member);
- }
- return false;
- }
-
- public boolean remove(Object member) {
- LOG.info("Removing a member");
- if (member instanceof Diagram) {
- return removeDiagram((Diagram) member);
- }
- ((AbstractProjectMember) member).remove();
- if (model == member) {
- model = null;
- return true;
- } else if (todoList == member) {
- LOG.info("Removing todo list");
- setTodoList(null);
- return true;
- } else if (profileConfiguration == member) {
- LOG.info("Removing profile configuration");
- setProfileConfiguration(null);
- return true;
- } else {
- return diagramMembers.remove(member);
- }
- }
-
- public Iterator iterator() {
- List temp = new ArrayList(size());
- if (model != null) {
- temp.add(model);
- }
- temp.addAll(diagramMembers);
- if (todoList != null) {
- temp.add(todoList);
- }
- if (profileConfiguration != null) {
- temp.add(profileConfiguration);
- }
- return temp.iterator();
- }
-
- public ListIterator listIterator() {
- List temp = new ArrayList(size());
- if (model != null) {
- temp.add(model);
- }
- temp.addAll(diagramMembers);
- if (todoList != null) {
- temp.add(todoList);
- }
- if (profileConfiguration != null) {
- temp.add(profileConfiguration);
- }
- return temp.listIterator();
- }
-
- public ListIterator listIterator(int arg0) {
- List temp = new ArrayList(size());
- if (model != null) {
- temp.add(model);
- }
- temp.addAll(diagramMembers);
- if (todoList != null) {
- temp.add(todoList);
- }
- if (profileConfiguration != null) {
- temp.add(profileConfiguration);
- }
- return temp.listIterator(arg0);
- }
-
- private boolean removeDiagram(Diagram d) {
- Iterator it = diagramMembers.iterator();
- while (it.hasNext()) {
- Object obj = it.next();
- ProjectMemberDiagram pmd = (ProjectMemberDiagram) obj;
- if (pmd.getDiagram() == d) {
- pmd.remove();
- diagramMembers.remove(pmd);
- return true;
- }
- }
- return false;
- }
-
- public int size() {
- int size = diagramMembers.size();
- if (model != null) {
- ++size;
- }
- if (todoList != null) {
- ++size;
- }
- if (profileConfiguration != null) {
- ++size;
- }
- return size;
- }
-
- public boolean contains(Object member) {
- if (todoList == member) {
- return true;
- }
- if (model == member) {
- return true;
- }
- if (profileConfiguration == member) {
- return true;
- }
- return diagramMembers.contains(member);
- }
-
- public void clear() {
- LOG.info("Clearing members");
- if (model != null) {
- model.remove();
- }
- if (todoList != null) {
- todoList.remove();
- }
- if (profileConfiguration != null) {
- profileConfiguration.remove();
- }
-
- Iterator membersIt = diagramMembers.iterator();
- while (membersIt.hasNext()) {
- ((AbstractProjectMember) membersIt.next()).remove();
- }
- diagramMembers.clear();
- }
-
- /**
- * @param type the type of the member
- * @return the member of the project
- */
- public ProjectMember getMember(Class type) {
- if (type == ProjectMemberModel.class) {
- return model;
- }
- if (type == ProjectMemberTodoList.class) {
- return todoList;
- }
- if (type == ProfileConfiguration.class) {
- return profileConfiguration;
- }
- throw new IllegalArgumentException(
- "There is no single instance of a " + type.getName() + " member");
- }
-
- /**
- * @param type the type of the member
- * @return the member of the project
- */
- public List getMembers(Class type) {
- if (type == ProjectMemberModel.class) {
- List temp = new ArrayList(1);
- temp.add(model);
- return temp;
- }
- if (type == ProjectMemberTodoList.class) {
- List temp = new ArrayList(1);
- temp.add(todoList);
- return temp;
- }
- if (type == ProjectMemberDiagram.class) {
- return diagramMembers;
- }
- if (type == ProfileConfiguration.class) {
- List temp = new ArrayList(1);
- temp.add(profileConfiguration);
- return temp;
- }
- throw new IllegalArgumentException(
- "There is no single instance of a " + type.getName() + " member");
- }
-
- public Object get(int i) {
- if (model != null) {
- if (i == 0) {
- return model;
- }
- --i;
- }
-
- if (i == diagramMembers.size()) {
- return todoList;
- }
- if (i == diagramMembers.size()+1) {
- return profileConfiguration;
- }
-
- return diagramMembers.get(i);
- }
-
- public boolean isEmpty() {
- return size() == 0;
- }
-
- public Object[] toArray() {
- Object[] temp = new Object[size()];
- int pos = 0;
- if (model != null) {
- temp[pos++] = model;
- }
- for (int i = 0; i < diagramMembers.size(); ++i) {
- temp[pos++] = diagramMembers.get(i);
- }
- if (todoList != null) {
- temp[pos++] = todoList;
- }
- if (profileConfiguration != null) {
- temp[pos++] = profileConfiguration;
- }
- return temp;
- }
-
- private void setTodoList(AbstractProjectMember member) {
- LOG.info("Setting todoList to " + member);
- todoList = member;
- }
-
- public Object[] toArray(Object[] arg0) {
- throw new UnsupportedOperationException();
- }
-
- public boolean containsAll(Collection arg0) {
- throw new UnsupportedOperationException();
- }
-
- public boolean addAll(Collection arg0) {
- throw new UnsupportedOperationException();
- }
-
- public boolean addAll(int arg0, Collection arg1) {
- throw new UnsupportedOperationException();
- }
-
- public boolean removeAll(Collection arg0) {
- throw new UnsupportedOperationException();
- }
-
- public boolean retainAll(Collection arg0) {
- throw new UnsupportedOperationException();
- }
-
- public Object set(int arg0, Object arg1) {
- throw new UnsupportedOperationException();
- }
-
- public void add(int arg0, Object arg1) {
- throw new UnsupportedOperationException();
- }
-
- public Object remove(int arg0) {
- throw new UnsupportedOperationException();
- }
-
- public int indexOf(Object arg0) {
- throw new UnsupportedOperationException();
- }
-
- public int lastIndexOf(Object arg0) {
- throw new UnsupportedOperationException();
- }
-
- public List subList(int arg0, int arg1) {
- throw new UnsupportedOperationException();
- }
-
- public AbstractProjectMember getProfileConfiguration() {
- return profileConfiguration;
- }
-
- public void setProfileConfiguration(AbstractProjectMember profileConfiguration) {
- this.profileConfiguration = profileConfiguration;
- }
-}
+// $Id$
+// Copyright (c) 2004-2006 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.kernel;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Vector;
+
+import org.apache.log4j.Logger;
+import org.argouml.uml.ProjectMemberModel;
+import org.argouml.uml.cognitive.ProjectMemberTodoList;
+import org.argouml.uml.diagram.ProjectMemberDiagram;
+import org.argouml.uml.profile.ProfileConfiguration;
+import org.tigris.gef.base.Diagram;
+
+/**
+ * @author Bob Tarling
+ */
+public class MemberList implements List {
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = Logger.getLogger(MemberList.class);
+
+ private AbstractProjectMember model;
+ private List diagramMembers = new ArrayList(10);
+ private AbstractProjectMember todoList;
+ private AbstractProjectMember profileConfiguration;
+
+ private Vector allMembers = new Vector();
+
+ /**
+ * The constructor.
+ */
+ public MemberList() {
+ LOG.info("Creating a member list");
+ }
+
+ public boolean add(Object member) {
+
+ if (member instanceof ProjectMemberModel) {
+ // Always put the model at the top
+ model = (AbstractProjectMember) member;
+ return true;
+ } else if (member instanceof ProjectMemberTodoList) {
+ // otherwise add the diagram at the start
+ setTodoList((AbstractProjectMember) member);
+ return true;
+ } else if (member instanceof ProfileConfiguration) {
+ setProfileConfiguration((AbstractProjectMember) member);
+ return true;
+ } else if (member instanceof ProjectMemberDiagram) {
+ // otherwise add the diagram at the start
+ return diagramMembers.add(member);
+ }
+ return false;
+ }
+
+ public boolean remove(Object member) {
+ LOG.info("Removing a member");
+ if (member instanceof Diagram) {
+ return removeDiagram((Diagram) member);
+ }
+ ((AbstractProjectMember) member).remove();
+ if (model == member) {
+ model = null;
+ return true;
+ } else if (todoList == member) {
+ LOG.info("Removing todo list");
+ setTodoList(null);
+ return true;
+ } else if (profileConfiguration == member) {
+ LOG.info("Removing profile configuration");
+ setProfileConfiguration(null);
+ return true;
+ } else {
+ return diagramMembers.remove(member);
+ }
+ }
+
+ public Iterator iterator() {
+ List temp = new ArrayList(size());
+ if (model != null) {
+ temp.add(model);
+ }
+ temp.addAll(diagramMembers);
+ if (todoList != null) {
+ temp.add(todoList);
+ }
+ if (profileConfiguration != null) {
+ temp.add(profileConfiguration);
+ }
+ return temp.iterator();
+ }
+
+ public ListIterator listIterator() {
+ List temp = new ArrayList(size());
+ if (model != null) {
+ temp.add(model);
+ }
+ temp.addAll(diagramMembers);
+ if (todoList != null) {
+ temp.add(todoList);
+ }
+ if (profileConfiguration != null) {
+ temp.add(profileConfiguration);
+ }
+ return temp.listIterator();
+ }
+
+ public ListIterator listIterator(int arg0) {
+ List temp = new ArrayList(size());
+ if (model != null) {
+ temp.add(model);
+ }
+ temp.addAll(diagramMembers);
+ if (todoList != null) {
+ temp.add(todoList);
+ }
+ if (profileConfiguration != null) {
+ temp.add(profileConfiguration);
+ }
+ return temp.listIterator(arg0);
+ }
+
+ private boolean removeDiagram(Diagram d) {
+ Iterator it = diagramMembers.iterator();
+ while (it.hasNext()) {
+ Object obj = it.next();
+ ProjectMemberDiagram pmd = (ProjectMemberDiagram) obj;
+ if (pmd.getDiagram() == d) {
+ pmd.remove();
+ diagramMembers.remove(pmd);
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public int size() {
+ int size = diagramMembers.size();
+ if (model != null) {
+ ++size;
+ }
+ if (todoList != null) {
+ ++size;
+ }
+ if (profileConfiguration != null) {
+ ++size;
+ }
+ return size;
+ }
+
+ public boolean contains(Object member) {
+ if (todoList == member) {
+ return true;
+ }
+ if (model == member) {
+ return true;
+ }
+ if (profileConfiguration == member) {
+ return true;
+ }
+ return diagramMembers.contains(member);
+ }
+
+ public void clear() {
+ LOG.info("Clearing members");
+ if (model != null) {
+ model.remove();
+ }
+ if (todoList != null) {
+ todoList.remove();
+ }
+ if (profileConfiguration != null) {
+ profileConfiguration.remove();
+ }
+
+ Iterator membersIt = diagramMembers.iterator();
+ while (membersIt.hasNext()) {
+ ((AbstractProjectMember) membersIt.next()).remove();
+ }
+ diagramMembers.clear();
+ }
+
+ /**
+ * @param type the type of the member
+ * @return the member of the project
+ */
+ public ProjectMember getMember(Class type) {
+ if (type == ProjectMemberModel.class) {
+ return model;
+ }
+ if (type == ProjectMemberTodoList.class) {
+ return todoList;
+ }
+ if (type == ProfileConfiguration.class) {
+ return profileConfiguration;
+ }
+ throw new IllegalArgumentException(
+ "There is no single instance of a " + type.getName() + " member");
+ }
+
+ /**
+ * @param type the type of the member
+ * @return the member of the project
+ */
+ public List getMembers(Class type) {
+ if (type == ProjectMemberModel.class) {
+ List temp = new ArrayList(1);
+ temp.add(model);
+ return temp;
+ }
+ if (type == ProjectMemberTodoList.class) {
+ List temp = new ArrayList(1);
+ temp.add(todoList);
+ return temp;
+ }
+ if (type == ProjectMemberDiagram.class) {
+ return diagramMembers;
+ }
+ if (type == ProfileConfiguration.class) {
+ List temp = new ArrayList(1);
+ temp.add(profileConfiguration);
+ return temp;
+ }
+ throw new IllegalArgumentException(
+ "There is no single instance of a " + type.getName() + " member");
+ }
+
+ public Object get(int i) {
+ if (model != null) {
+ if (i == 0) {
+ return model;
+ }
+ --i;
+ }
+
+ if (i == diagramMembers.size()) {
+ return todoList;
+ }
+ if (i == diagramMembers.size()+1) {
+ return profileConfiguration;
+ }
+
+ return diagramMembers.get(i);
+ }
+
+ public boolean isEmpty() {
+ return size() == 0;
+ }
+
+ public Object[] toArray() {
+ Object[] temp = new Object[size()];
+ int pos = 0;
+ if (model != null) {
+ temp[pos++] = model;
+ }
+ for (int i = 0; i < diagramMembers.size(); ++i) {
+ temp[pos++] = diagramMembers.get(i);
+ }
+ if (todoList != null) {
+ temp[pos++] = todoList;
+ }
+ if (profileConfiguration != null) {
+ temp[pos++] = profileConfiguration;
+ }
+ return temp;
+ }
+
+ private void setTodoList(AbstractProjectMember member) {
+ LOG.info("Setting todoList to " + member);
+ todoList = member;
+ }
+
+ public Object[] toArray(Object[] arg0) {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean containsAll(Collection arg0) {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean addAll(Collection arg0) {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean addAll(int arg0, Collection arg1) {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean removeAll(Collection arg0) {
+ throw new UnsupportedOperationException();
+ }
+
+ public boolean retainAll(Collection arg0) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object set(int arg0, Object arg1) {
+ throw new UnsupportedOperationException();
+ }
+
+ public void add(int arg0, Object arg1) {
+ throw new UnsupportedOperationException();
+ }
+
+ public Object remove(int arg0) {
+ throw new UnsupportedOperationException();
+ }
+
+ public int indexOf(Object arg0) {
+ throw new UnsupportedOperationException();
+ }
+
+ public int lastIndexOf(Object arg0) {
+ throw new UnsupportedOperationException();
+ }
+
+ public List subList(int arg0, int arg1) {
+ throw new UnsupportedOperationException();
+ }
+
+ public AbstractProjectMember getProfileConfiguration() {
+ return profileConfiguration;
+ }
+
+ public void setProfileConfiguration(AbstractProjectMember profileConfiguration) {
+ this.profileConfiguration = profileConfiguration;
+ }
+}
Modified: branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/Project.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/Project.java?view=diff&rev=13021&p1=branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/Project.java&p2=branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/Project.java&r1=13020&r2=13021
==============================================================================
--- branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/Project.java (original)
+++ branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/Project.java 2007-07-10 07:56:30-0700
@@ -1,4 +1,4 @@
-// $Id: Project.java 12859 2007-06-16 11:57:03Z maurelio1234 $
+// $Id$
// Copyright (c) 1996-2007 The Regents of the University of California. All
// Rights Reserved. Permission to use, copy, modify, and distribute this
// software and its documentation without fee, and without a written
Modified: branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectManager.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectManager.java?view=diff&rev=13021&p1=branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectManager.java&p2=branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectManager.java&r1=13020&r2=13021
==============================================================================
--- branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectManager.java (original)
+++ branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectManager.java 2007-07-10 07:56:30-0700
@@ -1,370 +1,370 @@
-// $Id: ProjectManager.java 12583 2007-05-09 20:11:45Z mvw $
-// Copyright (c) 1996-2007 The Regents of the University of California. All
-// Rights Reserved. Permission to use, copy, modify, and distribute this
-// software and its documentation without fee, and without a written
-// agreement is hereby granted, provided that the above copyright notice
-// and this paragraph appear in all copies. This software program and
-// documentation are copyrighted by The Regents of the University of
-// California. The software program and documentation are supplied "AS
-// IS", without any accompanying services from The Regents. The Regents
-// does not warrant that the operation of the program will be
-// uninterrupted or error-free. The end-user understands that the program
-// was developed for research purposes and is advised not to rely
-// exclusively on the program for any reason. IN NO EVENT SHALL THE
-// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
-// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
-// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
-// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
-// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
-// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
-// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
-// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-
-package org.argouml.kernel;
-
-import java.beans.PropertyChangeEvent;
-import java.beans.PropertyChangeListener;
-import java.util.Vector;
-
-import javax.swing.Action;
-import javax.swing.event.EventListenerList;
-
-import org.apache.log4j.Logger;
-import org.argouml.cognitive.Designer;
-import org.argouml.i18n.Translator;
-import org.argouml.model.MementoCreationObserver;
-import org.argouml.model.Model;
-import org.argouml.model.ModelMemento;
-import org.argouml.uml.cognitive.ProjectMemberTodoList;
-import org.argouml.uml.diagram.ArgoDiagram;
-import org.argouml.uml.diagram.DiagramFactory;
-import org.argouml.uml.diagram.static_structure.ui.UMLClassDiagram;
-import org.argouml.uml.diagram.use_case.ui.UMLUseCaseDiagram;
-import org.tigris.gef.graph.MutableGraphSupport;
-import org.tigris.gef.undo.Memento;
-import org.tigris.gef.undo.UndoManager;
-
-/**
- * This class manages the projects loaded in argouml. <p>
- *
- * Classes in ArgoUML can ask this class for the current
- * project and set the current project. Since we only have one
- * project in ArgoUML at the moment, this class does not manage a list
- * of projects like one would expect. This could be a nice extension
- * for the future of ArgoUML. As soon as the current project is
- * changed, a property changed event is fired.
- *
- * @since Nov 17, 2002
- * @author [email protected]
- * @stereotype singleton
- */
-public final class ProjectManager implements MementoCreationObserver {
-
- /**
- * The name of the property that defines the current project.
- */
- public static final String CURRENT_PROJECT_PROPERTY_NAME =
- "currentProject";
-
- /**
- * The name of the property that there is no project.
- */
- public static final String NO_PROJECT =
- "noProject";
-
- /**
- * The name of the property that defines the save state.
- */
- public static final String SAVE_STATE_PROPERTY_NAME = "saveState";
-
- /**
- * Logger.
- */
- private static final Logger LOG = Logger.getLogger(ProjectManager.class);
-
- /**
- * The singleton instance of this class.
- */
- private static ProjectManager instance = new ProjectManager();
-
- /**
- * The project that is visible in the projectbrowser.
- */
- private static Project currentProject;
-
- /**
- * Flag to indicate we are creating a new current project.
- */
- private boolean creatingCurrentProject;
-
- private Action saveAction;
-
- /**
- * The listener list.
- */
- private EventListenerList listenerList = new EventListenerList();
-
- /**
- * The event to fire.
- *
- * TODO: Investigate! Is the purpose really to let the next call to
- * {@link #firePropertyChanged(String, Object, Object)} fire the old
- * event again if the previous invocation resulted in an exception?
- * If so, please document why. If not, fix it.
- */
- private PropertyChangeEvent event;
-
- /**
- * The singleton accessor method of this class.
- *
- * @return The singleton.
- */
- public static ProjectManager getManager() {
- return instance;
- }
-
- /**
- * Constructor for ProjectManager.
- */
- private ProjectManager() {
- super();
- Model.setMementoCreationObserver(this);
- }
-
- /**
- * Adds a listener to the listener list.
- *
- * @param listener The listener to add.
- */
- public void addPropertyChangeListener(PropertyChangeListener listener) {
- listenerList.add(PropertyChangeListener.class, listener);
- }
-
- /**
- * Removes a listener from the listener list.
- *
- * @param listener The listener to remove.
- */
- public void removePropertyChangeListener(PropertyChangeListener listener) {
- listenerList.remove(PropertyChangeListener.class, listener);
- }
-
- /**
- * Fire an event to all members of the listener list.
- *
- * @param propertyName The name of the event.
- * @param oldValue The old value.
- * @param newValue The new value.
- */
- private void firePropertyChanged(String propertyName,
- Object oldValue, Object newValue) {
- // Guaranteed to return a non-null array
- Object[] listeners = listenerList.getListenerList();
- // Process the listeners last to first, notifying
- // those that are interested in this event
- for (int i = listeners.length - 2; i >= 0; i -= 2) {
- if (listeners[i] == PropertyChangeListener.class) {
- // Lazily create the event:
- if (event == null) {
- event =
- new PropertyChangeEvent(
- this,
- propertyName,
- oldValue,
- newValue);
- }
- ((PropertyChangeListener) listeners[i + 1]).propertyChange(
- event);
- }
- }
- event = null;
- }
-
- /**
- * Sets the current project (the project that is viewable in the
- * projectbrowser).
- * Sets the current diagram for the project (if one exists).
- * This method fires a propertychanged event.<p>
- *
- * If the argument is null, then the current project will be forgotten
- * about.
- *
- * @param newProject The new project.
- */
- public void setCurrentProject(Project newProject) {
- Project oldProject = currentProject;
- currentProject = newProject;
- if (currentProject != null
- && currentProject.getActiveDiagram() == null) {
- Vector diagrams = currentProject.getDiagrams();
- if (diagrams != null && !diagrams.isEmpty()) {
- ArgoDiagram activeDiagram =
- (ArgoDiagram) currentProject.getDiagrams().get(0);
- currentProject.setActiveDiagram(activeDiagram);
- }
- }
- firePropertyChanged(CURRENT_PROJECT_PROPERTY_NAME,
- oldProject, newProject);
- }
-
- /**
- * Returns the current project.<p>
- *
- * If there is no project, a new one is created
- * (unless we are busy creating one).
- *
- * @return Project the current project
- */
- public Project getCurrentProject() {
- if (currentProject == null && !creatingCurrentProject) {
- makeEmptyProject();
- }
- return currentProject;
- }
-
- /**
- * Makes an empty project.
- * @return Project the empty project
- */
- public Project makeEmptyProject() {
- return makeEmptyProject(true);
- }
-
- /**
- * Make a new empty project optionally including default diagrams.
- * <p>
- * Historically new projects have been created with two default diagrams
- * (Class and Use Case). NOTE: ArgoUML currently requires at least one
- * diagram for proper operation.
- *
- * @param addDefaultDiagrams
- * if true the project will be be created with the two standard
- * default diagrams (Class and Use Case)
- * @return Project the newly created project
- */
- public Project makeEmptyProject(boolean addDefaultDiagrams) {
- Model.getPump().stopPumpingEvents();
-
- creatingCurrentProject = true;
- LOG.info("making empty project");
- Project oldProject = currentProject;
- currentProject = new Project();
- if (addDefaultDiagrams) {
- createDefaultDiagrams();
- }
- firePropertyChanged(CURRENT_PROJECT_PROPERTY_NAME,
- oldProject, currentProject);
- creatingCurrentProject = false;
-
- UndoManager.getInstance().empty();
- if (!UndoEnabler.isEnabled()) {
- UndoManager.getInstance().setUndoMax(0);
- }
- Model.getPump().startPumpingEvents();
-
- if (saveAction != null) {
- saveAction.setEnabled(false);
- }
- return currentProject;
- }
-
- private void createDefaultDiagrams() {
- Object model = Model.getModelManagementFactory().createModel();
- Model.getCoreHelper().setName(model,
- Translator.localize("misc.untitled-model"));
- currentProject.setRoot(model);
- currentProject.setCurrentNamespace(model);
- currentProject.addMember(model);
- DiagramFactory df = DiagramFactory.getInstance();
- ArgoDiagram d = df.createDiagram(UMLClassDiagram.class, model, null);
- currentProject.addMember(d);
- currentProject.addMember(
- df.createDiagram(UMLUseCaseDiagram.class, model, null));
- currentProject.addMember(new ProjectMemberTodoList("",
- currentProject));
- currentProject.setActiveDiagram(d);
- }
-
- /**
- * Set the save action.
- *
- * @param save the action to be used
- */
- public void setSaveAction(Action save) {
- this.saveAction = save;
- // Register with the save action with other subsystems so that
- // any changes in those subsystems will enable the
- // save button/menu item etc.
- Designer.setSaveAction(save);
- MutableGraphSupport.setSaveAction(save);
- }
-
- /**
- * @return true is the save action is currently enabled
- */
- public boolean isSaveActionEnabled() {
- return this.saveAction.isEnabled();
- }
-
- /**
- * Notify the gui that the
- * current project's save state has changed. There are 2 receivers:
- * the SaveProject tool icon and the title bar (for showing a *).
- *
- * @param newValue The new state.
- */
- public void setSaveEnabled(boolean newValue) {
- if (saveAction != null) {
- saveAction.setEnabled(newValue);
- }
- }
-
-
- /**
- * Remove the project.
- *
- * @param oldProject The project to be removed.
- */
- public void removeProject(Project oldProject) {
-
- if (currentProject == oldProject) {
- currentProject = null;
- }
-
- oldProject.remove();
- }
-
- /**
- * Called when the model subsystem creates a memento.
- * We must add this to the UndoManager.
- *
- * @param memento the memento.
- * @see org.argouml.model.MementoCreationObserver#mementoCreated(org.argouml.model.ModelMemento)
- */
- public void mementoCreated(final ModelMemento memento) {
- if (saveAction != null) {
- saveAction.setEnabled(true);
- }
- Memento wrappedMemento = new Memento() {
- private ModelMemento modelMemento = memento;
- public void undo() {
- modelMemento.undo();
- }
- public void redo() {
- modelMemento.redo();
- }
- public void dispose() {
- modelMemento.dispose();
- }
-
- public String toString() {
- return (isStartChain() ? "*" : " ") + "ModelMemento "
- + modelMemento;
- }
-
- };
- UndoManager.getInstance().addMemento(wrappedMemento);
- }
-}
+// $Id$
+// Copyright (c) 1996-2007 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.kernel;
+
+import java.beans.PropertyChangeEvent;
+import java.beans.PropertyChangeListener;
+import java.util.Vector;
+
+import javax.swing.Action;
+import javax.swing.event.EventListenerList;
+
+import org.apache.log4j.Logger;
+import org.argouml.cognitive.Designer;
+import org.argouml.i18n.Translator;
+import org.argouml.model.MementoCreationObserver;
+import org.argouml.model.Model;
+import org.argouml.model.ModelMemento;
+import org.argouml.uml.cognitive.ProjectMemberTodoList;
+import org.argouml.uml.diagram.ArgoDiagram;
+import org.argouml.uml.diagram.DiagramFactory;
+import org.argouml.uml.diagram.static_structure.ui.UMLClassDiagram;
+import org.argouml.uml.diagram.use_case.ui.UMLUseCaseDiagram;
+import org.tigris.gef.graph.MutableGraphSupport;
+import org.tigris.gef.undo.Memento;
+import org.tigris.gef.undo.UndoManager;
+
+/**
+ * This class manages the projects loaded in argouml. <p>
+ *
+ * Classes in ArgoUML can ask this class for the current
+ * project and set the current project. Since we only have one
+ * project in ArgoUML at the moment, this class does not manage a list
+ * of projects like one would expect. This could be a nice extension
+ * for the future of ArgoUML. As soon as the current project is
+ * changed, a property changed event is fired.
+ *
+ * @since Nov 17, 2002
+ * @author [email protected]
+ * @stereotype singleton
+ */
+public final class ProjectManager implements MementoCreationObserver {
+
+ /**
+ * The name of the property that defines the current project.
+ */
+ public static final String CURRENT_PROJECT_PROPERTY_NAME =
+ "currentProject";
+
+ /**
+ * The name of the property that there is no project.
+ */
+ public static final String NO_PROJECT =
+ "noProject";
+
+ /**
+ * The name of the property that defines the save state.
+ */
+ public static final String SAVE_STATE_PROPERTY_NAME = "saveState";
+
+ /**
+ * Logger.
+ */
+ private static final Logger LOG = Logger.getLogger(ProjectManager.class);
+
+ /**
+ * The singleton instance of this class.
+ */
+ private static ProjectManager instance = new ProjectManager();
+
+ /**
+ * The project that is visible in the projectbrowser.
+ */
+ private static Project currentProject;
+
+ /**
+ * Flag to indicate we are creating a new current project.
+ */
+ private boolean creatingCurrentProject;
+
+ private Action saveAction;
+
+ /**
+ * The listener list.
+ */
+ private EventListenerList listenerList = new EventListenerList();
+
+ /**
+ * The event to fire.
+ *
+ * TODO: Investigate! Is the purpose really to let the next call to
+ * {@link #firePropertyChanged(String, Object, Object)} fire the old
+ * event again if the previous invocation resulted in an exception?
+ * If so, please document why. If not, fix it.
+ */
+ private PropertyChangeEvent event;
+
+ /**
+ * The singleton accessor method of this class.
+ *
+ * @return The singleton.
+ */
+ public static ProjectManager getManager() {
+ return instance;
+ }
+
+ /**
+ * Constructor for ProjectManager.
+ */
+ private ProjectManager() {
+ super();
+ Model.setMementoCreationObserver(this);
+ }
+
+ /**
+ * Adds a listener to the listener list.
+ *
+ * @param listener The listener to add.
+ */
+ public void addPropertyChangeListener(PropertyChangeListener listener) {
+ listenerList.add(PropertyChangeListener.class, listener);
+ }
+
+ /**
+ * Removes a listener from the listener list.
+ *
+ * @param listener The listener to remove.
+ */
+ public void removePropertyChangeListener(PropertyChangeListener listener) {
+ listenerList.remove(PropertyChangeListener.class, listener);
+ }
+
+ /**
+ * Fire an event to all members of the listener list.
+ *
+ * @param propertyName The name of the event.
+ * @param oldValue The old value.
+ * @param newValue The new value.
+ */
+ private void firePropertyChanged(String propertyName,
+ Object oldValue, Object newValue) {
+ // Guaranteed to return a non-null array
+ Object[] listeners = listenerList.getListenerList();
+ // Process the listeners last to first, notifying
+ // those that are interested in this event
+ for (int i = listeners.length - 2; i >= 0; i -= 2) {
+ if (listeners[i] == PropertyChangeListener.class) {
+ // Lazily create the event:
+ if (event == null) {
+ event =
+ new PropertyChangeEvent(
+ this,
+ propertyName,
+ oldValue,
+ newValue);
+ }
+ ((PropertyChangeListener) listeners[i + 1]).propertyChange(
+ event);
+ }
+ }
+ event = null;
+ }
+
+ /**
+ * Sets the current project (the project that is viewable in the
+ * projectbrowser).
+ * Sets the current diagram for the project (if one exists).
+ * This method fires a propertychanged event.<p>
+ *
+ * If the argument is null, then the current project will be forgotten
+ * about.
+ *
+ * @param newProject The new project.
+ */
+ public void setCurrentProject(Project newProject) {
+ Project oldProject = currentProject;
+ currentProject = newProject;
+ if (currentProject != null
+ && currentProject.getActiveDiagram() == null) {
+ Vector diagrams = currentProject.getDiagrams();
+ if (diagrams != null && !diagrams.isEmpty()) {
+ ArgoDiagram activeDiagram =
+ (ArgoDiagram) currentProject.getDiagrams().get(0);
+ currentProject.setActiveDiagram(activeDiagram);
+ }
+ }
+ firePropertyChanged(CURRENT_PROJECT_PROPERTY_NAME,
+ oldProject, newProject);
+ }
+
+ /**
+ * Returns the current project.<p>
+ *
+ * If there is no project, a new one is created
+ * (unless we are busy creating one).
+ *
+ * @return Project the current project
+ */
+ public Project getCurrentProject() {
+ if (currentProject == null && !creatingCurrentProject) {
+ makeEmptyProject();
+ }
+ return currentProject;
+ }
+
+ /**
+ * Makes an empty project.
+ * @return Project the empty project
+ */
+ public Project makeEmptyProject() {
+ return makeEmptyProject(true);
+ }
+
+ /**
+ * Make a new empty project optionally including default diagrams.
+ * <p>
+ * Historically new projects have been created with two default diagrams
+ * (Class and Use Case). NOTE: ArgoUML currently requires at least one
+ * diagram for proper operation.
+ *
+ * @param addDefaultDiagrams
+ * if true the project will be be created with the two standard
+ * default diagrams (Class and Use Case)
+ * @return Project the newly created project
+ */
+ public Project makeEmptyProject(boolean addDefaultDiagrams) {
+ Model.getPump().stopPumpingEvents();
+
+ creatingCurrentProject = true;
+ LOG.info("making empty project");
+ Project oldProject = currentProject;
+ currentProject = new Project();
+ if (addDefaultDiagrams) {
+ createDefaultDiagrams();
+ }
+ firePropertyChanged(CURRENT_PROJECT_PROPERTY_NAME,
+ oldProject, currentProject);
+ creatingCurrentProject = false;
+
+ UndoManager.getInstance().empty();
+ if (!UndoEnabler.isEnabled()) {
+ UndoManager.getInstance().setUndoMax(0);
+ }
+ Model.getPump().startPumpingEvents();
+
+ if (saveAction != null) {
+ saveAction.setEnabled(false);
+ }
+ return currentProject;
+ }
+
+ private void createDefaultDiagrams() {
+ Object model = Model.getModelManagementFactory().createModel();
+ Model.getCoreHelper().setName(model,
+ Translator.localize("misc.untitled-model"));
+ currentProject.setRoot(model);
+ currentProject.setCurrentNamespace(model);
+ currentProject.addMember(model);
+ DiagramFactory df = DiagramFactory.getInstance();
+ ArgoDiagram d = df.createDiagram(UMLClassDiagram.class, model, null);
+ currentProject.addMember(d);
+ currentProject.addMember(
+ df.createDiagram(UMLUseCaseDiagram.class, model, null));
+ currentProject.addMember(new ProjectMemberTodoList("",
+ currentProject));
+ currentProject.setActiveDiagram(d);
+ }
+
+ /**
+ * Set the save action.
+ *
+ * @param save the action to be used
+ */
+ public void setSaveAction(Action save) {
+ this.saveAction = save;
+ // Register with the save action with other subsystems so that
+ // any changes in those subsystems will enable the
+ // save button/menu item etc.
+ Designer.setSaveAction(save);
+ MutableGraphSupport.setSaveAction(save);
+ }
+
+ /**
+ * @return true is the save action is currently enabled
+ */
+ public boolean isSaveActionEnabled() {
+ return this.saveAction.isEnabled();
+ }
+
+ /**
+ * Notify the gui that the
+ * current project's save state has changed. There are 2 receivers:
+ * the SaveProject tool icon and the title bar (for showing a *).
+ *
+ * @param newValue The new state.
+ */
+ public void setSaveEnabled(boolean newValue) {
+ if (saveAction != null) {
+ saveAction.setEnabled(newValue);
+ }
+ }
+
+
+ /**
+ * Remove the project.
+ *
+ * @param oldProject The project to be removed.
+ */
+ public void removeProject(Project oldProject) {
+
+ if (currentProject == oldProject) {
+ currentProject = null;
+ }
+
+ oldProject.remove();
+ }
+
+ /**
+ * Called when the model subsystem creates a memento.
+ * We must add this to the UndoManager.
+ *
+ * @param memento the memento.
+ * @see org.argouml.model.MementoCreationObserver#mementoCreated(org.argouml.model.ModelMemento)
+ */
+ public void mementoCreated(final ModelMemento memento) {
+ if (saveAction != null) {
+ saveAction.setEnabled(true);
+ }
+ Memento wrappedMemento = new Memento() {
+ private ModelMemento modelMemento = memento;
+ public void undo() {
+ modelMemento.undo();
+ }
+ public void redo() {
+ modelMemento.redo();
+ }
+ public void dispose() {
+ modelMemento.dispose();
+ }
+
+ public String toString() {
+ return (isStartChain() ? "*" : " ") + "ModelMemento "
+ + modelMemento;
+ }
+
+ };
+ UndoManager.getInstance().addMemento(wrappedMemento);
+ }
+}
Modified: branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectMember.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectMember.java?view=diff&rev=13021&p1=branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectMember.java&p2=branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectMember.java&r1=13020&r2=13021
==============================================================================
--- branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectMember.java (original)
+++ branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectMember.java 2007-07-10 07:56:30-0700
@@ -1,73 +1,73 @@
-// $Id: ProjectMember.java 10737 2006-06-11 19:01:27Z mvw $
-// Copyright (c) 2004-2006 The Regents of the University of California. All
-// Rights Reserved. Permission to use, copy, modify, and distribute this
-// software and its documentation without fee, and without a written
-// agreement is hereby granted, provided that the above copyright notice
-// and this paragraph appear in all copies. This software program and
-// documentation are copyrighted by The Regents of the University of
-// California. The software program and documentation are supplied "AS
-// IS", without any accompanying services from The Regents. The Regents
-// does not warrant that the operation of the program will be
-// uninterrupted or error-free. The end-user understands that the program
-// was developed for research purposes and is advised not to rely
-// exclusively on the program for any reason. IN NO EVENT SHALL THE
-// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
-// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
-// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
-// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
-// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
-// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
-// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
-// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-
-package org.argouml.kernel;
-
-/**
- * A member of the project is a part of the datastructure that
- * makes up the project. A saved project data file contains all members.<p>
- *
- * Examples: The UML model, the ToDo list.
- *
- */
-public interface ProjectMember {
-
- /**
- * In contrast to {@link #getZipName()} returns the member's
- * name without the prepended name of the project.
- *
- * @author Steffen Zschaler
- *
- * @return the member's name without any prefix or suffix
- */
- String getUniqueDiagramName();
-
- /**
- * Returns a unique member's name for storage in a zipfile.
- * The project's base name is prepended followed by an
- * underscore '_'.
- *
- * @return the name for zip file storage
- */
- String getZipName();
-
- /**
- * @return a short string defining the member type.
- * Usually equals the file extension.
- */
- String getType();
-
- /**
- * @return the file extension string
- */
- String getZipFileExtension();
-
- /**
- * Repair any corruptions in the project member. Executed before a save in
- * order to ensure persistence is robust.
- *
- * @return A text that explains what is repaired.
- */
- String repair();
-}
+// $Id$
+// Copyright (c) 2004-2006 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.kernel;
+
+/**
+ * A member of the project is a part of the datastructure that
+ * makes up the project. A saved project data file contains all members.<p>
+ *
+ * Examples: The UML model, the ToDo list.
+ *
+ */
+public interface ProjectMember {
+
+ /**
+ * In contrast to {@link #getZipName()} returns the member's
+ * name without the prepended name of the project.
+ *
+ * @author Steffen Zschaler
+ *
+ * @return the member's name without any prefix or suffix
+ */
+ String getUniqueDiagramName();
+
+ /**
+ * Returns a unique member's name for storage in a zipfile.
+ * The project's base name is prepended followed by an
+ * underscore '_'.
+ *
+ * @return the name for zip file storage
+ */
+ String getZipName();
+
+ /**
+ * @return a short string defining the member type.
+ * Usually equals the file extension.
+ */
+ String getType();
+
+ /**
+ * @return the file extension string
+ */
+ String getZipFileExtension();
+
+ /**
+ * Repair any corruptions in the project member. Executed before a save in
+ * order to ensure persistence is robust.
+ *
+ * @return A text that explains what is repaired.
+ */
+ String repair();
+}
Modified: branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectSettings.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectSettings.java?view=diff&rev=13021&p1=branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectSettings.java&p2=branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectSettings.java&r1=13020&r2=13021
==============================================================================
--- branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectSettings.java (original)
+++ branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/ProjectSettings.java 2007-07-10 07:56:30-0700
@@ -1,712 +1,712 @@
-// $Id: ProjectSettings.java 12546 2007-05-05 16:54:40Z linus $
-// Copyright (c) 2006-2007 The Regents of the University of California. All
-// Rights Reserved. Permission to use, copy, modify, and distribute this
-// software and its documentation without fee, and without a written
-// agreement is hereby granted, provided that the above copyright notice
-// and this paragraph appear in all copies. This software program and
-// documentation are copyrighted by The Regents of the University of
-// California. The software program and documentation are supplied "AS
-// IS", without any accompanying services from The Regents. The Regents
-// does not warrant that the operation of the program will be
-// uninterrupted or error-free. The end-user understands that the program
-// was developed for research purposes and is advised not to rely
-// exclusively on the program for any reason. IN NO EVENT SHALL THE
-// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
-// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
-// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
-// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
-// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
-// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
-// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
-// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-
-package org.argouml.kernel;
-
-import java.beans.PropertyChangeEvent;
-
-import org.argouml.application.events.ArgoEventPump;
-import org.argouml.application.events.ArgoEventTypes;
-import org.argouml.application.events.ArgoNotationEvent;
-import org.argouml.configuration.Configuration;
-import org.argouml.configuration.ConfigurationKey;
-import org.argouml.notation.Notation;
-import org.argouml.notation.NotationName;
-import org.argouml.notation.NotationProviderFactory2;
-import org.tigris.gef.undo.Memento;
-import org.tigris.gef.undo.UndoManager;
-
-/**
- * A datastructure for settings for a Project. <p>
- *
- * Most getters return a string, since they are used by "argo.tee".
- * This is also the reason all these attributes
- * are not part of a Map or something.
- *
- * @author michiel
- */
-public class ProjectSettings {
-
- /* The notation settings with project scope: */
- private String notationLanguage;
- private boolean showBoldNames;
- private boolean useGuillemots;
- private boolean showVisibility;
- private boolean showMultiplicity;
- private boolean showInitialValue;
- private boolean showProperties;
- private boolean showTypes;
- private boolean showStereotypes;
- private boolean showSingularMultiplicities;
- private int defaultShadowWidth;
-
-
- /**
- * Create a new set of project settings,
- * based on the application defaults. <p>
- *
- * The constructor is not public, since this
- * class is only created from the Project..
- */
- ProjectSettings() {
- super();
-
- notationLanguage =
- Notation.getConfiguredNotation().getConfigurationValue();
- NotationProviderFactory2.setCurrentLanguage(notationLanguage);
- showBoldNames = Configuration.getBoolean(
- Notation.KEY_SHOW_BOLD_NAMES);
- useGuillemots = Configuration.getBoolean(
- Notation.KEY_USE_GUILLEMOTS, false);
- showVisibility = Configuration.getBoolean(
- Notation.KEY_SHOW_VISIBILITY);
- showMultiplicity = Configuration.getBoolean(
- Notation.KEY_SHOW_MULTIPLICITY);
- showInitialValue = Configuration.getBoolean(
- Notation.KEY_SHOW_INITIAL_VALUE);
- showProperties = Configuration.getBoolean(
- Notation.KEY_SHOW_PROPERTIES);
- /*
- * The next one defaults to TRUE, to stay compatible with older
- * ArgoUML versions that did not have this setting:
- */
- showTypes = Configuration.getBoolean(Notation.KEY_SHOW_TYPES, true);
- showStereotypes = Configuration.getBoolean(
- Notation.KEY_SHOW_STEREOTYPES);
- /*
- * The next one defaults to TRUE, despite that this is
- * NOT compatible with older ArgoUML versions
- * (before 0.24) that did
- * not have this setting - see issue 1395 for the rationale:
- */
- showSingularMultiplicities = Configuration.getBoolean(
- Notation.KEY_SHOW_SINGULAR_MULTIPLICITIES, true);
- defaultShadowWidth = Configuration.getInteger(
- Notation.KEY_DEFAULT_SHADOW_WIDTH, 1);
- }
-
-
- /**
- * Used by "argo.tee".
- *
- * @return Returns the notation language.
- */
- public String getNotationLanguage() {
- return notationLanguage;
- }
-
- /**
- * @return Returns the notation language.
- */
- public NotationName getNotationName() {
- return Notation.findNotation(notationLanguage);
- }
-
- /**
- * @param newLanguage the notation language.
- */
- public void setNotationLanguage(final String newLanguage) {
- if (notationLanguage.equals(newLanguage)) return;
-
- final String oldLanguage = notationLanguage;
-
- Memento memento = new Memento() {
- private final ConfigurationKey key = Notation.KEY_DEFAULT_NOTATION;
-
- public void redo() {
- notationLanguage = newLanguage;
- NotationProviderFactory2.setCurrentLanguage(newLanguage);
- fireEvent(key, oldLanguage, newLanguage);
- }
-
- public void undo() {
- notationLanguage = oldLanguage;
- NotationProviderFactory2.setCurrentLanguage(oldLanguage);
- fireEvent(key, newLanguage, oldLanguage);
- }
- };
- if (UndoManager.getInstance().isGenerateMementos()) {
- UndoManager.getInstance().addMemento(memento);
- }
- memento.redo();
- ProjectManager.getManager().setSaveEnabled(true);
- }
-
- /**
- * @param nn the new notation language
- */
- public void setNotationLanguage(NotationName nn) {
- setNotationLanguage(nn.getConfigurationValue());
- }
-
- /**
- * Used by "argo.tee".
- *
- * @return Returns "true" if we show bold names.
- */
- public String getShowBoldNames() {
- return Boolean.toString(showBoldNames);
- }
-
- /**
- * @return Returns <code>true</code> if we show bold names.
- */
- public boolean getShowBoldNamesValue() {
- return showBoldNames;
- }
-
- /**
- * @param showbold <code>true</code> if names are to be shown in bold font.
- */
- public void setShowBoldNames(String showbold) {
- setShowBoldNames(Boolean.valueOf(showbold).booleanValue());
- }
-
- /**
- * @param showem <code>true</code> if names are to be shown in bold font.
- */
- public void setShowBoldNames(final boolean showem) {
- if (showBoldNames == showem) return;
-
- Memento memento = new Memento() {
- private final ConfigurationKey key = Notation.KEY_SHOW_BOLD_NAMES;
-
- public void redo() {
- showBoldNames = showem;
- fireEvent(key, !showem, showem);
- }
-
- public void undo() {
- showBoldNames = !showem;
- fireEvent(key, showem, !showem);
- }
- };
- if (UndoManager.getInstance().isGenerateMementos()) {
- UndoManager.getInstance().addMemento(memento);
- }
- memento.redo();
- ProjectManager.getManager().setSaveEnabled(true);
- }
-
- /**
- * Used by "argo.tee".
- *
- * @return Returns "true" if we show guillemots.
- */
- public String getUseGuillemots() {
- return Boolean.toString(useGuillemots);
- }
-
- /**
- * @return Returns <code>true</code> if we show guillemots.
- */
- public boolean getUseGuillemotsValue() {
- return useGuillemots;
- }
-
- /**
- * @param showem <code>true</code> if guillemots are to be shown.
- */
- public void setUseGuillemots(String showem) {
- setUseGuillemots(Boolean.valueOf(showem).booleanValue());
- }
-
- /**
- * @param showem <code>true</code> if guillemots are to be shown.
- */
-
- public void setUseGuillemots(final boolean showem) {
- if (useGuillemots == showem) return;
-
- Memento memento = new Memento() {
- private final ConfigurationKey key = Notation.KEY_USE_GUILLEMOTS;
-
- public void redo() {
- useGuillemots = showem;
- fireEvent(key, !showem, showem);
- }
-
- public void undo() {
- useGuillemots = !showem;
- fireEvent(key, showem, !showem);
- }
- };
- if (UndoManager.getInstance().isGenerateMementos()) {
- UndoManager.getInstance().addMemento(memento);
- }
- memento.redo();
- ProjectManager.getManager().setSaveEnabled(true);
- }
-
- /**
- * @return the left pointing guillemot, i.e. << or the one-character symbol
- */
- public String getLeftGuillemot() {
- return useGuillemots ? "\u00ab" : "<<";
- }
-
- /**
- * @return the right pointing guillemot, i.e. >> or the one-character symbol
- */
- public String getRightGuillemot() {
- return useGuillemots ? "\u00bb" : ">>";
- }
-
- /**
- * Used by "argo.tee".
- *
- * @return Returns "true" if we show visibilities.
- */
- public String getShowVisibility() {
- return Boolean.toString(showVisibility);
- }
-
- /**
- * @return Returns <code>true</code> if we show visibilities.
- */
- public boolean getShowVisibilityValue() {
- return showVisibility;
- }
-
- /**
- * @param showem <code>true</code> if visibilities are to be shown.
- */
- public void setShowVisibility(String showem) {
- setShowVisibility(Boolean.valueOf(showem).booleanValue());
- }
-
- /**
- * @param showem <code>true</code> if visibilities are to be shown.
- */
- public void setShowVisibility(final boolean showem) {
- if (showVisibility == showem) return;
-
- Memento memento = new Memento() {
- private final ConfigurationKey key = Notation.KEY_SHOW_VISIBILITY;
-
- public void redo() {
- showVisibility = showem;
- fireEvent(key, !showem, showem);
- }
-
- public void undo() {
- showVisibility = !showem;
- fireEvent(key, showem, !showem);
- }
- };
- if (UndoManager.getInstance().isGenerateMementos()) {
- UndoManager.getInstance().addMemento(memento);
- }
- memento.redo();
- ProjectManager.getManager().setSaveEnabled(true);
- }
-
- /**
- * Used by "argo.tee".
- *
- * @return Returns "true" if we show multiplicities.
- */
- public String getShowMultiplicity() {
- return Boolean.toString(showMultiplicity);
- }
-
- /**
- * @return Returns <code>true</code> if we show multiplicities.
- */
- public boolean getShowMultiplicityValue() {
- return showMultiplicity;
- }
-
- /**
- * @param showem <code>true</code> if multiplicity is to be shown.
- */
- public void setShowMultiplicity(String showem) {
- setShowMultiplicity(Boolean.valueOf(showem).booleanValue());
- }
-
- /**
- * @param showem <code>true</code> if the multiplicity is to be shown.
- */
- public void setShowMultiplicity(final boolean showem) {
- if (showMultiplicity == showem) return;
-
- Memento memento = new Memento() {
- private final ConfigurationKey key = Notation.KEY_SHOW_MULTIPLICITY;
-
- public void redo() {
- showMultiplicity = showem;
- fireEvent(key, !showem, showem);
- }
-
- public void undo() {
- showMultiplicity = !showem;
- fireEvent(key, showem, !showem);
- }
- };
- if (UndoManager.getInstance().isGenerateMementos()) {
- UndoManager.getInstance().addMemento(memento);
- }
- memento.redo();
- ProjectManager.getManager().setSaveEnabled(true);
- }
-
- /**
- * Used by "argo.tee".
- *
- * @return Returns "true" if we show initial values.
- */
- public String getShowInitialValue() {
- return Boolean.toString(showInitialValue);
- }
-
- /**
- * @return Returns <code>true</code> if we show initial values.
- */
- public boolean getShowInitialValueValue() {
- return showInitialValue;
- }
-
- /**
- * @param showem <code>true</code> if initial values are to be shown.
- */
- public void setShowInitialValue(String showem) {
- setShowInitialValue(Boolean.valueOf(showem).booleanValue());
- }
-
- /**
- * @param showem <code>true</code> if initial values are to be shown.
- */
- public void setShowInitialValue(final boolean showem) {
- if (showInitialValue == showem) return;
-
- Memento memento = new Memento() {
- private final ConfigurationKey key =
- Notation.KEY_SHOW_INITIAL_VALUE;
-
- public void redo() {
- showInitialValue = showem;
- fireEvent(key, !showem, showem);
- }
-
- public void undo() {
- showInitialValue = !showem;
- fireEvent(key, showem, !showem);
- }
- };
- if (UndoManager.getInstance().isGenerateMementos()) {
- UndoManager.getInstance().addMemento(memento);
- }
- memento.redo();
- ProjectManager.getManager().setSaveEnabled(true);
- }
-
- /**
- * Used by "argo.tee".
- *
- * @return Returns "true" if we show properties.
- */
- public String getShowProperties() {
- return Boolean.toString(showProperties);
- }
-
- /**
- * @return Returns <code>true</code> if we show properties.
- */
- public boolean getShowPropertiesValue() {
- return showProperties;
- }
-
- /**
- * @param showem <code>true</code> if properties are to be shown.
- */
- public void setShowProperties(String showem) {
- setShowProperties(Boolean.valueOf(showem).booleanValue());
- }
-
- /**
- * @param showem <code>true</code> if properties are to be shown.
- */
- public void setShowProperties(final boolean showem) {
- if (showProperties == showem) return;
-
- Memento memento = new Memento() {
- private final ConfigurationKey key =
- Notation.KEY_SHOW_PROPERTIES;
-
- public void redo() {
- showProperties = showem;
- fireEvent(key, !showem, showem);
- }
-
- public void undo() {
- showProperties = !showem;
- fireEvent(key, showem, !showem);
- }
- };
- if (UndoManager.getInstance().isGenerateMementos()) {
- UndoManager.getInstance().addMemento(memento);
- }
- memento.redo();
- ProjectManager.getManager().setSaveEnabled(true);
- }
-
- /**
- * Used by "argo.tee".
- *
- * @return Returns "true" if we show types.
- */
- public String getShowTypes() {
- return Boolean.toString(showTypes);
- }
-
- /**
- * @return Returns <code>true</code> if we show types.
- */
- public boolean getShowTypesValue() {
- return showTypes;
- }
-
- /**
- * @param showem <code>true</code> if types are to be shown.
- */
- public void setShowTypes(String showem) {
- setShowTypes(Boolean.valueOf(showem).booleanValue());
- }
-
- /**
- * @param showem <code>true</code> if types are to be shown.
- */
- public void setShowTypes(final boolean showem) {
- if (showTypes == showem) return;
-
- Memento memento = new Memento() {
- private final ConfigurationKey key = Notation.KEY_SHOW_TYPES;
-
- public void redo() {
- showTypes = showem;
- fireEvent(key, !showem, showem);
- }
-
- public void undo() {
- showTypes = !showem;
- fireEvent(key, showem, !showem);
- }
- };
- if (UndoManager.getInstance().isGenerateMementos()) {
- UndoManager.getInstance().addMemento(memento);
- }
- memento.redo();
- ProjectManager.getManager().setSaveEnabled(true);
- }
-
-
- /**
- * Used by "argo.tee".
- *
- * @return Returns "true" if we show stereotypes.
- */
- public String getShowStereotypes() {
- return Boolean.toString(showStereotypes);
- }
-
- /**
- * @return Returns <code>true</code> if we show stereotypes.
- */
- public boolean getShowStereotypesValue() {
- return showStereotypes;
- }
-
- /**
- * @param showem <code>true</code> if stereotypes are to be shown.
- */
- public void setShowStereotypes(String showem) {
- setShowStereotypes(Boolean.valueOf(showem).booleanValue());
- }
-
- /**
- * @param showem <code>true</code> if stereotypes are to be shown.
- */
- public void setShowStereotypes(final boolean showem) {
- if (showStereotypes == showem) return;
-
- Memento memento = new Memento() {
- private final ConfigurationKey key = Notation.KEY_SHOW_STEREOTYPES;
-
- public void redo() {
- showStereotypes = showem;
- fireEvent(key, !showem, showem);
- }
-
- public void undo() {
- showStereotypes = !showem;
- fireEvent(key, showem, !showem);
- }
- };
- if (UndoManager.getInstance().isGenerateMementos()) {
- UndoManager.getInstance().addMemento(memento);
- }
- memento.redo();
- ProjectManager.getManager().setSaveEnabled(true);
- }
-
- /**
- * Used by "argo.tee".
- *
- * @return Returns "true" if we show "1" Multiplicities.
- */
- public String getShowSingularMultiplicities() {
- return Boolean.toString(showSingularMultiplicities);
- }
-
- /**
- * @return Returns <code>true</code> if we show "1" Multiplicities.
- */
- public boolean getShowSingularMultiplicitiesValue() {
- return showSingularMultiplicities;
- }
-
- /**
- * @param showem <code>true</code> if "1" Multiplicities are to be shown.
- */
- public void setShowSingularMultiplicities(String showem) {
- setShowSingularMultiplicities(Boolean.valueOf(showem).booleanValue());
- }
-
- /**
- * @param showem <code>true</code> if "1" Multiplicities are to be shown.
- */
- public void setShowSingularMultiplicities(final boolean showem) {
- if (showSingularMultiplicities == showem) return;
-
- Memento memento = new Memento() {
- private final ConfigurationKey key =
- Notation.KEY_SHOW_SINGULAR_MULTIPLICITIES;
-
- public void redo() {
- showSingularMultiplicities = showem;
- fireEvent(key, !showem, showem);
- }
-
- public void undo() {
- showSingularMultiplicities = !showem;
- fireEvent(key, showem, !showem);
- }
- };
- if (UndoManager.getInstance().isGenerateMementos()) {
- UndoManager.getInstance().addMemento(memento);
- }
- memento.redo();
- ProjectManager.getManager().setSaveEnabled(true);
- }
-
- /**
- * Used by "argo.tee".
- *
- * @return Returns the shadow width.
- */
- public String getDefaultShadowWidth() {
- return new Integer(defaultShadowWidth).toString();
- }
-
- /**
- * @return Returns the shadow width.
- */
- public int getDefaultShadowWidthValue() {
- return defaultShadowWidth;
- }
-
- /**
- * @param newWidth The Shadow Width.
- */
- public void setDefaultShadowWidth(final int newWidth) {
- if (defaultShadowWidth == newWidth) return;
-
- final int oldValue = defaultShadowWidth;
-
- Memento memento = new Memento() {
- private final ConfigurationKey key =
- Notation.KEY_DEFAULT_SHADOW_WIDTH;
-
- public void redo() {
- defaultShadowWidth = newWidth;
- fireEvent(key, oldValue, newWidth);
- }
-
- public void undo() {
- defaultShadowWidth = oldValue;
- fireEvent(key, newWidth, oldValue);
- }
- };
- if (UndoManager.getInstance().isGenerateMementos()) {
- UndoManager.getInstance().addMemento(memento);
- }
- memento.redo();
- ProjectManager.getManager().setSaveEnabled(true);
- }
-
- /**
- * @param width The shadow width to set.
- */
- public void setDefaultShadowWidth(String width) {
- setDefaultShadowWidth(Integer.parseInt(width));
- }
-
-
- /**
- * Convenience methods to fire notation configuration change events.
- *
- * @param key the ConfigurationKey that is related to the change
- * @param oldValue the old value
- * @param newValue the new value
- */
- private void fireEvent(ConfigurationKey key, int oldValue, int newValue) {
- fireEvent(key, Integer.toString(oldValue), Integer.toString(newValue));
- }
-
- /**
- * Convenience methods to fire notation configuration change events.
- *
- * @param key the ConfigurationKey that is related to the change
- * @param oldValue the old value
- * @param newValue the new value
- */
- private void fireEvent(ConfigurationKey key, boolean oldValue,
- boolean newValue) {
- fireEvent(key, Boolean.toString(oldValue), Boolean.toString(newValue));
- }
-
- /**
- * Convenience methods to fire notation configuration change events.
- *
- * @param key the ConfigurationKey that is related to the change
- * @param oldValue the old value
- * @param newValue the new value
- */
- private void fireEvent(ConfigurationKey key, String oldValue,
- String newValue) {
- ArgoEventPump.fireEvent(new ArgoNotationEvent(
- ArgoEventTypes.NOTATION_CHANGED, new PropertyChangeEvent(this,
- key.getKey(), oldValue, newValue)));
- }
-}
+// $Id$
+// Copyright (c) 2006-2007 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.kernel;
+
+import java.beans.PropertyChangeEvent;
+
+import org.argouml.application.events.ArgoEventPump;
+import org.argouml.application.events.ArgoEventTypes;
+import org.argouml.application.events.ArgoNotationEvent;
+import org.argouml.configuration.Configuration;
+import org.argouml.configuration.ConfigurationKey;
+import org.argouml.notation.Notation;
+import org.argouml.notation.NotationName;
+import org.argouml.notation.NotationProviderFactory2;
+import org.tigris.gef.undo.Memento;
+import org.tigris.gef.undo.UndoManager;
+
+/**
+ * A datastructure for settings for a Project. <p>
+ *
+ * Most getters return a string, since they are used by "argo.tee".
+ * This is also the reason all these attributes
+ * are not part of a Map or something.
+ *
+ * @author michiel
+ */
+public class ProjectSettings {
+
+ /* The notation settings with project scope: */
+ private String notationLanguage;
+ private boolean showBoldNames;
+ private boolean useGuillemots;
+ private boolean showVisibility;
+ private boolean showMultiplicity;
+ private boolean showInitialValue;
+ private boolean showProperties;
+ private boolean showTypes;
+ private boolean showStereotypes;
+ private boolean showSingularMultiplicities;
+ private int defaultShadowWidth;
+
+
+ /**
+ * Create a new set of project settings,
+ * based on the application defaults. <p>
+ *
+ * The constructor is not public, since this
+ * class is only created from the Project..
+ */
+ ProjectSettings() {
+ super();
+
+ notationLanguage =
+ Notation.getConfiguredNotation().getConfigurationValue();
+ NotationProviderFactory2.setCurrentLanguage(notationLanguage);
+ showBoldNames = Configuration.getBoolean(
+ Notation.KEY_SHOW_BOLD_NAMES);
+ useGuillemots = Configuration.getBoolean(
+ Notation.KEY_USE_GUILLEMOTS, false);
+ showVisibility = Configuration.getBoolean(
+ Notation.KEY_SHOW_VISIBILITY);
+ showMultiplicity = Configuration.getBoolean(
+ Notation.KEY_SHOW_MULTIPLICITY);
+ showInitialValue = Configuration.getBoolean(
+ Notation.KEY_SHOW_INITIAL_VALUE);
+ showProperties = Configuration.getBoolean(
+ Notation.KEY_SHOW_PROPERTIES);
+ /*
+ * The next one defaults to TRUE, to stay compatible with older
+ * ArgoUML versions that did not have this setting:
+ */
+ showTypes = Configuration.getBoolean(Notation.KEY_SHOW_TYPES, true);
+ showStereotypes = Configuration.getBoolean(
+ Notation.KEY_SHOW_STEREOTYPES);
+ /*
+ * The next one defaults to TRUE, despite that this is
+ * NOT compatible with older ArgoUML versions
+ * (before 0.24) that did
+ * not have this setting - see issue 1395 for the rationale:
+ */
+ showSingularMultiplicities = Configuration.getBoolean(
+ Notation.KEY_SHOW_SINGULAR_MULTIPLICITIES, true);
+ defaultShadowWidth = Configuration.getInteger(
+ Notation.KEY_DEFAULT_SHADOW_WIDTH, 1);
+ }
+
+
+ /**
+ * Used by "argo.tee".
+ *
+ * @return Returns the notation language.
+ */
+ public String getNotationLanguage() {
+ return notationLanguage;
+ }
+
+ /**
+ * @return Returns the notation language.
+ */
+ public NotationName getNotationName() {
+ return Notation.findNotation(notationLanguage);
+ }
+
+ /**
+ * @param newLanguage the notation language.
+ */
+ public void setNotationLanguage(final String newLanguage) {
+ if (notationLanguage.equals(newLanguage)) return;
+
+ final String oldLanguage = notationLanguage;
+
+ Memento memento = new Memento() {
+ private final ConfigurationKey key = Notation.KEY_DEFAULT_NOTATION;
+
+ public void redo() {
+ notationLanguage = newLanguage;
+ NotationProviderFactory2.setCurrentLanguage(newLanguage);
+ fireEvent(key, oldLanguage, newLanguage);
+ }
+
+ public void undo() {
+ notationLanguage = oldLanguage;
+ NotationProviderFactory2.setCurrentLanguage(oldLanguage);
+ fireEvent(key, newLanguage, oldLanguage);
+ }
+ };
+ if (UndoManager.getInstance().isGenerateMementos()) {
+ UndoManager.getInstance().addMemento(memento);
+ }
+ memento.redo();
+ ProjectManager.getManager().setSaveEnabled(true);
+ }
+
+ /**
+ * @param nn the new notation language
+ */
+ public void setNotationLanguage(NotationName nn) {
+ setNotationLanguage(nn.getConfigurationValue());
+ }
+
+ /**
+ * Used by "argo.tee".
+ *
+ * @return Returns "true" if we show bold names.
+ */
+ public String getShowBoldNames() {
+ return Boolean.toString(showBoldNames);
+ }
+
+ /**
+ * @return Returns <code>true</code> if we show bold names.
+ */
+ public boolean getShowBoldNamesValue() {
+ return showBoldNames;
+ }
+
+ /**
+ * @param showbold <code>true</code> if names are to be shown in bold font.
+ */
+ public void setShowBoldNames(String showbold) {
+ setShowBoldNames(Boolean.valueOf(showbold).booleanValue());
+ }
+
+ /**
+ * @param showem <code>true</code> if names are to be shown in bold font.
+ */
+ public void setShowBoldNames(final boolean showem) {
+ if (showBoldNames == showem) return;
+
+ Memento memento = new Memento() {
+ private final ConfigurationKey key = Notation.KEY_SHOW_BOLD_NAMES;
+
+ public void redo() {
+ showBoldNames = showem;
+ fireEvent(key, !showem, showem);
+ }
+
+ public void undo() {
+ showBoldNames = !showem;
+ fireEvent(key, showem, !showem);
+ }
+ };
+ if (UndoManager.getInstance().isGenerateMementos()) {
+ UndoManager.getInstance().addMemento(memento);
+ }
+ memento.redo();
+ ProjectManager.getManager().setSaveEnabled(true);
+ }
+
+ /**
+ * Used by "argo.tee".
+ *
+ * @return Returns "true" if we show guillemots.
+ */
+ public String getUseGuillemots() {
+ return Boolean.toString(useGuillemots);
+ }
+
+ /**
+ * @return Returns <code>true</code> if we show guillemots.
+ */
+ public boolean getUseGuillemotsValue() {
+ return useGuillemots;
+ }
+
+ /**
+ * @param showem <code>true</code> if guillemots are to be shown.
+ */
+ public void setUseGuillemots(String showem) {
+ setUseGuillemots(Boolean.valueOf(showem).booleanValue());
+ }
+
+ /**
+ * @param showem <code>true</code> if guillemots are to be shown.
+ */
+
+ public void setUseGuillemots(final boolean showem) {
+ if (useGuillemots == showem) return;
+
+ Memento memento = new Memento() {
+ private final ConfigurationKey key = Notation.KEY_USE_GUILLEMOTS;
+
+ public void redo() {
+ useGuillemots = showem;
+ fireEvent(key, !showem, showem);
+ }
+
+ public void undo() {
+ useGuillemots = !showem;
+ fireEvent(key, showem, !showem);
+ }
+ };
+ if (UndoManager.getInstance().isGenerateMementos()) {
+ UndoManager.getInstance().addMemento(memento);
+ }
+ memento.redo();
+ ProjectManager.getManager().setSaveEnabled(true);
+ }
+
+ /**
+ * @return the left pointing guillemot, i.e. << or the one-character symbol
+ */
+ public String getLeftGuillemot() {
+ return useGuillemots ? "\u00ab" : "<<";
+ }
+
+ /**
+ * @return the right pointing guillemot, i.e. >> or the one-character symbol
+ */
+ public String getRightGuillemot() {
+ return useGuillemots ? "\u00bb" : ">>";
+ }
+
+ /**
+ * Used by "argo.tee".
+ *
+ * @return Returns "true" if we show visibilities.
+ */
+ public String getShowVisibility() {
+ return Boolean.toString(showVisibility);
+ }
+
+ /**
+ * @return Returns <code>true</code> if we show visibilities.
+ */
+ public boolean getShowVisibilityValue() {
+ return showVisibility;
+ }
+
+ /**
+ * @param showem <code>true</code> if visibilities are to be shown.
+ */
+ public void setShowVisibility(String showem) {
+ setShowVisibility(Boolean.valueOf(showem).booleanValue());
+ }
+
+ /**
+ * @param showem <code>true</code> if visibilities are to be shown.
+ */
+ public void setShowVisibility(final boolean showem) {
+ if (showVisibility == showem) return;
+
+ Memento memento = new Memento() {
+ private final ConfigurationKey key = Notation.KEY_SHOW_VISIBILITY;
+
+ public void redo() {
+ showVisibility = showem;
+ fireEvent(key, !showem, showem);
+ }
+
+ public void undo() {
+ showVisibility = !showem;
+ fireEvent(key, showem, !showem);
+ }
+ };
+ if (UndoManager.getInstance().isGenerateMementos()) {
+ UndoManager.getInstance().addMemento(memento);
+ }
+ memento.redo();
+ ProjectManager.getManager().setSaveEnabled(true);
+ }
+
+ /**
+ * Used by "argo.tee".
+ *
+ * @return Returns "true" if we show multiplicities.
+ */
+ public String getShowMultiplicity() {
+ return Boolean.toString(showMultiplicity);
+ }
+
+ /**
+ * @return Returns <code>true</code> if we show multiplicities.
+ */
+ public boolean getShowMultiplicityValue() {
+ return showMultiplicity;
+ }
+
+ /**
+ * @param showem <code>true</code> if multiplicity is to be shown.
+ */
+ public void setShowMultiplicity(String showem) {
+ setShowMultiplicity(Boolean.valueOf(showem).booleanValue());
+ }
+
+ /**
+ * @param showem <code>true</code> if the multiplicity is to be shown.
+ */
+ public void setShowMultiplicity(final boolean showem) {
+ if (showMultiplicity == showem) return;
+
+ Memento memento = new Memento() {
+ private final ConfigurationKey key = Notation.KEY_SHOW_MULTIPLICITY;
+
+ public void redo() {
+ showMultiplicity = showem;
+ fireEvent(key, !showem, showem);
+ }
+
+ public void undo() {
+ showMultiplicity = !showem;
+ fireEvent(key, showem, !showem);
+ }
+ };
+ if (UndoManager.getInstance().isGenerateMementos()) {
+ UndoManager.getInstance().addMemento(memento);
+ }
+ memento.redo();
+ ProjectManager.getManager().setSaveEnabled(true);
+ }
+
+ /**
+ * Used by "argo.tee".
+ *
+ * @return Returns "true" if we show initial values.
+ */
+ public String getShowInitialValue() {
+ return Boolean.toString(showInitialValue);
+ }
+
+ /**
+ * @return Returns <code>true</code> if we show initial values.
+ */
+ public boolean getShowInitialValueValue() {
+ return showInitialValue;
+ }
+
+ /**
+ * @param showem <code>true</code> if initial values are to be shown.
+ */
+ public void setShowInitialValue(String showem) {
+ setShowInitialValue(Boolean.valueOf(showem).booleanValue());
+ }
+
+ /**
+ * @param showem <code>true</code> if initial values are to be shown.
+ */
+ public void setShowInitialValue(final boolean showem) {
+ if (showInitialValue == showem) return;
+
+ Memento memento = new Memento() {
+ private final ConfigurationKey key =
+ Notation.KEY_SHOW_INITIAL_VALUE;
+
+ public void redo() {
+ showInitialValue = showem;
+ fireEvent(key, !showem, showem);
+ }
+
+ public void undo() {
+ showInitialValue = !showem;
+ fireEvent(key, showem, !showem);
+ }
+ };
+ if (UndoManager.getInstance().isGenerateMementos()) {
+ UndoManager.getInstance().addMemento(memento);
+ }
+ memento.redo();
+ ProjectManager.getManager().setSaveEnabled(true);
+ }
+
+ /**
+ * Used by "argo.tee".
+ *
+ * @return Returns "true" if we show properties.
+ */
+ public String getShowProperties() {
+ return Boolean.toString(showProperties);
+ }
+
+ /**
+ * @return Returns <code>true</code> if we show properties.
+ */
+ public boolean getShowPropertiesValue() {
+ return showProperties;
+ }
+
+ /**
+ * @param showem <code>true</code> if properties are to be shown.
+ */
+ public void setShowProperties(String showem) {
+ setShowProperties(Boolean.valueOf(showem).booleanValue());
+ }
+
+ /**
+ * @param showem <code>true</code> if properties are to be shown.
+ */
+ public void setShowProperties(final boolean showem) {
+ if (showProperties == showem) return;
+
+ Memento memento = new Memento() {
+ private final ConfigurationKey key =
+ Notation.KEY_SHOW_PROPERTIES;
+
+ public void redo() {
+ showProperties = showem;
+ fireEvent(key, !showem, showem);
+ }
+
+ public void undo() {
+ showProperties = !showem;
+ fireEvent(key, showem, !showem);
+ }
+ };
+ if (UndoManager.getInstance().isGenerateMementos()) {
+ UndoManager.getInstance().addMemento(memento);
+ }
+ memento.redo();
+ ProjectManager.getManager().setSaveEnabled(true);
+ }
+
+ /**
+ * Used by "argo.tee".
+ *
+ * @return Returns "true" if we show types.
+ */
+ public String getShowTypes() {
+ return Boolean.toString(showTypes);
+ }
+
+ /**
+ * @return Returns <code>true</code> if we show types.
+ */
+ public boolean getShowTypesValue() {
+ return showTypes;
+ }
+
+ /**
+ * @param showem <code>true</code> if types are to be shown.
+ */
+ public void setShowTypes(String showem) {
+ setShowTypes(Boolean.valueOf(showem).booleanValue());
+ }
+
+ /**
+ * @param showem <code>true</code> if types are to be shown.
+ */
+ public void setShowTypes(final boolean showem) {
+ if (showTypes == showem) return;
+
+ Memento memento = new Memento() {
+ private final ConfigurationKey key = Notation.KEY_SHOW_TYPES;
+
+ public void redo() {
+ showTypes = showem;
+ fireEvent(key, !showem, showem);
+ }
+
+ public void undo() {
+ showTypes = !showem;
+ fireEvent(key, showem, !showem);
+ }
+ };
+ if (UndoManager.getInstance().isGenerateMementos()) {
+ UndoManager.getInstance().addMemento(memento);
+ }
+ memento.redo();
+ ProjectManager.getManager().setSaveEnabled(true);
+ }
+
+
+ /**
+ * Used by "argo.tee".
+ *
+ * @return Returns "true" if we show stereotypes.
+ */
+ public String getShowStereotypes() {
+ return Boolean.toString(showStereotypes);
+ }
+
+ /**
+ * @return Returns <code>true</code> if we show stereotypes.
+ */
+ public boolean getShowStereotypesValue() {
+ return showStereotypes;
+ }
+
+ /**
+ * @param showem <code>true</code> if stereotypes are to be shown.
+ */
+ public void setShowStereotypes(String showem) {
+ setShowStereotypes(Boolean.valueOf(showem).booleanValue());
+ }
+
+ /**
+ * @param showem <code>true</code> if stereotypes are to be shown.
+ */
+ public void setShowStereotypes(final boolean showem) {
+ if (showStereotypes == showem) return;
+
+ Memento memento = new Memento() {
+ private final ConfigurationKey key = Notation.KEY_SHOW_STEREOTYPES;
+
+ public void redo() {
+ showStereotypes = showem;
+ fireEvent(key, !showem, showem);
+ }
+
+ public void undo() {
+ showStereotypes = !showem;
+ fireEvent(key, showem, !showem);
+ }
+ };
+ if (UndoManager.getInstance().isGenerateMementos()) {
+ UndoManager.getInstance().addMemento(memento);
+ }
+ memento.redo();
+ ProjectManager.getManager().setSaveEnabled(true);
+ }
+
+ /**
+ * Used by "argo.tee".
+ *
+ * @return Returns "true" if we show "1" Multiplicities.
+ */
+ public String getShowSingularMultiplicities() {
+ return Boolean.toString(showSingularMultiplicities);
+ }
+
+ /**
+ * @return Returns <code>true</code> if we show "1" Multiplicities.
+ */
+ public boolean getShowSingularMultiplicitiesValue() {
+ return showSingularMultiplicities;
+ }
+
+ /**
+ * @param showem <code>true</code> if "1" Multiplicities are to be shown.
+ */
+ public void setShowSingularMultiplicities(String showem) {
+ setShowSingularMultiplicities(Boolean.valueOf(showem).booleanValue());
+ }
+
+ /**
+ * @param showem <code>true</code> if "1" Multiplicities are to be shown.
+ */
+ public void setShowSingularMultiplicities(final boolean showem) {
+ if (showSingularMultiplicities == showem) return;
+
+ Memento memento = new Memento() {
+ private final ConfigurationKey key =
+ Notation.KEY_SHOW_SINGULAR_MULTIPLICITIES;
+
+ public void redo() {
+ showSingularMultiplicities = showem;
+ fireEvent(key, !showem, showem);
+ }
+
+ public void undo() {
+ showSingularMultiplicities = !showem;
+ fireEvent(key, showem, !showem);
+ }
+ };
+ if (UndoManager.getInstance().isGenerateMementos()) {
+ UndoManager.getInstance().addMemento(memento);
+ }
+ memento.redo();
+ ProjectManager.getManager().setSaveEnabled(true);
+ }
+
+ /**
+ * Used by "argo.tee".
+ *
+ * @return Returns the shadow width.
+ */
+ public String getDefaultShadowWidth() {
+ return new Integer(defaultShadowWidth).toString();
+ }
+
+ /**
+ * @return Returns the shadow width.
+ */
+ public int getDefaultShadowWidthValue() {
+ return defaultShadowWidth;
+ }
+
+ /**
+ * @param newWidth The Shadow Width.
+ */
+ public void setDefaultShadowWidth(final int newWidth) {
+ if (defaultShadowWidth == newWidth) return;
+
+ final int oldValue = defaultShadowWidth;
+
+ Memento memento = new Memento() {
+ private final ConfigurationKey key =
+ Notation.KEY_DEFAULT_SHADOW_WIDTH;
+
+ public void redo() {
+ defaultShadowWidth = newWidth;
+ fireEvent(key, oldValue, newWidth);
+ }
+
+ public void undo() {
+ defaultShadowWidth = oldValue;
+ fireEvent(key, newWidth, oldValue);
+ }
+ };
+ if (UndoManager.getInstance().isGenerateMementos()) {
+ UndoManager.getInstance().addMemento(memento);
+ }
+ memento.redo();
+ ProjectManager.getManager().setSaveEnabled(true);
+ }
+
+ /**
+ * @param width The shadow width to set.
+ */
+ public void setDefaultShadowWidth(String width) {
+ setDefaultShadowWidth(Integer.parseInt(width));
+ }
+
+
+ /**
+ * Convenience methods to fire notation configuration change events.
+ *
+ * @param key the ConfigurationKey that is related to the change
+ * @param oldValue the old value
+ * @param newValue the new value
+ */
+ private void fireEvent(ConfigurationKey key, int oldValue, int newValue) {
+ fireEvent(key, Integer.toString(oldValue), Integer.toString(newValue));
+ }
+
+ /**
+ * Convenience methods to fire notation configuration change events.
+ *
+ * @param key the ConfigurationKey that is related to the change
+ * @param oldValue the old value
+ * @param newValue the new value
+ */
+ private void fireEvent(ConfigurationKey key, boolean oldValue,
+ boolean newValue) {
+ fireEvent(key, Boolean.toString(oldValue), Boolean.toString(newValue));
+ }
+
+ /**
+ * Convenience methods to fire notation configuration change events.
+ *
+ * @param key the ConfigurationKey that is related to the change
+ * @param oldValue the old value
+ * @param newValue the new value
+ */
+ private void fireEvent(ConfigurationKey key, String oldValue,
+ String newValue) {
+ ArgoEventPump.fireEvent(new ArgoNotationEvent(
+ ArgoEventTypes.NOTATION_CHANGED, new PropertyChangeEvent(this,
+ key.getKey(), oldValue, newValue)));
+ }
+}
Modified: branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/UndoEnabler.java
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/UndoEnabler.java?view=diff&rev=13021&p1=branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/UndoEnabler.java&p2=branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/UndoEnabler.java&r1=13020&r2=13021
==============================================================================
--- branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/UndoEnabler.java (original)
+++ branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/UndoEnabler.java 2007-07-10 07:56:30-0700
@@ -1,55 +1,55 @@
-// $Id: UndoEnabler.java 11453 2006-11-12 07:58:26Z linus $
-// Copyright (c) 1996-2006 The Regents of the University of California. All
-// Rights Reserved. Permission to use, copy, modify, and distribute this
-// software and its documentation without fee, and without a written
-// agreement is hereby granted, provided that the above copyright notice
-// and this paragraph appear in all copies. This software program and
-// documentation are copyrighted by The Regents of the University of
-// California. The software program and documentation are supplied "AS
-// IS", without any accompanying services from The Regents. The Regents
-// does not warrant that the operation of the program will be
-// uninterrupted or error-free. The end-user understands that the program
-// was developed for research purposes and is advised not to rely
-// exclusively on the program for any reason. IN NO EVENT SHALL THE
-// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
-// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
-// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
-// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
-// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
-// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
-// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
-// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
-// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
-
-package org.argouml.kernel;
-
-/**
- * Control for enabling undo functionality. Remove once undo has acceptable
- * support through all of GEF and ArgoUML.
- *
- * @author Bob Tarling
- */
-public final class UndoEnabler {
-
- /**
- * Change this value to true to enable undo.
- * Do not commit in this state.
- * TODO: Implement!
- */
- private static boolean enabled = false;
-
- /**
- * The constructor.
- */
- private UndoEnabler() {
- super();
- }
-
- /**
- * @return <code>true</code> if undo is enabled.
- */
- public static boolean isEnabled() {
- return enabled;
- }
-}
+// $Id$
+// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Rights Reserved. Permission to use, copy, modify, and distribute this
+// software and its documentation without fee, and without a written
+// agreement is hereby granted, provided that the above copyright notice
+// and this paragraph appear in all copies. This software program and
+// documentation are copyrighted by The Regents of the University of
+// California. The software program and documentation are supplied "AS
+// IS", without any accompanying services from The Regents. The Regents
+// does not warrant that the operation of the program will be
+// uninterrupted or error-free. The end-user understands that the program
+// was developed for research purposes and is advised not to rely
+// exclusively on the program for any reason. IN NO EVENT SHALL THE
+// UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+// SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+// ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+// THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+// SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+// PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+// CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+// UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+
+package org.argouml.kernel;
+
+/**
+ * Control for enabling undo functionality. Remove once undo has acceptable
+ * support through all of GEF and ArgoUML.
+ *
+ * @author Bob Tarling
+ */
+public final class UndoEnabler {
+
+ /**
+ * Change this value to true to enable undo.
+ * Do not commit in this state.
+ * TODO: Implement!
+ */
+ private static boolean enabled = false;
+
+ /**
+ * The constructor.
+ */
+ private UndoEnabler() {
+ super();
+ }
+
+ /**
+ * @return <code>true</code> if undo is enabled.
+ */
+ public static boolean isEnabled() {
+ return enabled;
+ }
+}
Modified: branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/package.html
Url: http://argouml.tigris.org/source/browse/argouml/branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/package.html?view=diff&rev=13021&p1=branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/package.html&p2=branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/package.html&r1=13020&r2=13021
==============================================================================
--- branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/package.html (original)
+++ branches/gsoc2007/maurelio1234/src_new/org/argouml/kernel/package.html 2007-07-10 07:56:30-0700
@@ -1,48 +1,48 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
-<html>
-<head>
-<title>org.argouml.kernel package</title>
-<!--
- Copyright (c) 1996-99 The Regents of the University of California. All
- Rights Reserved. Permission to use, copy, modify, and distribute this
- software and its documentation without fee, and without a written
- agreement is hereby granted, provided that the above copyright notice
- and this paragraph appear in all copies. This software program and
- documentation are copyrighted by The Regents of the University of
- California. The software program and documentation are supplied "AS
- IS", without any accompanying services from The Regents. The Regents
- does not warrant that the operation of the program will be
- uninterrupted or error-free. The end-user understands that the program
- was developed for research purposes and is advised not to rely
- exclusively on the program for any reason. IN NO EVENT SHALL THE
- UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
- SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
- ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
- THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
- SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
- WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
- MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
- PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
- CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
- UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
--->
-</head>
-<body bgcolor="white">
-
-
-<p>Contains support for delayed change event handling,
- and Project handling.</P>
-
-<h2>Package Specification</h2>
-
- (none)
-
-
-<h2>Related Documentation </h2>
-
- (none)
-
-</body>
-</html>
-
-
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+<title>org.argouml.kernel package</title>
+<!--
+ Copyright (c) 1996-99 The Regents of the University of California. All
+ Rights Reserved. Permission to use, copy, modify, and distribute this
+ software and its documentation without fee, and without a written
+ agreement is hereby granted, provided that the above copyright notice
+ and this paragraph appear in all copies. This software program and
+ documentation are copyrighted by The Regents of the University of
+ California. The software program and documentation are supplied "AS
+ IS", without any accompanying services from The Regents. The Regents
+ does not warrant that the operation of the program will be
+ uninterrupted or error-free. The end-user understands that the program
+ was developed for research purposes and is advised not to rely
+ exclusively on the program for any reason. IN NO EVENT SHALL THE
+ UNIVERSITY OF CALIFORNIA BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT,
+ SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS,
+ ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF
+ THE UNIVERSITY OF CALIFORNIA HAS BEEN ADVISED OF THE POSSIBILITY OF
+ SUCH DAMAGE. THE UNIVERSITY OF CALIFORNIA SPECIFICALLY DISCLAIMS ANY
+ WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+ MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE
+ PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THE UNIVERSITY OF
+ CALIFORNIA HAS NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT,
+ UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
+-->
+</head>
+<body bgcolor="white">
+
+
+<p>Contains support for delayed change event handling,
+ and Project handling.</P>
+
+<h2>Package Specification</h2>
+
+ (none)
+
+
+<h2>Related Documentation </h2>
+
+ (none)
+
+</body>
+</html>
+
+
lmpx.com only provides a reader for public news (NNTP) servers. It is not
affiliated with the servers or forums shown here and is not responsible for
the content of articles, which is written by their respective authors.