diff options
author | Adrien Hopkins <ahopk127@my.yorku.ca> | 2022-04-10 14:22:29 -0500 |
---|---|---|
committer | Adrien Hopkins <ahopk127@my.yorku.ca> | 2022-04-10 14:22:29 -0500 |
commit | b1affe92460637211f560d70ee5c8770f3952822 (patch) | |
tree | 2fe58d9280794cd4c65e2f76e8068c9fd49bbc2c /src/main/java/sevenUnitsGUI/View.java | |
parent | c421e474a7b0d0d453e4a527907f327f2ddef320 (diff) |
Created API for settings and unit/prefix viewing
Diffstat (limited to 'src/main/java/sevenUnitsGUI/View.java')
-rw-r--r-- | src/main/java/sevenUnitsGUI/View.java | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/src/main/java/sevenUnitsGUI/View.java b/src/main/java/sevenUnitsGUI/View.java index e78c9cc..da3749e 100644 --- a/src/main/java/sevenUnitsGUI/View.java +++ b/src/main/java/sevenUnitsGUI/View.java @@ -16,6 +16,12 @@ */ package sevenUnitsGUI; +import java.util.Optional; +import java.util.Set; + +import sevenUnits.unit.UnitType; +import sevenUnits.utils.NameSymbol; + /** * An object that controls user interaction with 7Units * @@ -24,6 +30,35 @@ package sevenUnitsGUI; */ public interface View { /** + * @return name of prefix currently being viewed + * @since 2022-04-10 + */ + Optional<String> getViewedPrefixName(); + + /** + * @return name of unit currently being viewed + * @since 2022-04-10 + */ + Optional<String> getViewedUnitName(); + + /** + * Sets the list of prefixes that are available to be viewed in a prefix + * viewer + * + * @param prefixNames prefix names to view + * @since 2022-04-10 + */ + void setViewablePrefixNames(Set<String> prefixNames); + + /** + * Sets the list of units that are available to be viewed in a unit viewer + * + * @param unitNames unit names to view + * @since 2022-04-10 + */ + void setViewableUnitNames(Set<String> unitNames); + + /** * Shows an error message. * * @param title title of error message; on any view that uses an error @@ -32,4 +67,25 @@ public interface View { * @since 2021-12-15 */ void showErrorMessage(String title, String message); + + /** + * Shows information about a prefix to the user. + * + * @param name name(s) and symbol of prefix + * @param multiplierString string representation of prefix multiplier + * @since 2022-04-10 + */ + void showPrefix(NameSymbol name, String multiplierString); + + /** + * Shows information about a unit to the user. + * + * @param name name(s) and symbol of unit + * @param definition unit's definition string + * @param dimensionName name of unit's dimension + * @param type type of unit (metric/semi-metric/non-metric) + * @since 2022-04-10 + */ + void showUnit(NameSymbol name, String definition, String dimensionName, + UnitType type); } |