- Inherits from:
- NSObject
- Package:
- com.apple.yellow.application
The NSCell class provides a mechanism for displaying text or images in an NSView without the overhead of a full NSView subclass. In particular, it provides much of the functionality of the NSText class by providing access to a shared NSText object used by all instances of NSCell in an application. NSCells are also extremely useful for placing text or images at various locations in a custom subclass of NSView.
NSCell is used heavily by most of the NSControl classes to implement their internal workings. For example, NSSlider uses an NSSliderCell, NSTextField uses an NSTextFieldCell, and NSBrowser uses an NSBrowserCell. Sending a message to the NSControl is often simpler than dealing directly with the corresponding NSCell. For instance, NSControls typically invoke updateCell (causing the cell to be displayed) after changing a cell attribute; whereas if you directly call the corresponding method of the NSCell, the NSCell might not automatically display itself again.
Some subclasses of NSControl (notably NSMatrix) group NSCells in an arrangement where they act together in some cooperative manner. Thus, with an NSMatrix, you can implement a uniformly sized group of radio buttons without needing an NSView for each button (and without needing an NSText object as the field editor for the text on each button).
The NSCell class provides primitives for displaying text or an image, editing text, setting and getting object values, maintaining state, highlighting, and tracking the mouse. NSCell's method trackMouse implements the mechanism that sends action messages to target objects. However, NSCell implements target/action features abstractly, deferring the details of implementation to NSActionCell and its subclasses.
Every NSCell that displays text has a value associated with it. The NSCell stores that value as an object of potentially any type, displays it as a String, and returns it as a primary value or string object, according to what's requested ( intValue, floatValue, stringValue, and so on). Formatters are objects associated with NSCells (through setFormatter) that translate a cell's object value to its it textual representation and convert what users type into the underlying object. NSCells have built-in formatters to handle common string and numeric (int, float, double) translations. In addition, you can specify date and numeric types more precisely with setEntryType and specify floating-point format characteristics with setFloatingPointFormat. You can also implement your own formatters to provide specialized object translation; see the NSFormatter specification for more information.
The text that an NSCell displays and stores can be an attributed string. Several methods help to set and get attributed-string values, including setAttributedStringValue and setImportsGraphics.
For some subclasses of NSCell, such as an NSButtonCell, the
object's value is its state. It can have either two states-OnState
and OffState
-or
three states-OnState
, OffState
,
and MixedState
. A mixed state is
useful for a checkbox or radio button that reflects the status of
a feature. For example, suppose there's a checkbox that makes
the selected text bold. If all the selected text is bold, it's
on. If none of the selected text is bold, it's off. If the text
has a combination of bold and plain text, it's mixed. Now suppose you
click the checkbox. If you turn it on, all the text becomes bold.
If you turn it off, all the text becomes plain. If you select the
mixed state, the text remains as it is.
By default, an NSCell has two states. You can allow the third state with the method setAllowsMixedState. To set the button's state directly, use setState. To cycle through all available states, use setNextState.
Represented objects are objects an NSCell stands for. (They're not to be confused with an NSCell's object value, which is the value of the cell.) By setting a represented object for an NSCell (using setRepresentedObject) you make an association between the NSCell and that object. For instance, you could have a pop-up list, each cell of which lists a color as its title; when the user selects a cell, the represented NSColor object is displayed in a color well. This feature is solely for the developer's convenience. The cell itself does not use the represented object, except to archive and restore it.
The initImageCell: method is the designated initializer for NSCells that display images. The initTextCell: method is the designated initializer for NSCells that display text. Override one or both of these methods if you implement a subclass of NSCell that performs its own initialization. If you need to use target and action behavior, you may prefer to subclass NSActionCell or one of its subclasses, which provide the default implementation of this behavior.
If you want to implement your own mouse-tracking or mouse-up behavior, consider overriding startTrackingMouse, continueTrackingMouse, and stopTrackingMouse. If you want to implement your own drawing, override drawWithFrameInView or drawInteriorWithFrameInView.
For more information on how NSCell is used, see the NSControl class specification.
These constants specify how a cell formats numeric data. They're used by setEntryType and entryType
Constant | Restrictions and Other Information |
IntType |
Must be between INT_MIN and INT_MAX |
PositiveIntType |
Must be between 1 and INT_MAX |
FloatType |
Must be between -FLT_MAX and FLT_MAX |
PositiveFloatType |
Must be between FLT_MIN and FLT_MAX |
DoubleType |
Must be between -DBL_MAX and DBL_MAX |
PositiveDoubleType |
Must be between DBL_MAX and DBL_MAX |
AnyType |
Any value is allowed. |
These constants specify what a cell contains. They're used by setType and type.
Constant | Description |
NullCellType |
Description forthcoming. |
TextCellType |
Description forthcoming. |
ImageCellType |
Description forthcoming. |
These constants specify how a button behaves when pressed and how it displays its state They're used by NSButton and NSButtonCell:
Constant | Description |
CellDisabled |
Description forthcoming. |
CellState |
Description forthcoming. |
PushInCell |
Description forthcoming. |
CellEditable |
Description forthcoming. |
ChangeGrayCell |
Description forthcoming. |
CellHighlighted |
Description forthcoming. |
CellLightsByContents |
Description forthcoming. |
CellLightsByGray |
Description forthcoming. |
ChangeBackgroundCell |
Description forthcoming. |
CellLightsByBackground |
Description forthcoming. |
CellIsBordered |
Description forthcoming. |
CellHasOverlappingImage |
Description forthcoming. |
CellHasImageHorizontal |
Description forthcoming. |
CellHasImageOnLeftOrBottom |
Description forthcoming. |
CellChangesContents |
Description forthcoming. |
CellIsInsetButton |
Description forthcoming. |
CellAllowsMixedState |
Description forthcoming. |
These constants specify the position of a button's image relative to its title. They're used by NSButton's and NSButtonCell's setImagePosition and imagePosition.
Constant | Description |
NoImage |
The cell doesn't display an image |
ImageOnly |
The cell displays an image, but not a title |
ImageLeft |
The image is to the left of the title |
ImageRight |
The image is to the right of the title |
ImageBelow |
The image is below the title |
ImageAbove |
The image is above the title |
ImageOverlaps |
The image overlaps the title |
These constants specify a cell's state and are used mostly for buttons. They're described in "Cell States" .
Constant | Description |
MixedState |
The corresponding feature is in effect somewhere. |
OffState |
The corresponding feature is in effect nowhere. |
OnState |
The corresponding feature is in effect everywhere. |
These constants specify what happens when a button is pressed or is displaying its alternate state. They're used by NSButtonCell's highlightsBy and showsStateBy.
Constant | Description |
NoCellMask |
The button cell doesn't change. |
PushInCellMask |
The button cell "pushes in" if it has a border. |
ContentsCellMask |
The button cell displays its alternate icon and/or title. |
ChangeGrayCellMask |
The button cell swaps the "control color" (NSColor's controlColor) and white pixels on the its background and icon. |
ChangeBackgroundCellMask |
Same as ChangeGrayCellMask ,
but only background pixels are changed. |
- Constructors
- NSCell
- Setting and getting cell values
- setObjectValue
- objectValue
- hasValidObjectValue
- setIntValue
- intValue
- setStringValue
- stringValue
- setDoubleValue
- doubleValue
- setFloatValue
- floatValue
- Setting and getting cell attributes
- setCellAttribute
- cellAttribute
- setType
- int
- setEnabled
- isEnabled
- setBezeled
- isBezeled
- setBordered
- isBordered
- isOpaque
- Setting the state
- allowsMixedState
- nextState
- setAllowsMixedState
- setNextState
- setState
- state
- Modifying textual attributes of cells
- setEditable
- isEditable
- setSelectable
- isSelectable
- setScrollable
- isScrollable
- setAlignment
- alignment
- setFont
- font
- setWraps
- wraps
- setAttributedStringValue
- attributedStringValue
- setAllowsEditingTextAttributes
- allowsEditingTextAttributes
- setImportsGraphics
- importsGraphics
- setUpFieldEditorAttributes
- Setting the target and action
- setAction
- action
- setTarget
- target
- setContinuous
- isContinuous
- setEventMaskForSendingAction
- Setting and getting an image
- setImage
- image
- Assigning a tag
- setTag
- tag
- Formatting and validating data
- setFormatter
- formatter
- setEntryType
- entryType
- isEntryAcceptable
- setFloatingPointFormat
- Managing menus for cells
- defaultMenu
- setMenu
- menu
- menuForEvent
- Comparing cells
- compare
- Making cells respond to keyboard events
- acceptsFirstResponder
- setShowsFirstResponder
- showsFirstResponder
- setTitleWithMnemonic
- mnemonic
- refusesFirstResponder
- setMnemonicLocation
- setRefusesFirstResponder
- mnemonicLocation
- performClick
- Deriving values from other cells
- takeObjectValue
- takeIntValue
- takeStringValue
- takeDoubleValue
- takeFloatValue
- Representing an object with a cell
- setRepresentedObject
- representedObject
- Tracking the mouse
- trackMouse
- startTrackingMouse
- continueTrackingMouse
- stopTrackingMouse
- mouseDownFlags
- prefersTrackingUntilMouseUp
- Managing the cursor
- resetCursorRect
- Managing cell messaging
- interval
- periodicDelay
- Handling keyboard alternatives
- keyEquivalent
- Determining cell sizes
- calcDrawInfo
- cellSize
- cellSizeForBounds
- drawingRectForBounds
- imageRectForBounds
- titleRectForBounds
- Drawing and highlighting cells
- drawWithFrameInView
- drawInteriorWithFrameInView
- controlView
- highlightWithFrameInView
- isHighlighted
- Editing and selecting cell text
- editWithFrameInView
- selectAndEditWithFrameInView
- sendsActionOnEndEditing
- setSendsActionOnEndEditing
- endEditing
public NSCell()
public NSCell(String aString)
public NSCell(NSImage anImage)
null
,
no image is set.public static NSMenu defaultMenu()
null
.public static boolean prefersTrackingUntilMouseUp()
false
, so tracking stops
when the mouse leaves the NSCell; subclasses may override.See Also: trackMouse
public boolean acceptsFirstResponder()
true
if the
cell is enabled and refusesFirstResponder returns false
;
subclasses can override.See Also: performClick, setShowsFirstResponder, setTitleWithMnemonic
public NSSelector action()
See Also: setAction, setTarget, target
public int alignment()
LeftTextAlignment
, RightTextAlignment
, CenterTextAlignment
, JustifiedTextAlignment
,
or NaturalTextAlignment
.See Also: setAlignment
public boolean allowsEditingTextAttributes()
See Also: setAllowsEditingTextAttributes
public boolean allowsMixedState()
true
if
the button has three states: on, off, and mixed. Returns false
if
the button has two states: on and off. See Also: nextState, setAllowsMixedState, setNextState
public NSAttributedString attributedStringValue()
See Also: setAttributedStringValue
public void calcDrawInfo(NSRect aRect)
See Also: cellSize, drawingRectForBounds
public int cellAttribute(int aParameter)
See Also: setCellAttribute
public NSSize cellSize()
See Also: drawingRectForBounds
public NSSize cellSizeForBounds(NSRect aRect)
See Also: drawingRectForBounds
public int compare(Object otherCell)
public boolean continueTrackingMouse(
NSPoint lastPoint,
NSPoint currentPoint,
NSView controlView)
true
if
the cell is set to continuously send action messages to its target
when the mouse is down or is being dragged. Subclasses can override
this method to provide more sophisticated tracking behavior.See Also: startTrackingMouse, stopTrackingMouse
public NSView controlView()
null
.See Also: drawWithFrameInView
public double doubleValue()
public void drawInteriorWithFrameInView(
NSRect cellFrame,
NSView controlView)
Subclasses often override this method to provide more sophisticated drawing of cell contents. Because drawWithFrameInView invokes drawInteriorWithFrameInView: after it draws the NSCell's border, don't invoke drawWithFrameInView in your override implementation.
See Also: isHighlighted, setShowsFirstResponder
public void drawWithFrameInView(
NSRect cellFrame,
NSView controlView)
public NSRect drawingRectForBounds(NSRect theRect)
See Also: calcSize (NSControl)
public void editWithFrameInView(
NSRect aRect,
NSView controlView,
NSText textObj,
Object anObject,
NSEvent theEvent)
LeftMouseDown
event. anObject is
made the delegate of textObj, and
so will receive various NSText delegation and notification messages.If the receiver isn't a text-type NSCell, no editing is performed. Otherwise, textObj is sized to aRect and its superview is set to aView, so it exactly covers the NSCell. Then it's activated and editing begins. It's the responsibility of the delegate to end editing when responding to textShouldEndEditing:. In doing this, it should remove any data from textObj.
See Also: endEditing, selectAndEditWithFrameInView
public void endEditing(NSText textObj)
public int entryType()
AnyType
is
returned. See setEntryType for
a list of type constants.See Also: isEntryAcceptable
public float floatValue()
public NSFont font()
null
if
the receiver is not a text-type cell.See Also: setFont
public NSFormatter formatter()
See Also: setFormatter
public boolean hasValidObjectValue()
See Also: objectValue, setObjectValue
public void highlightWithFrameInView(
boolean flag,
NSRect cellFrame,
NSView controlView)
true
, highlights
the rectangle cellFrame in the NSControl
(controlView).Note that NSCell's highlighting does not appear when highlighted cells are printed (although instances of NSTextFieldCell, NSButtonCell, and others can print themselves highlighted). Generally, you cannot depend on highlighting being printed because implementations of this method may choose (or not choose) to use transparency.
See Also: drawWithFrameInView, isHighlighted
public NSImage image()
null
if
the receiver is not an image-type cell.See Also: setImage
public NSRect imageRectForBounds(NSRect theRect)
See Also: cellSizeForBounds, drawingRectForBounds
public boolean importsGraphics()
See Also: setImportsGraphics
public int int()
public float interval()
See Also: periodicDelay
public int intValue()
public boolean isBezeled()
See Also: setBezeled
public boolean isBordered()
See Also: setBordered
public boolean isContinuous()
See Also: setContinuous
public boolean isEditable()
See Also: setEditable
public boolean isEnabled()
See Also: setEnabled
public boolean isEntryAcceptable(String aString)
Note: This method is being deprecated in favor of a new class of formatter objects. For more information, see NSFormatter. This documentation is provided only for developers who need to modify older applications. |
See Also: entryType, setEntryType
public boolean isHighlighted()
public boolean isOpaque()
public boolean isScrollable()
See Also: setScrollable
public boolean isSelectable()
See Also: setSelectable
public String keyEquivalent()
public NSMenu menu()
null
if
no menu is associated.See Also: setMenu
public NSMenu menuForEvent(
NSEvent anEvent,
NSRect cellFrame,
NSView aView)
null
if
no menu has been set. Subclasses can override to customize the returned
menu according to the event received and the area in which the mouse
event occurs.public String mnemonic()
See Also: setTitleWithMnemonic
public int mnemonicLocation()
NotFound
.See Also: setMnemonicLocation
public int mouseDownFlags()
See Also: modifierFlags (NSEvent)
public int nextState()
See Also: allowsMixedState, setAllowsMixedState, setNextState
public Object objectValue()
null
. To
be valid, the cell must have a formatter capable of converting the
object to and from its textual representation.public void performClick(Object sender)
public float periodicDelay()
See Also: interval
public boolean refusesFirstResponder()
true
if
the cell can never become the first responder. To
find out whether the cell can become first responder at this time,
use the method acceptsFirstResponder.See Also: setRefusesFirstResponder
public Object representedObject()
See Also: setRepresentedObject
public void resetCursorRect(
NSRect cellFrame,
NSView controlView)
public void selectAndEditWithFrameInView(
NSRect aRect,
NSView controlView,
NSText textObj,
Object anObject,
int selStart,
int selLength)
null
,
or if the receiver has no font set for it.public int setEventMaskForSendingAction(int mask)
Value | Description |
LeftMouseUpMask |
Don't send action message on (left) mouse up. |
LeftMouseDownMask |
Send action message on (left) mouse down. |
LeftMouseDraggedMask |
Send action message when (left) mouse is dragged. |
PeriodicMask |
Send action message continuously. |
You can use setContinuous to
turn on the flag corresponding to PeriodicMask
or LeftMouseDraggedMask
,
whichever is appropriate to the given subclass of NSCell.
See Also: action
public boolean sendsActionOnEndEditing()
true
,
the cell sends its action message when the user does one of the
following:This behavior is familiar to Mac OS users.
If it returns false
,
the cell sends its action message only when the user presses the
Return key.
public void setAction(NSSelector aSelector)
See Also: action, setTarget, target
public void setAlignment(int mode)
LeftTextAlignment
, RightTextAlignment
, CenterTextAlignment
, JustifiedTextAlignment
, NaturalTextAlignment
(the default
alignment for the text).public void setAllowsEditingTextAttributes(boolean flag)
false
,
the receiver also cannot import graphics (that is, it does not support
RTFD text).See Also: allowsEditingTextAttributes, setImportsGraphics
public void setAllowsMixedState(boolean flag)
true
,
the button has three states: on, off, and mixed. If flag is false
,
the button has two states: on and off. See Also: allowsMixedState, nextState, setNextState
public void setAttributedStringValue(NSAttributedString attribStr)
See Also: attributedStringValue
public void setBezeled(boolean flag)
See Also: isBezeled
public void setBordered(boolean flag)
See Also: isBordered
public void setCellAttribute(
int aParameter,
int value)
See Also: cellAttribute
public void setContinuous(boolean flag)
See Also: isContinuous, setEventMaskForSendingAction
public void setDoubleValue(double aDouble)
See Also: doubleValue
public void setEditable(boolean flag)
true
,
the text can also be selected. If flag is false
,
the selectable attribute is restored to what it was before the cell
was last made editable.See Also: isEditable, setSelectable
public void setEnabled(boolean flag)
See Also: isEnabled
public void setEntryType(int aType)
Constant | Restrictions and Other Information |
IntType |
Must be between INT_MIN and INT_MAX |
PositiveIntType |
Must be between 1 and INT_MAX |
FloatType |
Must be between -FLT_MAX and FLT_MAX |
PositiveFloatType |
Must be between FLT_MIN and FLT_MAX |
DoubleType |
Must be between -DBL_MAX and DBL_MAX |
PositiveDoubleType |
Must be between DBL_MAX and DBL_MAX |
AnyType |
Any value is allowed. |
If the receiver isn't a text-type cell, this method converts it to one; in the process, it makes its title "Cell" and sets its font to the user's system font at 12 points.
You can check whether formatted strings conform to the entry types of cells with the isEntryAcceptable method. NSControl subclasses also use isEntryAcceptable to validate what users have typed in editable cells. You can control the format of values accepted and displayed in cells by creating a custom subclass of NSFormatter and associating an instance of that class with cells (through setFormatter). In custom NSCell subclasses, you can also override isEntryAcceptable to check for the validity of data entered into cells.
Note: This method is being deprecated in favor of a new class of formatter objects. For more information, see NSFormatter. This documentation is provided only for developers who need to modify older applications. |
See Also: entryType
public void setFloatingPointFormat(
boolean autoRange,
int leftDigits,
int rightDigits)
false
, leftDigits specifies
the maximum number of digits to the left of the decimal point, and rightDigits specifies
the number of digits to the right (the fractional digit places will
be padded with zeros to fill this width). However, if a number is too
large to fit its integer part in leftDigits digits,
as many places as are needed on the left are effectively removed
from rightDigits when the number
is displayed.If autoRange is true
, leftDigits and rightDigits are
simply added to form a maximum total field width for the receiver
(plus 1 for the decimal point). The fractional part will be padded
with zeros on the right to fill this width, or truncated as much
as possible (up to removing the decimal point and displaying the
number as an integer). The integer portion of a number is never
truncated-that is, it is displayed in full no matter what the
field width limit is.
See Also: setEntryType
public void setFloatValue(float aFloat)
See Also: floatValue
public void setFont(NSFont fontObj)
See Also: font
public void setFormatter(NSFormatter newFormatter)
null
,
the receiver is disassociated from the current formatter.See Also: formatter
public void setImage(NSImage image)
See Also: image
public void setImportsGraphics(boolean flag)
true
,
the receiver is also set to allow editing of text attributes ( setAllowsEditingTextAttributes).See Also: importsGraphics
public void setIntValue(int anInt)
See Also: intValue
public void setMenu(NSMenu aMenu)
null
,
any association with a previous menu is removed.See Also: menu
public void setMnemonicLocation(int location)
See Also: mnemonicLocation
public void setNextState()
See Also: allowsMixedState, nextState, setAllowsMixedState
public void setObjectValue(Object object)
See Also: objectValue, setRepresentedObject
public void setRefusesFirstResponder(boolean flag)
true
,
the cell cannot become the first responder. If refusesFirstResponder returns false
and
the cell is enabled, the method acceptsFirstResponder returns true
,
allowing the cell to become first responder
public void setRepresentedObject(Object anObject)
See Also: setObjectValue, representedObject
public void setScrollable(boolean flag)
true
,
wrapping is turned off. When the scrollable attribute is turned
on, the alignment of text in the cell is changed to left alignment.See Also: isScrollable
public void setSelectable(boolean flag)
See Also: isSelectable, setEditable
public void setSendsActionOnEndEditing(boolean flag)
true
,
the cell sends its action message when the user does one of the
following:This behavior is familiar to Mac OS users.
If flag is false
,
the cell sends its action message only when the user presses the
Return key.
public void setShowsFirstResponder(boolean flag)
See Also: showsFirstResponder
public void setState(int value)
OnState
, OffState
,
or MixedState.The
cell can have two or three states. If it has two, value can
be OffState
(the normal or unpressed state)
or OnState
(the alternate or pressed
state). If it has three, value can
be OnState
(the feature is in effect
everywhere), OffState
(the feature
is in effect nowhere), or MixedState (the
feature is in effect somewhere). Note that if the cell has only
two states and value is MixedState,
this method sets the cell's state to OnState
.
Although
using the enumerated constants is preferred, value can
also be an integer. If the cell has two states, zero is treated
as OffState
, and a non-zero value
is treated as OnState
. If the cell
has three states, zero is treated as OffState
;
a negative value, as MixedState; and a
positive value, as OnState
.
Note that the value state returns may not be the same value you passed into setState.
To check whether the cell has three states (and uses the mixed state), invoke the method allowsMixedState.
See Also: state
public void setStringValue(String aString)
See Also: stringValue
public void setTag(int anInt)
See Also: tag
public void setTarget(Object anObject)
See Also: target
public void setTitleWithMnemonic(String aString)
See Also: mnemonic, setMnemonicLocation
public void setType(int aType)
TextCellType
, ImageTypeCell
,
or NullCellType
. If aType is TextCellType
,
converts the receiver to a cell of that type, giving it a default
title and setting the font to the system font at the default size.
If aType is ImageTypeCell
,
sets a null
image.See Also: type
public NSText setUpFieldEditorAttributes(NSText textObj)
public void setWraps(boolean flag)
true
, then
it also sets the receiver to be non-scrollable.See Also: wraps
public boolean showsFirstResponder()
See Also: setShowsFirstResponder
public boolean startTrackingMouse(
NSPoint startPoint,
NSView controlView)
true
if the receiver is set
to respond continuously or when the mouse is dragged. Subclasses
override this method to implement special mouse-tracking behavior
at the beginning of mouse tracking-for example, displaying a special
cursor. See Also: continueTrackingMouse, stopTrackingMouse
public int state()
NSOffState
(the
normal or unpressed state) or OnState
(the
alternate or pressed state). If it has three, it returns OnState
(the
feature is in effect everywhere), OffState
(the
feature is in effect nowhere), or MixedState
(the
feature is in effect somewhere).To check whether the button uses the mixed state, use the method allowsMixedState.
Note that the value state returns may not be the same value you passed into setState.
See Also: setState
public void stopTrackingMouse(
NSPoint lastPoint,
NSPoint stopPoint,
NSView controlView,
boolean flag)
true
). lastPoint is
the point the mouse was at and stopPoint is
its current point. controlView is
the NSControl managing the receiver. NSCell's default implementation
does nothing. Subclasses often override this method to provide customized
tracking behavior. See Also: startTrackingMouse, stopTrackingMouse
public String stringValue()
See Also: setStringValue
public int tag()
See Also: setTag
public void takeDoubleValue(Object sender)
See Also: setDoubleValue
public void takeFloatValue(Object sender)
See Also: setFloatValue
public void takeIntValue(Object sender)
See Also: setIntValue
public void takeObjectValue(Object sender)
See Also: setObjectValue
public void takeStringValue(Object sender)
See Also: setStringValue
public Object target()
null
.See Also: setTarget
public NSRect titleRectForBounds(NSRect theRect)
See Also: imageRectForBounds
public boolean trackMouse(
NSEvent theEvent,
NSRect cellFrame,
NSView controlView,
boolean untilMouseUp)
true
, this
method returns true
if the mouse
goes up anywhere; false
, otherwise.
If that flag is set to false
, this
method returns true
if the mouse
goes up within cellFrame; false
,
otherwise. The argument theEvent is
typically the mouse event received by the initiating NSControl,
usually identified by controlView.
The untilMouseUp argument indicates
whether tracking should continue until the mouse button goes up;
if it's false
, tracking ends when
the mouse is dragged after the initial mouse down.This method
first invokes startTrackingMouse.
If that method returns true
, then
as mouse-dragged events are intercepted, continueTrackingMouse is invoked.
Finally, stopTrackingMouse is
invoked. If untilMouseUp is true
,
it's invoked when the mouse goes up anywhere, If untilMouseUp is false
, it's
invoked when the mouse goes up within cellFrame.
(If cellFrame is null
,
then the bounds are considered infinitely large.) You usually override
one or more of these methods to respond to specific mouse events.
public boolean wraps()
See Also: setWraps