View Javadoc

1   /***
2    *     Ambient - A music player for the Android platform
3    Copyright (C) 2007 Martin Vysny
4    
5    This program is free software: you can redistribute it and/or modify
6    it under the terms of the GNU General Public License as published by
7    the Free Software Foundation, either version 3 of the License, or
8    (at your option) any later version.
9    
10   This program is distributed in the hope that it will be useful,
11   but WITHOUT ANY WARRANTY; without even the implied warranty of
12   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13   GNU General Public License for more details.
14  
15   You should have received a copy of the GNU General Public License
16   along with this program.  If not, see <http://www.gnu.org/licenses/>.
17   */
18  
19  package sk.baka.ambient.activity.main;
20  
21  import java.util.Arrays;
22  import java.util.List;
23  import java.util.Map;
24  
25  import sk.baka.ambient.ActionsEnum;
26  import sk.baka.ambient.R;
27  import sk.baka.ambient.ZoomEnum;
28  import sk.baka.ambient.views.ButtonBar;
29  import android.graphics.Point;
30  
31  /***
32   * Controls the three window buttons.
33   * 
34   * @author Martin Vysny
35   */
36  public final class WindowButtonsController extends AbstractController {
37  	/***
38  	 * Creates the controller
39  	 * 
40  	 * @param mainActivity
41  	 *            the activity
42  	 */
43  	public WindowButtonsController(MainActivity mainActivity) {
44  		super(R.id.mainButtons, mainActivity);
45  		final List<ActionsEnum> actions = Arrays.asList(ActionsEnum.About,
46  				ActionsEnum.Minimize, ActionsEnum.Quit);
47  		final ButtonBar bar = (ButtonBar) mainView;
48  		bar.setBitmaps(new int[] { R.drawable.button_i,
49  				R.drawable.button_minimize, R.drawable.button_close }, null,
50  				new Point(30, 19), new Point(45, 28));
51  		bar.setTag(actions);
52  		bar.listener = listener;
53  	}
54  
55  	@Override
56  	protected void performZoom(final Map<ZoomEnum,Integer> zoom) {
57  		// do nothing
58  	}
59  }