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


[Previous] [Class List] [Next]

NSPanel


Inherits from: NSWindow : NSResponder : NSObject
Package: com.apple.yellow.application


Class Description


A panel is a special kind of window, typically serving an auxiliary function in an application. NSPanel adds a few special behaviors to NSWindow in support of the role panels play:

In addition to these automatic behaviors, NSPanel allows you to configure certain other behaviors common to some kinds of panels:


Method Types


Configuring panel behavior
setFloatingPanel:
isFloatingPanel
setBecomesKeyOnlyIfNeeded
becomesKeyOnlyIfNeeded
setWorksWhenModal
worksWhenModal

Constructors


NSPanel

public NSPanel(NSRect aNSRect, int anInt, int anInt, boolean aBoolean)

<<Documentation Forthcoming>>

public NSPanel(NSRect aNSRect, int anInt, int anInt, boolean aBoolean, NSScreen aNSScreen)

<<Documentation Forthcoming>>

Instance Methods



becomesKeyOnlyIfNeeded

public boolean becomesKeyOnlyIfNeeded()

Returns true if the receiver becomes the key window only when the user clicks a view object that needs to be first responder to receive event and action messages; for example if it edits text or otherwise accepts keyboard input. Returns false if it becomes the key window whenever clicked. NSPanel by default returns false, indicating that panels become key as other windows do.

See Also: setBecomesKeyOnlyIfNeeded, - needsPanelToBecomeKey (NSView)



isFloatingPanel

public boolean isFloatingPanel()

Returns true if the receiver is set to float above normal windows, false otherwise. A floating panel's window level is FloatingWindowLevel. NSPanels by default returns false, indicating that they inhabit the normal window level.

See Also: setFloatingPanel:, - level (NSWindow)



setBecomesKeyOnlyIfNeeded

public void setBecomesKeyOnlyIfNeeded(boolean flag)

Controls whether the receiver becomes the key window only when the user clicks a view object that edits text or otherwise accepts keyboard input. If flag is true, the receiver becomes the key window only when keyboard input is needed; if flag is false, it becomes the key window whenever clicked. This behavior is not set by default. You should consider setting it only if most controls in the NSPanel aren't text fields, and if the choices that can be made by entering text can also be made in another way (such as by clicking an item in a pick list).

See Also: becomesKeyOnlyIfNeeded, - needsPanelToBecomeKey (NSView)



setFloatingPanel:

public void setFloatingPanel(boolean flag)

Controls whether the receiver floats above normal windows. If flag is true, sets the receiver's window level to FloatingWindowLevel; if flag is false, sets the receiver's window level to NormalWindowLevel. The default is false. It's appropriate for an NSPanel to float above other windows only if all of the following conditions are true:

See Also: isFloatingPanel, - setLevel: (NSWindow)



setWorksWhenModal

public void setWorksWhenModal(boolean flag)

Controls whether the receiver receives keyboard and mouse events even when some other window is being run modally. If flag is true, the application object sends events to the receiver even during a modal loop or session; if flag is false, the receiver gets no events while a modal loop or session is running. See "Modal Windows" in the NSWindow class specification for more information on modal windows and panels.

See Also: worksWhenModal, - runModalForWindow: (NSApplication) - runModalSession: (NSApplication)



worksWhenModal

public boolean worksWhenModal()

Returns true if the receiver is able to receive keyboard and mouse events even when some other window is being run modally, false otherwise. NSPanels by default return false, indicating their ineligibility for events during a modal loop or session. See "Modal Windows" in the NSWindow class specification for more information on modal windows and panels.

See Also: setWorksWhenModal, - runModalForWindow: (NSApplication) - runModalSession: (NSApplication)




[Previous] [Next]