ETLineFragment
ETLineFragment : NSObject <ETFragment>Overview
A line fragment is a collection of fragments to be layouted either horizontally or vertically.
A line fragment is typically used together with ETComputedLayout to cluster items spatially without requiring that these layout items belong to an item group.
Although we name 'items' the elements hold by a line fragment, they can be any objects that comply to the ETFragment protocol when their layout implements the ETLayoutFragmentOwner protocol in a compatible way.
Take note that ETComputedLayout and its EtoileUI subclasses only accept ETLayoutItem objects as arguments to -rectForItem: and -setOrigin:forItem: .
You can write subclasses and override these methods to solve this limitation.
It is not advised to subclass ETLineFragment. In any case, the ivars must be considered private.
Default
-
+ (id) horizontalLineWithOwner: (id
) anOwner itemMargin: (CGFloat)aMargin maxWidth: (CGFloat)aWidth - Description forthcoming.
-
+ (id) verticalLineWithOwner: (id
) anOwner itemMargin: (CGFloat)aMargin maxHeight: (CGFloat)aHeight isFlipped: (BOOL)isFlipped Returns a new autoreleased vertical layout line filled with the given fragments.
- - (NSArray *) fillWithItems: (NSArray *)fragments
Adds the given fragments sequentially to the receiver until its length becomes greater than its max allowed length, then return all the fragments that were accepted and added.
Accepted fragments can be an empty array or equal to the fragments given in input.
- - (void) setOrigin: (NSPoint)location
Sets the origin of the line in a layout.
The origin is at the top left corner of the line when the parent coordinate space is flipped, ortherwise at the bottom left corner.
- - (CGFloat) maxLength
Returns the max lenght of the line.
When the receiver length reaches the max length, it starts to refuse fragments.
The max length is the max width when the line is horizontal, the max height when the line is vertical.
- - (CGFloat) length
Returns the lenght of the line.
The length is the width when the line is horizontal, the height when the line is vertical.
