public abstract class Application extends Object
Modifier and Type | Class and Description |
---|---|
static class |
Application.EventHandler |
Modifier | Constructor and Description |
---|---|
protected |
Application() |
Modifier and Type | Method and Description |
---|---|
protected abstract Object |
_enterNestedEventLoop() |
protected abstract int |
_getKeyCodeForChar(char c) |
protected abstract void |
_invokeAndWait(Runnable runnable) |
protected abstract void |
_invokeLater(Runnable runnable) |
protected abstract void |
_leaveNestedEventLoop(Object retValue) |
protected boolean |
_supportsInputMethods() |
protected boolean |
_supportsSystemMenu() |
protected abstract boolean |
_supportsTransparentWindows() |
protected abstract boolean |
_supportsUnifiedWindows() |
static void |
checkEventThread()
Verifies that the current thread is the event thread, and throws
an exception if this is not so.
|
Accessible |
createAccessible() |
abstract Cursor |
createCursor(int type) |
abstract Cursor |
createCursor(int x,
int y,
Pixels pixels) |
EventLoop |
createEventLoop() |
Menu |
createMenu(String title) |
Menu |
createMenu(String title,
boolean enabled) |
MenuBar |
createMenuBar() |
MenuItem |
createMenuItem(String title) |
MenuItem |
createMenuItem(String title,
MenuItem.Callback callback) |
MenuItem |
createMenuItem(String title,
MenuItem.Callback callback,
int shortcutKey,
int shortcutModifiers) |
MenuItem |
createMenuItem(String title,
MenuItem.Callback callback,
int shortcutKey,
int shortcutModifiers,
Pixels pixels) |
abstract Pixels |
createPixels(int width,
int height,
ByteBuffer data) |
abstract Pixels |
createPixels(int width,
int height,
IntBuffer data) |
abstract Pixels |
createPixels(int width,
int height,
IntBuffer data,
float scale) |
abstract Robot |
createRobot() |
abstract Timer |
createTimer(Runnable runnable) |
abstract View |
createView() |
abstract Window |
createWindow(long parent) |
Window |
createWindow(Screen screen,
int styleMask)
Create a window.
|
abstract Window |
createWindow(Window owner,
Screen screen,
int styleMask)
Create a window.
|
protected void |
finishTerminating() |
static Application |
GetApplication() |
String |
getDataDirectory()
Gets a platform specific path that can be used to store
application data.
|
static Map |
getDeviceDetails() |
Application.EventHandler |
getEventHandler() |
protected static Thread |
getEventThread() |
String |
getHighContrastTheme()
Gets the Name of the currently active high contrast theme.
|
static int |
getKeyCodeForChar(char c)
Returns a VK_ code of a key capable of producing the given unicode
character with respect to the currently active keyboard layout or
VK_UNDEFINED if the character isn't present in the current layout.
|
String |
getName()
Gets the name for the application.
|
boolean |
hasMultiTouch() |
boolean |
hasPointer() |
boolean |
hasTouch() |
boolean |
hasTwoLevelFocus() |
boolean |
hasVirtualKeyboard() |
boolean |
hasWindowManager() |
void |
installDefaultMenus(MenuBar menubar)
Install app's default native menus:
on Mac OS X - Apple menu (showing the app name) with a single Quit menu item
on Windows - NOP
on Linux - NOP
|
static void |
invokeAndWait(Runnable runnable)
Block the current thread and wait until the given runnable finishes
running on the native event loop thread.
|
static void |
invokeLater(Runnable runnable)
Schedule the given runnable to run on the native event loop thread
some time in the future, and return immediately.
|
static boolean |
isEventThread()
Returns
true if the current thread is the event thread. |
static boolean |
isNestedLoopRunning() |
protected static void |
loadNativeLibrary() |
protected static void |
loadNativeLibrary(String libname) |
void |
menuAboutAction() |
void |
notifyRenderingFinished()
Notifies the Application that rendering has completed for current pulse.
|
static void |
reportException(Throwable t) |
static void |
run(Runnable launchable) |
protected abstract void |
runLoop(Runnable launchable) |
static void |
setDeviceDetails(Map details) |
void |
setEventHandler(Application.EventHandler eventHandler) |
protected static void |
setEventThread(Thread thread) |
void |
setName(String name)
Sets the name for the application.
|
void |
setTerminateWhenLastWindowClosed(boolean b) |
boolean |
shouldTerminateWhenLastWindowClosed() |
boolean |
shouldUpdateWindow() |
protected abstract CommonDialogs.FileChooserResult |
staticCommonDialogs_showFileChooser(Window owner,
String folder,
String filename,
String title,
int type,
boolean multipleMode,
CommonDialogs.ExtensionFilter[] extensionFilters,
int defaultFilterIndex) |
protected abstract File |
staticCommonDialogs_showFolderChooser(Window owner,
String folder,
String title) |
protected abstract Size |
staticCursor_getBestSize(int width,
int height) |
protected abstract void |
staticCursor_setVisible(boolean visible) |
protected abstract int |
staticPixels_getNativeFormat() |
protected abstract Screen[] |
staticScreen_getScreens() |
protected abstract double |
staticScreen_getVideoRefreshPeriod() |
protected abstract int |
staticTimer_getMaxPeriod() |
protected abstract int |
staticTimer_getMinPeriod() |
protected abstract int |
staticView_getMultiClickMaxX() |
protected abstract int |
staticView_getMultiClickMaxY() |
protected abstract long |
staticView_getMultiClickTime() |
boolean |
supportsInputMethods() |
boolean |
supportsSystemMenu() |
boolean |
supportsTransparentWindows() |
boolean |
supportsUnifiedWindows() |
void |
terminate() |
protected String name
protected static void loadNativeLibrary(String libname)
protected static void loadNativeLibrary()
public static void setDeviceDetails(Map details)
public static Map getDeviceDetails()
public static void run(Runnable launchable)
protected abstract void runLoop(Runnable launchable)
protected void finishTerminating()
public String getName()
public void setName(String name)
name
- the new application namepublic String getDataDirectory()
public void installDefaultMenus(MenuBar menubar)
public Application.EventHandler getEventHandler()
public void setEventHandler(Application.EventHandler eventHandler)
public final boolean shouldTerminateWhenLastWindowClosed()
public final void setTerminateWhenLastWindowClosed(boolean b)
public boolean shouldUpdateWindow()
public boolean hasWindowManager()
public void notifyRenderingFinished()
public void terminate()
public static Application GetApplication()
protected static void setEventThread(Thread thread)
protected static Thread getEventThread()
public static boolean isEventThread()
true
if the current thread is the event thread.public static void checkEventThread()
IllegalStateException
- if the current thread is not the event threadpublic static void reportException(Throwable t)
protected abstract void _invokeAndWait(Runnable runnable)
public static void invokeAndWait(Runnable runnable)
protected abstract void _invokeLater(Runnable runnable)
public static void invokeLater(Runnable runnable)
protected abstract Object _enterNestedEventLoop()
protected abstract void _leaveNestedEventLoop(Object retValue)
public static boolean isNestedLoopRunning()
public void menuAboutAction()
public abstract Window createWindow(Window owner, Screen screen, int styleMask)
public final Window createWindow(Screen screen, int styleMask)
public abstract Window createWindow(long parent)
public abstract View createView()
public abstract Cursor createCursor(int type)
protected abstract void staticCursor_setVisible(boolean visible)
protected abstract Size staticCursor_getBestSize(int width, int height)
public final MenuBar createMenuBar()
public final MenuItem createMenuItem(String title, MenuItem.Callback callback)
public final MenuItem createMenuItem(String title, MenuItem.Callback callback, int shortcutKey, int shortcutModifiers)
public final MenuItem createMenuItem(String title, MenuItem.Callback callback, int shortcutKey, int shortcutModifiers, Pixels pixels)
public abstract Pixels createPixels(int width, int height, ByteBuffer data)
public abstract Pixels createPixels(int width, int height, IntBuffer data, float scale)
protected abstract int staticPixels_getNativeFormat()
public abstract Robot createRobot()
protected abstract double staticScreen_getVideoRefreshPeriod()
protected abstract Screen[] staticScreen_getScreens()
protected abstract int staticTimer_getMinPeriod()
protected abstract int staticTimer_getMaxPeriod()
public final EventLoop createEventLoop()
public Accessible createAccessible()
protected abstract CommonDialogs.FileChooserResult staticCommonDialogs_showFileChooser(Window owner, String folder, String filename, String title, int type, boolean multipleMode, CommonDialogs.ExtensionFilter[] extensionFilters, int defaultFilterIndex)
protected abstract File staticCommonDialogs_showFolderChooser(Window owner, String folder, String title)
protected abstract long staticView_getMultiClickTime()
protected abstract int staticView_getMultiClickMaxX()
protected abstract int staticView_getMultiClickMaxY()
public String getHighContrastTheme()
protected boolean _supportsInputMethods()
public final boolean supportsInputMethods()
protected abstract boolean _supportsTransparentWindows()
public final boolean supportsTransparentWindows()
public boolean hasTwoLevelFocus()
public boolean hasVirtualKeyboard()
public boolean hasTouch()
public boolean hasMultiTouch()
public boolean hasPointer()
protected abstract boolean _supportsUnifiedWindows()
public final boolean supportsUnifiedWindows()
protected boolean _supportsSystemMenu()
public final boolean supportsSystemMenu()
protected abstract int _getKeyCodeForChar(char c)
public static int getKeyCodeForChar(char c)
c
- the characterCopyright © 2020. All rights reserved.