Author: bobtarling
Date: 2007-05-13 15:03:22-0700
New Revision: 12614
Added:
trunk/src_new/org/argouml/uml/diagram/activity/ui/ActionCreatePartition.java (contents, props changed)
trunk/src_new/org/argouml/uml/diagram/activity/ui/ModePlacePackage.java (contents, props changed)
Modified:
trunk/src_new/org/argouml/uml/diagram/activity/ui/FigPartition.java
Log:
Snap partitions together
Added: trunk/src_new/org/argouml/uml/diagram/activity/ui/ActionCreatePartition.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/activity/ui/ActionCreatePartition.java?view=auto&rev=12614
==============================================================================
--- (empty file)
+++ trunk/src_new/org/argouml/uml/diagram/activity/ui/ActionCreatePartition.java 2007-05-13 15:03:22-0700
@@ -0,0 +1,46 @@
+// $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.uml.diagram.activity.ui;
+
+import org.argouml.model.Model;
+import org.argouml.ui.CmdCreateNode;
+import org.tigris.gef.base.Mode;
+import org.tigris.gef.base.ModePlace;
+
+public class ActionCreatePartition extends CmdCreateNode {
+
+ /**
+ * Constructor
+ */
+ public ActionCreatePartition() {
+ super(Model.getMetaTypes().getPartition(),
+ "button.new-partition");
+ }
+
+ protected Mode createMode(String instructions) {
+ return new ModePlacePackage(this, instructions);
+ }
+
+}
Modified: trunk/src_new/org/argouml/uml/diagram/activity/ui/FigPartition.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/activity/ui/FigPartition.java?view=diff&rev=12614&p1=trunk/src_new/org/argouml/uml/diagram/activity/ui/FigPartition.java&p2=trunk/src_new/org/argouml/uml/diagram/activity/ui/FigPartition.java&r1=12613&r2=12614
==============================================================================
--- trunk/src_new/org/argouml/uml/diagram/activity/ui/FigPartition.java (original)
+++ trunk/src_new/org/argouml/uml/diagram/activity/ui/FigPartition.java 2007-05-13 15:03:22-0700
@@ -233,19 +233,6 @@
}
/**
- * TODO: Create an abstract postPlacement method in Fig and have ModePlace
- * call. This method can then be removed.
- * @param layer The Layer containing this Fig
- */
- public void setLayer(Layer layer) {
- super.setLayer(layer);
- if (!placed && layer != null) {
- placed = true;
- postPlacement();
- }
- }
-
- /**
* On post placement look to see if there are any other
* FigPartitions. If so place to the right and resize height.
*/
Added: trunk/src_new/org/argouml/uml/diagram/activity/ui/ModePlacePackage.java
Url: http://argouml.tigris.org/source/browse/argouml/trunk/src_new/org/argouml/uml/diagram/activity/ui/ModePlacePackage.java?view=auto&rev=12614
==============================================================================
--- (empty file)
+++ trunk/src_new/org/argouml/uml/diagram/activity/ui/ModePlacePackage.java 2007-05-13 15:03:22-0700
@@ -0,0 +1,49 @@
+// $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.uml.diagram.activity.ui;
+
+import java.awt.event.MouseEvent;
+import org.tigris.gef.base.ModePlace;
+import org.tigris.gef.graph.GraphFactory;
+
+public class ModePlacePackage extends ModePlace {
+
+ public ModePlacePackage(GraphFactory gf, String instructions) {
+ super(gf, instructions);
+ }
+
+ @Override
+ public void mouseReleased(MouseEvent me) {
+ if (me.isConsumed()) {
+ return;
+ }
+
+ FigPartition fig = (FigPartition) _pers;
+
+ super.mouseReleased(me);
+
+ fig.postPlacement();
+ }
+}
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.