DrawKit
Vector and illustration framework for Mac OS X
|
This category implements object alignment features for DKObjectDrawingLayer. More...
Instance Methods | |
(IBAction) | - alignBottomEdges: |
Aligns the selected objects on their bottom edges. More... | |
(IBAction) | - alignEdgesToGrid: |
(IBAction) | - alignHorizontalCentres: |
Aligns the selected objects on their horizontal centres. More... | |
(IBAction) | - alignLeftEdges: |
Aligns the selected objects on their left edges. More... | |
(IBAction) | - alignLocationToGrid: |
(NSUInteger) | - alignmentMenuItemRequiredObjects: |
Returns the minimum number of objects needed to enable the user interface item. More... | |
(void) | - alignObjectEdges:toGrid: |
Aligns the objects to the grid, resizing and positioning as necessary so that all edges lie on the grid. More... | |
(void) | - alignObjectLocation:toGrid: |
Aligns a set of objects so their locations lie on a grid intersection. More... | |
(void) | - alignObjects:toLocation:withAlignment: |
Aligns a set of objects to a given point. More... | |
(void) | - alignObjects:toMasterObject:withAlignment: |
Aligns a set ofobjects. More... | |
(void) | - alignObjects:withAlignment: |
Aligns a set of objects. More... | |
(IBAction) | - alignRightEdges: |
Aligns the selected objects on their right edges. More... | |
(IBAction) | - alignTopEdges: |
Aligns the selected objects on their top edges. More... | |
(IBAction) | - alignVerticalCentres: |
Aligns the selected objects on their vertical centres. More... | |
(IBAction) | - assignKeyObject: |
(IBAction) | - distributeHorizontalCentres: |
Distributes the selected objects to equalize the horizontal centres. More... | |
(IBAction) | - distributeHorizontalSpace: |
Distributes the selected objects to equalize the horizontal space. More... | |
(BOOL) | - distributeObjects:withAlignment: |
Distributes a set of objects. More... | |
(IBAction) | - distributeVerticalCentres: |
Distributes the selected objects to equalize the vertical centres. More... | |
(IBAction) | - distributeVerticalSpace: |
Distributes the selected objects to equalize the vertical space. More... | |
(DKDrawableObject *) | - keyObject |
Returns the object as the master to be used for alignment operations, etc. More... | |
(NSArray *) | - objectsSortedByHorizontalPosition: |
Sorts a set of objects into order of their horizontal location. More... | |
(NSArray *) | - objectsSortedByVerticalPosition: |
Sorts a set of objects into order of their vertical location. More... | |
(void) | - setKeyObject: |
Nominates an object as the master to be used for alignment operations, etc. More... | |
(CGFloat) | - totalHorizontalSpace: |
Computes the amount of space available for a horizontal distribution operation. More... | |
(CGFloat) | - totalVerticalSpace: |
Computes the amount of space available for a vertical distribution operation. More... | |
This category implements object alignment features for DKObjectDrawingLayer.
- (IBAction) alignBottomEdges: | (id) | sender |
Aligns the selected objects on their bottom edges.
sender | the action's sender |
Extends class DKObjectDrawingLayer.
- (IBAction) alignEdgesToGrid: | (id) | sender |
Extends class DKObjectDrawingLayer.
- (IBAction) alignHorizontalCentres: | (id) | sender |
Aligns the selected objects on their horizontal centres.
sender | the action's sender |
Extends class DKObjectDrawingLayer.
- (IBAction) alignLeftEdges: | (id) | sender |
Aligns the selected objects on their left edges.
sender | the action's sender |
Extends class DKObjectDrawingLayer.
- (IBAction) alignLocationToGrid: | (id) | sender |
Extends class DKObjectDrawingLayer.
- (NSUInteger) alignmentMenuItemRequiredObjects: | (id< NSValidatedUserInterfaceItem >) | item |
Returns the minimum number of objects needed to enable the user interface item.
Call this from a generic validateMenuItem method for the layer as a whole
item | the user interface item to validate |
Extends class DKObjectDrawingLayer.
- (void) alignObjectEdges: | (NSArray *) | objects | |
toGrid: | (DKGridLayer *) | grid | |
Aligns the objects to the grid, resizing and positioning as necessary so that all edges lie on the grid.
The logical bounds is used for alignment, consistent with normal snapping behaviour.
May minimally resize the objects.
objects | the objects to align |
grid | the grid to use |
Extends class DKObjectDrawingLayer.
- (void) alignObjectLocation: | (NSArray *) | objects | |
toGrid: | (DKGridLayer *) | grid | |
Aligns a set of objects so their locations lie on a grid intersection.
Does not resize the objects
objects | the objects to align |
grid | the grid to use |
Extends class DKObjectDrawingLayer.
- (void) alignObjects: | (NSArray *) | objects | |
toLocation: | (NSPoint) | loc | |
withAlignment: | (NSInteger) | align | |
Aligns a set of objects to a given point.
objects | the objects to align |
loc | the point to which the objects are aligned |
align | the alignment operation required |
Extends class DKObjectDrawingLayer.
- (void) alignObjects: | (NSArray *) | objects | |
toMasterObject: | (id) | object | |
withAlignment: | (NSInteger) | align | |
Aligns a set ofobjects.
objects | the objects to align |
object | the "master" object - the one to which the others are aligned |
align | the alignment operation required |
Extends class DKObjectDrawingLayer.
Aligns a set of objects.
Objects are aligned with the layer's nominated key object, by default the first object in the supplied list
objects | the objects to align |
align | the alignment operation required |
Extends class DKObjectDrawingLayer.
- (IBAction) alignRightEdges: | (id) | sender |
Aligns the selected objects on their right edges.
sender | the action's sender |
Extends class DKObjectDrawingLayer.
- (IBAction) alignTopEdges: | (id) | sender |
Aligns the selected objects on their top edges.
sender | the action's sender |
Extends class DKObjectDrawingLayer.
- (IBAction) alignVerticalCentres: | (id) | sender |
Aligns the selected objects on their vertical centres.
sender | the action's sender |
Extends class DKObjectDrawingLayer.
- (IBAction) assignKeyObject: | (id) | sender |
Extends class DKObjectDrawingLayer.
- (IBAction) distributeHorizontalCentres: | (id) | sender |
Distributes the selected objects to equalize the horizontal centres.
sender | the action's sender |
Extends class DKObjectDrawingLayer.
- (IBAction) distributeHorizontalSpace: | (id) | sender |
Distributes the selected objects to equalize the horizontal space.
sender | the action's sender |
Extends class DKObjectDrawingLayer.
Distributes a set of objects.
Normally this is called by the higher level alignObjects: methods when a distribution alignment is detected
objects | the objects to distribute |
align | the distribution required |
Extends class DKObjectDrawingLayer.
- (IBAction) distributeVerticalCentres: | (id) | sender |
Distributes the selected objects to equalize the vertical centres.
sender | the action's sender |
Extends class DKObjectDrawingLayer.
- (IBAction) distributeVerticalSpace: | (id) | sender |
Distributes the selected objects to equalize the vertical space.
sender | the action's sender |
Extends class DKObjectDrawingLayer.
- (DKDrawableObject*) keyObject |
Returns the object as the master to be used for alignment operations, etc.
If no specific object is set (nil), then the first object in the selection is returned. If there's no selection, returns nil.
Extends class DKObjectDrawingLayer.
Sorts a set of objects into order of their horizontal location.
objects | the objects to sort |
Extends class DKObjectDrawingLayer.
Sorts a set of objects into order of their vertical location.
objects | the objects to sort |
Extends class DKObjectDrawingLayer.
- (void) setKeyObject: | (DKDrawableObject *) | keyObject |
Nominates an object as the master to be used for alignment operations, etc.
The object is not retained as it should already be owned. A nil object can be set to mean that the topmost select object should be considered key.
keyObject | an object that is to be considered key for alignment ops |
Extends class DKObjectDrawingLayer.
Computes the amount of space available for a horizontal distribution operation.
The list of objects must be sorted into order of their horizontal location. The space is the total distance between the leftmost and rightmost objects, minus the sum of the widths of the objects in between
objects | the objects to align |
Extends class DKObjectDrawingLayer.
Computes the amount of space available for a vertical distribution operation.
The list of objects must be sorted into order of their vertical location. The space is the total distance between the top and bottom objects, minus the sum of the heights of the objects in between
objects | the objects to align |
Extends class DKObjectDrawingLayer.