Class AngleDegreesConverter
java.lang.Object
org.bidib.wizard.mvc.stepcontrol.view.converter.AngleDegreesConverter
public final class AngleDegreesConverter
extends Object
implements com.jgoodies.binding.value.BindingConverter<Number,String>
Converts Values to Strings and vice-versa using a given Format.
-
Constructor Summary
ConstructorsConstructorDescriptionAngleDegreesConverter(long totalSteps) Constructs aStringConverteron the given subject using the default DecimalFormat.AngleDegreesConverter(Format format, long totalSteps) Constructs aStringConverteron the given subject using the specifiedFormat. -
Method Summary
Modifier and TypeMethodDescriptionstatic doublegetPositionAsAngle(long position, long totalSteps) sourceValue(String targetValue) Parses the given String encoding and sets it as the subject's new value.targetValue(Number sourceValue) Formats the source value and returns a String representation.
-
Constructor Details
-
AngleDegreesConverter
Constructs aStringConverteron the given subject using the specifiedFormat.- Parameters:
format- theFormatused to format and parse- Throws:
NullPointerException- if the subject or the format is null.
-
AngleDegreesConverter
public AngleDegreesConverter(long totalSteps) Constructs aStringConverteron the given subject using the default DecimalFormat.
-
-
Method Details
-
targetValue
Formats the source value and returns a String representation. -
getPositionAsAngle
public static double getPositionAsAngle(long position, long totalSteps) - Returns:
- the position
-
sourceValue
Parses the given String encoding and sets it as the subject's new value. Silently catchesParseException.
-