public class ComponentSize extends Object implements Mergeable, Cloneable, Serializable
Component
size.
This is just an utility class that is used for convenient size configuration in XML.Modifier and Type | Class and Description |
---|---|
static class |
ComponentSize.Type
ComponentSize type. |
Modifier and Type | Field and Description |
---|---|
protected Insets |
insets
Additional
Component insets. |
protected Integer |
minimumHeight
Component minimum height, 0 by default. |
protected Integer |
minimumWidth
Component minimum width, 0 by default. |
protected ComponentSize.Type |
type
Component size calculation ComponentSize.Type . |
Constructor and Description |
---|
ComponentSize() |
Modifier and Type | Method and Description |
---|---|
Insets |
getInsets()
Returns additional
Component insets. |
int |
getMinimumHeight()
Returns component minimum height.
|
int |
getMinimumWidth()
Returns component minimum width.
|
ComponentSize.Type |
getType()
Returns component size calculation
ComponentSize.Type . |
Dimension |
size(Component component)
Returns
Component 's size according to these ComponentSize settings. |
@Nullable @XStreamAsAttribute protected ComponentSize.Type type
Component
size calculation ComponentSize.Type
.@Nullable @XStreamAsAttribute protected Integer minimumWidth
Component
minimum width, 0
by default.
For ComponentSize.Type.none
it will have no effect.
For ComponentSize.Type.minimum
it will be used if greater than component's minimum width.
For ComponentSize.Type.preferred
it will be used if greater than component's preferred width.
For ComponentSize.Type.fixed
it will be used as preferred width.@Nullable @XStreamAsAttribute protected Integer minimumHeight
Component
minimum height, 0
by default.
For ComponentSize.Type.none
it will have no effect.
For ComponentSize.Type.minimum
it will be used if greater than component's minimum width.
For ComponentSize.Type.preferred
it will be used if greater than component's preferred width.
For ComponentSize.Type.fixed
it will be used as preferred width.@NotNull public ComponentSize.Type getType()
ComponentSize.Type
.ComponentSize.Type
public int getMinimumWidth()
public int getMinimumHeight()
@NotNull public Insets getInsets()
Component
insets.Component
insets@NotNull public Dimension size(@NotNull Component component)
Component
's size according to these ComponentSize
settings.component
- Component
Component
's size according to these ComponentSize
settingsCopyright © 2020. All rights reserved.