org.rococoa.cocoa.appkit
Class NSGradient

java.lang.Object
  extended by org.rococoa.cocoa.foundation.NSObject
      extended by org.rococoa.cocoa.appkit.NSGradient
All Implemented Interfaces:
NSCoding, NSCopying, NSObject, ObjCObject

public abstract class NSGradient
extends NSObject
implements ObjCObject, NSCopying, NSCoding

This file was autogenerated by JNAerator,
a tool written by Olivier Chafik that uses a few opensource projects..
For help, please visit NativeLibs4Java, Rococoa, or JNA.


Nested Class Summary
static class NSGradient._class_
           
 
Nested classes/interfaces inherited from interface org.rococoa.cocoa.foundation.protocols.NSCopying
NSCopying._static_
 
Nested classes/interfaces inherited from interface org.rococoa.cocoa.foundation.protocols.NSCoding
NSCoding._static_
 
Nested classes/interfaces inherited from interface org.rococoa.cocoa.foundation.protocols.NSObject
NSObject._static_
 
Constructor Summary
NSGradient()
           
 
Method Summary
static NSGradient alloc()
           
abstract  NSColorSpace colorSpace()
          Returns the color space of the gradient
Original signature : -(NSColorSpace*)colorSpace
native declaration : NSGradient.h:131
static NSGradient createWithColors_atLocations_colorSpace(NSArray colorArray, org.rococoa.cocoa.CGFloat[] locations, NSColorSpace colorSpace)
          Factory method
static NSGradient createWithColors_atLocations_colorSpace(NSArray colorArray, CGFloatByReference locations, NSColorSpace colorSpace)
          Deprecated. 
static NSGradient createWithColors(NSArray colorArray)
          Factory method
static NSGradient createWithColorsAndLocations(NSColor firstColor, NSObject... varargs)
          Factory method
static NSGradient createWithStartingColor_endingColor(NSColor startingColor, NSColor endingColor)
          Factory method
abstract  void drawInBezierPath_angle(NSBezierPath path, org.rococoa.cocoa.CGFloat angle)
          Convenience method for drawing a linear gradient to fill a path.
abstract  void getColor_location_atIndex(PointerByReference color, CGFloatByReference location, NSInteger index)
          Returns the color and location at a particular index in the color gradient
Original signature : -(void)getColor:(NSColor**) location:(CGFloat*) atIndex:(NSInteger)
native declaration : NSGradient.h:139
static NSGradient._class_ getNSClass()
           
abstract  NSGradient initWithColors_atLocations_colorSpace(NSArray colorArray, org.rococoa.cocoa.CGFloat[] locations, NSColorSpace colorSpace)
          Initializes a gradient by pairing the colors provided in the color array with the locations provided in the locations array.
abstract  NSGradient initWithColors_atLocations_colorSpace(NSArray colorArray, CGFloatByReference locations, NSColorSpace colorSpace)
          Deprecated. use the safer methods initWithColors_atLocations_colorSpace(org.rococoa.cocoa.foundation.NSArray, org.rococoa.cocoa.CGFloat[], org.rococoa.cocoa.appkit.NSColorSpace) and initWithColors_atLocations_colorSpace(org.rococoa.cocoa.foundation.NSArray, com.ochafik.lang.jnaerator.runtime.CGFloatByReference, org.rococoa.cocoa.appkit.NSColorSpace) instead
abstract  NSGradient initWithColors(NSArray colorArray)
          Initializes a gradient with the first color in the array at 0.0, the last color in the array at 1.0, and intervening colors at equal intervals in between.
abstract  NSGradient initWithColorsAndLocations(NSColor firstColor, NSObject... varargs)
          This initializer takes the first color, then the first location as a CGFloat, then an alternating list of colors and CGFloats, terminated by nil.
abstract  NSGradient initWithStartingColor_endingColor(NSColor startingColor, NSColor endingColor)
          Initializes a gradient with starting color at location 0.0 and ending color at location 1.0 The color space returned by [NSColorSpace genericRGBColorSpace] is used.
abstract  NSColor interpolatedColorAtLocation(org.rococoa.cocoa.CGFloat location)
          This method will return the interpolated gradient value at the given location.
static NSGradient new_()
           
abstract  NSInteger numberOfColorStops()
          The number of color stops in the color gradient
Original signature : -(NSInteger)numberOfColorStops
native declaration : NSGradient.h:135
 
