Revision: 6040
http://squirrel-sql.svn.sourceforge.net/squirrel-sql/?rev=6040&view=rev
Author: gerdwagner
Date: 2010-12-20 21:32:43 +0000 (Mon, 20 Dec 2010)
Log Message:
-----------
Gave dragging a bit of tolerance before it removes table multi selection
Modified Paths:
--------------
trunk/sql12/plugins/graph/src/main/java/net/sourceforge/squirrel_sql/plugins/graph/GraphDesktopManager.java
Modified: trunk/sql12/plugins/graph/src/main/java/net/sourceforge/squirrel_sql/plugins/graph/GraphDesktopManager.java
===================================================================
--- trunk/sql12/plugins/graph/src/main/java/net/sourceforge/squirrel_sql/plugins/graph/GraphDesktopManager.java 2010-12-20 21:23:37 UTC (rev 6039)
+++ trunk/sql12/plugins/graph/src/main/java/net/sourceforge/squirrel_sql/plugins/graph/GraphDesktopManager.java 2010-12-20 21:32:43 UTC (rev 6040)
@@ -27,14 +27,13 @@
{
TableFrame tf = (TableFrame) f;
- if (!_graphDesktopPane.isGroupFrame(tf))
- {
- _graphDesktopPane.setGroupFrame(tf);
- }
Point correctDelta = checkBounds(newX - f.getX(), newY - f.getY(), _graphDesktopPane);
correctX = f.getX() + correctDelta.x;
correctY = f.getY() + correctDelta.y;
+
+ tolerantlyCheckGroupDissolve(tf, correctDelta);
+
for (TableFrame current : _graphDesktopPane.getGroupFrames())
{
if (current != tf)
@@ -47,9 +46,23 @@
}
super.dragFrame(f, correctX, correctY);
- _graphDesktopPane.repaint(); // Needed in case tbles are moved that don't have any constraints.
+ _graphDesktopPane.repaint(); // Needed in case tables are moved that don't have any constraints.
}
+ private void tolerantlyCheckGroupDissolve(TableFrame tf, Point correctDelta)
+ {
+ double tolerance = 0.005;
+
+ if ( ((double)correctDelta.x) / ((_graphDesktopPane.getWidth())) > tolerance
+ || ((double)correctDelta.y) / ((_graphDesktopPane.getHeight())) > tolerance)
+ {
+ if (!_graphDesktopPane.isGroupFrame(tf))
+ {
+ _graphDesktopPane.setGroupFrame(tf);
+ }
+ }
+ }
+
private void moveFoldingPoints(List<TableFrame> movedTableFrames, Point delta)
{
for (TableFrame f1 : movedTableFrames)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|