public interface Dimension
Modifier and Type | Method and Description |
---|---|
void |
computeOptimalSize(Widget widget,
int availableWidth,
int availableHeight,
Size optimalSize)
Computes the optimal size of a widget.
|
void |
getAvailableSize(Widget widget,
int availableWidth,
int availableHeight,
Size availableSize)
Gets the available size for a widget.
|
void |
layOut(Widget widget,
Rectangle bounds)
Lays out a widget.
|
void computeOptimalSize(Widget widget, int availableWidth, int availableHeight, Size optimalSize)
The given optimal size is the optimal size of the widget considering the available size.
The given size is updated by this method to set the optimal size for this dimension.
widget
- the widget.availableWidth
- the available width.availableHeight
- the available height.optimalSize
- the optimal size.void getAvailableSize(Widget widget, int availableWidth, int availableHeight, Size availableSize)
The given available size is the available width and height minus the outlines.
The given size is updated by this method to set the available size for this dimension.
widget
- the widget.availableWidth
- the available width.availableHeight
- the available height.availableSize
- the available size.void layOut(Widget widget, Rectangle bounds)
The style of the widget must be set before (not null
).
This dimension is applied to compute the widget bounds and align the widget in the given bounds. The given rectangle is updated with the updated bounds.
widget
- the widget.bounds
- the bounds of the widget.