- Inherits from:
- NSControl : NSView : NSResponder : NSObject
- Package:
- com.apple.yellow.application
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.
- Constructors
- NSColorWell
- Drawing
- drawWellInside
- Activating
- activate
- deactivate
- isActive
- Managing Color
- color
- setColor
- takeColorFrom
- Managing Borders
- isBordered
- setBordered
public NSColorWell()
public NSColorWell(NSRect aRect)
public void activate(boolean exclusive)
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
public NSColor color()
See Also: setColor, takeColorFrom
public void deactivate()
public void drawWellInside(NSRect insideRect)
public boolean isActive()
true
if
the receiver is active, false
otherwise.public boolean isBordered()
true
if
the receiver is bordered, false
otherwise.See Also: setBordered
public void setBordered(boolean bordered)
See Also: isBordered
public void setColor(NSColor color)
See Also: color, takeColorFrom
public void takeColorFrom(Object sender)