From c421e474a7b0d0d453e4a527907f327f2ddef320 Mon Sep 17 00:00:00 2001 From: Adrien Hopkins Date: Sat, 9 Apr 2022 11:32:43 -0500 Subject: View now sends and recieves Strings instead of data --- .../java/sevenUnitsGUI/UnitConversionView.java | 47 ++++++++++++---------- 1 file changed, 26 insertions(+), 21 deletions(-) (limited to 'src/main/java/sevenUnitsGUI/UnitConversionView.java') diff --git a/src/main/java/sevenUnitsGUI/UnitConversionView.java b/src/main/java/sevenUnitsGUI/UnitConversionView.java index 67d3ddc..9d3a67b 100644 --- a/src/main/java/sevenUnitsGUI/UnitConversionView.java +++ b/src/main/java/sevenUnitsGUI/UnitConversionView.java @@ -17,15 +17,8 @@ package sevenUnitsGUI; import java.util.Optional; -import java.util.OptionalDouble; import java.util.Set; -import sevenUnits.unit.BaseDimension; -import sevenUnits.unit.Unit; -import sevenUnits.unit.UnitValue; -import sevenUnits.utils.NamedObjectProduct; -import sevenUnits.utils.ObjectProduct; - /** * A View that supports single unit-based conversion * @@ -37,60 +30,72 @@ public interface UnitConversionView extends View { * @return dimensions available for filtering * @since 2022-01-29 */ - Set> getDimensions(); + Set getDimensionNames(); /** - * @return unit to convert from + * @return name of unit to convert from * @since 2021-12-15 */ - Optional getFromSelection(); + Optional getFromSelection(); + + /** + * @return list of names of units available to convert from + * @since 2022-03-30 + */ + Set getFromUnitNames(); /** * @return value to convert between the units (specifically, the numeric * string provided by the user) * @since 2021-12-15 */ - OptionalDouble getInputValue(); + String getInputValue(); /** * @return selected dimension * @since 2021-12-15 */ - Optional> getSelectedDimension(); + Optional getSelectedDimensionName(); /** - * @return unit to convert to + * @return name of unit to convert to * @since 2021-12-15 */ - Optional getToSelection(); + Optional getToSelection(); + + /** + * @return list of names of units available to convert to + * @since 2022-03-30 + */ + Set getToUnitNames(); /** * Sets the available dimensions for filtering. * - * @param dimensions dimensions to use + * @param dimensionNames names of dimensions to use * @since 2021-12-15 */ - void setDimensions(Set> dimensions); + void setDimensionNames(Set dimensionNames); /** * Sets the available units to convert from. {@link #getFromSelection} is not * required to use one of these units; this method is to be used for views * that allow the user to select units from a list. * - * @param units units to convert from + * @param unitNames names of units to convert from * @since 2021-12-15 */ - void setFromUnits(Set units); + void setFromUnitNames(Set unitNames); /** * Sets the available units to convert to. {@link #getToSelection} is not * required to use one of these units; this method is to be used for views * that allow the user to select units from a list. * - * @param units units to convert to + * @param unitNames names of units to convert to * @since 2021-12-15 */ - void setToUnits(Set units); + void setToUnitNames(Set unitNames); /** * Shows the output of a unit conversion. @@ -99,5 +104,5 @@ public interface UnitConversionView extends View { * @param output output unit & value * @since 2021-12-24 */ - void showUnitConversionOutput(UnitValue input, UnitValue output); + void showUnitConversionOutput(UnitConversionRecord uc); } -- cgit v1.2.3