Package snap.view
Class ViewEnv
java.lang.Object
snap.view.ViewEnv
- Direct Known Subclasses:
SwingViewEnv
An interface for platform specific UI functionality.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
activateApp
(View aView) Activates the App giving focus to given node.protected void
abstract ViewEvent
createEvent
(View aView, Object anEvent, ViewEvent.Type aType, String aName) Sends an event for a UI node.createHelper
(View aView) Returns a ViewHelper for given native component.Returns the system clipboard.Returns the clipboard for dragging.static ViewEnv
getEnv()
Returns the node environment.Returns the screen bounds inset to usable area.getUISource
(Class<?> aClass) Returns a UI source for given class.abstract boolean
Returns whether current thread is event thread.void
runDelayed
(Runnable aRun, int aDelay, boolean inAppThread) Runs given runnable after delay.void
runIntervals
(Runnable aRun, int aPeriod, int aDelay, boolean doAll, boolean inAppThread) Runs given runnable for given period after given delay with option to run once for every interval, even under load.abstract void
Run given runnable on event thread.void
runLaterAndWait
(Runnable aRun) Runs an runnable later and waits for it to finish.void
runLaterOnce
(Runnable aRun) Runs the given runnable once.void
runLaterOnce
(String aName, Runnable aRun) Runs the given runnable for name once.void
stopIntervals
(Runnable aRun) Runs given runnable for given period after given delay with option to run once for every interval, even under load.
-
Field Details
-
_env
-
-
Constructor Details
-
ViewEnv
public ViewEnv()
-
-
Method Details
-
getEnv
Returns the node environment. -
isEventThread
public abstract boolean isEventThread()Returns whether current thread is event thread. -
runLater
Run given runnable on event thread. -
runLaterOnce
Runs the given runnable once. -
runLaterOnce
Runs the given runnable for name once. -
runDelayed
Runs given runnable after delay. -
runIntervals
public void runIntervals(Runnable aRun, int aPeriod, int aDelay, boolean doAll, boolean inAppThread) Runs given runnable for given period after given delay with option to run once for every interval, even under load. -
stopIntervals
Runs given runnable for given period after given delay with option to run once for every interval, even under load. -
runLaterAndWait
Runs an runnable later and waits for it to finish. -
getUISource
Returns a UI source for given class. -
getClipboard
Returns the system clipboard. -
getClipboardDrag
Returns the clipboard for dragging. -
createHelper
Returns a ViewHelper for given native component. -
createEvent
public abstract ViewEvent createEvent(View aView, Object anEvent, ViewEvent.Type aType, String aName) Sends an event for a UI node. -
getScreenBoundsInset
Returns the screen bounds inset to usable area. -
activateApp
Activates the App giving focus to given node. -
complain
-