public interface GfxSize
Modifier and Type | Field and Description |
---|---|
static Pattern |
DOUBLE_WITH_UNITS_PATTERN |
static Pattern |
INT_WITH_UNITS_PATTERN |
static Pattern |
MEASUREMENT_PATTERN |
static Pattern |
SCIENTIFIC_NOTATION_WITH_UNITS_PATTERN |
Modifier and Type | Method and Description |
---|---|
GfxSize |
add(GfxSize inValue) |
static GfxSize |
allocate(float inValue,
GfxUnits inUnits)
Function for constructing a GfxSize object.
|
static GfxSize |
allocate(int inValue,
GfxUnits inUnits)
Function for constructing a GfxSize object.
|
static GfxSize |
allocate(String inStringValue)
Convenience allocator that accepts a string with a value followed by units.
|
static GfxSize |
allocate(String inStringValue,
GfxUnits inDefaultUnits)
Function for converting a string representation of a graphics measurement into its appropriate object.
|
GfxUnits |
getUnits() |
default boolean |
greaterThan(GfxSize inValue) |
default boolean |
lessThan(GfxSize inValue) |
void |
scale(float inScalingFactor) |
GfxSize |
subtract(GfxSize inValue) |
float |
to(GfxUnits inUnits) |
int |
toInt(GfxUnits inUnits) |
float |
value() |
static final Pattern MEASUREMENT_PATTERN
static final Pattern INT_WITH_UNITS_PATTERN
static final Pattern DOUBLE_WITH_UNITS_PATTERN
static final Pattern SCIENTIFIC_NOTATION_WITH_UNITS_PATTERN
float value()
void scale(float inScalingFactor)
static GfxSize allocate(String inStringValue)
inStringValue
- the string valuestatic GfxSize allocate(String inStringValue, GfxUnits inDefaultUnits)
inStringValue
- the string representation (ex: "10px", "12pt", or "17.5")inDefaultUnits
- the units to use if the string representation is unit-less.static GfxSize allocate(int inValue, GfxUnits inUnits)
inValue
- the integer valueinUnits
- the units to usestatic GfxSize allocate(float inValue, GfxUnits inUnits)
inValue
- the float valueinUnits
- the units to usedefault boolean greaterThan(GfxSize inValue)