1 /*
2  * aTunes
3  * Copyright (C) Alex Aranda, Sylvain Gaudard and contributors
4  *
5  * See http://www.atunes.org/wiki/index.php?title=Contributing for information about contributors
6  *
7  * http://www.atunes.org
8  * http://sourceforge.net/projects/atunes
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  */
20 
21 package net.sourceforge.atunes.gui.frame;
22 
23 import net.sourceforge.atunes.model.IFramePosition;
24 import net.sourceforge.atunes.model.IStateUI;
25 
26 /**
27  * Saves frame position of frame
28  *
29  * @author alex
30  *
31  */
32 public final class SaveFramePositionTask implements Runnable {
33 
34 	private IStateUI stateUI;
35 	private int x;
36 	private int y;
37 
38 	/**
39 	 * @param stateUI
40 	 */
setStateUI(final IStateUI stateUI)41 	public void setStateUI(final IStateUI stateUI) {
42 		this.stateUI = stateUI;
43 	}
44 
45 	/**
46 	 * @param x
47 	 */
setX(final int x)48 	public void setX(final int x) {
49 		this.x = x;
50 	}
51 
52 	/**
53 	 * @param y
54 	 */
setY(final int y)55 	public void setY(final int y) {
56 		this.y = y;
57 	}
58 
59 	@Override
run()60 	public void run() {
61 		IFramePosition framePosition = this.stateUI.getFramePosition();
62 		framePosition.setXPosition(this.x);
63 		framePosition.setYPosition(this.y);
64 		this.stateUI.setFramePosition(framePosition);
65 	}
66 }