# HG changeset patch # User Ingo Weinzierl # Date 1305184107 0 # Node ID e763d8efd42fcba6fddc731c0ed353c18182b995 # Parent f33af25b7490d93bb609b32226b9abc0f0ccd688 ISSUE-34 Limit the windows which are moved to the right lower corner to 10. flys-client/trunk@1906 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r f33af25b7490 -r e763d8efd42f flys-client/ChangeLog --- a/flys-client/ChangeLog Wed May 11 16:38:54 2011 +0000 +++ b/flys-client/ChangeLog Thu May 12 07:08:27 2011 +0000 @@ -1,3 +1,13 @@ +2011-05-12 Ingo Weinzierl + + ISSUE-34 + + * src/main/java/de/intevation/flys/client/client/ui/FLYSWorkspace.java: + The number of windows which are moved the right lower browser window + corner is limited to 10 windows now. The 11th window is placed at the + left upper corner again. Window 12-20 are moved with an offset into to + the right lower corner again. + 2011-05-11 Sascha L. Teichmann * src/main/java/de/intevation/flys/client/shared/model/DataCageNode.java, diff -r f33af25b7490 -r e763d8efd42f flys-client/src/main/java/de/intevation/flys/client/client/ui/FLYSWorkspace.java --- a/flys-client/src/main/java/de/intevation/flys/client/client/ui/FLYSWorkspace.java Wed May 11 16:38:54 2011 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/client/ui/FLYSWorkspace.java Thu May 12 07:08:27 2011 +0000 @@ -11,6 +11,14 @@ */ public class FLYSWorkspace extends Canvas { + /** The maximal number of windows that fit into the browser view when an + * offset is used to move windows initially.*/ + public static int MAX_WINDOWS = 10; + + /** The number of pixels used to move windows.*/ + public static int WINDOW_OFFSET = 20; + + /** A map that contains the open CollectionViews. */ protected List views; @@ -31,11 +39,11 @@ * @param collectionView A new CollectionView. */ public void addView(CollectionView collectionView) { - if (views.size() > 0) { - collectionView.moveTo( - views.size() * 20, - views.size() * 20); - } + int num = views != null ? views.size() : 0; + int factor = num % MAX_WINDOWS; + + collectionView.moveTo(factor * WINDOW_OFFSET, factor * WINDOW_OFFSET); + views.add(collectionView); addChild(collectionView); }