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

Table of Contents

NSImageView


Inherits from:
NSControl : NSView : NSResponder : NSObject
Package:
com.apple.yellow.application


Class Description


An NSImageView displays a single NSImage in a frame. The NSImageView class provides methods for choosing the image, choosing the frame, and for aligning and scaling the image to fit the frame.

For an NSControl, NSImageView is quite limited in its ability to respond to user events: the only thing a user can do is drag in a new image. When it receives the new image, the NSImageView replaces its old image and sends its action message to its target. Even this low level of interactivity can be disabled: you can send the NSImageView the message setEditable with an argument of false.

For more information, see the class specification for NSImageCell.




Method Types


Constructors
NSImageView
Choosing the image
image
setImage
Choosing the frame
imageFrameStyle
setImageFrameStyle
Aligning and scaling the image
imageAlignment
setImageAlignment
imageScaling
setImageScaling
Responding to user events
isEditable
setEditable


Constructors



NSImageView

public NSImageView()

Description forthcoming.

public NSImageView(NSRect aRect)

Description forthcoming.


Instance Methods



image

public NSImage image()

Returns the NSImage displayed by the NSImageView.

See Also: setImage



imageAlignment

public int imageAlignment()

Returns the position of the cell's image in the frame. For a list of possible alignments, see setImageAlignment.

imageFrameStyle

public int imageFrameStyle()

Returns the style of frame that appears around the image. For a list of frame styles, see setImageFrameStyle.

imageScaling

public int imageScaling()

Returns the way the cell's image alters to fit the frame. For a list of possible values, see setImageScaling.

isEditable

public boolean isEditable()

Returns whether the user can drag a new image into the frame. The default is true.

See Also: setEditable



setEditable

public void setEditable(boolean flag)

Specifies whether the user can drag a new image into the frame.

See Also: isEditable



setImage

public void setImage(NSImage image)

Lets you specify the image the NSImageView displays.

See Also: image



setImageAlignment

public void setImageAlignment(int alignment)

Lets you specify the position of the image in the frame. The possible alignments are:

The default alignment is ImageAlignCenter.

See Also: imageAlignment



setImageFrameStyle

public void setImageFrameStyle(int frameStyle)

Lets you specify the kind of frame that borders the image. The possible styles are:

The default frameStyle is ImageFrameNone.

See Also: imageFrameStyle



setImageScaling

public void setImageScaling(int scaling)

Lets you specify the way the image alters to fit the frame. The possible values are:

The default scaling is ScaleProportionally.

See Also: imageScaling




Table of Contents