1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25 package org.utgenome.gwt.utgb.client.ui;
26
27 import org.utgenome.gwt.widget.client.Style;
28
29 import com.google.gwt.core.client.GWT;
30 import com.google.gwt.user.client.ui.Composite;
31 import com.google.gwt.user.client.ui.FlexTable;
32 import com.google.gwt.user.client.ui.Label;
33 import com.google.gwt.user.client.ui.VerticalPanel;
34
35 public class WindowTitleBar extends Composite {
36
37 public final FlexTable layoutFrame = new FlexTable();
38 public final Label leftCorner = new Label();
39 public final FlexTable titleBar = new FlexTable();
40 public final Label title = new Label("Title");
41 public final Label rightCorner = new Label();
42
43 public WindowTitleBar() {
44
45 setupWidget();
46 initWidget(layoutFrame);
47 }
48
49 protected void setupWidget() {
50
51 layoutFrame.clear();
52 layoutFrame.setWidget(0, 0, leftCorner);
53 layoutFrame.setWidget(0, 1, titleBar);
54 layoutFrame.setWidget(0, 2, rightCorner);
55
56
57 layoutFrame.setCellPadding(0);
58 layoutFrame.setCellSpacing(0);
59 layoutFrame.getCellFormatter().setWidth(0, 1, "100%");
60 layoutFrame.setHeight("100%");
61
62
63 titleBar.setCellPadding(0);
64 titleBar.setCellSpacing(0);
65 titleBar.setWidth("100%");
66 titleBar.setHeight("23px");
67 titleBar.setWidget(0, 0, title);
68 titleBar.getRowFormatter().setVerticalAlign(0, VerticalPanel.ALIGN_MIDDLE);
69 titleBar.getCellFormatter().setWidth(0, 0, "100%");
70 Style.cursor(title, Style.CURSOR_MOVE);
71
72
73 leftCorner.setPixelSize(9, 23);
74 rightCorner.setPixelSize(9, 23);
75 Style.fontSize(leftCorner, 0);
76 Style.fontSize(rightCorner, 0);
77 Style.fontSize(title, 12);
78 Style.nowrap(title);
79 Style.backgroundImage(leftCorner, GWT.getModuleBaseURL() + "theme/mac/tl.gif");
80 Style.backgroundImage(titleBar, GWT.getModuleBaseURL() + "theme/mac/t.gif");
81 Style.backgroundImage(rightCorner, GWT.getModuleBaseURL() + "theme/mac/tr.gif");
82 Style.backgroundNoRepeat(leftCorner);
83 Style.backgroundNoRepeat(rightCorner);
84 }
85
86 }