Methods inherited from class org.rococoa.cocoa.foundation.NSObject
as_NSObject_NSAccessibility, as_NSObject_NSAccessibilityAdditions, as_NSObject_NSApplicationScriptingDelegation, as_NSObject_NSArchiverCallback, as_NSObject_NSClassDescriptionPrimitives, as_NSObject_NSCoderMethods, as_NSObject_NSColorPanelResponderMethod, as_NSObject_NSComparisonMethods, as_NSObject_NSControlSubclassNotifications, as_NSObject_NSCopyLinkMoveHandler, as_NSObject_NSDelayedPerforming, as_NSObject_NSDeprecatedKeyValueCoding, as_NSObject_NSDeprecatedKeyValueObservingCustomization, as_NSObject_NSDeprecatedMethods, as_NSObject_NSDictionaryControllerKeyValuePair, as_NSObject_NSDistributedObjects, as_NSObject_NSDraggingDestination, as_NSObject_NSDraggingSource, as_NSObject_NSDraggingSourceDeprecated, as_NSObject_NSEditor, as_NSObject_NSEditorRegistration, as_NSObject_NSErrorRecoveryAttempting, as_NSObject_NSFileManagerFileOperationAdditions, as_NSObject_NSFontManagerDelegate, as_NSObject_NSFontManagerResponderMethod, as_NSObject_NSFontPanelValidationAdditions, as_NSObject_NSKeyValueBindingCreation, as_NSObject_NSKeyValueCoding, as_NSObject_NSKeyValueObserverNotification, as_NSObject_NSKeyValueObserverRegistration, as_NSObject_NSKeyValueObserving, as_NSObject_NSKeyValueObservingCustomization, as_NSObject_NSMenuValidation, as_NSObject_NSNibAwaking, as_NSObject_NSPasteboardOwner, as_NSObject_NSPlaceholders, as_NSObject_NSScriptClassDescription, as_NSObject_NSScripting, as_NSObject_NSScriptingComparisonMethods, as_NSObject_NSScriptKeyValueCoding, as_NSObject_NSScriptObjectSpecifiers, as_NSObject_NSThreadPerformAdditions, as_NSObject_NSURLClient, as_NSObject_NSURLConnectionDelegate, as_NSObject_NSURLDownloadDelegate, copy, create, dealloc, description, doesNotRecognizeSelector, finalize, forwardingTargetForSelector, forwardInvocation, init, isKindOfClass, isKindOfClass, methodForSelector, methodSignatureForSelector, mutableCopy, release, retain, retainCount
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.rococoa.cocoa.foundation.protocols.NSCopying
copyWithZone
 
Methods inherited from interface org.rococoa.cocoa.foundation.protocols.NSCoding
encodeWithCoder, initWithCoder
 
Methods inherited from interface org.rococoa.ObjCObject
id
 
Methods inherited from interface org.rococoa.cocoa.foundation.protocols.NSObject
autorelease, class_, conformsToProtocol, hash, isEqual, isMemberOfClass, isProxy, performSelector_withObject_withObject, performSelector_withObject, performSelector, respondsToSelector, self, superclass, zone
 

Constructor Detail

NSGradient

public NSGradient()
Method Detail

initWithStartingColor_endingColor

public abstract NSGradient initWithStartingColor_endingColor(NSColor startingColor,
                                                             NSColor endingColor)
Initializes a gradient with starting color at location 0.0 and ending color at location 1.0 The color space returned by [NSColorSpace genericRGBColorSpace] is used.
Original signature : -(id)initWithStartingColor:(NSColor*) endingColor:(NSColor*)
native declaration : NSGradient.h:65


createWithStartingColor_endingColor

public static NSGradient createWithStartingColor_endingColor(NSColor startingColor,
                                                             NSColor endingColor)
Factory method

See Also:
initWithStartingColor_endingColor(org.rococoa.cocoa.appkit.NSColor, org.rococoa.cocoa.appkit.NSColor)

initWithColors

public abstract NSGradient initWithColors(NSArray colorArray)
Initializes a gradient with the first color in the array at 0.0, the last color in the array at 1.0, and intervening colors at equal intervals in between. The color space returned by [NSColorSpace genericRGBColorSpace] is used.
Original signature : -(id)initWithColors:(NSArray*)
native declaration : NSGradient.h:70


createWithColors

public static NSGradient createWithColors(NSArray colorArray)
Factory method

See Also:
initWithColors(org.rococoa.cocoa.foundation.NSArray)

initWithColorsAndLocations

public abstract NSGradient initWithColorsAndLocations(NSColor firstColor,
                                                      NSObject... varargs)
This initializer takes the first color, then the first location as a CGFloat, then an alternating list of colors and CGFloats, terminated by nil. If no color is provided for 0.0 or 1.0, the created color gradient will use the color provided at the locations closest to 0.0 and 1.0 for those values. The color space returned by [NSColorSpace genericRGBColorSpace] is used.
For example:
NSGradient *gradient = [[NSGradient alloc] initWithColorsAndLocations: [NSColor blackColor], 0.0, [NSColor blueColor], 0.33, [NSColor cyanColor], 0.45, [NSColor orangeColor], 0.72, [NSColor redColor], 1.0, nil];
Original signature : -(id)initWithColorsAndLocations:(NSColor*), ...
native declaration : NSGradient.h:79


createWithColorsAndLocations

public static NSGradient createWithColorsAndLocations(NSColor firstColor,
                                                      NSObject... varargs)
Factory method

See Also:
#initWithColorsAndLocations(org.rococoa.cocoa.appkit.NSColor, org.rococoa.cocoa.foundation.NSObject)

