- 
    Type:
Enhancement
 - 
    Resolution: Unresolved
 - 
    Priority:
  P4                     
     - 
    None
 - 
    Affects Version/s: 1.4.2
 - 
    Component/s: client-libs
 
- 
        x86
 - 
        windows_2000
 
Name: rmT116609 Date: 06/05/2003
A DESCRIPTION OF THE REQUEST :
I'm finally beginning to graps SpringLayout and learning how to use it effeciently when hand-coding my GUI. A coding pattern emerges in all my panel constructors; besides ading the various components to the panel, I also have to constantly extract a reference to each component's constraints in order to adjust them. I also have to keep these Constraints references around because many components' constraints have to be specified with references to neighbouring components' constraints. It amounts to a lot of additional local variables.
Why not expand class java.awt.Component to carry it's own SpringLayout.Constraints around? The field can be null if the component hasn't been added to a SpringLayout managed panel, but if it is, the add() method or the SpringLayout class can set the component's constraints field.
JUSTIFICATION :
The late addition of SpringLayout has resulted in a situation where the components it is supposed to manage lacks the proper support for living inside a SpringLayout managed panel. This leads to more complex and cluttered code when setting up the components in a SpringLayout managed panel.
Coding would be much easier if the standard component base class java.awt.Component already had a built-in support for keeping tags on it's current constraints.
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
Set the proposed SpringLayout.Constraints field in java.awt.Component if and when it's added to a panel managed by SpringLayout.
(Review ID: 187194)
======================================================================