svn commit: r12653 - trunk/src_new/org/argouml: cognitive/ui swingext ui

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2007-05-24 10:05:31-0700
New Revision: 12653

Added:
   trunk/src_new/org/argouml/swingext/LeftArrowIcon.java   (contents, props changed)
   trunk/src_new/org/argouml/swingext/UpArrowIcon.java   (contents, props changed)
   trunk/src_new/org/argouml/ui/TabToDoTarget.java
      - copied, changed from r12652, /trunk/src_new/org/argouml/cognitive/ui/TabToDoTarget.java
Removed:
   trunk/src_new/org/argouml/cognitive/ui/TabToDoTarget.java
Modified:
   trunk/src_new/org/argouml/cognitive/ui/TabToDo.java
   trunk/src_new/org/argouml/cognitive/ui/WizStep.java
   trunk/src_new/org/argouml/ui/DetailsPane.java

Log:
Remove (cyclic) dependency from org.argouml.ui.DetailsPane to org.argouml.cognitive.ui.

Modified: trunk/src_new/org/argouml/cognitive/ui/TabToDo.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/TabToDo.java?view=diff&rev=12653&p1=trunk/src_new/org/argouml/cognitive/ui/TabToDo.java&p2=trunk/src_new/org/argouml/cognitive/ui/TabToDo.java&r1=12652&r2=12653
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/TabToDo.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/TabToDo.java	2007-05-24 10:05:31-0700
@@ -36,6 +36,7 @@
 import org.argouml.cognitive.critics.Wizard;
 import org.argouml.configuration.Configuration;
 import org.argouml.ui.AbstractArgoJPanel;
+import org.argouml.ui.TabToDoTarget;
 import org.argouml.ui.cmd.ActionNewToDoItem;
 import org.argouml.ui.cmd.ActionResolve;
 import org.argouml.ui.cmd.ActionSnooze;

Removed: trunk/src_new/org/argouml/cognitive/ui/TabToDoTarget.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/TabToDoTarget.java?view=auto&rev=12652

Modified: trunk/src_new/org/argouml/cognitive/ui/WizStep.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/cognitive/ui/WizStep.java?view=diff&rev=12653&p1=trunk/src_new/org/argouml/cognitive/ui/WizStep.java&p2=trunk/src_new/org/argouml/cognitive/ui/WizStep.java&r1=12652&r2=12653
==============================================================================
--- trunk/src_new/org/argouml/cognitive/ui/WizStep.java	(original)
+++ trunk/src_new/org/argouml/cognitive/ui/WizStep.java	2007-05-24 10:05:31-0700
@@ -43,6 +43,7 @@
 import org.argouml.cognitive.critics.Wizard;
 import org.argouml.swingext.SpacerPanel;
 import org.argouml.ui.ProjectBrowser;
+import org.argouml.ui.TabToDoTarget;
 import org.argouml.ui.targetmanager.TargetEvent;
 import org.argouml.util.osdep.StartBrowser;
 

Added: trunk/src_new/org/argouml/swingext/LeftArrowIcon.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/swingext/LeftArrowIcon.java?view=auto&rev=12653
==============================================================================
--- (empty file)
+++ trunk/src_new/org/argouml/swingext/LeftArrowIcon.java	2007-05-24 10:05:31-0700
@@ -0,0 +1,54 @@
+// $Id$
+// Copyright (c) 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.swingext;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Polygon;
+
+import javax.swing.Icon;
+
+/**
+ * Class defining a graphic that goes on the tab label.
+ */
+public class LeftArrowIcon implements Icon {
+    public void paintIcon(Component c, Graphics g, int x, int y) {
+        int w = getIconWidth(), h = getIconHeight();
+        g.setColor(Color.black);
+        Polygon p = new Polygon();
+        p.addPoint(x + 1, y + h / 2 + 1);
+        p.addPoint(x + w, y);
+        p.addPoint(x + w, y + h);
+        g.fillPolygon(p);
+    }
+    public int getIconWidth() {
+        return 9;
+    }
+    public int getIconHeight() {
+        return 9;
+    }
+
+}