initWithColors_atLocations_colorSpace

@Deprecated
public abstract NSGradient initWithColors_atLocations_colorSpace(NSArray colorArray,
                                                                            CGFloatByReference locations,
                                                                            NSColorSpace colorSpace)
Deprecated. use the safer methods initWithColors_atLocations_colorSpace(org.rococoa.cocoa.foundation.NSArray, org.rococoa.cocoa.CGFloat[], org.rococoa.cocoa.appkit.NSColorSpace) and initWithColors_atLocations_colorSpace(org.rococoa.cocoa.foundation.NSArray, com.ochafik.lang.jnaerator.runtime.CGFloatByReference, org.rococoa.cocoa.appkit.NSColorSpace) instead

Initializes a gradient by pairing the colors provided in the color array with the locations provided in the locations array. Each location should be a CGFloat between 0.0 and 1.0. The color array and location array should not be empty, and should contain the same number of items. If no color is provided for 0.0 or 1.0, the created color gradient will use the color provided at the locations closest to 0.0 and 1.0 for those values. This is the designated initializer.
Original signature : -(id)initWithColors:(NSArray*) atLocations:(const CGFloat*) colorSpace:(NSColorSpace*)
native declaration : NSGradient.h:84


createWithColors_atLocations_colorSpace

@Deprecated
public static NSGradient createWithColors_atLocations_colorSpace(NSArray colorArray,
                                                                            CGFloatByReference locations,
                                                                            NSColorSpace colorSpace)
Deprecated. 

Factory method

See Also:
initWithColors_atLocations_colorSpace(org.rococoa.cocoa.foundation.NSArray, com.ochafik.lang.jnaerator.runtime.CGFloatByReference, org.rococoa.cocoa.appkit.NSColorSpace)

initWithColors_atLocations_colorSpace

public abstract NSGradient initWithColors_atLocations_colorSpace(NSArray colorArray,
                                                                 org.rococoa.cocoa.CGFloat[] locations,
                                                                 NSColorSpace colorSpace)
Initializes a gradient by pairing the colors provided in the color array with the locations provided in the locations array. Each location should be a CGFloat between 0.0 and 1.0. The color array and location array should not be empty, and should contain the same number of items. If no color is provided for 0.0 or 1.0, the created color gradient will use the color provided at the locations closest to 0.0 and 1.0 for those values. This is the designated initializer.
Original signature : -(id)initWithColors:(NSArray*) atLocations:(const CGFloat*) colorSpace:(NSColorSpace*)
native declaration : NSGradient.h:84


createWithColors_atLocations_colorSpace

public static NSGradient createWithColors_atLocations_colorSpace(NSArray colorArray,
                                                                 org.rococoa.cocoa.CGFloat[] locations,
                                                                 NSColorSpace colorSpace)
Factory method

See Also:
initWithColors_atLocations_colorSpace(org.rococoa.cocoa.foundation.NSArray, org.rococoa.cocoa.CGFloat[], org.rococoa.cocoa.appkit.NSColorSpace)

drawInBezierPath_angle

public abstract void drawInBezierPath_angle(NSBezierPath path,
                                            org.rococoa.cocoa.CGFloat angle)
Convenience method for drawing a linear gradient to fill a path. Draws a linear gradient clipped by the provided path. The start point and end point are calculated with respect to the provided path so that the gradient is drawn at the provided angle in degrees. The end points are located such that both the start and end color in the gradient are visible in the path.
Original signature : -(void)drawInBezierPath:(NSBezierPath*) angle:(CGFloat)
native declaration : NSGradient.h:101


colorSpace

public abstract NSColorSpace colorSpace()
Returns the color space of the gradient
Original signature : -(NSColorSpace*)colorSpace
native declaration : NSGradient.h:131


numberOfColorStops

public abstract NSInteger numberOfColorStops()
The number of color stops in the color gradient
Original signature : -(NSInteger)numberOfColorStops
native declaration : NSGradient.h:135


getColor_location_atIndex

public abstract void getColor_location_atIndex(PointerByReference color,
                                               CGFloatByReference location,
                                               NSInteger index)
Returns the color and location at a particular index in the color gradient
Original signature : -(void)getColor:(NSColor**) location:(CGFloat*) atIndex:(NSInteger)
native declaration : NSGradient.h:139


interpolatedColorAtLocation

public abstract NSColor interpolatedColorAtLocation(org.rococoa.cocoa.CGFloat location)
This method will return the interpolated gradient value at the given location. For example, in a two color gradient with white at location 0.0 and black at location 1.0, the interpolated color at location 0.5 would be 50% gray.
You should not need to override this method, it reports the color value of the gradient at a particular location, and does not affect the drawn color values.
Original signature : -(NSColor*)interpolatedColorAtLocation:(CGFloat)
native declaration : NSGradient.h:146


alloc

public static NSGradient alloc()

new_

public static NSGradient new_()

getNSClass

public static NSGradient._class_ getNSClass()


Copyright © 2009. All Rights Reserved.