Mercurial > dive4elements > river
comparison flys-client/src/main/java/de/intevation/flys/client/client/ui/FLYSWorkspace.java @ 279:e763d8efd42f
ISSUE-34 Limit the windows which are moved to the right lower corner to 10.
flys-client/trunk@1906 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author | Ingo Weinzierl <ingo.weinzierl@intevation.de> |
---|---|
date | Thu, 12 May 2011 07:08:27 +0000 |
parents | 905daf30221a |
children | 92c200887b20 |
comparison
equal
deleted
inserted
replaced
278:f33af25b7490 | 279:e763d8efd42f |
---|---|
8 | 8 |
9 /** | 9 /** |
10 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> | 10 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a> |
11 */ | 11 */ |
12 public class FLYSWorkspace extends Canvas { | 12 public class FLYSWorkspace extends Canvas { |
13 | |
14 /** The maximal number of windows that fit into the browser view when an | |
15 * offset is used to move windows initially.*/ | |
16 public static int MAX_WINDOWS = 10; | |
17 | |
18 /** The number of pixels used to move windows.*/ | |
19 public static int WINDOW_OFFSET = 20; | |
20 | |
13 | 21 |
14 /** A map that contains the open CollectionViews. */ | 22 /** A map that contains the open CollectionViews. */ |
15 protected List<CollectionView> views; | 23 protected List<CollectionView> views; |
16 | 24 |
17 | 25 |
29 * reference in {@link views}. | 37 * reference in {@link views}. |
30 * | 38 * |
31 * @param collectionView A new CollectionView. | 39 * @param collectionView A new CollectionView. |
32 */ | 40 */ |
33 public void addView(CollectionView collectionView) { | 41 public void addView(CollectionView collectionView) { |
34 if (views.size() > 0) { | 42 int num = views != null ? views.size() : 0; |
35 collectionView.moveTo( | 43 int factor = num % MAX_WINDOWS; |
36 views.size() * 20, | 44 |
37 views.size() * 20); | 45 collectionView.moveTo(factor * WINDOW_OFFSET, factor * WINDOW_OFFSET); |
38 } | 46 |
39 views.add(collectionView); | 47 views.add(collectionView); |
40 addChild(collectionView); | 48 addChild(collectionView); |
41 } | 49 } |
42 } | 50 } |
43 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : | 51 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 : |