Bug 335473

Summary: FlowLayout inconsistently handles major and minor spacing
Product: [Tools] GEF Reporter: Alexander Nyßen <nyssen>
Component: GEF-Legacy Draw2dAssignee: gef-inbox <gef-inbox>
Status: NEW --- QA Contact:
Severity: major    
Priority: P3 CC: hudsonr
Version: 3.6.1   
Target Milestone: ---   
Hardware: All   
OS: All   
Whiteboard:
Attachments:
Description Flags
Javadoc Update for getMajorSpacing and setMajorSpacing none

Description Alexander Nyßen CLA 2011-01-26 12:07:57 EST
FlowLayout seems to mix up major and minor spacing. That is, while the javadoc states that the major spacing affects "the spacing in pixels to be used between children in the direction parallel to the layout's orientation", which is in my eyes also the intuitive meaning of the term "major spacing", the value set for the major spacing actually affects the spacing perpendicular to the layout orientation, and vice versa. You may easily reproduce this using the FlowLayoutExample snippet of the Draw2d examples.
Comment 1 Randy Hudson CLA 2011-01-26 13:16:20 EST
All you can do is fix the javadoc.  "minor" means the children inside the rows.  "major" refers to the major pieces, i.e. the rows themselves.  So minor spacing is parallel to the row (when horizontal), but minor alignment is the vertical alignment within that horizontal row.
Comment 2 Alexander Nyßen CLA 2011-01-26 16:32:10 EST
(In reply to comment #1)
> All you can do is fix the javadoc.  "minor" means the children inside the rows.
>  "major" refers to the major pieces, i.e. the rows themselves.  So minor
> spacing is parallel to the row (when horizontal), but minor alignment is the
> vertical alignment within that horizontal row.

I fear you are right. However, this is really ugly, as major and minor alignment seem to be used in the opposite sense (i.e. they are used consistent with the current javadoc of minor and major spacing).
Comment 3 Arieh Bibliowicz CLA 2012-02-20 15:51:51 EST
Created attachment 211287 [details]
Javadoc Update for getMajorSpacing and setMajorSpacing

Expanded the explanation of what is the major spacing in both javadocs.
Comment 4 Alexander Nyßen CLA 2012-02-21 17:36:45 EST
Arieh, could you upload a patch, please? That would make it easier to consume your contribution.