Added: trunk/src_new/org/argouml/swingext/UpArrowIcon.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/swingext/UpArrowIcon.java?view=auto&rev=12653
==============================================================================
--- (empty file)
+++ trunk/src_new/org/argouml/swingext/UpArrowIcon.java	2007-05-24 10:05:31-0700
@@ -0,0 +1,53 @@
+// $Id$
+// Copyright (c) 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.swingext;
+
+import java.awt.Color;
+import java.awt.Component;
+import java.awt.Graphics;
+import java.awt.Polygon;
+
+import javax.swing.Icon;
+
+/**
+ * Class defining a graphic that goes on the tab label.
+ */
+public class UpArrowIcon implements Icon {
+    public void paintIcon(Component c, Graphics g, int x, int y) {
+        int w = getIconWidth(), h = getIconHeight();
+        g.setColor(Color.black);
+        Polygon p = new Polygon();
+        p.addPoint(x, y + h);
+        p.addPoint(x + w / 2 + 1, y);
+        p.addPoint(x + w, y + h);
+        g.fillPolygon(p);
+    }
+    public int getIconWidth() {
+        return 9;
+    }
+    public int getIconHeight() {
+        return 9;
+    }
+}

Modified: trunk/src_new/org/argouml/ui/DetailsPane.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/DetailsPane.java?view=diff&rev=12653&p1=trunk/src_new/org/argouml/ui/DetailsPane.java&p2=trunk/src_new/org/argouml/ui/DetailsPane.java&r1=12652&r2=12653
==============================================================================
--- trunk/src_new/org/argouml/ui/DetailsPane.java	(original)
+++ trunk/src_new/org/argouml/ui/DetailsPane.java	2007-05-24 10:05:31-0700
@@ -25,12 +25,9 @@
 package org.argouml.ui;
 
 import java.awt.BorderLayout;
-import java.awt.Color;
 import java.awt.Component;
 import java.awt.Dimension;
 import java.awt.Font;
-import java.awt.Graphics;
-import java.awt.Polygon;
 import java.awt.Rectangle;
 import java.awt.event.MouseEvent;
 import java.awt.event.MouseListener;
@@ -46,10 +43,10 @@
 import javax.swing.event.EventListenerList;
 
 import org.apache.log4j.Logger;
-import org.argouml.cognitive.ui.TabToDo;
-import org.argouml.cognitive.ui.TabToDoTarget;
 import org.argouml.i18n.Translator;
 import org.argouml.model.Model;
+import org.argouml.swingext.LeftArrowIcon;
+import org.argouml.swingext.UpArrowIcon;
 import org.argouml.ui.targetmanager.TargetEvent;
 import org.argouml.ui.targetmanager.TargetListener;
 import org.argouml.ui.targetmanager.TargetManager;
@@ -138,13 +135,13 @@
      *
      * Registers listeners.<p>
      *
-     * @param pane is probably the name of the pane TODO: verify this!
+     * @param compassPoint the position for which to build the pane
      * @param orientation is the orientation.
      */
