svn commit: r16491 - trunk/src/argouml-app/src/org/argouml/gefext

Tom Morris <[email protected]>
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: tfmorris
Date: 2009-01-03 08:36:57-0800
New Revision: 16491

Modified:
   trunk/src/argouml-app/src/org/argouml/gefext/ArgoFigLine.java
   trunk/src/argouml-app/src/org/argouml/gefext/ArgoModeCreateFigLine.java

Log:
Back out color setting that causes dependency cycle.  This is going need reorganization.

Modified: trunk/src/argouml-app/src/org/argouml/gefext/ArgoFigLine.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/gefext/ArgoFigLine.java?view=diff&pathrev=16491&r1=16490&r2=16491
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/gefext/ArgoFigLine.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/gefext/ArgoFigLine.java	2009-01-03 08:36:57-0800
@@ -24,6 +24,8 @@
 
 package org.argouml.gefext;
 
+import java.awt.Color;
+
 import javax.management.ListenerNotFoundException;
 import javax.management.MBeanNotificationInfo;
 import javax.management.Notification;
@@ -32,7 +34,6 @@
 import javax.management.NotificationFilter;
 import javax.management.NotificationListener;
 
-import org.argouml.uml.diagram.ui.ArgoFig;
 import org.tigris.gef.presentation.FigLine;
 
 /**
@@ -47,23 +48,24 @@
 
     public ArgoFigLine() {
         super();
-        initFig();
     }
     
     public ArgoFigLine(int x1, int y1, int x2, int y2) {
-        super(x1, y1, x2, y2);
-        initFig();
+        super(x1, y1, x2, y2 );
     }
 
-    
     /**
-     * Set default line width and color
+     * Create a line from x1,y1 to x2,y2 in the given color
+     * @param x1 x1
+     * @param y1 y1
+     * @param x2 x2
+     * @param y2 y2
+     * @param lineColor color of line
      */
-    private void initFig() {
-        setLineColor(ArgoFig.LINE_COLOR);
-        setLineWidth(ArgoFig.LINE_WIDTH);
+    public ArgoFigLine(int x1, int y1, int x2, int y2, Color lineColor) {
+        super(x1, y1, x2, y2, lineColor);
     }
-    
+        
     /*
      * @see org.tigris.gef.presentation.Fig#deleteFromModel()
      */

Modified: trunk/src/argouml-app/src/org/argouml/gefext/ArgoModeCreateFigLine.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/gefext/ArgoModeCreateFigLine.java?view=diff&pathrev=16491&r1=16490&r2=16491
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/gefext/ArgoModeCreateFigLine.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/gefext/ArgoModeCreateFigLine.java	2009-01-03 08:36:57-0800
@@ -27,11 +27,12 @@
 import java.awt.event.MouseEvent;
 
 import org.argouml.i18n.Translator;
+import org.argouml.uml.diagram.ui.ArgoFig;
 import org.tigris.gef.base.ModeCreateFigLine;
 import org.tigris.gef.presentation.Fig;
 
 /**
- * A Mode to interprete user input while creating a FigLine. All of
+ * A Mode to interpret user input while creating a FigLine. All of
  *  the actual event handling is inherited from ModeCreate. This class
  *  just implements the differences needed to make it specific to
  *  lines.
@@ -42,7 +43,13 @@
 
     @Override
     public Fig createNewItem(MouseEvent me, int snapX, int snapY) {
-        return new ArgoFigLine(snapX, snapY, snapX, snapY);
+        Fig line = new ArgoFigLine(snapX, snapY, snapX, snapY);
+        // TODO: We need a way to set the line color and width here, but
+        // TestDependencies thinks this creates a dependency cycle
+        //        Fig line = new ArgoFigLine(snapX, snapY, snapX, snapY, 
+//                ArgoFig.LINE_COLOR);
+//        line.setLineWidth(ArgoFig.LINE_WIDTH);
+        return line;
     }
 
     @Override

------------------------------------------------------
http://argouml.tigris.org/ds/viewMessage.do?dsForumId=5905&dsMessageId=1000738

To unsubscribe from this discussion, e-mail: [[email protected]].
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.