annotate flys-client/src/main/java/de/intevation/flys/client/client/ui/FLYSWorkspace.java @ 4657:65eadfe33466

Remove unused import
author Björn Ricks <bjoern.ricks@intevation.de>
date Tue, 11 Dec 2012 09:46:22 +0100
parents c0a275c581fb
children e70ff0a600a3
rev   line source
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
1 package de.intevation.flys.client.client.ui;
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
2
4128
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
3 import com.google.gwt.core.client.GWT;
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
4
4607
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
5 import com.smartgwt.client.types.Alignment;
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
6 import com.smartgwt.client.types.VerticalAlignment;
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
7 import com.smartgwt.client.widgets.Button;
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
8 import com.smartgwt.client.widgets.Canvas;
4607
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
9 import com.smartgwt.client.widgets.Img;
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
10 import com.smartgwt.client.widgets.Label;
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
11 import com.smartgwt.client.widgets.events.ClickEvent;
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
12 import com.smartgwt.client.widgets.events.ClickHandler;
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
13 import com.smartgwt.client.widgets.layout.HLayout;
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
14 import com.smartgwt.client.widgets.layout.VLayout;
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
15
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
16 import de.intevation.flys.client.client.FLYS;
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
17 import de.intevation.flys.client.client.FLYSConstants;
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
18
557
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
19 import java.util.HashMap;
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
20 import java.util.Map;
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
21
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
22
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
23 /**
3549
6a8f83c538e3 Merged revisions 5384 via svnmerge from
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 3522
diff changeset
24 * "Workspace" canvas showing the CollectionViews (subwindows).
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
25 * @author <a href="mailto:ingo.weinzierl@intevation.de">Ingo Weinzierl</a>
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
26 */
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
27 public class FLYSWorkspace extends Canvas {
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
28
279
e763d8efd42f ISSUE-34 Limit the windows which are moved to the right lower corner to 10.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 273
diff changeset
29 /** The maximal number of windows that fit into the browser view when an
e763d8efd42f ISSUE-34 Limit the windows which are moved to the right lower corner to 10.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 273
diff changeset
30 * offset is used to move windows initially.*/
e763d8efd42f ISSUE-34 Limit the windows which are moved to the right lower corner to 10.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 273
diff changeset
31 public static int MAX_WINDOWS = 10;
e763d8efd42f ISSUE-34 Limit the windows which are moved to the right lower corner to 10.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 273
diff changeset
32
e763d8efd42f ISSUE-34 Limit the windows which are moved to the right lower corner to 10.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 273
diff changeset
33 /** The number of pixels used to move windows.*/
e763d8efd42f ISSUE-34 Limit the windows which are moved to the right lower corner to 10.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 273
diff changeset
34 public static int WINDOW_OFFSET = 20;
e763d8efd42f ISSUE-34 Limit the windows which are moved to the right lower corner to 10.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 273
diff changeset
35
e763d8efd42f ISSUE-34 Limit the windows which are moved to the right lower corner to 10.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 273
diff changeset
36
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
37 /** A map that contains the open CollectionViews. */
557
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
38 protected Map<String, CollectionView> views;
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
39
4607
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
40 /** The interface that provides the message resources. */
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
41 private FLYSConstants MESSAGES = GWT.create(FLYSConstants.class);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
42
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
43 private FLYS flys;
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
44
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
45 /**
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
46 * The default constructor creates an empty FLYSWorkspace with no
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
47 * CollectionViews opened.
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
48 */
4607
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
49 public FLYSWorkspace(FLYS flys) {
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
50 this.flys = flys;
557
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
51 views = new HashMap<String, CollectionView>();
3522
6eeacd0bbe26 New projects are now maximized by default.
Christian Lins <christian.lins@intevation.de>
parents: 896
diff changeset
52
6eeacd0bbe26 New projects are now maximized by default.
Christian Lins <christian.lins@intevation.de>
parents: 896
diff changeset
53 setWidth("100%");
6eeacd0bbe26 New projects are now maximized by default.
Christian Lins <christian.lins@intevation.de>
parents: 896
diff changeset
54 setHeight("100%");
4607
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
55
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
56 addBackgroundWorkspace();
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
57 }
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
58
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
59
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
60 /**
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
61 * This method adds a new CollectionView to this workspace and stores a
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
62 * reference in {@link views}.
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
63 *
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
64 * @param collectionView A new CollectionView.
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
65 */
557
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
66 public void addView(String uuid, CollectionView collectionView) {
3522
6eeacd0bbe26 New projects are now maximized by default.
Christian Lins <christian.lins@intevation.de>
parents: 896
diff changeset
67 collectionView.moveTo(0, 0);
6eeacd0bbe26 New projects are now maximized by default.
Christian Lins <christian.lins@intevation.de>
parents: 896
diff changeset
68 collectionView.setMaximized(true);
279
e763d8efd42f ISSUE-34 Limit the windows which are moved to the right lower corner to 10.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 273
diff changeset
69
557
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
70 views.put(uuid, collectionView);
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
71 addChild(collectionView);
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
72 }
557
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
73
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
74
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
75 public void removeProject(String uuid) {
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
76 views.remove(uuid);
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
77 }
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
78
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
79
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
80 public void bringUp(String uuid) {
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
81 CollectionView view = views.get(uuid);
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
82
4128
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
83 if (view != null) {
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
84 view.show();
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
85 view.restore();
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
86 }
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
87 else {
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
88 GWT.log("FLYSWorkspace.bringUp() failed!");
11c589d68f13 Fix for NPE in FLYSWorkspace.bringUp() #933
Christian Lins <christian.lins@intevation.de>
parents: 3549
diff changeset
89 }
557
92c200887b20 #21 There might be just a single window for each project now. Users can't open a project twice.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 279
diff changeset
90 }
600
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
91
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
92
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
93 /**
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
94 * Removes a project from workspace (view) and clears its reference from
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
95 * hash map.
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
96 *
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
97 * @param uuid The project's uuid.
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
98 */
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
99 public void destroyProject(String uuid) {
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
100 CollectionView project = views.get(uuid);
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
101
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
102 if (project != null) {
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
103 removeProject(uuid);
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
104 project.destroy();
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
105 }
347cf4a5a486 Open projects are removed from screen if the user deletes them (via project list).
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents: 591
diff changeset
106 }
895
9acbd3f98262 Update the collection view title when the project name changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 600
diff changeset
107
9acbd3f98262 Update the collection view title when the project name changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 600
diff changeset
108
9acbd3f98262 Update the collection view title when the project name changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 600
diff changeset
109 public void updateTitle(String uuid, String title) {
9acbd3f98262 Update the collection view title when the project name changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 600
diff changeset
110 CollectionView view = views.get(uuid);
9acbd3f98262 Update the collection view title when the project name changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 600
diff changeset
111 view.setTitle(title);
9acbd3f98262 Update the collection view title when the project name changes.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 600
diff changeset
112 }
896
fe23bbf0ea11 Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 895
diff changeset
113
fe23bbf0ea11 Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 895
diff changeset
114
fe23bbf0ea11 Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 895
diff changeset
115 public boolean hasView(String uuid) {
fe23bbf0ea11 Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 895
diff changeset
116 if(views.get(uuid) != null) {
fe23bbf0ea11 Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 895
diff changeset
117 return true;
fe23bbf0ea11 Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 895
diff changeset
118 }
fe23bbf0ea11 Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 895
diff changeset
119 return false;
fe23bbf0ea11 Fixed a problem with renaming collection view title and duplicating projects.
Raimund Renkert <raimund.renkert@intevation.de>
parents: 895
diff changeset
120 }
4607
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
121
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
122 private void addBackgroundWorkspace() {
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
123 String baseUrl = GWT.getHostPageBaseURL();
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
124 Img bfg = new Img(
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
125 baseUrl + MESSAGES.bfgLogo());
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
126 bfg.setWidth(150);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
127 bfg.setHeight(100);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
128 bfg.setLayoutAlign(Alignment.RIGHT);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
129
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
130 HLayout backgroundlayout = new HLayout();
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
131 backgroundlayout.setHeight100();
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
132 backgroundlayout.setWidth100();
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
133 backgroundlayout.setDefaultLayoutAlign(Alignment.CENTER);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
134 backgroundlayout.setDefaultLayoutAlign(VerticalAlignment.CENTER);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
135
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
136 Canvas spacer = new Canvas();
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
137 spacer.setWidth("33%");
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
138
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
139 VLayout infobox = new VLayout();
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
140 infobox.setHeight("*");
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
141 infobox.setWidth("*");
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
142 infobox.setDefaultLayoutAlign(Alignment.CENTER);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
143
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
144 Label welcome = new Label(MESSAGES.welcome());
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
145 welcome.setAlign(Alignment.CENTER);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
146 welcome.setStyleName("fontNormalBig");
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
147
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
148 Label lcreate = new Label(MESSAGES.welcome_open_or_create());
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
149 lcreate.setStyleName("welcomeCreateText");
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
150 lcreate.setWidth100();
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
151 lcreate.setAlign(Alignment.CENTER);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
152
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
153 Button addbutton = new Button(MESSAGES.new_project());
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
154 addbutton.setStyleName("projectsAddButton");
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
155 addbutton.setAlign(Alignment.CENTER);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
156 addbutton.setTitle(MESSAGES.new_project());
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
157 addbutton.setAutoFit(true);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
158 addbutton.addClickHandler(new ClickHandler() {
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
159
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
160 @Override
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
161 public void onClick(ClickEvent event) {
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
162 flys.newProject();
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
163 }
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
164 });
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
165
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
166
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
167 infobox.addMember(welcome);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
168 infobox.addMember(lcreate);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
169 infobox.addMember(addbutton);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
170
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
171 backgroundlayout.addMember(spacer);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
172 backgroundlayout.addMember(infobox);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
173 backgroundlayout.addMember(spacer);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
174
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
175 addChild(backgroundlayout);
c0a275c581fb Add a welcome screen to the workspace background
Björn Ricks <bjoern.ricks@intevation.de>
parents: 4128
diff changeset
176 }
6
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
177 }
e2b3966b40ca Added a workspace that handles the collection windows. New button to open a new collection.
Ingo Weinzierl <ingo.weinzierl@intevation.de>
parents:
diff changeset
178 // vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org