public interface PercentLayoutPlatformAdapter
Definition of an interface that encapsulates platform (library) specific access to GUI components that are managed by a percent layout manager.
The family of percent layout managers is intended to work together with different GUI libraries. To achieve this the classes cannot directly access the managed components. They rather implement only the layouting algorithms and delegate to a platform specific adapter when it comes to manipulating components.
This interface defines how such an adapter looks like. It contains methods that can roughly be devided into two different groups: One group allows access to the components currently associated with this layout manager and their layout constraints. The other group supports manipulating of components and accessing their properties.
For each specific GUI library to be supported by percent layouts an adapter class has to be created. This single adapter class will then play together with all different percent layout implementations.
Modifier and Type | Method and Description |
---|---|
Object |
getComponent(int index)
Returns the component with the given index.
|
int |
getComponentCount()
Returns the number of components that belong to this layout manager.
|
Object |
getConstraints(int index)
Returns the constraints object for the component with the given index.
|
int |
getMinimumComponentSize(Object component,
boolean vert)
Returns the minimum component size of the specified component for the
given axis.
|
int |
getPreferredComponentSize(Object component,
boolean vert)
Returns the preferred component size of the specified component for the
given axis.
|
UnitSizeHandler |
getSizeHandler()
Returns the platform specific
implementation. |
void |
setComponentBounds(Object component,
Rectangle bounds)
Sets the bounds of a component.
|
int getComponentCount()
Object getComponent(int index)
index
- the index of a component (0-based)Object getConstraints(int index)
index
- the index of a component (0-based)UnitSizeHandler getSizeHandler()
UnitSizeHandler
implementation.SizeHandler
for this platformint getMinimumComponentSize(Object component, boolean vert)
component
- the componentvert
- the direction flag (true
for the y axis,
false for the x axis)int getPreferredComponentSize(Object component, boolean vert)
component
- the componentvert
- the direction flag (true
for the y axis,
false for the x axis)Copyright © 2016 The JGUIraffe Team. All rights reserved.