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


[Previous] [Class List] [Next]

NSColorWell


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


Class Description


NSColorWell is an NSControl for selecting and displaying a single color value. An example of an NSColorWell object (or simply color well) is found in NSColorPanel, which uses a color well to display the current color selection. A color well is available from the Palettes panel of Interface Builder.

An application can have one or more active color wells. You can activate multiple color wells by invoking the activate method with false as its argument. When a mouse-down event occurs on a color well's border, it becomes the only active color well. When a color well becomes active, it brings up the color panel also.

The mouseDown: method enables a color well to send its color to another color well or any other subclass of NSView that implements the NSDraggingDestination protocol.


Method Types


Drawing
drawWellInside
Activating
activate
deactivate
isActive
Managing Color
color
setColor
takeColorFrom
Managing Borders
isBordered
setBordered

Constructors


NSColorWell

public NSColorWell(NSRect aRect)

<<Documentation Forthcoming>>

Instance Methods



activate

public void activate(boolean exclusive)

Activates the NSColorWell, displays the Color panel, and makes the NSColorPanel's current color the same as its own. If exclusive is true, deactivates any other color wells; if true, keeps them active. Redraws the receiver. An active color well will have its color updated when the NSColorPanel's current color changes. Any color well that shows its border highlights the border when it's active.

See Also: deactivate, isActive



color

public NSColor color()

Returns the color of the NSColorWell.

See Also: setColor, takeColorFrom



deactivate

public void deactivate()

Deactivates the NSColorWell and redraws it.

See Also: activate, isActive



drawWellInside

public void drawWellInside(NSRect insideRect)

Draws the colored area inside the NSColorWell at the location specified by insideRect without drawing borders.

isActive

public boolean isActive()

Returns true if the NSColorWell is active, false otherwise.

isBordered

public boolean isBordered()

Returns true if the NSColorWell is bordered, false otherwise.

See Also: setBordered



setBordered

public void setBordered(boolean bordered)

Places or removes a border on the NSColorWell, depending on bordered, and redraws the receiver.

See Also: isBordered



setColor

public void setColor(NSColor color)

Sets the color of the NSColorWell to color and redraws the receiver.

See Also: color, takeColorFrom



takeColorFrom

public void takeColorFrom(Object sender)

Changes the color of the NSColorWell to that of sender.

See Also: color, setColor




[Previous] [Next]