PATH  Documentation > Mac OS X > Application Kit Reference: Java

Table of Contents

NSCustomImageRep


Inherits from:
NSImageRep : NSObject
Package:
com.apple.yellow.application


Class Description


An NSCustomImageRep is an object that uses a delegated method to render an image. When called upon to produce the image, it sends a message to its delegate to have the method performed.

Like most other kinds of NSImageReps, an NSCustomImageRep is generally used indirectly, through an NSImage object. An NSImage must be able to choose between various representations of a given image. It also needs to provide an off-screen cache of the appropriate depth for any image it uses. It determines this information by querying its NSImageReps.

Thus to work with an NSImage, an NSCustomImageRep must be able to provide some information about its image. Use the following methods, inherited from the NSImageRep class, to set attributes of the NSCustomImageRep:

Note that if these attributes aren't set, and an NSCustomImageRep is used in an NSImage with other representations, NSImage won't be able to select among them. In practice, this usually isn't a problem.




Method Types


Constructors
NSCustomImageRep
Identifying the object
delegate
drawMethod


Constructors



NSCustomImageRep

public NSCustomImageRep()

Description forthcoming.

public NSCustomImageRep( NSSelector aMethod, Object anObject)

Creates a new NSCustomImageRep instance, so that it delegates responsibility for rendering the image to anObject. When the NSCustomImageRep receives a draw message, it will in turn send a message to anObject to perform aMethod . aMethod should take only one argument, the NSCustomImageRep. It should draw the image at location (0.0, 0.0) in the current coordinate system.

See Also: draw (NSImageRep)




Instance Methods



delegate

public Object delegate()

Returns the delegate object that renders the image for the NSCustomImageRep.

drawMethod

public NSSelector drawMethod()

Returns the associated draw method selector.


Table of Contents