This web site requires JavaScript for proper operation. JavaScript is disabled on your browser.
packages...
org.violetlib.jnr
org.violetlib.jnr.aqua
classes...
Java Native Rendering
Class org.violetlib.jnr .FloatingInsetter1
Deprecated: Show Hide
classes...
enum constants...
fields...
static methods...
constructors...
methods...
properties...
Modifier and Type
Static Method and Description
createCentered
Create a single dimension insets for a fixed size region that is centered between two minimum insets.
@NotNull
public static
FloatingInsetter1 createCentered (float regionSize,
float d1,
float d2)
Create a single dimension insets for a fixed size region that is centered between two minimum insets. Any extra
space is divided equally and added to the two insets.
Parameters: regionSize
- The fixed region size.d1
- The minimum offset of the region from the left or bottom edge of the component.d2
- The minimum offset of the region from the right or bottom edge of the component.
Throws:
IllegalArgumentException
- if regionSize
, d1
, or d2
is negative.
createLeftTopAligned
Create a single dimension insets for a fixed size region that is positioned at a fixed offset from the left or top
edge of the component.
@NotNull
public static
FloatingInsetter1 createLeftTopAligned (float regionSize,
float d1)
Create a single dimension insets for a fixed size region that is positioned at a fixed offset from the left or top
edge of the component.
Parameters: regionSize
- The fixed region size.d1
- The offset of the region from the left or top edge of the component.
Throws:
IllegalArgumentException
- if regionSize
or d1
is negative.
createRightBottomAligned
Create a single dimension insets for a fixed size region that is positioned at a fixed offset from the right or
bottom edge of the component.
@NotNull
public static
FloatingInsetter1 createRightBottomAligned (float regionSize,
float d2)
Create a single dimension insets for a fixed size region that is positioned at a fixed offset from the right or
bottom edge of the component.
Parameters: regionSize
- The fixed region size.d2
- The offset of the region from the right or bottom edge of the component.
Throws:
IllegalArgumentException
- if regionSize
or d2
is negative.
Modifier and Type
Method and Description
getComponentSize
float
getComponentSize (float regionSize)
Map the region size to the size of the component.
Map the region size to the size of the component. This operation is valid only if the insetter is invertible.
Specified by:
getComponentSize
in interface Insetter1
Parameters: regionSize
- The region size along the relevant axis.
Returns: the component size along the axis.
Throws:
InsetterNotInvertibleException
- if this insetter is not invertible.
getFixedInset1
float
getFixedInset1 ()
Return the left or top inset, if it is fixed.
public float getFixedInset1 ()
Return the left or top inset, if it is fixed.
Specified by:
getFixedInset1
in interface Insetter1
Returns: the inset, or -1 if not fixed.
getFixedInset2
float
getFixedInset2 ()
Return the right or bottom inset, if it is fixed.
public float getFixedInset2 ()
Return the right or bottom inset, if it is fixed.
Specified by:
getFixedInset2
in interface Insetter1
Returns: the inset, or -1 if not fixed.
getRegionOrigin
float
getRegionOrigin (float componentSize)
Map the component size to the origin of the region, relative to the left or top edge of the component.
public float getRegionOrigin (float componentSize)
Map the component size to the origin of the region, relative to the left or top edge of the component.
Specified by:
getRegionOrigin
in interface Insetter1
Parameters: componentSize
- The component size along the relevant axis.
Returns: The origin of the region along the axis relative to the component.
getRegionSize
float
getRegionSize (float componentSize)
Map the component size to the size of the region.
public float getRegionSize (float componentSize)
Map the component size to the size of the region.
Specified by:
getRegionSize
in interface Insetter1
Parameters: componentSize
- The component size along the relevant axis.
Returns: the region size along the relevant axis.
isInvertible
boolean
isInvertible ()
Indicate whether this insetter is invertible.
public boolean isInvertible ()
Indicate whether this insetter is invertible. An invertible insetter can map a region size to the component size.
Specified by:
isInvertible
in interface Insetter1
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait