Top Description Fields Methods
com.sun.javafx.tk

public Interface TKStage

Known Direct Implementers
com.sun.javafx.tk.quantum.GlassStage
Imports
javafx.scene.input.KeyCode, .KeyCodeCombination, .KeyCombination.ModifierValue

TKStage - Peer interface for a Stage

Field Summary

Modifier and TypeField and Description
public static final KeyCodeCombination

Method Summary

Modifier and TypeMethod and Description
public void
public default void
public TKScene

Returns:

scenePeer The peer of the scene to be displayed
createTKScene
(boolean depthBuffer, boolean msaa)

Creates a Scene peer that can be displayed in this Stage peer.

public float
public float
public float
public float
public long

Returns:

platform window id, or 0L if there is none.
getRawHandle
()

Return a handle to the native platform window id.

public boolean

Returns:

true if the operation is successful
grabFocus
()

Grabs focus on this window.

public default void
public void
releaseInput()

Native keyboard for text input is no longer necessary.

public void
public void
public void
requestInput(String
text to be shown in the native text input component
text
,
int
type of text input component @see com.sun.javafx.scene.control.behavior.TextInputTypes
type
,
double
width of JavaFX text input component
width
,
double
height of JavaFX text input component
height
,
double Mxx, double Mxy, double Mxz, double Mxt, double Myx, double Myy, double Myz, double Myt, double Mzx, double Mzy, double Mzz, double Mzt)

Requests text input in form of native keyboard for text component contained by this Window.

public void
setAlwaysOnTop(boolean alwaysOnTop)

public void
setBounds(float
the new window horizontal position, ignored if xSet is set to false
x
,
float
the new window vertical position, ignored if ySet is set to false
y
,
boolean
indicates whether the x parameter is valid
xSet
,
boolean
indicates whether the y parameter is valid
ySet
,
float
the new window width, ignored if set to -1
w
,
float
the new window height, ignored if set to -1
h
,
float
the new window content width, ignored if set to -1
cw
,
float
the new window content height, ignored if set to -1
ch
,
float
the xGravity coefficient
xGravity
,
float
the yGravity coefficient
yGravity
,
float
new rendering scale, ignored if < 1
renderScaleX
,
float
new rendering scale, ignored if < 1
renderScaleY
)

Sets the window bounds to the specified values.

public void
setEnabled(boolean enabled)

Whether mouse/keyboard events should be sent to this window.

public void
setFullScreen(boolean fullScreen)

public void
setIconified(boolean iconified)

public void
setIcons(List<E> icons)

public void
setImportant(boolean important)

public void
setMaximized(boolean maximized)

public void
setMaximumSize(int maxWidth, int maxHeight)

public void
setMinimumSize(int minWidth, int minHeight)

public void
setOpacity(float opacity)

public void
setResizable(boolean resizable)

public void
setRTL(boolean b)

public void
setScene(TKScene
The peer of the scene to be displayed
scene
)

Set the scene to be displayed in this stage

public void
public void
setTKStageListener(TKStageListener
The listener provided by the stage
listener
)

Listener for this stage peer to pass updates and events back to the stage

public void
setVisible(boolean
True if the stage should be visible
visible
)

Set if the stage is visible on screen

public void
public void
public void
ungrabFocus()

Manually ungrabs focus grabbed on this window previously.

Field Detail

defaultFullScreenExitKeycomboback to summary
public static final KeyCodeCombination defaultFullScreenExitKeycombo

Method Detail

closeback to summary
public void close()
closePostponedback to summary
public default void closePostponed()
createTKSceneback to summary
public TKScene createTKScene(boolean depthBuffer, boolean msaa)

Creates a Scene peer that can be displayed in this Stage peer.

Returns:TKScene

scenePeer The peer of the scene to be displayed

getOutputScaleXback to summary
public float getOutputScaleX()
getOutputScaleYback to summary
public float getOutputScaleY()
getPlatformScaleXback to summary
public float getPlatformScaleX()
getPlatformScaleYback to summary
public float getPlatformScaleY()
getRawHandleback to summary
public long getRawHandle()

Return a handle to the native platform window id.

Returns:long

platform window id, or 0L if there is none.

grabFocusback to summary
public boolean grabFocus()

