svn commit: r12633 - trunk/src_new/org/argouml/cognitive: . ui

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2007-05-22 12:33:35-0700
New Revision: 12633

Modified:
   trunk/src_new/org/argouml/cognitive/Designer.java
   trunk/src_new/org/argouml/cognitive/ui/ToDoPane.java

Log:
Removed dependency from org.argouml.cognitive to org.argouml.ui.

Modified: trunk/src_new/org/argouml/cognitive/Designer.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/Designer.java?view=diff&rev=12633&p1=trunk/src_new/org/argouml/cognitive/Designer.java&p2=trunk/src_new/org/argouml/cognitive/Designer.java&r1=12632&r2=12633
==============================================================================
--- trunk/src_new/org/argouml/cognitive/Designer.java	(original)
+++ trunk/src_new/org/argouml/cognitive/Designer.java	2007-05-22 12:33:35-0700
@@ -41,7 +41,6 @@
 import org.argouml.configuration.Configuration;
 import org.argouml.configuration.ConfigurationKey;
 import org.argouml.model.InvalidElementException;
-import org.argouml.ui.ActionGoToCritique;
 import org.tigris.gef.util.ChildGenerator;
 import org.tigris.gef.util.EnumerationEmpty;
 
@@ -819,46 +818,7 @@
      * @param item the todo item
      */
     public void inform(ToDoItem item) {
-        if (item.getPriority() >= disruptiveThreshold()) {
-            disruptivelyWarn(item);
-        } else {
-            nondisruptivelyWarn(item);
-        }
-    }
-
-    /**
-     * Inform the human designer that there is an urgent ToDoItem that
-     * (s)he must consider before doing any more work.  Currently not
-     * implemented.
-     *
-     * @param item the todoitem
-     */
-    public synchronized void disruptivelyWarn(ToDoItem item) {
         toDoList.addElement(item);
-        // and keep nagging until the user solves the problem:
-        // This seems a nice way to nag:
-        (new ActionGoToCritique(item)).actionPerformed(null);
-    }
-
-    /**
-     * Inform the human designer that there is a ToDoItem that is
-     * relevant to his design work, and allow him to consider it on his
-     * own initiative.
-     *
-     * @param item the todo item
-     */
-    public synchronized void nondisruptivelyWarn(ToDoItem item) {
-        toDoList.addElement(item);
-    }
-
-    /**
-     * Used to determine which ToDoItems are urgent. Just returns the value 9.
-     *
-     * @return from this priority, we warn disruptively
-     */
-    public int disruptiveThreshold() {
-        // TODO: check prefs
-        return ToDoItem.INTERRUPTIVE_PRIORITY;
     }
 
     /**

Modified: trunk/src_new/org/argouml/cognitive/ui/ToDoPane.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/ToDoPane.java?view=diff&rev=12633&p1=trunk/src_new/org/argouml/cognitive/ui/ToDoPane.java&p2=trunk/src_new/org/argouml/cognitive/ui/ToDoPane.java&r1=12632&r2=12633
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/ToDoPane.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/ToDoPane.java	2007-05-22 12:33:35-0700
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// 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
@@ -367,6 +367,15 @@
         if (curPerspective instanceof ToDoListListener) {
             ((ToDoListListener) curPerspective).toDoItemsAdded(tde);
 	}
+        Vector<ToDoItem> v = tde.getToDoItems();
+        for (ToDoItem todo : v) {
+            if (todo.getPriority() >= ToDoItem.INTERRUPTIVE_PRIORITY) {
+                // keep nagging until the user solves the problem:
+                // This seems a nice way to nag:
+                selectItem(todo);
+                break; // Only interrupt for one todoitem
+            }
+        }
         updateCountLabel();
     }
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.