DrawKit
Vector and illustration framework for Mac OS X
|
Instance Methods | |
(NSString *) | - actionNameForTextAttribute: |
(void) | - adoptFromText: |
(NSTextAlignment) | - alignment |
(void) | - applyStrokeAttributesToPath: |
Applies the cap, join, mitre limit, dash and line width attributes of the rear-most stroke to the path. More... | |
(void) | - applyToText: |
(void) | - assignUniqueKey |
Sets the unique key of the style. More... | |
(void) | - changeKeyPath:ofObject:toValue: |
Vectors undo invocations back to the object from whence they came. More... | |
(void) | - changeTextAttribute:toValue: |
(void) | - clearRemergeFlag |
(id) | - clone |
Returns a copy of the style having a new unique ID. More... | |
(BOOL) | - copyToPasteboard: |
Copies the style to the pasteboard. More... | |
(NSUInteger) | - countOfClients |
Returns the number of client objects using this style. More... | |
(NSUInteger) | - countOfStrokes |
Returns the number of strokes. More... | |
(id) | - currentRenderClient |
Returns the current object being rendered by this style. More... | |
(DKStyle *) | - derivedStyleWithPasteboard: |
Returns a style based on the receiver plus any data on the clipboard we are able to use. More... | |
(DKStyle *) | - derivedStyleWithPasteboard:withOptions: |
Returns a style based on the receiver plus any data on the clipboard we are able to use. More... | |
(DKStyle *) | - drawingStyleFromTextAttributes |
(DKFill *) | - fill |
(NSColor *) | - fillColour |
(NSFont *) | - font |
(CGFloat) | - fontSize |
(BOOL) | - hasFill |
Queries whether the style has at least one filling property. More... | |
(BOOL) | - hasHatch |
Queries whether the style has at least one hatch property. More... | |
(BOOL) | - hasImageComponent |
(BOOL) | - hasStroke |
Queries whether the style has at least one stroke. More... | |
(BOOL) | - hasTextAdornment |
Queries whether the style has at least one text adornment property. More... | |
(BOOL) | - hasTextAttributes |
Return wjether the style has any text attributes set. More... | |
(NSImage *) | - image |
(NSImage *) | - imageComponent |
(NSImage *) | - imageToFitSize: |
(BOOL) | - isEmpty |
Queries whether the style has any components at all. More... | |
(BOOL) | - isEqualToStyle: |
Is this style the same as <aStyle>? More... | |
(BOOL) | - isStyleRegistered |
Returns whether the style is registered with the current style registry. More... | |
(BOOL) | - isStyleSharable |
Returns whether the style can be shared among multiple objects, or whether unique copies should be used. More... | |
(NSTimeInterval) | - lastModificationTimestamp |
(BOOL) | - locked |
Returns whether the style is locked and cannot be edited. More... | |
(CGFloat) | - maxStrokeWidth |
Returns the widest stroke width in the style. More... | |
(CGFloat) | - maxStrokeWidthDifference |
Returns the difference between the widest and narrowest strokes. More... | |
(void) | - notifyClientsAfterChange |
Informs clients that a property of the style has just changed. More... | |
(void) | - notifyClientsBeforeChange |
Informs clients that a property of the style is about to change. More... | |
(NSParagraphStyle *) | - paragraphStyle |
(NSArray *) | - registryKeys |
Returns the list of keys that the style is registered under (if any) More... | |
(void) | - removeTextAttributes |
Remove all of the style's current text attributes. More... | |
(BOOL) | - requiresRemerge |
Query whether the style should be considered for a re-merge with the registry. More... | |
(void) | - scaleStrokeWidthsBy:withoutInformingClients: |
Adjusts all contained stroke widths by the given scale value. More... | |
(void) | - setAlignment: |
(void) | - setFillColour: |
(void) | - setFont: |
(void) | - setFontSize: |
(void) | - setImageComponent: |
(void) | - setLocked: |
Set whether style is locked (editable) More... | |
(void) | - setParagraphStyle: |
(void) | - setString: |
(void) | - setStrokeColour: |
(void) | - setStrokeDash: |
(void) | - setStrokeLineCapStyle: |
(void) | - setStrokeLineJoinStyle: |
(void) | - setStrokeWidth: |
(void) | - setStyleSharable: |
Sets whether the style can be shared among multiple objects, or whether unique copies should be used. More... | |
(void) | - setTextAttributes: |
Sets the text attributes dictionary. More... | |
(void) | - setTextColour: |
(void) | - setUnderlined: |
(void) | - setUndoManager: |
Sets the undo manager that style changes will be recorded by. More... | |
(NSImage *) | - standardStyleSwatch |
Creates a thumbnail image of the style. More... | |
(NSString *) | - string |
(DKStroke *) | - stroke |
(NSColor *) | - strokeColour |
(DKStrokeDash *) | - strokeDash |
(NSLineCapStyle) | - strokeLineCapStyle |
(NSLineJoinStyle) | - strokeLineJoinStyle |
(CGFloat) | - strokeWidth |
(DKStyle *) | - styleByMergingFromStyle: |
Returns a new style formed by copying the rasterizers from the receiver and the other style into one object. More... | |
(DKStyle *) | - styleByRemovingRenderersOfClass: |
Returns a new style formed by copying the rasterizers from the receiver but not those of <aClass> More... | |
(NSImage *) | - styleSwatchWithSize:type: |
Creates a thumbnail image of the style. More... | |
(void) | - styleWasAttached: |
Called when a style is attached to an object. More... | |
(void) | - styleWillBeRemoved: |
Called when a style is about to be removed from an object. More... | |
(NSString *) | - swatchCacheKeyForSize:type: |
Return a key for the swatch cache for the given size and type of swatch. More... | |
(NSDictionary *) | - textAttributes |
Returns the attributes dictionary. More... | |
(NSColor *) | - textColour |
(void) | - toggleUnderlined |
(NSInteger) | - underlined |
(NSUndoManager *) | - undoManager |
Returns the undo manager that style changes will be recorded by. More... | |
(NSString *) | - uniqueKey |
Returns the unique key of the style. More... | |
Instance Methods inherited from DKRastGroup | |
(void) | - addRenderer: |
(BOOL) | - containsRendererOfClass: |
(NSUInteger) | - countOfRenderList |
(NSUInteger) | - indexOfRenderer: |
(void) | - insertObject:inRenderListAtIndex: |
(void) | - insertRenderer:atIndex: |
(BOOL) | - isValid |
(void) | - moveRendererAtIndex:toIndex: |
(id) | - objectInRenderListAtIndex: |
(void) | - observableWasAdded: |
(void) | - observableWillBeRemoved: |
(void) | - removeAllRenderers |
(void) | - removeObjectFromRenderListAtIndex: |
(void) | - removeRenderer: |
(void) | - removeRendererAtIndex: |
(void) | - removeRenderersOfClass:inSubgroups: |
(DKRasterizer *) | - rendererAtIndex: |
(NSArray *) | - renderersOfClass: |
(DKRasterizer *) | - rendererWithName: |
(NSArray *) | - renderList |
(DKRastGroup *) | - root |
(void) | - setRenderList: |
Instance Methods inherited from DKRasterizer | |
(DKClippingOption) | - clipping |
Whether the rasterizer's effect is clipped to the path or not, and if so, which side. More... | |
(DKRastGroup *) | - container |
Returns the immediate container of this object, if owned by a group. More... | |
(BOOL) | - enabled |
(NSString *) | - label |
(NSString *) | - name |
(NSBezierPath *) | - renderingPathForObject: |
Returns the path to render given the object doing the rendering. More... | |
(void) | - setClipping: |
(void) | - setClippingWithoutNotifying: |
(void) | - setContainer: |
Sets the immediate container of this object. More... | |
(void) | - setEnabled: |
(void) | - setName: |
(NSString *) | - styleScript |
Instance Methods inherited from GCObservableObject | |
(NSString *) | - actionNameForKeyPath: |
(NSString *) | - actionNameForKeyPath:changeKind: |
(NSArray *) | - oldArrayValueForKeyPath: |
(void) | - registerActionNames |
(void) | - sendInitialValuesForAllPropertiesToObserver:context: |
(void) | - setActionName:forKeyPath: |
(BOOL) | - setUpKVOForObserver: |
(void) | - setUpObservables:forObserver: |
(BOOL) | - tearDownKVOForObserver: |
(void) | - tearDownObservables:forObserver: |
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 <DKRasterizer> | |
(NSSize) | - extraSpaceNeeded |
(BOOL) | - isFill |
(void) | - render: |
(void) | - renderPath: |
Instance Methods inherited from <NSCoding> | |
(void) | - encodeWithCoder: |
(id) | - initWithCoder: |
Instance Methods inherited from <NSCopying> | |
(id) | - copyWithZone: |
Instance Methods inherited from <NSMutableCopying> | |
(id) | - mutableCopyWithZone: |
Class Methods | |
(BOOL) | + canInitWithPasteboard: |
(NSShadow *) | + defaultShadow |
Returns a default NSShadow object. More... | |
(DKStyle *) | + defaultStyle |
(DKStyle *) | + defaultTextStyle |
(DKStyle *) | + defaultTrackStyle |
(void) | + registerStyle:withPasteboardName: |
(void) | + setShouldAntialias: |
Set whether drawing should be anti-aliased or not. More... | |
(void) | + setShouldSubstitutePlaceholderStyle: |
Set whether the style should substitute a simple placeholder when a style is complex and slow to render. More... | |
(void) | + setStylesAreSharableByDefault: |
Set whether styles are generally shared or not. More... | |
(BOOL) | + setWillDrawShadows: |
Set whether shadow attributes within a style should be drawn. More... | |
(BOOL) | + shouldAntialias |
Set whether drawing should be anti-aliased or not. More... | |
(BOOL) | + shouldSubstitutePlaceholderStyle |
Set whether the style should substitute a simple placeholder when a style is complex and slow to render. More... | |
(DKStyle *) | + styleFromPasteboard: |
(NSString *) | + styleNameForFont: |
Returns the name and size of the font in a form that can be used as a style name. More... | |
(NSArray *) | + stylePasteboardTypes |
Return a list of types supported by styles for pasteboard operations. More... | |
(BOOL) | + stylesAreSharableByDefault |
Query whether styles are generally shared or not. More... | |
(DKStyle *) | + styleWithDotDensity:foreColour:backColour: |
(DKStyle *) | + styleWithFillColour:strokeColour: |
(DKStyle *) | + styleWithFillColour:strokeColour:strokeWidth: |
(DKStyle *) | + styleWithPasteboardName: |
(DKStyle *) | + textStyleWithFont: |
(BOOL) | + willDrawShadows |
Set whether shadow attributes within a style should be drawn. More... | |
Class Methods inherited from DKRasterizer | |
(DKRasterizer *) | + rasterizerFromPasteboard: |
Class Methods inherited from GCObservableObject | |
(NSString *) | + actionNameForKeyPath:objClass: |
(NSArray *) | + observableKeyPaths |
(void) | + registerActionName:forKeyPath:objClass: |
Class Methods inherited from NSObject | |
(id) | + alloc |
(Class) | + class |
(void) | + initialize |
(void) | + load |
(id) | + new |
Class Methods inherited from <NSKeyValueBindingCreation> | |
(void) | + exposeBinding: |
Provided by category DKStyle(TextAdditions).
- (void) adoptFromText: | (NSAttributedString *) | text |
Provided by category DKStyle(TextAdditions).
- (NSTextAlignment) alignment |
Provided by category DKStyle(TextAdditions).
- (void) applyStrokeAttributesToPath: | (NSBezierPath *) | path |
Applies the cap, join, mitre limit, dash and line width attributes of the rear-most stroke to the path.
This can be used to set up a path for a Quartz operation such as outlining. The rearmost stroke attribute is used if there is more than one on the basis that this forms the largest element of the stroke. However, for the line width the max stroke is applied. If there are no strokes the path is not changed.
path | a bezier path to apply the attributes to |
- (void) applyToText: | (NSMutableAttributedString *) | text |
Provided by category DKStyle(TextAdditions).
- (void) assignUniqueKey |
Sets the unique key of the style.
Called when the object is inited, this assigns a unique key. The key cannot be reassigned - its purpose is to identify this style regardless of any mutations it otherwise undergoes, including its ordinary name.
+ (BOOL) canInitWithPasteboard: | (NSPasteboard *) | pb |
Vectors undo invocations back to the object from whence they came.
keypath | the keypath of the action, relative to the object |
object | the real target of the invocation |
Provided by category DKStyle(TextAdditions).
- (void) clearRemergeFlag |
- (id) clone |
Returns a copy of the style having a new unique ID.
Similar to -mutabelCopy except name is copied and the object is returned autoreleased
- (BOOL) copyToPasteboard: | (NSPasteboard *) | pb |
Copies the style to the pasteboard.
Puts both the archived style and its key (as a separate type) on the pasteboard. When pasting a style, the key should be used in preference to allow a possible shared style to work as expected.
pb | the pasteboard to copy to |
Implements DKRasterizer.
- (NSUInteger) countOfClients |
Returns the number of client objects using this style.
This is for information only - do not base critical code on this value
- (NSUInteger) countOfStrokes |
Returns the number of strokes.
Counts all strokes, including those in subgroups.
- (id) currentRenderClient |
Returns the current object being rendered by this style.
This is only valid when called while rendering is in progress - mainly for the benefit of renderers that are part of this style
+ (NSShadow*) defaultShadow |
+ (DKStyle*) defaultStyle |
+ (DKStyle*) defaultTextStyle |
Provided by category DKStyle(TextAdditions).
+ (DKStyle*) defaultTrackStyle |
- (DKStyle*) derivedStyleWithPasteboard: | (NSPasteboard *) | pb |
Returns a style based on the receiver plus any data on the clipboard we are able to use.
This method is used when dragging properties such as colours onto an object. The object's existing style is used as a starting point, then any data on the pasteboard we can use such as colours, images, etc, is used to add or change properties of the style. For example if the pb has a colour, it will be set as the first fill colour, or add a fill if there isn't one. Images are converted to image adornments, text to text adornments, etc. Note that it's impossible for this method to anticipate what the user is really expecting - it does what it sensibly can, but in some cases it won't be appropriate. It is up to the receiver of the drag itself to make the most appropriate choice about what happens to an object's appearance. If the style could not make use of any data on the clipboard, it returns itself, thus avoiding an unnecessary copy of the style when its contents were not actually changed
pb | the pasteboard to take additional data from |
- (DKStyle*) derivedStyleWithPasteboard: | (NSPasteboard *) | pb | |
withOptions: | (DKDerivedStyleOptions) | options | |
Returns a style based on the receiver plus any data on the clipboard we are able to use.
See notes for derivedStyleWithPasteboard: The options are used to set up renderers in more appropriate ways when the type of object that the style will be attached to is known.
pb | the pasteboard to take additional data from |
options | some hints that can influence the outcome of the operation |
- (DKStyle*) drawingStyleFromTextAttributes |
Provided by category DKStyle(TextAdditions).
- (DKFill*) fill |
Provided by category DKStyle(SimpleAccess).
- (NSColor*) fillColour |
Provided by category DKStyle(SimpleAccess).
- (NSFont*) font |
Provided by category DKStyle(TextAdditions).
- (CGFloat) fontSize |
Provided by category DKStyle(TextAdditions).
- (BOOL) hasFill |
Queries whether the style has at least one filling property.
This queries all rasterizers for the -isFill property
- (BOOL) hasHatch |
Queries whether the style has at least one hatch property.
Hatches are not always considered to be 'fills' in the normal sense, so hatches are counted separately
- (BOOL) hasImageComponent |
Provided by category DKStyle(SimpleAccess).
- (BOOL) hasStroke |
Queries whether the style has at least one stroke.
- (BOOL) hasTextAdornment |
Queries whether the style has at least one text adornment property.
- (BOOL) hasTextAttributes |
Return wjether the style has any text attributes set.
- (NSImage*) image |
- (NSImage*) imageComponent |
Provided by category DKStyle(SimpleAccess).
- (NSImage*) imageToFitSize: | (NSSize) | aSize |
- (BOOL) isEmpty |
Queries whether the style has any components at all.
Is this style the same as <aStyle>?
Styles are considered equal if they have the same unique ID and the same timestamp.
aStyle | a style to compare this with |
- (BOOL) isStyleRegistered |
Returns whether the style is registered with the current style registry.
This method gives a definitive answer about whether the style is registered. Along with locking, this should prevent accidental editing of styles that an app might prefer to consider "read only".
- (BOOL) isStyleSharable |
Returns whether the style can be shared among multiple objects, or whether unique copies should be used.
- (NSTimeInterval) lastModificationTimestamp |
- (BOOL) locked |
Returns whether the style is locked and cannot be edited.
- (CGFloat) maxStrokeWidth |
Returns the widest stroke width in the style.
- (CGFloat) maxStrokeWidthDifference |
Returns the difference between the widest and narrowest strokes.
- (void) notifyClientsAfterChange |
Informs clients that a property of the style has just changed.
This method is called in response to any observed change to any renderer the style contains
- (void) notifyClientsBeforeChange |
Informs clients that a property of the style is about to change.
- (NSParagraphStyle*) paragraphStyle |
Provided by category DKStyle(TextAdditions).
- (NSArray*) registryKeys |
Returns the list of keys that the style is registered under (if any)
The returned array may contain no keys if the style isn't registered, or >1 key if the style has been registered multiple times with different keys (not recommended). The key is not intended for display in a user interface and has no relationship to the style's name.
- (void) removeTextAttributes |
Remove all of the style's current text attributes.
Does nothing if the style is locked
- (BOOL) requiresRemerge |
Query whether the style should be considered for a re-merge with the registry.
Re-merging is done when a document is opened. Any styles that were registered when it was saved will set this flag when the style is inited from the archive. The document gathers these styles together and remerges them according to the user's settings.
Adjusts all contained stroke widths by the given scale value.
scale | the scale factor, e.g. 2.0 will double all stroke widths |
quiet | if YES, will ignore locked state and not inform clients. This is done when making hit |
- (void) setAlignment: | (NSTextAlignment) | align |
Provided by category DKStyle(TextAdditions).
- (void) setFillColour: | (NSColor *) | fillColour |
Provided by category DKStyle(SimpleAccess).
- (void) setFont: | (NSFont *) | font |
Provided by category DKStyle(TextAdditions).
- (void) setFontSize: | (CGFloat) | size |
Provided by category DKStyle(TextAdditions).
- (void) setImageComponent: | (NSImage *) | anImage |
Provided by category DKStyle(SimpleAccess).
- (void) setLocked: | (BOOL) | lock |
Set whether style is locked (editable)
Locked styles are intended not to be editable, though this cannot be entirely enforced by the style itself - client code should honour the locked state. You cannot add or remove renderers from a locked style. Styles are normally not locked, but styles that are put in the registry are locked by that action. Changing the lock state doesn't inform clients, since in general this does not cause a visual change.
lock | YES to lock the style |
- (void) setParagraphStyle: | (NSParagraphStyle *) | style |
Provided by category DKStyle(TextAdditions).
+ (void) setShouldAntialias: | (BOOL) | aa |
Set whether drawing should be anti-aliased or not.
Default is YES. Turning off anti-aliasing can speed up drawing at the expense of quality.
aa | YES to anti-alias, NO to turn anti-aliasing off |
+ (void) setShouldSubstitutePlaceholderStyle: | (BOOL) | substitute |
Set whether the style should substitute a simple placeholder when a style is complex and slow to render.
Default is NO. Typically this method causes a style to render a single simple stroke in place of its actual components. If the style has a simple stroke, it is used, otherwise a default one is used.
substitute | YES to substitute a faster placeholder style for complex styles |
- (void) setString: | (NSString *) | aString |
Provided by category DKStyle(SimpleAccess).
- (void) setStrokeColour: | (NSColor *) | strokeColour |
Provided by category DKStyle(SimpleAccess).
- (void) setStrokeDash: | (DKStrokeDash *) | aDash |
Provided by category DKStyle(SimpleAccess).
- (void) setStrokeLineCapStyle: | (NSLineCapStyle) | capStyle |
Provided by category DKStyle(SimpleAccess).
- (void) setStrokeLineJoinStyle: | (NSLineJoinStyle) | joinStyle |
Provided by category DKStyle(SimpleAccess).
- (void) setStrokeWidth: | (CGFloat) | strokeWidth |
Provided by category DKStyle(SimpleAccess).
+ (void) setStylesAreSharableByDefault: | (BOOL) | share |
Set whether styles are generally shared or not.
Sharing styles means that all object that share that style will change when a style property changes, regardless of any other state information, such as selection, layer owner, etc. Styles are set NOT to be shared by default.
share | YES to share styles, NO to return unique copies. |
- (void) setStyleSharable: | (BOOL) | share |
Sets whether the style can be shared among multiple objects, or whether unique copies should be used.
Default is copied from class setting +shareStyles. Changing this flag is not undoable and does not inform clients. It does send a notification however.
share | YES to share among several objects, NO to make unique copies. |
- (void) setTextAttributes: | (NSDictionary *) | attrs |
Sets the text attributes dictionary.
Objects that display text can use a style's text attributes. This together with sharable styles allows text (labels in particular) to have their styling changed for a whole drawing. See also DKStyle+Text which gives more text-oriented methods that manipulate theses attributes.
attrs | a dictionary of text attributes |
- (void) setTextColour: | (NSColor *) | aColour |
Provided by category DKStyle(TextAdditions).
- (void) setUnderlined: | (NSInteger) | uval |
Provided by category DKStyle(TextAdditions).
- (void) setUndoManager: | (NSUndoManager *) | undomanager |
Sets the undo manager that style changes will be recorded by.
The undo manager is not retained.
undomanager | the manager to use |
Set whether shadow attributes within a style should be drawn.
Drawing shadows is one of the main performance killers, so this provides a way to turn them off in certain situations. Rasterizers that have a shadow property should check and honour this setting.
drawShadows | YES to draw shadows, NO to suppress them |
+ (BOOL) shouldAntialias |
Set whether drawing should be anti-aliased or not.
Default is YES. Turning off anti-aliasing can speed up drawing at the expense of quality.
+ (BOOL) shouldSubstitutePlaceholderStyle |
Set whether the style should substitute a simple placeholder when a style is complex and slow to render.
Default is NO. Typically this method causes a style to render a single simple stroke in place of its actual components. If the style has a simple stroke, it is used, otherwise a default one is used.
- (NSImage*) standardStyleSwatch |
Creates a thumbnail image of the style.
The swatch returned will have the curve path style if it has no fill, otherwise the rect style.
- (NSString*) string |
Provided by category DKStyle(SimpleAccess).
- (DKStroke*) stroke |
Provided by category DKStyle(SimpleAccess).
- (NSColor*) strokeColour |
Provided by category DKStyle(SimpleAccess).
- (DKStrokeDash*) strokeDash |
Provided by category DKStyle(SimpleAccess).
- (NSLineCapStyle) strokeLineCapStyle |
Provided by category DKStyle(SimpleAccess).
- (NSLineJoinStyle) strokeLineJoinStyle |
Provided by category DKStyle(SimpleAccess).
- (CGFloat) strokeWidth |
Provided by category DKStyle(SimpleAccess).
Returns a new style formed by copying the rasterizers from the receiver and the other style into one object.
The receiver's rasterizers are copied first, then otherStyles are appended, so they draw after (on top) of the receiver's.
otherStyle | a style object |
Returns a new style formed by copying the rasterizers from the receiver but not those of <aClass>
aClass | the rasterizer class not to be copied |
+ (DKStyle*) styleFromPasteboard: | (NSPasteboard *) | pb |
+ (NSString*) styleNameForFont: | (NSFont *) | font |
Returns the name and size of the font in a form that can be used as a style name.
font | a font |
Provided by category DKStyle(TextAdditions).
+ (NSArray*) stylePasteboardTypes |
Return a list of types supported by styles for pasteboard operations.
+ (BOOL) stylesAreSharableByDefault |
Query whether styles are generally shared or not.
Styles are set NOT to be shared by default.
- (NSImage*) styleSwatchWithSize: | (NSSize) | size | |
type: | (DKStyleSwatchType) | type | |
Creates a thumbnail image of the style.
size | the desired size of the thumbnail |
type | the type of thumbnail - currently rect and path types are supported, or selected automatically |
- (void) styleWasAttached: | (DKDrawableObject *) | toObject |
Called when a style is attached to an object.
The notification's object is the drawable, not the style - the style is passed in the user info dictionary with the key 'style'.
toObject | the object the style was attached to |
- (void) styleWillBeRemoved: | (DKDrawableObject *) | fromObject |
Called when a style is about to be removed from an object.
The notification's object is the drawable, not the style - the style is passed in the user info dictionary with the key 'style'. This permits this to be called by the dealloc method of the drawable, which would not be the case if the drawable was retained by the dictionary.
toObject | the object the style was attached to |
+ (DKStyle*) styleWithDotDensity: | (CGFloat) | percent | |
foreColour: | (NSColor *) | fore | |
backColour: | (NSColor *) | back | |
Provided by category DKStyle(SimpleAccess).
+ (DKStyle*) styleWithFillColour: | (NSColor *) | fc | |
strokeColour: | (NSColor *) | sc | |
strokeWidth: | (CGFloat) | sw | |
- (NSString*) swatchCacheKeyForSize: | (NSSize) | size | |
type: | (DKStyleSwatchType) | type | |
Return a key for the swatch cache for the given size and type of swatch.
The key is a simple concatenation of the size and the type, but don't rely on this anywhere - just ask for the swatch you want and if it's cached it will be returned.
- (NSDictionary*) textAttributes |
Returns the attributes dictionary.
Renderers are not considered attributes in this sense
- (NSColor*) textColour |
Provided by category DKStyle(TextAdditions).
+ (DKStyle*) textStyleWithFont: | (NSFont *) | font |
Provided by category DKStyle(TextAdditions).
- (void) toggleUnderlined |
Provided by category DKStyle(TextAdditions).
- (NSInteger) underlined |
Provided by category DKStyle(TextAdditions).
- (NSUndoManager*) undoManager |
Returns the undo manager that style changes will be recorded by.
- (NSString*) uniqueKey |
Returns the unique key of the style.
The unique key is set once and for all time when the style is initialised, and is guaranteed unique as it is a UUID.
+ (BOOL) willDrawShadows |
Set whether shadow attributes within a style should be drawn.
Drawing shadows is one of the main performance killers, so this provides a way to turn them off in certain situations. Rasterizers that have a shadow property should check and honour this setting.