svn commit: r16154 - trunk/src/argouml-app/src/org/argouml/uml/diagram/ui

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: bobtarling
Date: 2008-11-23 11:21:33-0800
New Revision: 16154

Modified:
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/PathItemPlacement.java
   trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/SelectionEdgeClarifiers.java

Log:
First commit towards path item placement algorithm painting

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/PathItemPlacement.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/PathItemPlacement.java?view=diff&rev=16154&p1=trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/PathItemPlacement.java&p2=trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/PathItemPlacement.java&r1=16153&r2=16154
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/PathItemPlacement.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/PathItemPlacement.java	2008-11-23 11:21:33-0800
@@ -25,6 +25,7 @@
 package org.argouml.uml.diagram.ui;
 
 import java.awt.Dimension;
+import java.awt.Graphics;
 import java.awt.Point;
 import java.awt.Rectangle;
 import java.awt.geom.Line2D;
@@ -574,5 +575,16 @@
         
         return result;
     }
-
+    
+    /**
+     * Paint the virtual connection from the edge to where the path item
+     * is placed according to this path item placement algorithm.
+     * TODO: Yet to implement
+     * 
+     * @param g the Graphics object
+     * @see org.tigris.gef.base.PathConv#paint(java.awt.Graphics)
+     */
+    public void paint(Graphics g) {
+        
+    }
 }

Modified: trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/SelectionEdgeClarifiers.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/SelectionEdgeClarifiers.java?view=diff&rev=16154&p1=trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/SelectionEdgeClarifiers.java&p2=trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/SelectionEdgeClarifiers.java&r1=16153&r2=16154
==============================================================================
--- trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/SelectionEdgeClarifiers.java	(original)
+++ trunk/src/argouml-app/src/org/argouml/uml/diagram/ui/SelectionEdgeClarifiers.java	2008-11-23 11:21:33-0800
@@ -26,8 +26,12 @@
 
 import java.awt.Graphics;
 
+import org.tigris.gef.base.Globals;
+import org.tigris.gef.base.PathItemPlacementStrategy;
+import org.tigris.gef.base.SelectionManager;
 import org.tigris.gef.base.SelectionReshape;
 import org.tigris.gef.presentation.Fig;
+import org.tigris.gef.presentation.FigEdge;
 
 /**
  *
@@ -46,14 +50,27 @@
      */
     public SelectionEdgeClarifiers(Fig f) { super(f); }
 
-    /** Paint the handles at the four corners and midway along each edge
-     * of the bounding box.
+    /**
+     * This extends the standard selection painting to also highlight
+     * the editable text labels and their placement strategies should
+     * there be only one selected item.
      *
      * @see org.tigris.gef.base.Selection#paint(java.awt.Graphics)
+     * @param g the graphics object
      */
+    @Override
     public void paint(Graphics g) {
-	((FigEdgeModelElement) getContent()).paintClarifiers(g);
-	super.paint(g);
+        super.paint(g);
+        int selectionCount =
+            Globals.curEditor().getSelectionManager().selections().size();
+        if (selectionCount == 1) {
+            FigEdgeModelElement edge = (FigEdgeModelElement) getContent();
+            edge.paintClarifiers(g);
+	    for (PathItemPlacementStrategy strategy
+	            : edge.getPathItemStrategies()) {
+	        strategy.paint(g);
+	    }
+	}
     }
 
 } /* end class SelectionEdgeClarifiers */
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.