DrawKit
Vector and illustration framework for Mac OS X
|
This layer adds the concept of selection to drawable objects as defined by DKObjectOwnerLayer. More...
Instance Methods | |
(void) | - addObjectsToSelectionFromArray: |
Add a set of objects to the selection. More... | |
(void) | - addObjectToSelection: |
Add a single object to the selection. More... | |
(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... | |
(BOOL) | - allowsObjectsToBeTargetedByDrags |
Returns whether a drag into this layer will target individual objects or not. More... | |
(IBAction) | - applyStyle: |
Applies a style to the objects in the selection. More... | |
(IBAction) | - assignKeyObject: |
(NSArray *) | - autoPolarDuplicate:centre: |
Automatically polar duplicates object to fit a circle exactly. More... | |
(void) | - beginDragOfSelectedObjectsWithEvent:inView: |
Initiates a drag of the selection to another document or app, or back to self. More... | |
(IBAction) | - clusterObjects: |
(void) | - commitSelectionUndoWithActionName: |
Sends the recorded selection state to the undo manager and tags it with the given action name. More... | |
(NSArray *) | - concentricDuplicate:centre:numberOfCopies:insetBy: |
Duplicates one or more objects concentrically around a common centre. More... | |
(IBAction) | - copy: |
Perform a copy. More... | |
(void) | - copySelectionToPasteboard: |
Copies the selection to the given pasteboard in a variety of formats. More... | |
(NSUInteger) | - countOfSelectedAvailableObjects |
Returns the number of objects that are visible and not locked. More... | |
(NSUInteger) | - countOfSelection |
Return the number of items in the selection. More... | |
(IBAction) | - cut: |
Perform a cut. More... | |
(IBAction) | - delete: |
Performs a delete operation. More... | |
(IBAction) | - deleteBackward: |
Calls delete: when backspace key is typed. More... | |
(void) | - deselectAll |
Deselect any selected objects. More... | |
(void) | - didAddGroup: |
Layer did create the group and added it to the layer. More... | |
(void) | - didUngroupObjects: |
A group object was ungrouped and its contents added back into the layer. More... | |
(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... | |
(NSRect) | - dragExclusionRect |
Gets the rect outside of which a mouse drag will drag the selection with the drag manager. More... | |
(void) | - drawingSizeChanged: |
(void) | - drawSelectedObjects |
Draws only the selected objects, but with the selection highlight itself not shown. More... | |
(void) | - drawSelectedObjectsWithSelectionState: |
Draws only the selected objects, with the selection highlight given. More... | |
(BOOL) | - drawsSelectionHighlightsOnTop |
Draw selection highlights on top or in situ? More... | |
(IBAction) | - duplicate: |
Duplicates the selection. More... | |
(NSArray *) | - duplicatedSelection |
Returns an array consisting of a copy of the selected objects. More... | |
(BOOL) | - exchangeSelectionWithObjectsFromArray: |
Sets the selection to a given set of objects. More... | |
(IBAction) | - ghostObjects: |
Set the selected objects ghosted. More... | |
(IBAction) | - groupObjects: |
Turns the selected objects into a group. More... | |
(IBAction) | - hideObject: |
Hides all selected objects, then deselects all. More... | |
(NSImage *) | - imageOfSelectedObjects |
Creates an image of the selected objects. More... | |
(BOOL) | - isSelectedObject: |
Query whether a given object is selected or not. More... | |
(BOOL) | - isSelectionNotEmpty |
Query whether any objects are selected. More... | |
(BOOL) | - isSingleObjectSelected |
Query whether there is exactly one object selected. More... | |
(IBAction) | - joinPaths: |
Connects any paths sharing an end point into a single path. More... | |
(DKDrawableObject *) | - keyObject |
Returns the object as the master to be used for alignment operations, etc. More... | |
(NSArray *) | - linearDuplicate:offset:numberOfCopies: |
Duplicates one or more objects linearly. More... | |
(IBAction) | - lockObject: |
Locks all selected objects. More... | |
(void) | - makeSelectedAvailableObjectsPerform: |
Makes the selected available object perform a given selector. More... | |
(void) | - makeSelectedAvailableObjectsPerform:withObject: |
Makes the selected available object perform a given selector with a single object parameter. More... | |
(IBAction) | - moveDown: |
Nudges the selected objects down by one unit. More... | |
(IBAction) | - moveLeft: |
Nudges the selected objects left by one unit. More... | |
(IBAction) | - moveRight: |
Nudges the selected objects right by one unit. More... | |
(BOOL) | - moveSelectedObjectsByX:byY: |
Changes the location of all objects in the selection by dx and dy. More... | |
(IBAction) | - moveUp: |
Nudges the selected objects up by one unit. More... | |
(BOOL) | - multipleSelectionAutoForwarding |
(BOOL) | - multipleSelectionValidatedMenuItem: |
Handle validation of menu items in a multiple selection when autoforwarding is enabled. More... | |
(IBAction) | - objectBringForward: |
Brings the selected object forward. More... | |
(IBAction) | - objectBringToFront: |
Brings the selected object to the front. More... | |
(DKDrawableObject *) | - objectInSelectedAvailableObjectsAtIndex: |
Returns the indexed object. More... | |
(IBAction) | - objectSendBackward: |
Sends the selected object backward. More... | |
(IBAction) | - objectSendToBack: |
Sends the selected object to the back. 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... | |
(IBAction) | - paste: |
Perform a paste. More... | |
(NSData *) | - pdfDataOfSelectedObjects |
Creates a PDF representation of the selected objects. More... | |
(NSArray *) | - polarDuplicate:centre:numberOfCopies:incrementAngle:rotateCopies: |
Duplicates one or more objects radially around a common centre. More... | |
(void) | - recordSelectionForUndo |
Make a copy of the selection for a possible undo recording. More... | |
(void) | - refreshSelectedObjects |
Causes all selected objects to redraw themselves. More... | |
(void) | - removeObjectFromSelection: |
Remove a single object from the selection. More... | |
(void) | - removeObjectsFromSelectionInArray: |
Remove a series of object from the selection. More... | |
(BOOL) | - replaceSelectionWithObject: |
Select the given object, deselecting all previously selected objects. More... | |
(BOOL) | - replaceStyle:withStyle:selectingObjects: |
(IBAction) | - revealHiddenObjects: |
Reveals any hidden objects, setting the selection to them. More... | |
(void) | - scrollToSelectionInView: |
Scrolls one or all views attached to the drawing so that the selection within this layer is visible. More... | |
(void) | - selectAll |
Select all available objects. More... | |
(IBAction) | - selectAll: |
Selects all objects. More... | |
(NSArray *) | - selectedAvailableObjects |
Returns the objects that are not locked, visible and selected. More... | |
(NSArray *) | - selectedAvailableObjectsOfClass: |
Returns the objects that are not locked, visible and selected and which have the given class. More... | |
(NSArray *) | - selectedObjectsPreservingStackingOrder |
Returns the selected objects in their original stacking order. More... | |
(NSSet *) | - selectedObjectsRespondingToSelector: |
Returns objects that respond to the selector <selector> More... | |
(NSSet *) | - selectedObjectsReturning:toSelector: |
(NSArray *) | - selectedVisibleObjects |
Returns the objects that are visible and selected. More... | |
(NSSet *) | - selection |
(NSRect) | - selectionBounds |
Return the overall area bounded by the objects in the selection. More... | |
(BOOL) | - selectionChangesAreUndoable |
Are selection changes undoable? More... | |
(BOOL) | - selectionContainsObjectOfClass: |
Query whether the selection contains any objects matching the given class. More... | |
(BOOL) | - selectionHasChangedFromRecorded |
Test whether the selection is now different from the recorded selection. More... | |
(NSRect) | - selectionLogicalBounds |
(BOOL) | - selectionVisible |
Whether the selection is actually shown or not. More... | |
(IBAction) | - selectMatchingStyle: |
Selects all objects having the same style as the single selected object. More... | |
(IBAction) | - selectNone: |
Deselects all objects in the selection. More... | |
(BOOL) | - selectObjectsWithStyle: |
Sets the selection to the set of objects that have the given style. More... | |
(IBAction) | - selectOthers: |
Selects the objects not selected, deselects those that are ("inverts" selection) More... | |
(void) | - setAllowsObjectsToBeTargetedByDrags: |
Sets whether a drag into this layer will target individual objects or not. More... | |
(void) | - setDragExclusionRect: |
Sets the rect outside of which a mouse drag will drag the selection with the drag manager. More... | |
(void) | - setDrawsSelectionHighlightsOnTop: |
Sets whether selection highlights should be drawn on top of all other objects, or if they should be drawn with the object at its current stacking position. More... | |
(BOOL) | - setHiddenObjectsVisible |
Reveals any hidden objects, setting the selection to those revealed. More... | |
(void) | - setKeyObject: |
Nominates an object as the master to be used for alignment operations, etc. More... | |
(void) | - setMultipleSelectionAutoForwarding: |
Default is NO for backward compatibility. More... | |
(void) | - setSelectedObjectsLocked: |
Locks or unlocks all the selected objects. More... | |
(void) | - setSelectedObjectsVisible: |
Hides or shows all of the objects in the selection. More... | |
(void) | - setSelection: |
Sets the selection to a given set of objects. More... | |
(void) | - setSelectionChangesAreUndoable: |
Set whether selection changes should be recorded for undo. More... | |
(void) | - setSelectionVisible: |
Sets whether the selection is actually shown or not. More... | |
(BOOL) | - shouldGroupObjects:intoGroup: |
Layer is about to group a number of objects. More... | |
(BOOL) | - shouldUngroup: |
A group object is about to be ungrouped. More... | |
(IBAction) | - showObject: |
Shows all selected objects. More... | |
(DKDrawableObject *) | - singleSelection |
If the selection consists of a single available object, return it. 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... | |
(IBAction) | - unghostObjects: |
Set the selected objects unghosted. More... | |
(IBAction) | - unlockObject: |
Unlocks all selected objects. More... | |
Instance Methods inherited from DKObjectOwnerLayer | |
(void) | - addObject: |
Adds an object to the layer. More... | |
(void) | - addObject:atIndex: |
(void) | - addObjectPendingCreation: |
Adds a new object to the layer pending successful interactive creation. More... | |
(void) | - addObjects:fromPasteboard:atDropLocation: |
Add objects to the layer from the pasteboard. More... | |
(void) | - addObjectsFromArray: |
Adds a set of objects to the layer. More... | |
(BOOL) | - addObjectsFromArray:bounds:relativeToPoint:pinToInterior: |
Adds a set of objects to the layer offsetting their location by the given delta values relative to a given point. More... | |
(BOOL) | - addObjectsFromArray:relativeToPoint:pinToInterior: |
Adds a set of objects to the layer offsetting their location by the given delta values relative to a given point. More... | |
(BOOL) | - allowsEditing |
Does the layer permit editing of its objects? More... | |
(BOOL) | - allowsSnapToObjects |
Does the layer permit snapping to its objects? More... | |
(void) | - applyTransformToObjects: |
Modifies the objects by applying the given transform to each of them. More... | |
(NSArray *) | - availableObjects |
Returns objects that are available to the user, that is, not locked or invisible. More... | |
(NSArray *) | - availableObjectsInRect: |
Returns objects that are available to the user, that is, not locked or invisible and that intersect the rect. More... | |
(NSArray *) | - availableObjectsOfClass: |
Returns objects that are available to the user of the given class. More... | |
(DKDrawableObject *) | - bottomObject |
Returns the bottom object. More... | |
(void) | - commitPendingObjectWithUndoActionName: |
Commits the pending object to the layer and sets up the undo task action name. More... | |
(NSUInteger) | - countOfObjects |
(void) | - drawable:needsDisplayInRect: |
(void) | - drawable:wasDoubleClickedAtPoint: |
An object owned by the layer was double-clicked. More... | |
(void) | - drawHighlightingForDrag |
Draws the highlighting to indicate the layer is a drag target. More... | |
(void) | - drawPendingObjectInView: |
Draws the pending object, if any, in the layer - called by drawRect:inView: More... | |
(void) | - drawVisibleObjects |
(DKDrawableObject *) | - hitTest: |
Find which object was hit by the given point, if any. More... | |
(DKDrawableObject *) | - hitTest:partCode: |
Performs a hit test but also returns the hit part code. More... | |
(NSImage *) | - imageOfObjects |
(NSIndexSet *) | - indexesOfObjectsInArray: |
Given a list of objects that are part of this layer, return an index set for them. More... | |
(NSUInteger) | - indexOfObject: |
Returns the stacking position of the given object. More... | |
(void) | - insertObject:inObjectsAtIndex: |
Adds an object to the layer. More... | |
(void) | - insertObjects:atIndexes: |
Inserts a set of objects at the indexes given. More... | |
(BOOL) | - isHighlightedForDrag |
Query whether the layer is currently highlighted for a drag (receive) operation. More... | |
(BOOL) | - isRecordingPasteOffset |
Return whether the paste offset will be recorded for the current drag operation. More... | |
(DKObjectOwnerLayer *) | - layer |
Returns the layer of a drawable's container - since this is that layer, returns self. More... | |
(DKLayerCacheOption) | - layerCacheOption |
Query whether the layer caches its content in an offscreen layer when not active. More... | |
(void) | - moveDownObject: |
Moves the object down in the stacking order. More... | |
(void) | - moveObject:toIndex: |
Movesthe object to the given stacking position index. More... | |
(void) | - moveObjectsAtIndexes:toIndex: |
Moves the objects indexed by the set to the given stacking position index. More... | |
(void) | - moveObjectsInArray:toIndex: |
Moves the objects in the array to the given stacking position index. More... | |
(void) | - moveObjectToBottom: |
Moves the object to the bottom of the stacking order. More... | |
(void) | - moveObjectToTop: |
Moves the object to the top of the stacking order. More... | |
(void) | - moveUpObject: |
Moves the object up in the stacking order. More... | |
(NSEnumerator *) | - objectEnumeratorForUpdateRect:inView: |
Return an iterator that will enumerate the objects needing update. More... | |
(NSEnumerator *) | - objectEnumeratorForUpdateRect:inView:options: |
Return an iterator that will enumerate the objects needing update. More... | |
(DKDrawableObject *) | - objectInObjectsAtIndex: |
Returns the object at a given stacking position index. More... | |
(NSArray *) | - objects |
Returns all owned objects. More... | |
(void) | - objects:wereDraggedFromPoint:toPoint: |
Sets the paste offset (distance between successively pasted objects) More... | |
(NSArray *) | - objectsAtIndexes: |
Returns a list of objects given by the index set. More... | |
(NSArray *) | - objectsForUpdateRect:inView: |
Return the objects needing update. More... | |
(NSArray *) | - objectsForUpdateRect:inView:options: |
Return the objects needing update. More... | |
(NSArray *) | - objectsInRect: |
Finds all objects touched by the given rect. More... | |
(NSArray *) | - objectsReturning:toSelector: |
Returns objects that respond to the selector with the value <answer> <selector> a selector taking no parameters. More... | |
(NSArray *) | - objectsWithStyle: |
Returns objects that share the given style. More... | |
(NSInteger) | - pasteCount |
(NSSize) | - pasteOffset |
Returns the paste offset (distance between successively pasted objects) More... | |
(NSPoint) | - pasteOrigin |
Return the current point where pasted object will be positioned relative to. More... | |
(NSData *) | - pdfDataOfObjects |
(DKDrawableObject *) | - pendingObject |
Returns the pending object, if any, in the layer. More... | |
(void) | - refreshAllObjects |
Causes all visible objects to redraw themselves. More... | |
(void) | - refreshObjectsInContainer: |
Causes all objects in the passed array, set or other container to redraw themselves. More... | |
(void) | - removeAllObjects |
Removes all objects from the layer. More... | |
(void) | - removeObject: |
Removes the object from the layer. More... | |
(void) | - removeObjectAtIndex: |
Removes the object at the given stacking position index. More... | |
(void) | - removeObjectFromObjectsAtIndex: |
Removes an object from the layer. More... | |
(void) | - removeObjectsAtIndexes: |
Removes objects from the indexes listed by the set. More... | |
(void) | - removeObjectsInArray: |
Removes a set of objects from the layer. More... | |
(void) | - removePendingObject |
Removes a pending object in the situation that the creation was unsuccessful. More... | |
(NSAffineTransform *) | - renderingTransform |
Returns the layer's transform used when rendering objects within. More... | |
(void) | - replaceObjectInObjectsAtIndex:withObject: |
Replaces an object in the layer with another. More... | |
(void) | - setAllowsEditing: |
Sets whether the layer permits editing of its objects. More... | |
(void) | - setAllowsSnapToObjects: |
Sets whether the layer permits snapping to its objects. More... | |
(void) | - setHighlightedForDrag: |
Set whether the layer is currently highlighted for a drag (receive) operation. More... | |
(void) | - setLayerCacheOption: |
Set whether the layer caches its content in an offscreen layer when not active, and how. More... | |
(void) | - setObjects: |
Sets the objects that this layer owns. More... | |
(void) | - setPasteOffset: |
Sets the paste offset (distance between successively pasted objects) More... | |
(void) | - setPasteOffsetX:y: |
Establish the paste offset - a value used to position items when pasting and duplicating. More... | |
(void) | - setPasteOrigin: |
Sets the current point where pasted object will be positioned relative to. More... | |
(void) | - setRecordingPasteOffset: |
Set whether the paste offset will be recorded for the current drag operation. More... | |
(void) | - setStorage: |
(NSPoint) | - snappedMousePoint:forObject:withControlFlag: |
Snap a (mouse) point to grid, guide or other object according to settings. More... | |
(NSPoint) | - snapPoint:toAnyObjectExcept:snapTolerance: |
Snap a point to any existing object control point within tolerance. More... | |
(id< DKObjectStorage >) | - storage |
Returns the storage object for the layer. More... | |
(IBAction) | - toggleShowStorageDebuggingPath: |
Toggles whether the debugging path is overlaid afterdrawing the content. More... | |
(IBAction) | - toggleSnapToObjects: |
Sets the snapping state for the layer. More... | |
(DKDrawableObject *) | - topObject |
Returns the topmost object. More... | |
(NSRect) | - unionOfAllObjectBounds |
Return the union of all the visible objects in the layer. More... | |
(BOOL) | - updatePasteCountWithPasteboard: |
Detect whether the paste from the pasteboard is a new paste, or a repeat paste. More... | |
(NSArray *) | - visibleObjects |
Returns objects that are visible to the user, but may be locked. More... | |
(NSArray *) | - visibleObjectsInRect: |
Returns objects that are visible to the user, intersect the rect, but may be locked. More... | |
Instance Methods inherited from DKLayer | |
(NSRect) | - activeCursorRect |
Return a rect where the layer's cursor is shown when the mouse is within it. More... | |
(void) | - addMetadata: |
(void) | - addUserInfo: |
(NSSet *) | - allRegisteredStyles |
Return all of registered styles used by the layer. More... | |
(NSSet *) | - allStyles |
Return all of styles used by the layer. More... | |
(CGFloat) | - alpha |
Returns the alpha level for the layer as a whole. More... | |
(void) | - beginDrawing |
Called before the layer starts drawing its content. More... | |
(NSBitmapImageRep *) | - bitmapRepresentationWithDPI: |
Returns the layer's content as a transparent bitmap having the given DPI. More... | |
(BOOL) | - clipsDrawingToInterior |
Whether the drawing will be clipped to the interior or not. More... | |
(NSColor *) | - colourForKey: |
(NSView *) | - currentView |
Returns the view which is either currently drawing the layer, or the one that mouse events are coming from. More... | |
(NSCursor *) | - cursor |
Returns the cursor to display while the mouse is over this layer while it's active. More... | |
(DKDrawing *) | - drawing |
Returns the drawing that the layer belongs to. More... | |
(void) | - drawingDidChangeMargins: |
(void) | - drawingDidChangeToSize: |
Called when the drawing's size is changed - this gives layers that need to know about this a direct notification. More... | |
(void) | - drawingHasNewUndoManager: |
Called when the drawing's undo manager is changed - this gives objects that cache the UM a chance to update their references. More... | |
(void) | - drawRect:inView: |
Main entry point for drawing the layer and its contents to the drawing's views. More... | |
(void) | - endDrawing |
Called after the layer has finished drawing its content. More... | |
(void) | - flagsChanged: |
Respond to a change in the modifier key state. More... | |
(CGFloat) | - floatValueForKey: |
(BOOL) | - hasMetadataForKey: |
(void) | - hideInfoWindow |
Hides the info window if it's visible. More... | |
(IBAction) | - hideLayer: |
User interface level method can be linked to a menu or other appropriate UI widget. More... | |
(void) | - hideRulerMarkers |
(BOOL) | - hitLayer: |
Detect whether the layer was "hit" by a point. More... | |
(NSUInteger) | - indexInGroup |
Gets the layer's index within the group that the layer is contained in. More... | |
(NSInteger) | - intValueForKey: |
(BOOL) | - isActive |
Is the layer the active layer? More... | |
(BOOL) | - isChildOfGroup: |
Determine whether a given group is the parent of this layer, or anywhere above it in the hierarchy. More... | |
(BOOL) | - isOpaque |
Is the layer opaque or transparent? More... | |
(DKKnob *) | - knobs |
(BOOL) | - knobsShouldAdjustToViewScale |
(void) | - layerDidBecomeActiveLayer |
The layer was made the active layer by the owning drawing. More... | |
(void) | - layerDidResignActiveLayer |
The layer is no longer the active layer. More... | |
(DKLayerGroup *) | - layerGroup |
Gets the group that the layer is contained in. More... | |
(BOOL) | - layerMayBecomeActive |
Returns whether the layer can become the active layer. More... | |
(BOOL) | - layerMayBeDeleted |
Return whether the layer can be deleted. More... | |
(NSString *) | - layerName |
Returns the layer's name. More... | |
(NSUInteger) | - level |
Returns the hierarchical level of this layer, i.e. More... | |
(BOOL) | - locked |
Returns whether the layer is locked or not. More... | |
(BOOL) | - lockedOrHidden |
Returns whether the layer is locked or hidden. More... | |
(IBAction) | - lockLayer: |
User interface level method can be linked to a menu or other appropriate UI widget. More... | |
(IBAction) | - logDescription: |
Debugging method. More... | |
(NSMenu *) | - menuForEvent:inView: |
Allows a contextual menu to be built for the layer or its contents. More... | |
(NSMutableDictionary *) | - metadata |
(NSUInteger) | - metadataChecksum |
(void) | - metadataDidChangeKey: |
(DKMetadataItem *) | - metadataItemForKey: |
(NSArray *) | - metadataKeys |
(id) | - metadataObjectForKey: |
(void) | - metadataWillChangeKey: |
(void) | - mouseDown:inView: |
The mouse went down in this layer. More... | |
(void) | - mouseDragged:inView: |
Subclasses must override to be notified of mouse dragged events. More... | |
(void) | - mouseMoved:inView: |
(void) | - mouseUp:inView: |
Override to respond to the event. More... | |
(BOOL) | - pasteboard:hasAvailableTypeForOperation: |
Tests whether the pasteboard has any of the types the layer is interested in receiving for the given operation. More... | |
(NSArray *) | - pasteboardTypesForOperation: |
Return the pasteboard types this layer is able to receive in a given operation (drop or paste) More... | |
(NSData *) | |
Returns the content of the layer as a pdf. More... | |
(void) | - removeMetadataForKey: |
(void) | - replaceMatchingStylesFromSet: |
Substitute styles with those in the given set. More... | |
(BOOL) | - rulerMarkerUpdatesEnabled |
(DKLayerMetadataSchema) | - schema |
(NSColor *) | - selectionColour |
Returns the currently preferred selection colour for this layer. More... | |
(void) | - setAlpha: |
Sets the alpha level for the layer. More... | |
(void) | - setClipsDrawingToInterior: |
Sets whether drawing is limited to the interior area or not. More... | |
(void) | - setColour:forKey: |
(void) | - setFloatValue:forKey: |
(void) | - setInfoWindowBackgroundColour: |
Sets the background colour of the small floating info window. More... | |
(void) | - setIntValue:forKey: |
(void) | - setKnobs: |
(void) | - setKnobsShouldAdustToViewScale: |
(void) | - setLayerGroup: |
Sets the group that the layer is contained in - called automatically when the layer is added to a group. More... | |
(void) | - setLayerName: |
Sets the user-readable name of the layer. More... | |
(void) | - setLocked: |
Sets whether the layer is locked or not. More... | |
(void) | - setMetadata: |
(void) | - setMetadataItem:forKey: |
(void) | - setMetadataItemType:forKey: |
(void) | - setMetadataItemValue:forKey: |
(void) | - setMetadataObject:forKey: |
(void) | - setNeedsDisplay: |
Flags the whole layer as needing redrawing. More... | |
(void) | - setNeedsDisplayInRect: |
Flags part of a layer as needing redrawing. More... | |
(void) | - setNeedsDisplayInRects: |
Marks several areas for update at once. More... | |
(void) | - setNeedsDisplayInRects:withExtraPadding: |
Marks several areas for update at once. More... | |
(void) | - setRulerMarkerUpdatesEnabled: |
(void) | - setSelectionColour: |
Sets the colour preference to use for selected objects within this layer. More... | |
(void) | - setShouldDrawToPrinter: |
Set whether this layer should be included in printed output. More... | |
(void) | - setSize:forKey: |
(void) | - setString:forKey: |
(void) | - setupMetadata |
(void) | - setUserInfo: |
(void) | - setUserInfoObject:forKey: |
(void) | - setVisible: |
Sets whether the layer is visible or not. More... | |
(BOOL) | - shouldAutoActivateWithEvent: |
Should the layer automatically activate on a click if the view has this behaviour set? More... | |
(BOOL) | - shouldDrawToPrinter |
Return whether the layer should be part of the printed output or not. More... | |
(void) | - showInfoWindowWithString:atPoint: |
Displays a small floating info window near the point p containg the string. More... | |
(IBAction) | - showLayer: |
User interface level method can be linked to a menu or other appropriate UI widget. More... | |
(NSSize) | - sizeForKey: |
(NSString *) | - stringForKey: |
(BOOL) | - supportsMetadata |
(NSImage *) | - thumbnail |
(NSImage *) | - thumbnailImageWithSize: |
Returns an image of the layer a the given size. More... | |
(IBAction) | - toggleLayerLock: |
User interface level method can be linked to a menu or other appropriate UI widget. More... | |
(IBAction) | - toggleLayerVisible: |
User interface level method can be linked to a menu or other appropriate UI widget. More... | |
(NSUndoManager *) | - undoManager |
Obtains the undo manager that is handling undo for the drawing and hence, this layer. More... | |
(NSString *) | - uniqueKey |
Returns the layer's unique key. More... | |
(IBAction) | - unlockLayer: |
User interface level method can be linked to a menu or other appropriate UI widget. More... | |
(void) | - updateMetadataKeys |
(void) | - updateRulerMarkersForRect: |
(NSMutableDictionary *) | - userInfo |
Return the attached user info. More... | |
(id) | - userInfoObjectForKey: |
Return an item of user info. More... | |
(BOOL) | - visible |
Is the layer visible? More... | |
(void) | - wasAddedToDrawing: |
Notifies the layer that it or a group containing it was added to a drawing. More... | |
(BOOL) | - writePDFDataToPasteboard: |
Writes the content of the layer as a pdf to a nominated pasteboard. More... | |
Instance Methods inherited from NSObject | |
(NSString *) | - address |
(DKStyleRegistry *) | - applicationWillReturnStyleRegistry |
(BOOL) | - canBeUsedWithSelectionTool |
(id) | - categoryManager:shouldReplaceObject:withObject: |
(Class) | - classForCoder |
(NSColor *) | - colorValue |
(NSColor *) | - colourValue |
(id) | - copy |
(void) | - dealloc |
(id) | - deepCopy |
(NSDictionary *) | - dimensionValuesForArrowStroke: |
(CGFloat) | - drawing:convertDistanceToExternalCoordinates: |
(NSPoint) | - drawing:convertLocationToExternalCoordinates: |
(void) | - drawing:didDrawRect:inView: |
(void) | - drawing:willDrawRect:inView: |
(NSString *) | - drawing:willReturnAbbreviationForUnit: |
(NSString *) | - drawing:willReturnFormattedCoordinateForDistance: |
(CGFloat) | - drawingWillReturnUnitToPointsConversonFactor: |
(void) | - finalize |
(NSString *) | - hexString |
(void) | - hotspot:didEndTrackingWithEvent:inView: |
(void) | - hotspot:isTrackingWithEvent:inView: |
(void) | - hotspot:willBeginTrackingWithEvent:inView: |
(NSData *) | - imageData |
(NSImage *) | - imageResourceNamed: |
(id) | - init |
(id) | - initWithExpression: |
(id) | - instantiateObjectWithShortName:parameters: |
(BOOL) | - isLiteralValue |
(void) | - layoutManager:willPlaceGlyphAtIndex:atLocation:pathAngle:yOffset: |
(void) | - menuItem:wasAddedForObject:inCategory: |
(BOOL) | - moveObjectTo:position:slope:userInfo: |
(id) | - mutableCopy |
(void) | - oneShotComplete |
(void) | - oneShotHasReached: |
(void) | - oneShotWillBegin |
(void) | - path:elementIndex:type:points:subPathIndex:subPathClosed:contextInfo: |
(id) | - placeLinkFromPoint:toPoint:onPath:linkNumber:userInfo: |
(id) | - placeObjectAtPoint:onPath:position:slope:userInfo: |
(NSPoint) | - point |
(NSPoint) | - pointForTextLayout |
(DKStyle *) | - registry:shouldReplaceStyle:withStyle: |
(NSBezierPath *) | - renderer:willRenderPath: |
(void) | - routeFinder:progressHasReached: |
(void) | - setValue:forNumericParameter: |
(NSString *) | - stringValue |
(CGFloat) | - taperFactorAtDistance:onPath:ofLength: |
(void) | - toolDidPerformUndoableAction: |
(void) | - toolWillPerformUndoableAction: |
(NSURL *) | - url |
Instance Methods inherited from <NSObject> | |
(NSString *) | - description |
(NSUInteger) | - hash |
(BOOL) | - isEqual: |
Instance Methods inherited from <NSKeyValueBindingCreation> | |
(void) | - bind:toObject:withKeyPath:options: |
(NSArray *) | - exposedBindings |
(NSDictionary *) | - infoForBinding: |
(NSArray *) | - optionDescriptionsForBinding: |
(void) | - unbind: |
(Class) | - valueClassForBinding: |
Instance Methods inherited from <NSCoding> | |
(void) | - encodeWithCoder: |
(id) | - initWithCoder: |
Instance Methods inherited from <DKKnobOwner> | |
(BOOL) | - knobsWantDrawingActiveState |
(CGFloat) | - knobsWantDrawingScale |
Instance Methods inherited from <DKDrawableContainer> | |
(DKDrawing *) | - drawing |
(DKImageDataManager *) | - imageManager |
(DKMetadataItem *) | - metadataItemForKey: |
(id) | - metadataObjectForKey: |
Class Methods | |
(BOOL) | + defaultSelectionChangesAreUndoable |
(DKObjectDrawingLayer *) | + layerWithObjectsInArray: |
Convenience method creates an entire new layer containing the given objects. More... | |
(BOOL) | + selectionIsShownWhenInactive |
(void) | + setDefaultSelectionChangesAreUndoable: |
(void) | + setSelectionIsShownWhenInactive: |
Class Methods inherited from DKObjectOwnerLayer | |
(DKLayerCacheOption) | + defaultLayerCacheOption |
(void) | + setDefaultLayerCacheOption: |
(void) | + setStorageClass: |
(Class) | + storageClass |
Class Methods inherited from DKLayer | |
(BOOL) | + metadataChangesAreUndoable |
(NSColor *) | + selectionColourForIndex: |
(NSArray *) | + selectionColours |
Returns the list of colours used for supplying the selection colours. More... | |
(void) | + setMetadataChangesAreUndoable: |
(void) | + setSelectionColours: |
Allows a list of colours to be set for supplying the selection colours. More... | |
Class Methods inherited from NSObject | |
(id) | + alloc |
(Class) | + class |
(void) | + initialize |
(void) | + load |
(id) | + new |
Class Methods inherited from <NSKeyValueBindingCreation> | |
(void) | + exposeBinding: |
Additional Inherited Members | |
Protected Attributes inherited from DKObjectOwnerLayer | |
BOOL | mShowStorageDebugging |
This layer adds the concept of selection to drawable objects as defined by DKObjectOwnerLayer.
This layer adds the concept of selection to drawable objects as defined by DKObjectOwnerLayer. Selected objects are held in the -selection list, which is a set (there is no order to selected objects per se - though sometimes the relative Z-stacking order of objects in the selection is needed, and the method -selectedObjectsPreservingStackingOrder et. al. will provide that.
Note that for selection, the locked state of owned objects is ignored (because it is OK to select a locked object, just not to do anything with it except unlock it).
Commands directed at this layer are usually meant to to go to "the selection", either multiple or single objects.
This class provides no direct mouse handlers for actually changing the selection - typically the selection and other manipulation of objects in this layer is done through the agency of tools and a DKToolController.
The actual appearance of the selection is mainly down to the objects themselves, with some information supplied by the layer (for example the layer's selectionColour). Also, the layer's (or more typically the drawing's) DKKnob class is generally used by objects to display their selected state.
- (void) addObjectsToSelectionFromArray: | (NSArray *) | objs |
Add a set of objects to the selection.
Existing objects in the selection remain selected
objs | an array of objects to select |
- (void) addObjectToSelection: | (DKDrawableObject *) | obj |
Add a single object to the selection.
Any existing objects in the selection remain selected
obj | an object to select |
- (IBAction) alignBottomEdges: | (id) | sender |
Aligns the selected objects on their bottom edges.
sender | the action's sender |
Provided by category DKObjectDrawingLayer(Alignment).
- (IBAction) alignEdgesToGrid: | (id) | sender |
Provided by category DKObjectDrawingLayer(Alignment).
- (IBAction) alignHorizontalCentres: | (id) | sender |
Aligns the selected objects on their horizontal centres.
sender | the action's sender |
Provided by category DKObjectDrawingLayer(Alignment).
- (IBAction) alignLeftEdges: | (id) | sender |
Aligns the selected objects on their left edges.
sender | the action's sender |
Provided by category DKObjectDrawingLayer(Alignment).
- (IBAction) alignLocationToGrid: | (id) | sender |
Provided by category DKObjectDrawingLayer(Alignment).
- (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 |
Provided by category DKObjectDrawingLayer(Alignment).
- (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 |
Provided by category DKObjectDrawingLayer(Alignment).
- (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 |
Provided by category DKObjectDrawingLayer(Alignment).
- (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 |
Provided by category DKObjectDrawingLayer(Alignment).
- (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 |
Provided by category DKObjectDrawingLayer(Alignment).
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 |
Provided by category DKObjectDrawingLayer(Alignment).
- (IBAction) alignRightEdges: | (id) | sender |
Aligns the selected objects on their right edges.
sender | the action's sender |
Provided by category DKObjectDrawingLayer(Alignment).
- (IBAction) alignTopEdges: | (id) | sender |
Aligns the selected objects on their top edges.
sender | the action's sender |
Provided by category DKObjectDrawingLayer(Alignment).
- (IBAction) alignVerticalCentres: | (id) | sender |
Aligns the selected objects on their vertical centres.
sender | the action's sender |
Provided by category DKObjectDrawingLayer(Alignment).
- (BOOL) allowsObjectsToBeTargetedByDrags |
Returns whether a drag into this layer will target individual objects or not.
If YES, the object under the mouse will highlight as a drag into the layer proceeds, and upon drop, the object itself will be passed the drop information. Default is YES.
- (IBAction) applyStyle: | (id) | sender |
Applies a style to the objects in the selection.
The sender -representedObject must be a DKStyle. This is designed to match the menu items managed by DKStyleRegistry, but can be arranged to be any object that can have a represented object.
sender | the action's sender |
- (IBAction) assignKeyObject: | (id) | sender |
Provided by category DKObjectDrawingLayer(Alignment).
- (NSArray*) autoPolarDuplicate: | (DKDrawableObject *) | object | |
centre: | (NSPoint) | centre | |
Automatically polar duplicates object to fit a circle exactly.
This computes the increment angle and number of copies needed to fit the object exactly into a circle. The angle is that subtended by the object's logical bounds at the centre. The radius will be adjusted outwards as necessary so that an integral number of copies fit a complete circle.
object | a single opject to be copied |
centre | the centre around which the object is located |
Provided by category DKObjectDrawingLayer(Duplication).
Initiates a drag of the selection to another document or app, or back to self.
Keeps control until the drag completes. Swallows the mouseUp event. called from the mouseDragged method when the mouse leaves the drag exclusion rect.
event | the event that triggered the action - must be a mouseDown or mouseDragged |
view | the view in which the user dragging operation is taking place |
- (IBAction) clusterObjects: | (id) | sender |
- (void) commitSelectionUndoWithActionName: | (NSString *) | actionName |
Sends the recorded selection state to the undo manager and tags it with the given action name.
Usually called at the end of any operation than might have changed the selection. This also sets the action name even if the selection is unaffected, so callers can just call this with the desired action name and get the correct outcome, whether or not selection is undoable or changed. This will help keep code tidy.
actionName | undo menu string, or nil to use a preset name |
- (NSArray*) concentricDuplicate: | (NSArray *) | objectsToDuplicate | |
centre: | (NSPoint) | centre | |
numberOfCopies: | (NSInteger) | nCopies | |
insetBy: | (CGFloat) | inset | |
Duplicates one or more objects concentrically around a common centre.
Objects in the result are obtained by copying the objects in the original list, and so will have the same types, styles, etc. While this works with paths, it works best with shapes or groups, because paths don't implement setSize: and their location is at their top, left.
objectsToDuplicate | a list of DKDrawableObjects which will be copied |
centre | the location of the centre around which the copies are arranged |
numberOfCopies | how many copies to make |
insetBy | the amount each copy is inset or outset (-ve) by |
Provided by category DKObjectDrawingLayer(Duplication).
- (IBAction) copy: | (id) | sender |
Perform a copy.
Copies the selection to the general pasteboard
sender | the action's sender |
Implements DKLayer.
- (void) copySelectionToPasteboard: | (NSPasteboard *) | pb |
Copies the selection to the given pasteboard in a variety of formats.
Data is recorded as native data, PDF and TIFF. Note that locked objects can't be copied as native types, but images are still copied.
pb | the pasteboard to copy to |
- (NSUInteger) countOfSelectedAvailableObjects |
Returns the number of objects that are visible and not locked.
If the layer itself is locked, returns 0
- (NSUInteger) countOfSelection |
Return the number of items in the selection.
KVC compliant; returns 0 if the layer is locked or hidden.
- (IBAction) cut: | (id) | sender |
Perform a cut.
Cuts the selection
sender | the action's sender |
+ (BOOL) defaultSelectionChangesAreUndoable |
- (IBAction) delete: | (id) | sender |
Performs a delete operation.
sender | the action's sender |
- (IBAction) deleteBackward: | (id) | sender |
Calls delete: when backspace key is typed.
sender | the action's sender |
- (void) deselectAll |
Deselect any selected objects.
- (void) didAddGroup: | (DKShapeGroup *) | aGroup |
Layer did create the group and added it to the layer.
The default does nothing - subclasses could override this. This is invoked by the high level
aGroup | the group just added |
- (void) didUngroupObjects: | (NSArray *) | ungroupedObjects |
A group object was ungrouped and its contents added back into the layer.
The default does nothing - subclasses could override this. This is invoked by the group just after it has ungrouped - see [DKShapeGroup ungroupObjects:]
ungroupedObjects | the objects just ungrouped |
- (IBAction) distributeHorizontalCentres: | (id) | sender |
Distributes the selected objects to equalize the horizontal centres.
sender | the action's sender |
Provided by category DKObjectDrawingLayer(Alignment).
- (IBAction) distributeHorizontalSpace: | (id) | sender |
Distributes the selected objects to equalize the horizontal space.
sender | the action's sender |
Provided by category DKObjectDrawingLayer(Alignment).
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 |
Provided by category DKObjectDrawingLayer(Alignment).
- (IBAction) distributeVerticalCentres: | (id) | sender |
Distributes the selected objects to equalize the vertical centres.
sender | the action's sender |
Provided by category DKObjectDrawingLayer(Alignment).
- (IBAction) distributeVerticalSpace: | (id) | sender |
Distributes the selected objects to equalize the vertical space.
sender | the action's sender |
Provided by category DKObjectDrawingLayer(Alignment).
- (NSRect) dragExclusionRect |
Gets the rect outside of which a mouse drag will drag the selection with the drag manager.
- (void) drawingSizeChanged: | (NSNotification *) | note |
- (void) drawSelectedObjects |
Draws only the selected objects, but with the selection highlight itself not shown.
This is used when imaging the selection to a PDF or other context.
- (void) drawSelectedObjectsWithSelectionState: | (BOOL) | selected |
Draws only the selected objects, with the selection highlight given.
This is used when imaging the selection to a PDF or other context.
Usually there is no good reason to copy objects with the selection state set to YES, but this is provided for special needs when you do want that.
selected | YES to show the selection, NO to not show it |
- (BOOL) drawsSelectionHighlightsOnTop |
Draw selection highlights on top or in situ?
Default is YES
- (IBAction) duplicate: | (id) | sender |
Duplicates the selection.
sender | the action's sender |
- (NSArray*) duplicatedSelection |
Returns an array consisting of a copy of the selected objects.
The result maintains the stacking order of the original objects, but the objects do not belong to where objects are ultimately going to be pasted back in to this or another layer.
Sets the selection to a given set of objects.
This is intended as a more efficient version of setSelection:, since it only changes the state of objects that differ between the current selection and the list passed. It is intended to be called when interactively making a selection such as during a marquee drag, when it's likely that the same set of objects is repeatedly offered for selection. Also, since it accepts an array parameter, it may be used directly with sets of objects without first making into a set.
sel | the set of objects to select |
- (IBAction) ghostObjects: | (id) | sender |
Set the selected objects ghosted.
Ghosted objects draw using an unobtrusive placeholder style
sender | the action's sender |
- (IBAction) groupObjects: | (id) | sender |
Turns the selected objects into a group.
The new group is placed on top of all objects even if the objects grouped were not on top. The group as a whole can be moved to any index - ungrouping replaces objects at that index.
sender | the action's sender |
- (IBAction) hideObject: | (id) | sender |
Hides all selected objects, then deselects all.
Caution: hiding the selection has usability implications!!
sender | the action's sender |
- (NSImage*) imageOfSelectedObjects |
Creates an image of the selected objects.
Used to create an image representation of the selection when performing a cut or copy operation, to allow the selection to be exported to graphical apps that don't understand our internal object format.
- (BOOL) isSelectedObject: | (DKDrawableObject *) | obj |
Query whether a given object is selected or not.
obj | the object to test |
- (BOOL) isSelectionNotEmpty |
Query whether any objects are selected.
- (BOOL) isSingleObjectSelected |
Query whether there is exactly one object selected.
- (IBAction) joinPaths: | (id) | sender |
Connects any paths sharing an end point into a single path.
sender | the action's sender |
- (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.
Provided by category DKObjectDrawingLayer(Alignment).
+ (DKObjectDrawingLayer*) layerWithObjectsInArray: | (NSArray *) | objects |
Convenience method creates an entire new layer containing the given objects.
The objects are not initially selected
objects | an array containing drawable objects which must not be already owned by another layer |
- (NSArray*) linearDuplicate: | (NSArray *) | objectsToDuplicate | |
offset: | (NSSize) | offset | |
numberOfCopies: | (NSInteger) | nCopies | |
Duplicates one or more objects linearly.
Objects in the result are obtained by copying the objects in the original list, and so will have the same types, styles, etc.
objectsToDuplicate | a list of DKDrawableObjects which will be copied |
offset | each copy is offset this much from the last |
numberOfCopies | how many copies to make |
Provided by category DKObjectDrawingLayer(Duplication).
- (IBAction) lockObject: | (id) | sender |
Locks all selected objects.
sender | the action's sender |
- (void) makeSelectedAvailableObjectsPerform: | (SEL) | selector |
Makes the selected available object perform a given selector.
An easy way to apply a command to the set of selected available objects, provided that the selector requires no parameters
selector | the selector the objects should perform |
- (void) makeSelectedAvailableObjectsPerform: | (SEL) | selector | |
withObject: | (id) | anObject | |
Makes the selected available object perform a given selector with a single object parameter.
selector | the selector the objects should perform |
anObject | the object parameter to pass to each method |
- (IBAction) moveDown: | (id) | sender |
Nudges the selected objects down by one unit.
The nudge amount is determined by the drawing's grid settings
sender | the action's sender (in fact the view) |
- (IBAction) moveLeft: | (id) | sender |
Nudges the selected objects left by one unit.
The nudge amount is determined by the drawing's grid settings
sender | the action's sender (in fact the view) |
- (IBAction) moveRight: | (id) | sender |
Nudges the selected objects right by one unit.
The nudge amount is determined by the drawing's grid settings
sender | the action's sender (in fact the view) |
Changes the location of all objects in the selection by dx and dy.
dx | add this much to each object's x coordinate |
dy | add this much to each object's y coordinate |
- (IBAction) moveUp: | (id) | sender |
Nudges the selected objects up by one unit.
The nudge amount is determined by the drawing's grid settings
sender | the action's sender (in fact the view) |
- (BOOL) multipleSelectionAutoForwarding |
- (BOOL) multipleSelectionValidatedMenuItem: | (NSMenuItem *) | item |
Handle validation of menu items in a multiple selection when autoforwarding is enabled.
This also tries to intelligently set the state of the item. If some objects set the state one way and others to another state, this will automatically set the mixed state. While the menu item itself is enabled if any object enabled it, the mixed state indicates that the outcome of the operation is likely to vary for different objects.
item | the menu item to validate |
- (IBAction) objectBringForward: | (id) | sender |
Brings the selected object forward.
sender | the action's sender |
- (IBAction) objectBringToFront: | (id) | sender |
Brings the selected object to the front.
sender | the action's sender |
- (DKDrawableObject*) objectInSelectedAvailableObjectsAtIndex: | (NSUInteger) | indx |
Returns the indexed object.
indx | the index of the required object |
- (IBAction) objectSendBackward: | (id) | sender |
Sends the selected object backward.
sender | the action's sender |
- (IBAction) objectSendToBack: | (id) | sender |
Sends the selected object to the back.
sender | the action's sender |
Sorts a set of objects into order of their horizontal location.
objects | the objects to sort |
Provided by category DKObjectDrawingLayer(Alignment).
Sorts a set of objects into order of their vertical location.
objects | the objects to sort |
Provided by category DKObjectDrawingLayer(Alignment).
- (IBAction) paste: | (id) | sender |
Perform a paste.
Pastes from the general pasteboard
sender | the action's sender |
- (NSData*) pdfDataOfSelectedObjects |
Creates a PDF representation of the selected objects.
Used to create a PDF representation of the selection when performing a cut or copy operation, to allow the selection to be exported to PDF apps that don't understand our internal object format. This requires the use of a temporary special view for recording the output as PDF.
- (NSArray*) polarDuplicate: | (NSArray *) | objectsToDuplicate | |
centre: | (NSPoint) | centre | |
numberOfCopies: | (NSInteger) | nCopies | |
incrementAngle: | (CGFloat) | incRadians | |
rotateCopies: | (BOOL) | rotCopies | |
Duplicates one or more objects radially around a common centre.
Objects in the result are obtained by copying the objects in the original list, and so will have the same types, styles, etc.
objectsToDuplicate | a list of DKDrawableObjects which will be copied |
centre | the location of the centre around which the copies are arranged |
numberOfCopies | how many copies to make |
incrementAngle | the angle in radians between each copy |
rotateCopies | YES to rotate the copies so that they lie on the radial, NO to keep them at their original rotation |
Provided by category DKObjectDrawingLayer(Duplication).
- (void) recordSelectionForUndo |
Make a copy of the selection for a possible undo recording.
The selection is copied and stored in the ivar <_selectionUndo>. Usually called at the start of an operation that can potentially change the selection state, such as a mouse down.
- (void) refreshSelectedObjects |
Causes all selected objects to redraw themselves.
- (void) removeObjectFromSelection: | (DKDrawableObject *) | obj |
Remove a single object from the selection.
Other objects in the selection are unaffected
obj | the object to deselect |
- (void) removeObjectsFromSelectionInArray: | (NSArray *) | objs |
Remove a series of object from the selection.
Other objects in the selection are unaffected
objs | the list of objects to deselect |
- (BOOL) replaceSelectionWithObject: | (DKDrawableObject *) | obj |
Select the given object, deselecting all previously selected objects.
obj | the object to select |
- (BOOL) replaceStyle: | (DKStyle *) | style | |
withStyle: | (DKStyle *) | newStyle | |
selectingObjects: | (BOOL) | select | |
- (IBAction) revealHiddenObjects: | (id) | sender |
Reveals any hidden objects, setting the selection to them.
Beeps if no objects were hidden
sender | the action's sender |
- (void) scrollToSelectionInView: | (NSView *) | aView |
Scrolls one or all views attached to the drawing so that the selection within this layer is visible.
aView | if not nil, the view to scroll. If nil, scrolls all views |
- (void) selectAll |
Select all available objects.
This also adds hidden objects to the selection, even though they are not visible
- (IBAction) selectAll: | (id) | sender |
Selects all objects.
sender | the action's sender (in fact the view) |
- (NSArray*) selectedAvailableObjects |
Returns the objects that are not locked, visible and selected.
This also preserves the stacking order of the objects (unlike -selection), so is the most useful means of obtaining the set of objects that can be acted upon by a command or user interface control. Note that if the layer is locked as a whole, this always returns an empty list
Returns the objects that are not locked, visible and selected and which have the given class.
See comments for selectedAvailableObjects
- (NSArray*) selectedObjectsPreservingStackingOrder |
Returns the selected objects in their original stacking order.
Slower than -selection, as it needs to iterate over the objects. This ignores visible and locked states of the objects. See also -selectedAvailableObjects. If the layer itself is locked, returns an empty array.
Returns objects that respond to the selector <selector>
This is a more general kind of test for ensuring that selectors are only sent to those objects that can respond. Hidden or locked objects are also excluded.
selector | any selector |
- (NSArray*) selectedVisibleObjects |
Returns the objects that are visible and selected.
See comments for selectedAvailableObjects
- (NSSet*) selection |
- (NSRect) selectionBounds |
Return the overall area bounded by the objects in the selection.
- (BOOL) selectionChangesAreUndoable |
Are selection changes undoable?
Query whether the selection contains any objects matching the given class.
c | the class of object sought |
, NO otherwise
- (BOOL) selectionHasChangedFromRecorded |
Test whether the selection is now different from the recorded selection.
+ (BOOL) selectionIsShownWhenInactive |
- (NSRect) selectionLogicalBounds |
- (BOOL) selectionVisible |
Whether the selection is actually shown or not.
Normally the selection should be visible, but some tools might want to hide it temporarily at certain well-defined times, such as when dragging objects.
- (IBAction) selectMatchingStyle: | (id) | sender |
Selects all objects having the same style as the single selected object.
sender | the action's sender |
- (IBAction) selectNone: | (id) | sender |
Deselects all objects in the selection.
sender | the action's sender |
Sets the selection to the set of objects that have the given style.
The style is compared by key, so clones of the style are not considered a match
style | the style to match |
- (IBAction) selectOthers: | (id) | sender |
Selects the objects not selected, deselects those that are ("inverts" selection)
sender | the action's sender |
- (void) setAllowsObjectsToBeTargetedByDrags: | (BOOL) | allow |
Sets whether a drag into this layer will target individual objects or not.
If YES, the object under the mouse will highlight as a drag into the layer proceeds, and upon drop, the object itself will be passed the drop information. Default is YES.
allow | allow individual objects to receive drags |
+ (void) setDefaultSelectionChangesAreUndoable: | (BOOL) | undoSel |
- (void) setDragExclusionRect: | (NSRect) | aRect |
Sets the rect outside of which a mouse drag will drag the selection with the drag manager.
By default the drag exclusion rect is set to the interior of the drawing. Dragging objects to the margins thus drags them "off" the drawing.
aRect | a rectangle - drags inside this rect do not cause a DM operation. Can be empty to |
- (void) setDrawsSelectionHighlightsOnTop: | (BOOL) | onTop |
Sets whether selection highlights should be drawn on top of all other objects, or if they should be drawn with the object at its current stacking position.
Default is YES
onTop | YES to draw on top, NO to draw in situ |
- (BOOL) setHiddenObjectsVisible |
Reveals any hidden objects, setting the selection to those revealed.
- (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 |
Provided by category DKObjectDrawingLayer(Alignment).
- (void) setMultipleSelectionAutoForwarding: | (BOOL) | autoForward |
Default is NO for backward compatibility.
This feature is useful to allow an action to be defined by an object but to have it invoked on all objects that are able to respond in the current selection without having to implement the action in the layer. Formerly such actions were only forwarded if exactly one object was selected that could respond. See -forwardInvocation.
autoForward | YES to automatically forward, NO to only operate on a single selected object |
- (void) setSelectedObjectsLocked: | (BOOL) | lock |
Locks or unlocks all the selected objects.
lock | YES to lock the objects, NO to unlock them |
- (void) setSelectedObjectsVisible: | (BOOL) | visible |
Hides or shows all of the objects in the selection.
Since hidden selected objects are not drawn, use with care, since usability may be severely compromised (for example, how are you going to be able to select hidden objects in order to show them?)
visible | YES to show the objects, NO to hide them |
- (void) setSelection: | (NSSet *) | sel |
Sets the selection to a given set of objects.
For interactive selections, exchangeSelectionWithObjectsInArray: is more appropriate and efficient
sel | a set of objects to select |
- (void) setSelectionChangesAreUndoable: | (BOOL) | undoable |
Set whether selection changes should be recorded for undo.
Different apps may want to treat selection changes as undoable state changes or not.
undoable | YES to record selection changes, NO to not bother. |
+ (void) setSelectionIsShownWhenInactive: | (BOOL) | visInactive |
- (void) setSelectionVisible: | (BOOL) | vis |
Sets whether the selection is actually shown or not.
Normally the selection should be visible, but some tools might want to hide it temporarily at certain well-defined times, such as when dragging objects.
vis | YES to show the selection, NO to hide it |
- (BOOL) shouldGroupObjects: | (NSArray *) | objectsToBeGrouped | |
intoGroup: | (DKShapeGroup *) | aGroup | |
Layer is about to group a number of objects.
The default does nothing and returns YES - subclasses could override this to enhance or refuse grouping. This is invoked by the high level groupObjects: action method.
objectsToBeGrouped | the objects about to be grouped |
aGroup | a group into which they will be placed |
- (BOOL) shouldUngroup: | (DKShapeGroup *) | aGroup |
A group object is about to be ungrouped.
The default does nothing - subclasses could override this. This is invoked by a group when it is about to ungroup - see [DKShapeGroup ungroupObjects:]
aGroup | the group about to be ungrouped |
- (IBAction) showObject: | (id) | sender |
Shows all selected objects.
sender | the action's sender |
- (DKDrawableObject*) singleSelection |
If the selection consists of a single available object, return it.
Otherwise nil.
This is useful for easily handling the case where an operation can only operate on one object to be meaningful. It is also used by the automatic invocation forwarding mechanism.
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 |
Provided by category DKObjectDrawingLayer(Alignment).
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 |
Provided by category DKObjectDrawingLayer(Alignment).
- (IBAction) unghostObjects: | (id) | sender |
Set the selected objects unghosted.
Ghosted objects draw using an unobtrusive placeholder style
sender | the action's sender |
- (IBAction) unlockObject: | (id) | sender |
Unlocks all selected objects.
sender | the action's sender |