DrawKit
Vector and illustration framework for Mac OS X
Class Methods | List of all members
DKDrawingTool(Deprecated) Category Reference

Class Methods

(DKDrawingTool *) + drawingToolWithKeyboardEquivalent:
 Retrieve a tool from the registry matching the key equivalent indicated by the key event passed. More...
 
(DKDrawingTool *) + drawingToolWithName:
 Retrieve a tool from the registry with the given name. More...
 
(void) + registerDrawingTool:withName:
 Register a tool in th eregistry with the given name. More...
 
(void) + registerStandardTools
 Set a "standard" set of tools in the registry. More...
 
(NSDictionary *) + sharedToolRegistry
 Return the shared instance of the tool registry. More...
 
(NSArray *) + toolNames
 Return a list of registered tools' names, sorted alphabetically. More...
 

Method Documentation

+ (DKDrawingTool*) drawingToolWithKeyboardEquivalent: (NSEvent *)  keyEvent

Retrieve a tool from the registry matching the key equivalent indicated by the key event passed.

See DKToolController

Parameters
keyEventa keyDown event.
Returns
the tool if it can be matched, or nil

Extends class DKDrawingTool.

+ (DKDrawingTool*) drawingToolWithName: (NSString *)  name

Retrieve a tool from the registry with the given name.

Registered tools may be conveniently set by name - see DKToolController

Parameters
namethe registry name of the tool required.
Returns
the tool if it exists, or nil

Extends class DKDrawingTool.

+ (void) registerDrawingTool: (DKDrawingTool *)  tool
withName: (NSString *)  name 

Register a tool in th eregistry with the given name.

Registered tools may be conveniently set by name - see DKToolController

Parameters
toola tool object to register
namea name to register it against.

Extends class DKDrawingTool.

+ (void) registerStandardTools

Set a "standard" set of tools in the registry.

"Standard" tools are creation tools for various basic shapes, the selection tool, zoom tool and launch time, may be safely called more than once - subsequent calls are no-ops. If the conversion table has been set up prior to this, the tools will automatically pick up the class from the table, so that apps don't need to swap out all the tools for subclasses, but can simply set up the table.

Extends class DKDrawingTool.

+ (NSDictionary*) sharedToolRegistry

Return the shared instance of the tool registry.

Creates a new empty registry if it doesn't yet exist

Returns
a dictionary - contains drawing tool objects keyed by name

Extends class DKDrawingTool.

+ (NSArray*) toolNames

Return a list of registered tools' names, sorted alphabetically.

May be useful for supporting a UI

Returns
an array, a list of NSStrings

Extends class DKDrawingTool.