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

[email protected]
Newsgroups gmane.comp.lang.uml.argouml.cvs
Message-ID <[email protected]>
Author: mvw
Date: 2008-02-19 10:43:30-0800
New Revision: 14132

Modified:
   trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigBranchState.java
   trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigHistoryState.java
   trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigJunctionState.java
   trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigSynchState.java

Log:
Fix for issue 4947 for FigBranchState, FigHistoryState, FigJunctionState, FigSynchState. This patch was supplied by Lukas Degener.

Modified: trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigBranchState.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigBranchState.java?view=diff&rev=14132&p1=trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigBranchState.java&p2=trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigBranchState.java&r1=14131&r2=14132
==============================================================================
--- trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigBranchState.java	(original)
+++ trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigBranchState.java	2008-02-19 10:43:30-0800
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2004-2006 The Regents of the University of California. All
+// Copyright (c) 2004-2008 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
@@ -26,6 +26,7 @@
 
 import java.awt.Color;
 import java.awt.Point;
+import java.awt.Rectangle;
 import java.awt.event.MouseEvent;
 import java.util.Iterator;
 
@@ -187,6 +188,26 @@
     }
 
     /**
+     * Override setStandardBounds to keep shapes looking right.
+     * {@inheritDoc}
+     */
+    @Override
+    protected void setStandardBounds(int x, int y, int w, int h) {
+        if (getNameFig() == null) {
+            return;
+        }
+        Rectangle oldBounds = getBounds();
+
+        getBigPort().setBounds(x, y, w, h);
+        head.setBounds(x, y, w, h);
+
+        calcBounds(); //_x = x; _y = y; _w = w; _h = h;
+        updateEdges();
+        firePropChange("bounds", oldBounds, getBounds());
+    }
+
+
+    /**
      * The UID.
      */
     static final long serialVersionUID = 6572261327347541373L;

Modified: trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigHistoryState.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigHistoryState.java?view=diff&rev=14132&p1=trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigHistoryState.java&p2=trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigHistoryState.java&r1=14131&r2=14132
==============================================================================
--- trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigHistoryState.java	(original)
+++ trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigHistoryState.java	2008-02-19 10:43:30-0800
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-2008 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
@@ -25,6 +25,7 @@
 package org.argouml.uml.diagram.state.ui;
 
 import java.awt.Color;
+import java.awt.Rectangle;
 import java.awt.event.MouseEvent;
 import java.util.Iterator;
 
@@ -79,10 +80,31 @@
         addFig(head);
         addFig(h);
 
-        setBlinkPorts(false); //make port invisble unless mouse enters
+        setBlinkPorts(false); //make port invisible unless mouse enters
     }
 
     /**
+     * Override setBounds to keep shapes looking right.
+     * {@inheritDoc}
+     */
+    @Override
+    protected void setStandardBounds(int x, int y, int w, int h) {        
+    	if (getNameFig() == null) {
+            return;
+        }
+        Rectangle oldBounds = getBounds();
+
+        getBigPort().setBounds(x, y, WIDTH, HEIGHT);
+        head.setBounds(x, y, WIDTH, HEIGHT);
+        this.h.setBounds(x, y, WIDTH - 10, HEIGHT - 10);
+        this.h.calcBounds();
+
+        calcBounds(); //_x = x; _y = y; _w = w; _h = h;
+        updateEdges();
+        firePropChange("bounds", oldBounds, getBounds());
+    }
+    
+    /**
      * This should return the text shown at the center of the history state.
      *
      * @return the text at the center (H or H*)

Modified: trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigJunctionState.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigJunctionState.java?view=diff&rev=14132&p1=trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigJunctionState.java&p2=trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigJunctionState.java&r1=14131&r2=14132
==============================================================================
--- trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigJunctionState.java	(original)
+++ trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigJunctionState.java	2008-02-19 10:43:30-0800
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 2004-2006 The Regents of the University of California. All
+// Copyright (c) 2004-2008 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
@@ -186,6 +186,27 @@
     }
 
     /**
+     * Override setStandardBounds to keep shapes looking right.
+     * {@inheritDoc}
+     */
+    @Override
+    protected void setStandardBounds(int x, int y, int w, int h) {
+        if (getNameFig() == null) {
+            return;
+        }
+        Rectangle oldBounds = getBounds();
+
+        getBigPort().setBounds(x, y, w, h);
+        head.setBounds(x, y, w, h);
+
+        calcBounds(); //_x = x; _y = y; _w = w; _h = h;
+        updateEdges();
+        firePropChange("bounds", oldBounds, getBounds());
+    }
+
+
+    
+    /**
      * The UID.
      */
     private static final long serialVersionUID = -5845934640541945686L;

Modified: trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigSynchState.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigSynchState.java?view=diff&rev=14132&p1=trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigSynchState.java&p2=trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigSynchState.java&r1=14131&r2=14132
==============================================================================
--- trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigSynchState.java	(original)
+++ trunk/src/app/src/org/argouml/uml/diagram/state/ui/FigSynchState.java	2008-02-19 10:43:30-0800
@@ -1,5 +1,5 @@
 // $Id$
-// Copyright (c) 1996-2006 The Regents of the University of California. All
+// Copyright (c) 1996-2008 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
@@ -26,6 +26,7 @@
 
 import java.awt.Color;
 import java.awt.Font;
+import java.awt.Rectangle;
 import java.awt.event.MouseEvent;
 import java.beans.PropertyChangeEvent;
 import java.util.Iterator;
@@ -99,6 +100,27 @@
         this();
         setOwner(node);
     }
+    /**
+     * Override setStandardBounds to keep shapes looking right.
+     * {@inheritDoc}
+     */
+    @Override
+    protected void setStandardBounds(int x, int y, int w, int h) {
+    	if (getNameFig() == null) {
+            return;
+        }
+        Rectangle oldBounds = getBounds();
+        
+        getBigPort().setBounds(x, y, WIDTH, HEIGHT);
+        head.setBounds(x, y, WIDTH, HEIGHT);
+        
+        bound.setBounds(x - 2, y + 2, 0, 0);
+        bound.calcBounds();
+        calcBounds(); 
+        updateEdges();
+        firePropChange("bounds", oldBounds, getBounds());
+    }
+
 
     /*
      * @see java.lang.Object#clone()
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.