Grabs focus on this window. All mouse clicks that occur in this window's client area or client-areas of any of its unfocusable owned windows are delivered as usual. Whenever a click occurs on another app's window (not related via the ownership relation with this one, or a focusable owned window), or on non-client area of any window (titlebar, etc.), or any third-party app's window, or native OS GUI (e.g. a taskbar), the grab is automatically reset, and the window that held the grab receives the FOCUS_UNGRAB event. Note that for this functionality to work correctly, the window must have a focus upon calling this method. All owned popup windows that should be operable during the grabbed focus state (e.g. nested popup menus) must be unfocusable (see setFocusable). Clicking a focusable owned window will reset the grab due to a focus transfer. The click that occurs in another window and causes resetting of the grab may or may not be delivered to that other window depending on the native OS behavior. If any of the application's windows already holds the grab, it is reset prior to grabbing the focus for this window. The method may be called multiple times for one window. Subsequent calls do not affect the grab status unless it is reset between the calls, in which case the focus is grabbed again. Note that grabbing the focus on an application window may prevent delivering certain events to other applications until the grab is reset. Therefore, if the application has finished showing popup windows based on a user action (e.g. clicking a menu item), and doesn't require the grab any more, it should call the ungrabFocus method. The FOCUS_UNGRAB event signals that the grab has been reset. A user event handler associated with a menu item must be invoked after resetting the grab. Otherwise, if a developer debugs the application and has installed a breakpoint in the event handler, the debugger may become unoperable due to events blocking for other applications on some platforms.

Returns:boolean

true if the operation is successful

Exceptions
IllegalStateException:
if the window isn't focused currently
postponeCloseback to summary
public default void postponeClose()
releaseInputback to summary
public void releaseInput()

Native keyboard for text input is no longer necessary. Keyboard will be hidden and native text input component too.

requestFocusback to summary
public void requestFocus()
requestFocusback to summary
public void requestFocus(FocusCause cause)
requestInputback to summary
public void requestInput(String text, int type, double width, double height, double Mxx, double Mxy, double Mxz, double Mxt, double Myx, double Myy, double Myz, double Myt, double Mzx, double Mzy, double Mzz, double Mzt)

Requests text input in form of native keyboard for text component contained by this Window. Native text input component is drawn on the place of JavaFX component to cover it completely and to provide native text editing techniques. Any change of text is immediately reflected in JavaFX text component.

Parameters
text:String

text to be shown in the native text input component

type:int

type of text input component @see com.sun.javafx.scene.control.behavior.TextInputTypes

width:double

width of JavaFX text input component

height:double

height of JavaFX text input component

setAlwaysOnTopback to summary
public void setAlwaysOnTop(boolean alwaysOnTop)
setBoundsback to summary
public void setBounds(float x, float y, boolean xSet, boolean ySet, float w, float h, float cw, float ch, float xGravity, float yGravity, float renderScaleX, float renderScaleY)

Sets the window bounds to the specified values. Gravity values specify how to correct window location if only its size changes (for example when stage decorations are added). User initiated resizing should be ignored and must not influence window location through this mechanism. The corresponding correction formulas are: x -= xGravity * deltaW y -= yGravity * deltaH

Parameters
x:float

the new window horizontal position, ignored if xSet is set to false

y:float

the new window vertical position, ignored if ySet is set to false

xSet:boolean

indicates whether the x parameter is valid

ySet:boolean

indicates whether the y parameter is valid

w:float

the new window width, ignored if set to -1

h:float

the new window height, ignored if set to -1

cw:float

the new window content width, ignored if set to -1

ch:float

the new window content height, ignored if set to -1

xGravity:float

the xGravity coefficient

yGravity:float

the yGravity coefficient

renderScaleX:float

new rendering scale, ignored if < 1

renderScaleY:float

new rendering scale, ignored if < 1

setEnabledback to summary
public void setEnabled(boolean enabled)

Whether mouse/keyboard events should be sent to this window.

setFullScreenback to summary
public void setFullScreen(boolean fullScreen)
setIconifiedback to summary
public void setIconified(boolean iconified)
setIconsback to summary
public void setIcons(List<E> icons)
setImportantback to summary
public void setImportant(boolean important)
setMaximizedback to summary
public void setMaximized(boolean maximized)
setMaximumSizeback to summary
public void setMaximumSize(int maxWidth, int maxHeight)
setMinimumSizeback to summary
public void setMinimumSize(int minWidth, int minHeight)
setOpacityback to summary
public void setOpacity(float opacity)
setResizableback to summary
public void setResizable(boolean resizable)
setRTLback to summary
public void setRTL(boolean b)
setSceneback to summary
public void setScene(TKScene scene)

Set the scene to be displayed in this stage

Parameters
scene:TKScene

The peer of the scene to be displayed

setTitleback to summary
public void setTitle(String title)
setTKStageListenerback to summary
public void setTKStageListener(TKStageListener listener)

Listener for this stage peer to pass updates and events back to the stage

Parameters
listener:TKStageListener

The listener provided by the stage

setVisibleback to summary
public void setVisible(boolean visible)

Set if the stage is visible on screen

Parameters
visible:boolean

True if the stage should be visible

toBackback to summary
public void toBack()
toFrontback to summary
public void toFront()
ungrabFocusback to summary
public void ungrabFocus()

Manually ungrabs focus grabbed on this window previously. This method resets the grab, and forces sending of the FOCUS_UNGRAB event. It should be used when popup windows (such as menus) should be dismissed manually, e.g. when a user clicks a menu item which usually causes the menus to hide.

See Also
grabFocus