View Javadoc

1   /*--------------------------------------------------------------------------
2    *  Copyright 2007 utgenome.org
3    *
4    *  Licensed under the Apache License, Version 2.0 (the "License");
5    *  you may not use this file except in compliance with the License.
6    *  You may obtain a copy of the License at
7    *
8    *     http://www.apache.org/licenses/LICENSE-2.0
9    *
10   *  Unless required by applicable law or agreed to in writing, software
11   *  distributed under the License is distributed on an "AS IS" BASIS,
12   *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   *  See the License for the specific language governing permissions and
14   *  limitations under the License.
15   *--------------------------------------------------------------------------*/
16  //--------------------------------------
17  // utgb-core Project
18  //
19  // TrackFrame.java
20  // Since: Nov 29, 2007
21  //
22  // $URL$ 
23  // $Author$
24  //--------------------------------------
25  package org.utgenome.gwt.utgb.client.ui;
26  
27  import org.utgenome.gwt.utgb.client.track.Design;
28  
29  import com.google.gwt.user.client.ui.AbsolutePanel;
30  import com.google.gwt.user.client.ui.Composite;
31  import com.google.gwt.user.client.ui.HorizontalPanel;
32  import com.google.gwt.user.client.ui.VerticalPanel;
33  import com.google.gwt.user.client.ui.Widget;
34  
35  /**
36   * @author leo
37   *
38   */
39  public class TrackFrame extends Composite implements Frame {
40  
41  	private final HorizontalPanel layoutFrame = new HorizontalPanel();
42  	private final RoundCornerFrame frameBorder = new RoundCornerFrame("999999", 2, RoundCornerFrame.NORTH | RoundCornerFrame.SOUTH | RoundCornerFrame.WEST);
43  	private final AbsolutePanel titleFrame = new AbsolutePanel();
44  	private final HorizontalPanel iconFrame = new HorizontalPanel(); 
45  	
46  	private Icon iconConfig = new Icon(Design.getIconImage(Design.ICON_CONFIG));
47  	private Icon iconAdjust = new Icon(Design.getIconImage(Design.ICON_PACK));
48  	private Icon iconMinmize = new Icon(Design.getIconImage(Design.ICON_HIDE));
49  	private Icon iconClose = new Icon(Design.getIconImage(Design.ICON_CLOSE));
50  	
51  	private FixedWidthLabel titleLabel = new FixedWidthLabel("Window Title Message (this is a sample message)", 150);
52  	
53  	private boolean isConfigurable = true;
54  	private boolean isAdjustable = true;
55  	private boolean isMinimizable = true;
56  	private boolean isClosable = true;
57  	
58  	public TrackFrame()
59  	{
60  		buildGUI();
61  		initWidget(layoutFrame);
62  	}
63  	
64  	protected void buildGUI()
65  	{
66  		frameBorder.setPixelSize(150, 20);
67  		titleFrame.setSize("100%", "100%");
68  		frameBorder.setWidget(titleFrame);
69  		
70  		iconFrame.setSpacing(0);
71  		iconFrame.setVerticalAlignment(VerticalPanel.ALIGN_MIDDLE);
72  				
73  		if(isConfigurable)
74  		{
75  			iconFrame.add(iconConfig);
76  		}
77  		if(isAdjustable)
78  			iconFrame.add(iconAdjust);
79  		if(isMinimizable)
80  			iconFrame.add(iconMinmize);
81  		if(isClosable)
82  			iconFrame.add(iconClose);
83  		
84  		titleFrame.add(titleLabel);
85  		titleFrame.add(iconFrame, 50, 0);
86  		
87  		layoutFrame.add(frameBorder);
88  		
89  		
90  		
91  		
92  	}
93  	
94  	
95  	public Widget getTitleBar() {
96  		// TODO Auto-generated method stub
97  		return null;
98  	}
99  
100 	public boolean isAdjustable() {
101 		// TODO Auto-generated method stub
102 		return false;
103 	}
104 
105 	public boolean isClosable() {
106 		// TODO Auto-generated method stub
107 		return false;
108 	}
109 
110 	public boolean isConfigurable() {
111 		// TODO Auto-generated method stub
112 		return false;
113 	}
114 
115 	public boolean isHorizontallyResizable() {
116 		// TODO Auto-generated method stub
117 		return false;
118 	}
119 
120 	public boolean isMinimizable() {
121 		// TODO Auto-generated method stub
122 		return false;
123 	}
124 
125 	public boolean isVerticallyResizable() {
126 		// TODO Auto-generated method stub
127 		return false;
128 	}
129 
130 	public void setAdjustable(boolean enable) {
131 		// TODO Auto-generated method stub
132 		
133 	}
134 
135 	public void setClosable(boolean enable) {
136 		// TODO Auto-generated method stub
137 		
138 	}
139 
140 	public void setConfigurable(boolean enable) {
141 		// TODO Auto-generated method stub
142 		
143 	}
144 
145 	public void setHeight(int height) {
146 		// TODO Auto-generated method stub
147 		
148 	}
149 
150 	public void setHorizontallyRisizable(boolean enable) {
151 		// TODO Auto-generated method stub
152 		
153 	}
154 
155 	public void setMinimizable(boolean enable) {
156 		// TODO Auto-generated method stub
157 		
158 	}
159 
160 	public void setSize(int width, int height) {
161 		// TODO Auto-generated method stub
162 		
163 	}
164 
165 	public void setVerticallyRisizable(boolean enable) {
166 		// TODO Auto-generated method stub
167 		
168 	}
169 
170 	public void setVisible(boolean visible) {
171 		// TODO Auto-generated method stub
172 		
173 	}
174 
175 	public void setWidth(int width) {
176 		// TODO Auto-generated method stub
177 		
178 	}
179 
180 	
181 	
182 }
183 
184 
185 
186