summaryrefslogtreecommitdiff
path: root/src/main/java/sevenUnits/newGUI/Presenter.java
blob: 6f7d34aa3c7b4a3a0f793b6d1cb6cee1c1fcecc0 (plain)
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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
/**
 * Copyright (C) 2021 Adrien Hopkins
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <https://www.gnu.org/licenses/>.
 */
package sevenUnits.newGUI;

/**
 * An object that handles interactions between the view and the backend code
 * 
 * @author Adrien Hopkins
 * @since 2021-12-15
 */
public final class Presenter {
	/**
	 * The view that this presenter communicates with
	 */
	private final View view;
	
	/**
	 * Creates a Presenter
	 * 
	 * @param view the view that this presenter communicates with
	 * @since 2021-12-15
	 */
	public Presenter(View view) {
		this.view = view;
	}
	
	/**
	 * Sets the dimension of the view's From and To units.
	 * 
	 * @throws UnsupportedOperationException if the view does not support
	 *                                       unit-based conversion (does not
	 *                                       implement
	 *                                       {@link UnitConversionView})
	 * @since 2021-12-15
	 */
	public void applyDimensionFilter() {}
	
	/**
	 * Gets settings from the view and applies them to both view and presenter.
	 * 
	 * @since 2021-12-15
	 */
	public void applySettings() {}
	
	/**
	 * Converts from the view's input expression to its output expression.
	 * Displays an error message if any of the required fields are invalid.
	 * 
	 * @throws UnsupportedOperationException if the view does not support
	 *                                       expression-based conversion (does
	 *                                       not implement
	 *                                       {@link ExpressionConversionView})
	 * @since 2021-12-15
	 */
	public void convertExpressions() {}
	
	/**
	 * Converts from the view's input unit to its output unit. Displays an error
	 * message if any of the required fields are invalid.
	 * 
	 * @throws UnsupportedOperationException if the view does not support
	 *                                       unit-based conversion (does not
	 *                                       implement
	 *                                       {@link UnitConversionView})
	 * @since 2021-12-15
	 */
	public void convertUnits() {}
	
	/**
	 * Loads settings from the user's settings file and applies them to the view.
	 * 
	 * @since 2021-12-15
	 */
	public void loadSettings() {}
	
	/**
	 * Gets user settings from the view then saves them to the user's settings
	 * file.
	 * 
	 * @since 2021-12-15
	 */
	public void saveSettings() {}
}