summaryrefslogtreecommitdiff
path: root/src/main/java/sevenUnitsGUI/View.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/sevenUnitsGUI/View.java')
-rw-r--r--src/main/java/sevenUnitsGUI/View.java56
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);
}