Class UnitConverter
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intValue to return if this converter can not handle theunitsent in as an argument to the convert method. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract intconvertToPixels(float value, String unit, boolean isHor, float refValue, ContainerWrapper parent, ComponentWrapper comp) Convertsvalueto pixels.Methods inherited from class Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()booleanIndicates whether some other object is "equal to" this one.final ClassgetClass()Returns the runtime class of an object.inthashCode()Returns a hash code value for the object.final voidnotify()Wakes up a single thread that is waiting on this object's monitor.final voidWakes up all threads that are waiting on this object's monitor.toString()Returns a string representation of the object.final voidwait()Causes current thread to wait until another thread invokes the method or the method for this object.final voidwait(long timeout) Causes current thread to wait until either another thread invokes the method or the method for this object, or a specified amount of time has elapsed.final voidwait(long timeout, int nanos) Causes current thread to wait until another thread invokes the method or the method for this object, or some other thread interrupts the current thread, or a certain amount of real time has elapsed.
-
Field Details
-
UNABLE
public static final int UNABLEValue to return if this converter can not handle theunitsent in as an argument to the convert method.- See Also:
-
-
Constructor Details
-
UnitConverter
public UnitConverter()
-
-
Method Details
-
convertToPixels
public abstract int convertToPixels(float value, String unit, boolean isHor, float refValue, ContainerWrapper parent, ComponentWrapper comp) Converts
valueto pixels.Parameters
-
value: The value to be converted. -
unit: The unit ofvalue. Nevernulland at least one character. -
refValue: @param refValue Some reference value that may of may not be used. If the unit is percent for instance this value is the value to take the percent from. Usually the size of the parent component in the appropriate dimension. -
isHor: If the value is horizontal (true) or vertical (false). -
parent: @param parent The parent of the target component thatvalueis to be applied to. Might for instance be needed to get the screen that the component is on in a multi screen environment.
May be
nullin which case a "best guess" value should be returned.comp: The component, if applicable, ornullif none.
Returns
The number of pixels if
unitis handled by this converter,UnitConverter.UNABLEif not. -
-