|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.timjohnstondev.unitconverter.controller.ModelController
public class ModelController
The controller in the MVC pattern for this application. Acts and the intermediary between the view components and the model components.
| Constructor Summary | |
|---|---|
ModelController()
Constructs and initializes a ModelController, pulling all of the model data into a
PropertyList. |
|
| Method Summary | |
|---|---|
String |
getConversion(String property,
String from,
String to)
Returns the Conversion factor or formula for the given
Property name for going from one set of units to another. |
List<String> |
getPropertyNames()
Returns a list of all the Property names in the data
source. |
List<String> |
getSymbols(String property)
Returns a list of all the symbols for this Property in the
data source. |
List<String> |
getSymbols(String property,
String fromUnit)
Returns a list, minus the symbol provided, of the symbols for this Property in the data source. |
String |
getUnitName(String property,
String unitSymbol)
Returns this symbol's name in unabbreviated words for this Property. |
String |
getUnitSeparator()
Returns the unit separator symbol or the default (*) if the value has not been set |
void |
setPropertyOrderPreferences(JList list)
Updates the preference that orders the Propertys in the application. |
void |
setUnitSeparator(String symbol)
Updates the unit separator symbol |
boolean |
usesMoles(String propertyName)
Returns true if this Property can do mole to mass and mass to mole unit conversions, else false |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ModelController()
ModelController, pulling all of the model data into a
PropertyList.
| Method Detail |
|---|
public final String getConversion(String property,
String from,
String to)
Conversion factor or formula for the given
Property name for going from one set of units to another.
property - the name of the Property that will be converted, such as temperature, pressure or lengthfrom - the original unitsto - the desired units
public final List<String> getPropertyNames()
Property names in the data
source. The order of the names is determined by the underlying PropertyList. This list order was initially
based on the order the properties appear in the data source.
Property namespublic final List<String> getSymbols(String property)
Property in the
data source. The order of the symbols is determined by the underlying PropertyList. This list order was
initially based on the order the symbols appear in the data source for this Property.
property - the name of the Property that is the basis for the units
public final List<String> getSymbols(String property,
String fromUnit)
Property in the data source. The order of the symbols is
determined by the underlying Property. This list order was initially based on the order the symbols appear
in the data source for this Property.
property - the name of the Property that is the basis for the unitsfromUnit - the symbol to leave out of the list
public final String getUnitName(String property,
String unitSymbol)
Property.
property - the name of the Property that is the basis for this unitunitSymbol - the symbol that represents the returned name
public final String getUnitSeparator()
public final void setUnitSeparator(String symbol)
symbol - the new unit separator symbolpublic final boolean usesMoles(String propertyName)
true if this Property can do mole to mass and mass to mole unit conversions, else false
propertyName - name of the property
true if this Property can do mole to mass and mass to mole unit conversions, else falsepublic final void setPropertyOrderPreferences(JList list)
Propertys in the application.
list - Property list
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||