Inherits from: NSObject
Package: com.apple.yellow.application
Implements: NSColorPickingDefault
NSColorPicker is an abstract superclass that implements the NSColorPickingDefault protocol. The NSColorPickingDefault and NSColorPickingCustom protocols define a way to add color pickers (custom user interfaces for color selection) to the NSColorPanel. The simplest way to implement a color picker is to create a subclass of NSColorPicker, instead of implementing the NSColorPickingDefault protocol in another kind of object. (To add functionality, implement the NSColorPickingCustom methods in your subclass.)
The NSColorPickingDefault protocol specification describes the details of implementing a color picker and adding it to your application's NSColorPanel; you should look there first for an overview of how NSColorPicker works. This specification is provided to document the specific behavior of NSColorPicker's methods.
- NSColorPickingDefault
- - alphaControlAddedOrRemoved:
- - attachColorList:
- - detachColorList:
- - initWithPickerMask:colorPanel:
- - insertNewButtonImage:in:
- - provideNewButtonImage
- - setMode:
- - viewSizeChanged:
- Initializing an NSColorPicker
- initWithPickerMask:colorPanel:
- Getting the color panel
- colorPanel
- Adding button images
- insertNewButtonImage
- provideNewButtonImage
- Setting the mode
- setMode
- Using color lists
- attachColorList
- detachColorList
- Responding to a resized view
- viewSizeChanged
public NSColorPicker(int mask, NSColorPanel owningColorPanel)
super
as part of the
implementation.<<Is it super in Java as well?>> <<Might
mention that this is the designated initializer and not mention specifically
about sending it to super...>>See Also: - colorPanel
public void alphaControlAddedOrRemoved(Object sender)
public void attachColorList(NSColorList colorList)
See Also: detachColorList
public NSColorPanel colorPanel()
public void detachColorList(NSColorList colorList)
See Also: attachColorList
public void insertNewButtonImage(NSImage newButtonImage, NSButtonCell buttonCell)
See Also: provideNewButtonImage
public NSImage provideNewButtonImage()
.tiff
".See Also: insertNewButtonImage
public void setMode(int mode)
Mode | Color Mode Constant |
Grayscale-Alpha | GrayModeColorPanel |
Red-Green-Blue | RGBModeColorPanel |
Cyan-Yellow-Magenta-Black | CMYKModeColorPanel |
Hue-Saturation-Brightness | HSBModeColorPanel |
Custom palette | CustomPaletteModeColorPanel |
Custom color list | ColorListModeColorPanel |
Color wheel | WheelModeColorPanel |
In grayscale-alpha, red-green-blue, cyan-magenta-yellow-black, and hue-saturation-brightness modes, the user adjusts colors by manipulating sliders. In the custom palette mode, the user can load an NSImage file (TIFF or EPS) into the NSColorPanel, then select colors from the image. In custom color list mode, the user can create and load lists of named colors. The two custom modes provide NSPopUpLists for loading and saving files. Finally, color wheel mode provides a simplified control for selecting colors.
public void viewSizeChanged(Object sender)