Package tripleplay.ui.util
Class Insets
java.lang.Object
tripleplay.ui.util.Insets
- Direct Known Subclasses:
Insets.Mutable
Corresponds to the distances that some rectangular object's edges will be offset when,
for example, it is contained in another rectangle.
-
Nested Class Summary
-
Field Summary
-
Constructor Summary
ConstructorDescriptionInsets
(float top, float right, float bottom, float left) Creates new insets. -
Method Summary
Modifier and TypeMethodDescriptionpythagoras.f.Dimension
addTo
(pythagoras.f.Dimension size) Adds these insets to the supplied dimensions.adjust
(float dtop, float dright, float dbottom, float dleft) Returns a new instance which is the supplied adjustments added to these insets.float
bottom()
Gets the bottom inset.float
height()
Returns this total adjustment to height.float
left()
Gets the left inset.mutable()
Gets or creates a copy of these insets that can be mutated.float
right()
Gets the right inset.pythagoras.f.Dimension
subtractFrom
(pythagoras.f.Dimension size) Adds these insets from the supplied dimensions.static Insets
symmetric
(float horiz, float vert) Returns a read-only instance with left and right set to one value and top and bottom set to another.float
top()
Gets the top inset.toString()
static Insets
uniform
(float val) Returns a read-only instance with all edges set to the same value.float
width()
Returns the total adjustment to width.
-
Field Details
-
ZERO
Read-only instance with zero for all edges.
-
-
Constructor Details
-
Insets
public Insets(float top, float right, float bottom, float left) Creates new insets.
-
-
Method Details
-
uniform
Returns a read-only instance with all edges set to the same value. -
symmetric
Returns a read-only instance with left and right set to one value and top and bottom set to another. -
top
public float top()Gets the top inset. -
right
public float right()Gets the right inset. -
bottom
public float bottom()Gets the bottom inset. -
left
public float left()Gets the left inset. -
width
public float width()Returns the total adjustment to width. -
height
public float height()Returns this total adjustment to height. -
addTo
public pythagoras.f.Dimension addTo(pythagoras.f.Dimension size) Adds these insets to the supplied dimensions. Returnssize
for chaining. -
subtractFrom
public pythagoras.f.Dimension subtractFrom(pythagoras.f.Dimension size) Adds these insets from the supplied dimensions. Returnssize
for chaining. -
mutable
Gets or creates a copy of these insets that can be mutated. Note, if storing an instance, the caller is expected to assign to the return value here in case a new object is allocated. -
adjust
Returns a new instance which is the supplied adjustments added to these insets. -
toString
-