-    public DetailsPane(String pane, Orientation orientation) {
-        LOG.info("making DetailsPane(" + pane + ")");
+    public DetailsPane(String compassPoint, Orientation orientation) {
+        LOG.info("making DetailsPane(" + compassPoint + ")");
 
-        ConfigLoader.loadTabs(tabPanelList, pane, orientation);
+        ConfigLoader.loadTabs(tabPanelList, compassPoint, orientation);
         setLayout(new BorderLayout());
         setFont(new Font("Dialog", Font.PLAIN, 10));
         add(topLevelTabbedPane, BorderLayout.CENTER);
@@ -178,7 +175,7 @@
             }
             // default if there is no tabprops if there is no tabtodo
             // either, this will result in lastNonNullTab = -1;
-            if (tabs[i] instanceof TabToDo) {
+            if (tabs[i] instanceof TabToDoTarget) {
                 lastNonNullTab = i;
             }
         }
@@ -208,8 +205,8 @@
         enableTabs(item);
         for (int i = 0; i < tabPanelList.size(); i++) {
             JPanel t = (JPanel) tabPanelList.get(i);
-            if (t instanceof TabToDo) {
-                ((TabToDo) t).setTarget(item);
+            if (t instanceof TabToDoTarget) {
+                ((TabToDoTarget) t).setTarget(item);
                 topLevelTabbedPane.setSelectedComponent(t);
                 return true;
             }
@@ -260,19 +257,19 @@
             // default tab todo
             if (!tabSelected) {
                 JPanel tab = (JPanel) tabPanelList.get(0);
-                if (!(tab instanceof TabToDo)) {
+                if (!(tab instanceof TabToDoTarget)) {
                     Iterator it = tabPanelList.iterator();
                     while (it.hasNext()) {
                         Object o = it.next();
-                        if (o instanceof TabToDo) {
-                            tab = (TabToDo) o;
+                        if (o instanceof TabToDoTarget) {
+                            tab = (JPanel) o;
                             break;
                         }
                     }
                 }
-                if (tab instanceof TabToDo) {
+                if (tab instanceof TabToDoTarget) {
                     topLevelTabbedPane.setSelectedComponent(tab);
-                    ((TabToDo) tab).setTarget(target);
+                    ((TabToDoTarget) tab).setTarget(target);
                     lastNonNullTab = topLevelTabbedPane.getSelectedIndex();
                 }
             }
@@ -281,19 +278,19 @@
             // default tab todo
             JPanel tab =
                 tabPanelList.isEmpty() ? null : (JPanel) tabPanelList.get(0);
-            if (!(tab instanceof TabToDo)) {
+            if (!(tab instanceof TabToDoTarget)) {
                 Iterator it = tabPanelList.iterator();
                 while (it.hasNext()) {
                     Object o = it.next();
-                    if (o instanceof TabToDo) {
-                        tab = (TabToDo) o;
+                    if (o instanceof TabToDoTarget) {
+                        tab = (JPanel) o;
                         break;
                     }
                 }
             }
-            if (tab instanceof TabToDo) {
+            if (tab instanceof TabToDoTarget) {
                 topLevelTabbedPane.setSelectedComponent(tab);
-                ((TabToDo) tab).setTarget(target);
+                ((TabToDoTarget) tab).setTarget(target);
 
             } else {
                 topLevelTabbedPane.setSelectedIndex(-1);
@@ -457,8 +454,8 @@
         Object target = TargetManager.getInstance().getTarget();
 
         if (!(sel instanceof TargetListener)) {
-            if (sel instanceof TabToDo) {
-                ((TabToDo) sel).refresh();
+            if (sel instanceof TabToDoTarget) {
+                ((TabToDoTarget) sel).setTarget(target);
             } else if (sel instanceof TabTarget) {
                 ((TabTarget) sel).setTarget(target);
             }
@@ -618,7 +615,7 @@
                 if (tab instanceof TabTarget) {
                     shouldEnable = ((TabTarget) tab).shouldBeEnabled(target);
                 } else {
-                    if (tab instanceof TabToDo) {
+                    if (tab instanceof TabToDoTarget) {
                         shouldEnable = true;
                     }
                 }
@@ -668,49 +665,3 @@
     }
 
 } /* end class DetailsPane */
-
-////////////////////////////////////////////////////////////////
-// related classes
-
-/**
- * Class defining a graphic that goes on the tab label.
- */
-class UpArrowIcon implements Icon {
-    public void paintIcon(Component c, Graphics g, int x, int y) {
-        int w = getIconWidth(), h = getIconHeight();
-        g.setColor(Color.black);
-        Polygon p = new Polygon();
-        p.addPoint(x, y + h);
-        p.addPoint(x + w / 2 + 1, y);
-        p.addPoint(x + w, y + h);
-        g.fillPolygon(p);
-    }
-    public int getIconWidth() {
-        return 9;
-    }
-    public int getIconHeight() {
-        return 9;
-    }
-}
-
-/**
- * Class defining a graphic that goes on the tab label.
- */
-class LeftArrowIcon implements Icon {
-    public void paintIcon(Component c, Graphics g, int x, int y) {
-        int w = getIconWidth(), h = getIconHeight();
-        g.setColor(Color.black);
-        Polygon p = new Polygon();
-        p.addPoint(x + 1, y + h / 2 + 1);
-        p.addPoint(x + w, y);
-        p.addPoint(x + w, y + h);
-        g.fillPolygon(p);
-    }
-    public int getIconWidth() {
-        return 9;
-    }
-    public int getIconHeight() {
-        return 9;
-    }
-
-}

Copied: trunk/src_new/org/argouml/ui/TabToDoTarget.java (from r12652, /trunk/src_new/org/argouml/cognitive/ui/TabToDoTarget.java)
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/ui/TabToDoTarget.java?view=diff&rev=12653&p1=/trunk/src_new/org/argouml/cognitive/ui/TabToDoTarget.java&p2=trunk/src_new/org/argouml/ui/TabToDoTarget.java&r1=12652&r2=12653
==============================================================================
--- /trunk/src_new/org/argouml/cognitive/ui/TabToDoTarget.java	(original)
+++ trunk/src_new/org/argouml/ui/TabToDoTarget.java	2007-05-24 10:05:31-0700
@@ -24,7 +24,7 @@
 
 // TODO: remove all methods before release 0.16. They are all deprecated
 
-package org.argouml.cognitive.ui;
+package org.argouml.ui;
 
 import org.argouml.ui.targetmanager.TargetListener;
 
@@ -34,4 +34,12 @@
  */
 public interface TabToDoTarget extends TargetListener {
 
+    /**
+     * Set the target.
+     *
+     * @param target
+     *            the new target to set
+     */
+    public void setTarget(Object target);
+
 }
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.