public class GuiWebDriver extends AbstractGuiDriver<java.lang.Integer> implements EmbeddedWebServer, ClientProtocolHooks, EmbeddedClient
Modifier and Type | Class and Description |
---|---|
private class |
GuiWebDriver.RepaintThread
Dedicated thread responsible of processing repaint requests.
|
AbstractGuiDriver.TextMetrics
Modifier and Type | Field and Description |
---|---|
private int |
activeWindowId
The active window.
|
private static java.awt.Component |
BOGUS_AWT_COMPONENT
A bogus AWT component used to raise mouse events, on notification from the JS code.
|
private BootstrapConfig |
config
Configuration.
|
private NativeDimension |
desktop
Desktop bounds.
|
private boolean |
embedded
Indicates if the web client embedded mode is on or off.
|
private java.util.Map<java.lang.Integer,FontMetricsHelper> |
fontMetricsCache
A cache of font metrics objects, by their remote font ID.
|
private static java.util.Set<java.lang.Integer> |
HOVER_ACTIONS
Actions for hoverable widgets
|
private java.util.Map<java.util.List<java.lang.Integer>,java.lang.Integer> |
imageSeals
Maps the image seal to the unique image identity.
|
private java.util.Map<java.util.List<java.lang.Integer>,java.util.Set<java.lang.Integer>> |
imageUsages
Image usages is a mapping of an image loaded by a client to its owner windows.
|
private java.util.Map<java.lang.Integer,java.util.Set<java.lang.Integer>> |
lastAnyWidgets
A map with the last widgets listening for "any mouse action" sent to the JS side in
[ windowid : [widgetId(s) ...
|
private java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,java.util.Set<java.lang.Integer>>> |
lastMouseWidgets
A map with the last widgets sent to the JS side in [ windowid : [widgetId : actions] ]
form.
|
private java.lang.Object |
lock
Lock object for shared syncrhonization of the web socket.
|
private static java.util.logging.Logger |
LOG
Logger.
|
private static java.lang.String |
MAIN_TARGET
Main page root target.
|
private int |
nextFontId
A counter for font IDs to be mapped on the js-side.
|
private java.util.Map<java.lang.Integer,java.util.Set<java.util.List<java.lang.Integer>>> |
ownedImages
Owned images is a mapping of a window to its owned images seals.
|
private java.util.LinkedList<GuiWebEmulatedWindow> |
repaints
A queue of pending repaint requests which needs to be processed by the
GuiWebDriver.RepaintThread thread. |
private boolean |
taskbar
Flag indicating if the virtual desktop taskbar is shown.
|
static int |
TASKBAR_HEIGHT
Taskbar height in pixels when it exists.
|
private VirtualScreen |
virtualScreen
Virtual screen for drawing in a memory
|
private GuiWebSocket |
websock
Web-Socket which provides a GUI-specific protocol for communication with the browser.
|
private EmbeddedWebServerImpl |
websrv
Delgated implementation for the embedded web server.
|
private static java.lang.String |
WELCOME_PAGE
Welcome page.
|
private java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,NativeRectangle>> |
widgetsRegions
Collects the mouse widgets belonging to a window.
|
private NativeDimension |
workarea
Work-Area bounds.
|
ews, translatedOrigin
direct, factory
Constructor and Description |
---|
GuiWebDriver(BootstrapConfig config)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
boolean |
addImageUsage(java.util.List<java.lang.Integer> imageHash,
int windowId)
Register a usage of the given image by the given window.
|
void |
beep()
Provide an audible feedback to user by generating a beep signal.
|
boolean |
captureMouseEvents(boolean state)
Enable or disable capture of mouse events.
|
void |
clientReady()
Notify the driver that the client is ready (useful for embedded mode, to notify the embedded
app the client can handle messages).
|
java.lang.String |
clipboardContents()
Get the current contents from the OS clipboard.
|
private void |
collectWidgets(Widget w,
java.util.function.Predicate<Widget> filter,
java.util.function.Consumer<Widget> actionsCollector)
Add the widget (and all its possible children) in the specified set, maintaining z-order in
a left-to-right (topmost to bottommost) order.
|
void |
copyToClipboard(java.lang.String txt)
Copy the given text to the system clipboard.
|
FontDetails<java.lang.Integer> |
createFont(FontDetails<java.lang.Integer> details)
Create a font with the given details and register it with the driver.
|
MousePtrWrapper |
createMousePointer(byte[] data,
java.lang.String ptrName)
Load mouse pointer from the InputStream
|
void |
deregisterWidget(int wid)
Deregister the specified widget for mouse events.
|
void |
deriveFont(FontDetails<java.lang.Integer> fd)
Scale the given font by the specified X and Y factors.
|
void |
enableEvents(int[] windowIds,
boolean capture)
Enable or Disable OS-level events for the specified windows.
|
NativeRectangle |
getDisplayBounds()
Since web interface is inherently a single-display setup the method
effectively returns a rectangle with top-level corner equal to 0,0.
|
NativeRectangle |
getDisplayWorkArea()
Returns an application-usable display area.
|
private int |
getMouseModifiers(int button,
int modifiersMask)
Gets the mouse modifiers mask for this event.
|
int |
getScreenResolution()
Reports the screen resolution in dots per inch (DPI).
|
java.lang.String |
getServerURI()
Get the embedded web server's URI.
|
int[][] |
getTextWidths(java.lang.String[] texts,
FontDetails<java.lang.Integer> fd)
Get the widths of the specified texts, using the given font, in batch.
|
java.lang.Integer |
getUniqueIdForSeal(java.util.List<java.lang.Integer> imageSeal)
Gets the unique image id by its identity array.
|
VirtualScreen |
getVirtualScreen()
Returns its virtual screen that represents the physical screen in a memory
using a sRGB pixel model.
|
private java.util.Set<java.lang.Integer> |
getWebActions(Widget widget)
Returns the set of mouse actions handled by this widget.
|
private java.lang.String |
getWelcomePageUrl(java.lang.String pageContext,
java.lang.String pageFile)
Build the name of the main page as a resource locator string.
|
void |
init()
Initialize driver.
|
void |
initRemoteClient()
Called each time a connect occurs, this allows caller-controlled initialization of the
remote client.
|
void |
injectVT100Key(int keyCode,
char charCode)
Input key events when in VT100 mode.
|
boolean |
isEmbeddedClient()
Returns true if this client runs in embedded mode.
|
boolean |
isFontInstalled(java.lang.String fontName)
Returns the boolean value if the target font is installed or not.
|
private boolean |
isInLastAnyWidgets(java.lang.Integer widgetId,
java.lang.Integer windowId)
Tests if the given any mouse widget is in the last any mouse widgets map.
|
private boolean |
isInLastMouseWidgets(java.lang.Integer widgetId,
java.lang.Integer windowId)
Tests if the given mouse widget is in the last mouse widgets map.
|
private boolean |
isInsideVisibleFrameOrStandalone(Widget wid)
Checks if the given widget is belonging to visible frame or not inside any frame, like
window decorations.
|
boolean |
isWindowDecorationSupported()
Returns true if a window can be decorated in this graphics environment, otherwise false.
|
void |
lockMousePointer(int widgetId,
MousePtrWrapper ptr)
Lock the mouse pointer (suppress widget-specific changes) or unlock it
|
void |
mapSealToUniqueId(java.util.List<java.lang.Integer> imageSeal,
java.lang.Integer uniqueId)
Maps the image identity array to the unique image id.
|
void |
moveToBottom(int windowId)
Move the specified window to the bottom of the z-order, at the OS level.
|
void |
moveToTop(int windowId,
boolean focus)
Move the specified window to the top of the z-order, at the OS level.
|
EmulatedWindowState |
newChildWindowEmulator(int windowId,
EmulatedWindowState parentWindow,
java.lang.String windowTitle,
boolean resizable,
boolean isShareActivationWithOwner,
boolean modal)
Create a new child window emulator.
|
EmulatedWindowState |
newEmulator(int windowId)
Create a new window emulator.
|
void |
openURL(java.lang.String path)
Opens the target page or resource in a browser's window.
|
int[][] |
parseEditorContent(int widgetId,
int windowId,
int maxWidth,
java.lang.String text,
int delta,
FontDetails<java.lang.Integer> font)
Split the text for a editor widget, so that it fits the specified maximum width.
|
protected void |
postRepaint(GuiWebEmulatedWindow ews)
Post a new repaint for the specified window to the
repaints queue. |
void |
propagate(int windowId,
int wid,
MousePtrWrapper ptr)
Push information about the loaded mouse pointer for widget
|
void |
propagateWaitState(boolean isWaitState)
Propagate wait state
|
void |
publish(long subId,
java.lang.String event,
java.lang.String[] param)
Send a PUBLISH notification to a remote application.
|
void |
raiseMouseEvent(int windowId,
int mouseOp,
long tstamp,
int mouseX,
int mouseY,
int button,
int clickCount,
int modifiersMask,
int[] wheelParameters,
int widgetId)
Raise a mouse event.
|
int |
readKey()
Read single keystroke from keyboard.
|
void |
registerHoverableWidget(MouseHoverAction action)
Register this widget as being editable, so that the mouse cursor will adjust properly when
the widget is entered.
|
void |
registerMouseWidgets()
Register all the mouse-aware widgets (in all Windows) with the JS side.
|
void |
registerMoveableWidget(int wid)
Register the specified widget as a moveable widget, via mouse.
|
void |
registerResizeableWidget(int wid)
Register the specified widget as a resizeable widget, via mouse.
|
UnformattedPayload |
remoteCall(UnformattedPayload request)
This is a special API which is used to delegate a call from converted 4GL code
(via _P2J_REMOTE_CALL_ functions) to the remote side.
|
java.util.Set<java.lang.Integer> |
removeUnusedImages(int windowId)
Returns all unused images.
|
void |
resetSelection()
Reset selection boxes painting mode and return to normal drawing mode.
|
protected FontMetricsHelper |
resolveFontMetrics(int font)
Resolved the font metrics for the given font.
|
void |
restackWindows(int[] windowIds)
Force the list of all GUI windows to be stacked as in the specified order.
|
void |
setCurrentSelection(java.lang.String txt)
Sets the current editors selection.
|
void |
setResizeableWindow(boolean resize,
int minWidth,
int minHeight,
int maxWidth,
int maxHeight)
Set the window details for resize; this includes the minimum and maximun dimensions, and
also the window's resizeable state.
|
void |
setWindowDimension(int windowId,
int width,
int height)
Set the dimension for the specified window.
|
void |
setWindowLocation(int windowId,
int x,
int y)
Set the location for the specified window.
|
void |
shutdown()
Perform driver shutdown.
|
void |
shutdownServer()
Shutdown the embedded web server.
|
java.lang.String |
startupServer(ServerKeyStore keyStore,
BootstrapConfig config,
java.lang.String host,
int port)
Startup the embedded server using the server's key store to build the web server SSL
context.
|
private boolean |
updateCachedWidgetBounds(int windowId,
Widget widget)
Updates the cached widgets bounds and returns true iff the cached widgets bounds has been
updated.
|
void |
waitInitialization()
Wait for the page to notify that it has fully initialized its JS code.
|
void |
windowActivated(int deactivatingWindowId,
int activatingWindowId)
Raise an event indicating that the target window has been activated or deactivated.
|
void |
windowIconified(int windowId,
boolean state)
Raise an event as the window was (de)iconified.
|
clear, createGreyImage, createIcon, createImage, createOutputManager, deiconifyWindow, deregisterTooltipWorkers, deregisterWindow, draw, draw, draw3DRect, drawFromOrigin, drawHighlight, drawImage, drawLine, drawParagraph, drawRect, drawRoundRect, drawSelection, drawString, drawStringCentered, drawStringCentered, drawStringScaled, drawStringWithMnemonic, endBatch, fill3DRect, fillPolygon, fillRect, fillRoundRect, flush, getBgColor, getBgStdColor, getChildProcessFactory, getDisplayBounds, getDisplayWorkArea, getFgColor, getFgStdColor, getFontHeight, getFontMaxWidth, getFontWidth, getFontWidths, getParagraphHeight, getSysColor, getTextHeight, getTextMetrics, getTextWidth, getTextWidths, getWindowDimension, getWindowLocation, handleMouseEvent, hasWindowEmulator, iconifyWindow, isEmptyText, isIconified, isWindowVisible, listenAnyMouseEvent, makeImage, registerChildWindow, registerDirectManipulation, registerPendingTooltipWorkers, registerTooltipWorker, registerWidgetPopup, registerWindow, releaseWindow, resetComposite, resetMode, resizeWindow, resolveTextMetrics, restoreDrawingState, resume, saveDrawingState, scaleFont, selectWindow, setColor, setColor, setCursorStatus, setDesktopBgColor, setDrawingArea, setDrawingAreas, setFontStyle, setGuiFont, setIcon, setLineStroke, setLineStroke, setStatusText, setStatusText, setTextMetrics, setTitle, setWindowBounds, setWindowEnabled, setWindowLocation, setWindowVisible, setXORComposite, setXORMode, stackWindows, startBatch, suspend, translatePop, translatePush
getFactory, getPrimitives, getWindowSystem, inBackgroundMode, inBatchMode, isChui, setBackgroundMode, setBatchMode, setTerminalType, terminalType
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setCursor, withSelectedWindow
getFactory, getPrimitives, getWindowSystem, inBackgroundMode, inBatchMode, isChui, setTerminalType, terminalType
public static final int TASKBAR_HEIGHT
private static final java.util.logging.Logger LOG
private static final java.lang.String MAIN_TARGET
private static final java.lang.String WELCOME_PAGE
private static final java.awt.Component BOGUS_AWT_COMPONENT
private static final java.util.Set<java.lang.Integer> HOVER_ACTIONS
private BootstrapConfig config
private EmbeddedWebServerImpl websrv
private GuiWebSocket websock
private java.lang.Object lock
private NativeDimension desktop
private NativeDimension workarea
private VirtualScreen virtualScreen
private final java.util.Map<java.util.List<java.lang.Integer>,java.lang.Integer> imageSeals
private final java.util.Map<java.util.List<java.lang.Integer>,java.util.Set<java.lang.Integer>> imageUsages
private final java.util.Map<java.lang.Integer,java.util.Set<java.util.List<java.lang.Integer>>> ownedImages
private java.util.Map<java.lang.Integer,FontMetricsHelper> fontMetricsCache
private int nextFontId
private java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,java.util.Set<java.lang.Integer>>> lastMouseWidgets
private java.util.Map<java.lang.Integer,java.util.Set<java.lang.Integer>> lastAnyWidgets
private java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,NativeRectangle>> widgetsRegions
private java.util.LinkedList<GuiWebEmulatedWindow> repaints
GuiWebDriver.RepaintThread
thread.private int activeWindowId
private final boolean embedded
private boolean taskbar
public GuiWebDriver(BootstrapConfig config)
config
- The BootstrapConfig
configuration.public void init()
init
in interface ScreenDriver<GuiOutputManager>
init
in class AbstractDriver<GuiPrimitives,GuiOutputManager>
public void clientReady()
clientReady
in interface ScreenDriver<GuiOutputManager>
public void initRemoteClient()
Whenever the main page is loaded or re-loaded, the WebSocket will connect and we must put the virtual terminal into a known state.
initRemoteClient
in interface ClientProtocolHooks
public void waitInitialization()
waitInitialization
in interface EmbeddedWebServer
public UnformattedPayload remoteCall(UnformattedPayload request)
This API is expected to block waiting for a response.
remoteCall
in interface EmbeddedClient
request
- The request data incoming from 4GL.public void publish(long subId, java.lang.String event, java.lang.String[] param)
publish
in interface EmbeddedClient
subId
- The subscriber's ID, known by the remote application.event
- The published event name.param
- The parameters for this event.public void injectVT100Key(int keyCode, char charCode)
injectVT100Key
in interface ClientProtocolHooks
keyCode
- The key code from the input event.charCode
- The character code from the input event.public NativeRectangle getDisplayBounds()
public VirtualScreen getVirtualScreen()
public boolean addImageUsage(java.util.List<java.lang.Integer> imageHash, int windowId)
imageHash
- The image hash id.windowId
- The window id.public java.util.Set<java.lang.Integer> removeUnusedImages(int windowId)
windowId
- The window id.public void mapSealToUniqueId(java.util.List<java.lang.Integer> imageSeal, java.lang.Integer uniqueId)
imageSeal
- The image identity array.uniqueId
- The image unique id.public java.lang.Integer getUniqueIdForSeal(java.util.List<java.lang.Integer> imageSeal)
imageSeal
- The image identity array.public NativeRectangle getDisplayWorkArea()
public void beep()
beep
in interface ScreenDriver<GuiOutputManager>
public int readKey()
readKey
in interface ScreenDriver<GuiOutputManager>
public EmulatedWindowState newEmulator(int windowId)
newEmulator
in class AbstractGuiDriver<java.lang.Integer>
windowId
- The window ID.public EmulatedWindowState newChildWindowEmulator(int windowId, EmulatedWindowState parentWindow, java.lang.String windowTitle, boolean resizable, boolean isShareActivationWithOwner, boolean modal)
newChildWindowEmulator
in class AbstractGuiDriver<java.lang.Integer>
windowId
- The window ID.parentWindow
- The parent window.windowTitle
- Title of the window emulator.resizable
- true
if the window is resizable.isShareActivationWithOwner
- Indicates whether the window shares activation state with its owner.modal
- true
if this is a modal window.public FontDetails<java.lang.Integer> createFont(FontDetails<java.lang.Integer> details)
createFont
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
details
- The font specifications.public void deriveFont(FontDetails<java.lang.Integer> fd)
deriveFont
in class AbstractGuiDriver<java.lang.Integer>
fd
- Font to scale. This instance's contained font will be modified.public int getScreenResolution()
getScreenResolution
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
public void copyToClipboard(java.lang.String txt)
copyToClipboard
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
txt
- The text to be copied.public java.lang.String clipboardContents()
clipboardContents
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
public void restackWindows(int[] windowIds)
restackWindows
in class AbstractGuiDriver<java.lang.Integer>
windowIds
- The stack order to be enforced.public void moveToTop(int windowId, boolean focus)
moveToTop
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
moveToTop
in class AbstractGuiDriver<java.lang.Integer>
windowId
- The window to be moved.focus
- If true
, the window will become the focused window
and its state changed to active.public void moveToBottom(int windowId)
moveToBottom
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
moveToBottom
in class AbstractGuiDriver<java.lang.Integer>
windowId
- The window to be moved.public void shutdown()
shutdown
in interface ScreenDriver<GuiOutputManager>
shutdown
in class AbstractGuiDriver<java.lang.Integer>
public java.lang.String startupServer(ServerKeyStore keyStore, BootstrapConfig config, java.lang.String host, int port)
There are two page handlers. One is for the root ("/") target and the other is for the index ("/index.html") target. Both load the same page index.html.
When the user is first redirected the URL is https://server:port/
and the
target is "/". The index.html page is loaded for this target.
After redirection and the main page is loaded, the URL in the browser address bar will
become https://server:port/index.html
and the corresponding target is now
"/index.html".
When the user reloads the main page within the browser environment the "/index.html" target is sent to the web server and the same main page index.html is loaded.
startupServer
in interface EmbeddedWebServer
keyStore
- The exported server KeyStore.config
- Client configuration.port
- An explicit port to start the web server or 0 to let the OS assign one.host
- An explicit host to start the web server or null
to use the server's
host.public void shutdownServer()
shutdownServer
in interface EmbeddedWebServer
public java.lang.String getServerURI()
getServerURI
in interface EmbeddedWebServer
public boolean captureMouseEvents(boolean state)
It also notifies the JS side to enable/disable mouse events.
captureMouseEvents
in interface ScreenDriver<GuiOutputManager>
captureMouseEvents
in class AbstractGuiDriver<java.lang.Integer>
state
- true
to capture mouse events, false
to ignore them.public void raiseMouseEvent(int windowId, int mouseOp, long tstamp, int mouseX, int mouseY, int button, int clickCount, int modifiersMask, int[] wheelParameters, int widgetId)
raiseMouseEvent
in interface ClientProtocolHooks
windowId
- The window ID.mouseOp
- The mouse event code.tstamp
- The event timestamp.mouseX
- The absolute mouse X for this event.mouseY
- The absolute mouse Y for this event.button
- The button which was pressed.clickCount
- The click count.modifiersMask
- The bit mask that represents the modifiers keys are pressed. The 0-bit corresponds
to the shift key, the 1-bit to the ctrl key, the 2-bit to the meta key and
the 3-bit to the alt key.wheelParameters
- The array that represents the wheel rotation amount and its unit.widgetId
- The explicit widget ID to which this event needs to be posted.private int getMouseModifiers(int button, int modifiersMask)
button
- The mouse button that is currently pressedmodifiersMask
- The bit mask that represents the modifiers keys are pressed. The 0-bit corresponds
to the shift key, the 1-bit to the ctrl key, the 2-bit to the meta key and
the 3-bit to the alt key.public void setWindowLocation(int windowId, int x, int y)
setWindowLocation
in interface ClientProtocolHooks
windowId
- The window ID.x
- The X coordinate of the top-left corner.y
- The Y coordinate of the top-left corner.public void setWindowDimension(int windowId, int width, int height)
setWindowDimension
in interface ClientProtocolHooks
windowId
- The window ID.width
- The window width.height
- The window height.public void windowActivated(int deactivatingWindowId, int activatingWindowId)
windowActivated
in interface ClientProtocolHooks
deactivatingWindowId
- Id of the window being deactivated, may be negative.activatingWindowId
- Id of the window being activated, always valid.public void windowIconified(int windowId, boolean state)
windowIconified
in interface ClientProtocolHooks
windowId
- The window ID.state
- true
if the window was iconified.public void registerMouseWidgets()
To register a widget, it must be visible, displayed and enabled, and part of a visible window.
registerMouseWidgets
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
registerMouseWidgets
in class AbstractGuiDriver<java.lang.Integer>
public int[][] parseEditorContent(int widgetId, int windowId, int maxWidth, java.lang.String text, int delta, FontDetails<java.lang.Integer> font)
delta
parameter represents the start position of this text, in the editor's
content; when the full content is parsed, this will be zero.parseEditorContent
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
widgetId
- The editor's ID.windowId
- The editor's window ID.maxWidth
- The width for the content to fit (the editor's editable area).text
- The text to split into lines.delta
- The start position of this text in the editor's full content.font
- The editor's font.public void resetSelection()
resetSelection
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
private boolean updateCachedWidgetBounds(int windowId, Widget widget)
windowId
- The target window id.widget
- The target widget with its cached bounds.private java.util.Set<java.lang.Integer> getWebActions(Widget widget)
widget
- The collected mouse widget.private boolean isInLastMouseWidgets(java.lang.Integer widgetId, java.lang.Integer windowId)
widgetId
- The widget id.windowId
- The window id.private boolean isInLastAnyWidgets(java.lang.Integer widgetId, java.lang.Integer windowId)
widgetId
- The widget id.windowId
- The window id.public void registerMoveableWidget(int wid)
This is a no-op for the web client: the work is done by registerMouseWidgets()
.
registerMoveableWidget
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
wid
- The widget ID.public void registerHoverableWidget(MouseHoverAction action)
This is a no-op for the web client: the work is done by registerMouseWidgets()
.
registerHoverableWidget
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
action
- The widget mouse action.public void propagateWaitState(boolean isWaitState)
propagateWaitState
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
isWaitState
- wait statepublic void registerResizeableWidget(int wid)
This is a no-op for the web client: the work is done by registerMouseWidgets()
.
registerResizeableWidget
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
wid
- The widget ID.public void deregisterWidget(int wid)
deregisterWidget
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
deregisterWidget
in class AbstractGuiDriver<java.lang.Integer>
wid
- The widget ID.public void setResizeableWindow(boolean resize, int minWidth, int minHeight, int maxWidth, int maxHeight)
setResizeableWindow
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
resize
- Flag indicating if the window can be resized or not.minWidth
- The window's minimum width.minHeight
- The window's minimum height.maxWidth
- The window's maximum width.maxHeight
- The window's maximum height.public void openURL(java.lang.String path)
openURL
in interface ScreenDriver<GuiOutputManager>
path
- The url path to the target resource.protected FontMetricsHelper resolveFontMetrics(int font)
font
- The font identifier, on the js-side font table.protected void postRepaint(GuiWebEmulatedWindow ews)
repaints
queue. This will
be processed by the GuiWebDriver.RepaintThread
.ews
- The window requiring repaint.private void collectWidgets(Widget w, java.util.function.Predicate<Widget> filter, java.util.function.Consumer<Widget> actionsCollector)
w
- The parent widget.filter
- The condition predicate that must be evaluated for collected widgets.actionsCollector
- Collects a widget's action if the target is selected by the filter condition.private java.lang.String getWelcomePageUrl(java.lang.String pageContext, java.lang.String pageFile)
pageContext
- Page context root.pageFile
- Main page HTML file.private boolean isInsideVisibleFrameOrStandalone(Widget wid)
wid
- Widget to check.TRUE
if the widget is inside visible frame or standalone,
FALSE
otherwise.public void setCurrentSelection(java.lang.String txt)
setCurrentSelection
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
txt
- The current editors selection.public MousePtrWrapper createMousePointer(byte[] data, java.lang.String ptrName)
createMousePointer
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
data
- cursor dataptrName
- pointer namenull
public void lockMousePointer(int widgetId, MousePtrWrapper ptr)
lockMousePointer
in interface ScreenDriver<GuiOutputManager>
widgetId
- the id of the active DropDown which caused the pointer lock or -1ptr
- the locked mouse pointer or null
for unlockpublic void propagate(int windowId, int wid, MousePtrWrapper ptr)
propagate
in interface ScreenDriver<GuiOutputManager>
windowId
- to level window idwid
- widgetIdptr
- mouse pointerpublic boolean isFontInstalled(java.lang.String fontName)
isFontInstalled
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
fontName
- The target font name.public void enableEvents(int[] windowIds, boolean capture)
enableEvents
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
enableEvents
in class AbstractGuiDriver<java.lang.Integer>
windowIds
- The window IDs which need to be processed.capture
- Flag indicating OS level events are captured (when true
).public boolean isWindowDecorationSupported()
isWindowDecorationSupported
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
public boolean isEmbeddedClient()
isEmbeddedClient
in interface EmbeddedClient
public int[][] getTextWidths(java.lang.String[] texts, FontDetails<java.lang.Integer> fd)
getTextWidths
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
getTextWidths
in class AbstractGuiDriver<java.lang.Integer>
texts
- The texts.fd
- The font details used to draw and measure the text.