Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: /gef/src/org/tigris/gef/base/SelectionMove.java

gef
Discussion topic

Back to topic list

CVS update: /gef/src/org/tigris/gef/base/SelectionMove.java

Reply

Author bobtarling
Full name Bob Tarling
Date 2006-08-30 09:40:45 PDT
Message User: bobtarling
Date: 2006-08-30 09:40:45-0700
Log:
 Increase bounds so that damage covers correct area

File Changes:

Directory: /gef/src/org/tigris/gef/base/
====================​====================​

File [changed]: SelectionMove.java
Url: http://gef.tigris.or​g/source/browse/gef/​src/org/tigris/gef/b​ase/SelectionMove.ja​va?r1=1.5&r2=1.6​
Delta lines: +21 -3
--------------------
--- SelectionMove.java 2006-02-08 14:29:36-0700 1.5
+++ SelectionMove.java 2006-08-30 09:40:43-0700 1.6
@@ -27,7 +27,7 @@
 // File: SelectionMove.java
 // Classes: SelectionMove
 // Original Author: jrobbins at ics dot uci dot edu
-// $Id: SelectionMove.java,v 1.5 2006/02/08 21:29:36 bobtarling Exp $
+// $Id: SelectionMove.java,v 1.6 2006/08/30 16:40:43 bobtarling Exp $
 
 package org.tigris.gef.base;
 
@@ -37,11 +37,15 @@
 import org.tigris.gef.prese​ntation.Fig;
 import org.tigris.gef.prese​ntation.Handle;
 
-/** Selection object that allows the user to move the selected Fig,
- * but not to resize it. */
+/**
+ * Selection object that allows the user to move the selected Fig,
+ * but not to resize it.
+ */
 
 public class SelectionMove extends Selection {
 
+ private static final long serialVersionUID = 2136083601083895759L;
+
     /** Construct a new SelectionMove around the given DiagramElement */
     public SelectionMove(Fig f) {
         super(f);
@@ -77,6 +81,20 @@
     public void hitHandle(Rectangle r, Handle h) {
         h.index = -1;
         h.instructions = "Move Object(s)";
+ }
+
+ /**
+ * The bounding box of the selection is the bbox of the contained Fig
+ * with added space for the handles.
+ * For SelectionMove this is larger than normal so that the edges
+ * of the selection box don't touch the edges of the contents.
+ **/
+ public Rectangle getBounds() {
+ return new Rectangle(
+ getContent().getX() - BORDER_WIDTH,
+ getContent().getY() - BORDER_WIDTH,
+ getContent().getWidth() + BORDER_WIDTH * 2 + 2,
+ getContent().getHeight() + BORDER_WIDTH * 2 + 2);
     }
 } /* end class SelectionMove */

« Previous message in topic | 1 of 1 | Next message in topic »

Messages

Show all messages in topic

CVS update: /gef/src/org/tigris/gef/base/SelectionMove.java bobtarling Bob Tarling 2006-08-30 09:40:45 PDT
Messages per page: