public interface TKStage
Modifier and Type | Field and Description |
---|---|
static KeyCodeCombination |
defaultFullScreenExitKeycombo |
Modifier and Type | Method and Description |
---|---|
void |
close() |
default void |
closePostponed() |
TKScene |
createTKScene(boolean depthBuffer,
boolean msaa,
AccessControlContext acc)
Creates a Scene peer that can be displayed in this Stage peer.
|
long |
getRawHandle()
Return a handle to the native platform window id.
|
float |
getRenderScale() |
float |
getUIScale() |
boolean |
grabFocus()
Grabs focus on this window.
|
default void |
postponeClose() |
void |
releaseInput()
Native keyboard for text input is no longer necessary.
|
void |
requestFocus() |
void |
requestFocus(FocusCause cause) |
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.
|
void |
setAlwaysOnTop(boolean alwaysOnTop) |
void |
setBounds(float x,
float y,
boolean xSet,
boolean ySet,
float w,
float h,
float cw,
float ch,
float xGravity,
float yGravity)
Sets the window bounds to the specified values.
|
void |
setEnabled(boolean enabled)
Whether mouse/keyboard events should be sent to this window.
|
void |
setFullScreen(boolean fullScreen) |
void |
setIconified(boolean iconified) |
void |
setIcons(List icons) |
void |
setImportant(boolean important) |
void |
setMaximized(boolean maximized) |
void |
setMaximumSize(int maxWidth,
int maxHeight) |
void |
setMinimumSize(int minWidth,
int minHeight) |
void |
setOpacity(float opacity) |
void |
setResizable(boolean resizable) |
void |
setRTL(boolean b) |
void |
setScene(TKScene scene)
Set the scene to be displayed in this stage
|
void |
setTitle(String title) |
void |
setTKStageListener(TKStageListener listener)
Listener for this stage peer to pass updates and events back to the stage
|
void |
setVisible(boolean visible)
Set if the stage is visible on screen
|
void |
toBack() |
void |
toFront() |
void |
ungrabFocus()
Manually ungrabs focus grabbed on this window previously.
|
static final KeyCodeCombination defaultFullScreenExitKeycombo
void setTKStageListener(TKStageListener listener)
listener
- The listener provided by the stageTKScene createTKScene(boolean depthBuffer, boolean msaa, AccessControlContext acc)
void setScene(TKScene scene)
scene
- The peer of the scene to be displayedvoid setBounds(float x, float y, boolean xSet, boolean ySet, float w, float h, float cw, float ch, float xGravity, float yGravity)
x -= xGravity * deltaW
y -= yGravity * deltaH
x
- the new window horizontal position, ignored if xSet is set to
falsey
- the new window vertical position, ignored if ySet is set to
falsexSet
- indicates whether the x parameter is validySet
- indicates whether the y parameter is validw
- the new window width, ignored if set to -1h
- the new window height, ignored if set to -1cw
- the new window content width, ignored if set to -1ch
- the new window content height, ignored if set to -1xGravity
- the xGravity coefficientyGravity
- the yGravity coefficientfloat getUIScale()
float getRenderScale()
void setIcons(List icons)
void setTitle(String title)
void setVisible(boolean visible)
visible
- True if the stage should be visiblevoid setOpacity(float opacity)
void setIconified(boolean iconified)
void setMaximized(boolean maximized)
void setAlwaysOnTop(boolean alwaysOnTop)
void setResizable(boolean resizable)
void setImportant(boolean important)
void setMinimumSize(int minWidth, int minHeight)
void setMaximumSize(int maxWidth, int maxHeight)
void setFullScreen(boolean fullScreen)
void requestFocus()
void toBack()
void toFront()
void close()
default void postponeClose()
default void closePostponed()
void requestFocus(FocusCause cause)
boolean grabFocus()
#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.true
if the operation is successfulIllegalStateException
- if the window isn't focused currentlyvoid ungrabFocus()
grabFocus()
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)
text
- text to be shown in the native text input componenttype
- type of text input component @see com.sun.javafx.scene.control.behavior.TextInputTypeswidth
- width of JavaFX text input componentheight
- height of JavaFX text input componentM
- standard transformation matrix for drawing the native text component derived from JavaFX componentvoid releaseInput()
void setRTL(boolean b)
void setEnabled(boolean enabled)
whether
- this stage should receive events/focuslong getRawHandle()
Copyright © 2020. All rights reserved.