java.lang.Object
org.proto4j.swing.core.desc.GenericDesc<Layout>
org.proto4j.swing.core.desc.LayoutDesc
org.proto4j.swing.core.desc.layout.SpringLayoutDesc
public class SpringLayoutDesc extends LayoutDesc
The basic descriptor for the
SpringLayout
.- See Also:
LayoutDesc
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
SpringLayoutDesc.SpringLayoutConstraints
-
Field Summary
-
Constructor Summary
Constructors Constructor Description SpringLayoutDesc(ComponentDesc parent)
Creates a newLayoutDesc
. -
Method Summary
Modifier and Type Method Description java.lang.Object
createConstraints(ComponentDesc child)
Creates layout constraints if possible by using extra configuration variables by the parentComponentDesc
.java.awt.LayoutManager
createManager()
Based on the configuration given by the annotations on each field, this descriptor tries to create the correspondingLayoutManager
.boolean
isAbsolute()
Indicates that the implementedLayoutDesc
will represent the absolute layout.Methods inherited from class org.proto4j.swing.core.desc.LayoutDesc
applyTo, bind, getParent, setConstraint
Methods inherited from class org.proto4j.swing.core.desc.GenericDesc
annotationType, get, getDefinedOptions, getOption, hasOption, keys, put, read, read
-
Constructor Details
-
SpringLayoutDesc
Creates a newLayoutDesc
. This constructor is protected so only inheritors can call it.- Parameters:
parent
- the parent component
-
-
Method Details
-
createManager
public java.awt.LayoutManager createManager()Description copied from class:LayoutDesc
Based on the configuration given by the annotations on each field, this descriptor tries to create the correspondingLayoutManager
.Implementations of this method should return
null
of failure instead of throwing an exception.- Specified by:
createManager
in classLayoutDesc
- Returns:
- the qualified LayoutManager
-
isAbsolute
public boolean isAbsolute()Description copied from class:LayoutDesc
Indicates that the implementedLayoutDesc
will represent the absolute layout.- Specified by:
isAbsolute
in classLayoutDesc
- Returns:
true
if the absolute layout should be used; false otherwise
-
createConstraints
Description copied from class:LayoutDesc
Creates layout constraints if possible by using extra configuration variables by the parentComponentDesc
.This method may return
null
if no constraints are defined or can be used. Another way is to throw an exception in order to show the user a misconfiguration.- Specified by:
createConstraints
in classLayoutDesc
- Returns:
- the layout constraints for the given child component
-