public class GuiWebDriver extends AbstractGuiDriver<java.lang.Integer> implements EmbeddedWebServer, ClientProtocolHooks, EmbeddedClient, DocumentOutputStorage, FileUploadStorage, WebClientConstants, HttpConfigurationConstants
Modifier and Type | Class and Description |
---|---|
private class |
GuiWebDriver.RepaintThread
Dedicated thread responsible of processing repaint requests.
|
AbstractGuiDriver.TextMetrics, AbstractGuiDriver.Uri
Modifier and Type | Field and Description |
---|---|
private int |
activeWindowId
The active window.
|
private java.util.Map<java.lang.Integer,java.util.List<MsgBlasterPeer>> |
blasterListeners
The set of listened widgetId.
|
private static java.awt.Component |
BOGUS_AWT_COMPONENT
A bogus AWT component used to raise mouse events, on notification from the JS code.
|
private NativeDimension |
desktop
Desktop bounds.
|
private java.util.Map<java.util.UUID,DocumentOutput> |
documentOutputs
Map of document outputs pending to be sent to the Javascript part of the client.
|
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 double[] |
fontScaleX
A cache of font scaling factors, by their remote font ID.
|
private static int[] |
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>,org.roaringbitmap.RoaringBitmap> |
imageUsages
Image usages is a mapping of an image loaded by a client to its owner windows.
|
private SupplierWithMemo<KeyboardLayoutsSettings> |
keyboardSupplier
The provider of keyboard layouts settings
|
private java.util.Map<java.lang.Integer,java.util.Map<java.lang.Integer,org.roaringbitmap.RoaringBitmap>> |
lastMouseWidgets
A map with the last widgets sent to the JS side in [ windowid : [widgetId : actions] ]
form.
|
private FontDetails<java.lang.Integer> |
lastUsedFont
The last font set.
|
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 static long |
MAX_PRINT_OUTPUT_AGE
Max age of print outputs in milliseconds.
|
private boolean |
needsNotificationOnWait
The notify-user-input state.
|
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 boolean |
registerMouseWidgets
Flag indicating if
registerMouseWidgets() must be executed. |
private java.util.LinkedList<GuiWebEmulatedWindow> |
repaints
A queue of pending repaint requests which needs to be processed by the
GuiWebDriver.RepaintThread thread. |
private org.roaringbitmap.RoaringBitmap |
stateChanged
Set of widget IDs for which their state has changed.
|
private boolean |
taskbar
Flag indicating if the virtual desktop taskbar is shown.
|
static int |
TASKBAR_HEIGHT
Taskbar height in pixels when it exists.
|
private TaskBarStyle |
taskBarStyle
The task bar style on the virtual desktop
|
private static java.lang.String |
TEXT_SAMPLE
Text sample to calculate scaling factor for variable size fonts.
|
private static java.lang.String |
TEXT_SAMPLE_MONO
Text sample to calculate scaling factor for monospace fonts.
|
private java.util.HashMap<java.lang.Integer,FileUploadInfo> |
uploads
Active uploads
|
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.
|
config, control, driverWidgets, ews, tmpDir, translatedOrigin
direct, factory
CONNECTION_RESTORED_MESSAGE, DELAY_BETWEEN_CONNECT_TRIES, DELAY_BETWEEN_PING_TRIES, DIRECTORY_NODE_ID, ENABLE_DEBUG_LOGGING, MAX_BINARY_MESSAGE_SIZE, MAX_LOST_PINGS, MAX_TEXT_MESSAGE_SIZE, MAX_WEB_SOCKET_IDLE_TIMEOUT, PING_PONG_INTERVAL, SERVER_UNAVAILABLE_MESSAGE, TRY_TO_CONNECT_MESSAGE, WATCH_DOG_TIMEOUT
MAX_HTTP_IDLE_TIMEOUT, OUTPUT_AGGREGATION_SIZE, OUTPUT_BUFFER_SIZE, REQUEST_HEADER_SIZE, RESPONSE_HEADER_SIZE
Constructor and Description |
---|
GuiWebDriver(BootstrapConfig config)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addHandler(org.eclipse.jetty.server.Handler handler)
Adds a custom handler.
|
boolean |
addImageUsage(java.util.List<java.lang.Integer> imageHash,
int windowId)
Register a usage of the given image by the given window.
|
void |
addMessageListener(MsgBlasterPeer listener,
int windowId,
int widgetId)
Add a low-level message listener for a specific window.
|
void |
beep()
Provide an audible feedback to user by generating a beep signal.
|
void |
cacheTextMetrics(java.util.Map<FontDetails<java.lang.Integer>,java.util.Set<java.lang.String>> texts,
java.lang.Integer windowId)
Get and cache metrics for the given texts.
|
boolean |
captureMouseEvents(boolean state)
Enable or disable capture of mouse events.
|
ChooseFileResult |
chooseFiles(java.lang.String title,
boolean multiple,
boolean upload,
java.lang.String uploadDir,
java.lang.String[] filters)
Supported by web-based drivers.
|
void |
clearMessages(int windowId)
Clear all message texts of specified window.
|
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(java.io.InputStream data,
java.lang.String ptrName)
Load mouse pointer from the InputStream
|
<T extends DriverWidget> |
createWidget(java.lang.Class<T> widgetClass,
int widgetId)
Create a driver-implemented widget.
|
void |
createWidget(java.lang.String type,
int widgetId)
Create a driver-implemented widget.
|
void |
deliverDocumentOutput(java.util.function.Consumer<java.io.OutputStream> consumer,
java.lang.Runnable finalizer,
MediaType format,
java.lang.String uuid,
boolean promptUser)
The method delivers document output to the client.
|
DocumentOutput |
dequeueDocumentOutput(java.lang.String id)
Returns the document outputs previously enqueued with
enqueueDocumentOutput(String, DocumentOutput) . |
void |
deregisterWidget(int wid)
Deregister the specified widget for mouse events.
|
void |
deriveFont(FontDetails<java.lang.Integer> fd)
Scale the given font to match the screen resolution.
|
void |
desktopResized(int width,
int height,
boolean taskBarFloat)
Called when the desktop on the client has changed its dimensions.
|
void |
doTextShift(java.lang.String text,
int widthHint)
Draws the cursor for the given text widget.
|
void |
drawCursor(LightweightTextWidget widget)
Draws the cursor for the given text widget.
|
void |
drawString(java.lang.String text,
int x,
int y)
Draw a string at the specified location.
|
void |
drawStringCentered(java.lang.String text,
int x,
int height)
Draw a string at the specified location.
|
void |
enableEvents(int[] windowIds,
boolean capture)
Enable or Disable OS-level events for the specified windows.
|
void |
enqueueDocumentOutput(java.lang.String id,
DocumentOutput docOutput)
The method stores document outputs pending to be sent to the Javascript part of FWD client.
|
void |
fillRectAroundText(int x,
int y,
int textWidthHint,
int textHeightHint,
java.lang.String text)
Fill a rectangle around the given text.
|
int[] |
getBasicWebPalette()
Queries the web driver for a basic palette.
|
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.
|
FileUploadInfo |
getFileUpload(int id)
Returns file upload metadata.
|
long |
getHostByName(java.lang.String name)
Returns the currently connected client's machine name for session.
|
java.lang.String |
getHostName()
Returns the currently connected client's machine name for session.
|
private int |
getMouseModifiers(int button,
int modifiersMask)
Gets the mouse modifiers mask for this event.
|
NativePoint |
getMousePosition()
Returns current mouse cursor display position relative to the display origin.
|
int |
getScreenResolution()
Reports the screen resolution in dots per inch (DPI).
|
java.lang.String |
getServerURI()
Get the embedded web server's URI.
|
int |
getTextWidth(java.lang.String text,
FontDetails<java.lang.Integer> fd)
Get the width of the specified text, using the given font.
|
int[] |
getTextWidths(java.lang.String text,
FontDetails<java.lang.Integer> fd)
Get the widths of the specified text, using the given font.
|
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.
|
NativeDimension |
getVirtualScreenSize()
Returns the size of the virtual screen, i.e.
|
private org.roaringbitmap.RoaringBitmap |
getWebActions(Widget widget)
Returns the set of mouse actions handled by this widget.
|
void |
init()
Initialize driver.
|
void |
initClipboardSoftPaste()
Init widget generated PASTE command from the OS clipboard.
|
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,
boolean boldFont,
boolean webScale)
Returns the boolean value if the target font is installed or not.
|
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 |
isWeb()
All web-based drivers return
true . |
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 |
lowLevelEvent(int widgetId,
int winId,
int messageId,
int p1,
int p2,
int p3)
Sends a notification of a low-level event for a listening widget.
|
void |
lowLevelMouseEvent(java.awt.event.MouseEvent evt,
MouseOps mop,
int windowId)
Sends a notification of a low-level mouse event for a listening widget.
|
void |
mapSealToUniqueId(java.util.List<java.lang.Integer> imageSeal,
java.lang.Integer uniqueId)
Maps the image identity array to the unique image id.
|
private java.lang.String |
mimeType(java.lang.String icon)
Detect MIME type of image.
|
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.
|
boolean |
needsExplicitTextMetricsCaching()
Returns
true if getting actual text metrics is an expensive operation for this
driver and you want to manually manage metrics cache using
GuiDriver.cacheTextMetrics(Map, Integer) . |
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,
boolean showInTaskbar)
Create a new window emulator.
|
void |
notifyWait()
The method is called when the 4GL program execution enters a modal or wait-for event loop, in other
words when user input is expected.
|
void |
openMimeResource(boolean deleteContent,
java.lang.String mimeType,
java.lang.String uriString,
boolean embedded)
Opens the specified 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 |
putFileUpload(int id,
FileUploadInfo uploadInfo)
The method stores an instance with file upload metadata.
|
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.
|
KeyCode |
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.
|
void |
removeFileUpload(int id)
Removes metadata for a particular upload.
|
void |
removeHandler(org.eclipse.jetty.server.Handler handler)
Removes the handler from the list of handlers.
|
void |
removeMessageListener(MsgBlasterPeer listener,
int windowId,
int widgetId)
Removes a low-level message listener for a specific window.
|
int[] |
removeUnusedImages(int windowId)
Returns all unused images.
|
void |
resetSelection()
Reset selection boxes painting mode and return to normal drawing mode.
|
(package private) java.lang.String |
resolveResourceId(boolean deleteContent,
java.lang.String mimeType,
ContentDisposition contentDisposition,
java.io.File originalFile)
Resolve the document ID used to retrieve the content of the original file.
|
(package private) java.lang.String |
resolveResourceId(boolean deleteContent,
java.lang.String mimeType,
ContentDisposition contentDisposition,
java.io.File originalFile,
java.util.function.BiConsumer<java.io.File,java.io.File> customCopy)
Resolve the document ID used to retrieve the content of the original file.
|
void |
restackWindows(int[] windowIds)
Force the list of all GUI windows to be stacked as in the specified order.
|
void |
saveDropTargetFile(java.lang.String name,
byte[] data,
int size)
Stores the given byte array date as file in Java temporary directory with the given name.
|
void |
saveDropTargetFile(java.lang.String name,
java.nio.channels.FileChannel channel,
int length)
Reads the data from the given file channel starting from its current position and stores
the retrieved data into the file in Java temporary directory with the given name.
|
void |
setControl(boolean control)
Notify the driver which side has control (client-side (when
true ) or server,
otherwise). |
void |
setCurrentSelection(java.lang.String txt)
Sets the current editors selection.
|
void |
setCursor(MousePtrWrapper ptr)
Set the mouse cursor
|
void |
setCursor(java.lang.String icon)
Set the mouse cursor from a given resource.
|
void |
setGuiFont(FontDetails<java.lang.Integer> font)
Set current font used on draw operations.
|
void |
setMessageText(int windowId,
java.lang.String[] message)
Add message texts of specified window.
|
void |
setNeedsNotificationOnWait(boolean newState)
The method is executed by the JS client when it requires to be notified when 4GL program execution
enters modal or wait-for event loop, in other words when user input is expected.
|
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 |
setStatusText(int windowId,
java.lang.String message)
Set status text message of specified window.
|
void |
setUploadFileSizeLimits(int single,
int total)
Setting up file size limits for cases when drag and drop needs file uploads from web client
to Java side.
|
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.
|
void |
startDirectManipulation(int opType,
boolean gridSnapOn,
int resizeDir,
NativeRectangle maxBounds,
NativeRectangle[] nr)
Uses websocket to notify the JS side the direct manipulation has started to draw the
selection box(es).
|
void |
startDropTarget(int windowId,
int widgetId,
java.util.List<java.lang.String> fileNameList)
Initiates the process of the file list dropping for web clients.
|
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 void |
syncDesktopDimensions()
Fetches the desktop dimension from the client and calls
updateDesktopDimensions(int, int) with the result. |
private boolean |
updateCachedWidgetBounds(int windowId,
Widget widget,
NativeRectangle[] widgetBounds)
Updates the cached widgets bounds and returns true iff the cached widgets bounds has been
updated.
|
private void |
updateDesktopDimensions(int width,
int height)
Updates the class state that relies on the client desktop dimensions.
|
void |
waitInitialization()
Wait for the page to notify that it has fully initialized its JS code.
|
void |
widgetStateChanged(int widgetId)
Notification that this widget's state has changed (visibility, sensitivity, z-order).
|
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.
|
private java.lang.String |
writeLauncherWrapper(java.lang.String uriString)
Create the wrapper for the launcher resource.
|
changeSensitivity, changeVisibility, clear, copyResource, copyResource, createGreyImage, createIcon, createImage, createMouseDirectManipulationInstance, createOutputManager, deiconifyWindow, deregisterTooltipWorkers, deregisterWindow, destroyWidget, draw, draw, draw3DRect, drawEdge, drawEllipse, drawFromOrigin, drawHighlight, drawIbeam, drawImage, drawLine, drawParagraph, drawRect, drawRoundRect, drawSelection, drawStringCentered, drawStringScaled, drawStringWithinBox, drawStringWithinBoxScaled, drawStringWithinBoxWithMnemonic, drawStringWithMnemonic, drawTextSelection, endBatch, fill3DRect, fillEllipse, fillPolygon, fillRect, fillRoundRect, fitStringWithEllipsis, getBgColor, getBgStdColor, getChildProcessFactory, getDisplayBounds, getDisplayWorkArea, getDriverWidget, getFgColor, getFgStdColor, getFontHeight, getFontMaxWidth, getFontWidth, getFontWidths, getParagraphHeight, getPrintOutputFile, getSubImage, getSysColor, getTextHeight, getTextMetrics, getTextWidths, getWindowDimension, getWindowLocation, handleMouseEvent, hasWindowEmulator, iconifyWindow, initDragAndDrop, invokeWidgetCommand, invokeWidgetCommand, isActualTextMetricsCached, isEmptyText, isWindowVisible, makeImage, moveResource, placeWidget, registerChildWindow, registerDirectManipulation, registerEmptySelector, registerPendingTooltipWorkers, registerTooltipWorker, registerWidgetPopup, registerWindow, releaseWindow, resetComposite, resetMode, resizeWindow, resolveTextMetrics, restoreDrawingState, resume, resume, saveDrawingState, scaleFont, selectWindow, setColor, setColor, setCursorStatus, setDesktopBgColor, setDisableRedraw, setDrawingArea, setDrawingAreas, setFontStyle, setIcon, setLineStroke, setLineStroke, setTextMetrics, setTitle, setWidgetAttribute, setWindowBounds, setWindowEnabled, setWindowLocation, setWindowVisible, setXORComposite, setXORMode, stackWindows, startBatch, suspend, suspend, translatePop, translatePush, updateClientMetrics
getClientStorage, getFactory, getPrimitives, getWindowSystem, inBackgroundMode, inBatchMode, isChui, setBackgroundMode, setBatchMode, setTerminalType, terminalType
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
setAlwaysOnTop, withSelectedWindow
getClientStorage, 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 int[] HOVER_ACTIONS
private static final long MAX_PRINT_OUTPUT_AGE
documentOutputs
form where it is later served to JS client. Print outputs are removed
from the map either upon successful delivery to the JS client or when the age extends over this value.private static final java.lang.String TEXT_SAMPLE
private static final java.lang.String TEXT_SAMPLE_MONO
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>,org.roaringbitmap.RoaringBitmap> 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,org.roaringbitmap.RoaringBitmap>> lastMouseWidgets
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
private TaskBarStyle taskBarStyle
private java.util.Map<java.util.UUID,DocumentOutput> documentOutputs
private volatile boolean needsNotificationOnWait
private boolean registerMouseWidgets
registerMouseWidgets()
must be executed. This is to minimize
the amount of calls, and is performed only when client-side receives control.private double[] fontScaleX
private org.roaringbitmap.RoaringBitmap stateChanged
private java.util.HashMap<java.lang.Integer,FileUploadInfo> uploads
private SupplierWithMemo<KeyboardLayoutsSettings> keyboardSupplier
private FontDetails<java.lang.Integer> lastUsedFont
private final java.util.Map<java.lang.Integer,java.util.List<MsgBlasterPeer>> blasterListeners
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 void addHandler(org.eclipse.jetty.server.Handler handler)
addHandler
in interface EmbeddedWebServer
handler
- The handler to add.public void removeHandler(org.eclipse.jetty.server.Handler handler)
removeHandler
in interface EmbeddedWebServer
handler
- The handler to remove.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 setStatusText(int windowId, java.lang.String message)
setStatusText
in interface EmbeddedClient
windowId
- Window ID.message
- Text message.public void setMessageText(int windowId, java.lang.String[] message)
setMessageText
in interface EmbeddedClient
windowId
- Window ID.message
- Text message.public void clearMessages(int windowId)
clearMessages
in interface EmbeddedClient
windowId
- Window ID.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 int[] 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 KeyCode readKey()
readKey
in interface ScreenDriver<GuiOutputManager>
null
if no keys were pressed since last call.public java.lang.String getHostName()
getHostName
in interface ScreenDriver<GuiOutputManager>
getHostName
in class AbstractDriver<GuiPrimitives,GuiOutputManager>
public long getHostByName(java.lang.String name)
getHostByName
in interface ScreenDriver<GuiOutputManager>
getHostByName
in class AbstractDriver<GuiPrimitives,GuiOutputManager>
name
- The name of the host to get IP.public EmulatedWindowState newEmulator(int windowId, boolean showInTaskbar)
The method ignores the alwaysOnTop flag.
newEmulator
in class AbstractGuiDriver<java.lang.Integer>
windowId
- The window ID.showInTaskbar
- If set to true
the window will be shown in the virtual desktop's taskbar.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 initClipboardSoftPaste()
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.public void startDropTarget(int windowId, int widgetId, java.util.List<java.lang.String> fileNameList)
startDropTarget
in interface ClientProtocolHooks
windowId
- The window ID.widgetId
- The widget ID.fileNameList
- The oredered file name list to be dropped.public void saveDropTargetFile(java.lang.String name, byte[] data, int size)
saveDropTargetFile
in interface ClientProtocolHooks
name
- The file name to create.data
- The data to store in the file.size
- The size of the to create, used to check the input array.public void saveDropTargetFile(java.lang.String name, java.nio.channels.FileChannel channel, int length)
saveDropTargetFile
in interface ClientProtocolHooks
name
- The file name to createchannel
- The file channellength
- The length of the contentpublic void startDirectManipulation(int opType, boolean gridSnapOn, int resizeDir, NativeRectangle maxBounds, NativeRectangle[] nr)
opType
- The operation type.gridSnapOn
- The flag indicating the grid snap is turned on.resizeDir
- The widget resize direction for respective operation or -1
if not
used.maxBounds
- The bounds that must not be exceeded when direct manipulating the widgets.nr
- The array of the rectangle coordinates.public void putFileUpload(int id, FileUploadInfo uploadInfo)
putFileUpload
in interface FileUploadStorage
id
- Upload id.uploadInfo
- The object that encapsulates the upload metadata.public FileUploadInfo getFileUpload(int id)
getFileUpload
in interface FileUploadStorage
id
- Upload id.public void removeFileUpload(int id)
removeFileUpload
in interface FileUploadStorage
id
- Id of the upload metadata to remove.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 desktopResized(int width, int height, boolean taskBarFloat)
desktopResized
in interface ClientProtocolHooks
width
- New desktop width.height
- New desktop height.taskBarFloat
- Flag indicating if the task bar is in floating mode.public void setControl(boolean control)
true
) or server,
otherwise).
When control is received, registerMouseWidgets()
is enabled.
setControl
in interface ScreenDriver<GuiOutputManager>
setControl
in class AbstractGuiDriver<java.lang.Integer>
control
- Flag indicating (when true
) that the client-side has control.public void widgetStateChanged(int widgetId)
widgetStateChanged
in interface ScreenDriver<GuiOutputManager>
public void registerMouseWidgets()
To register a widget, it must be visible, displayed and enabled, and part of a visible window.
This method is executed only when registerMouseWidgets
flag is set
(via setControl(boolean)
). Once executed, it disables this flag.
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>
public void setUploadFileSizeLimits(int single, int total)
setUploadFileSizeLimits
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
single
- Single file size limit.total
- Total file size limit for single operation.private boolean updateCachedWidgetBounds(int windowId, Widget widget, NativeRectangle[] widgetBounds)
windowId
- The target window id.widget
- The target widget with its cached bounds.widgetBounds
- On index 0, the computed bounds will be saved.private org.roaringbitmap.RoaringBitmap 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.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 enqueueDocumentOutput(java.lang.String id, DocumentOutput docOutput)
Before the supplied print output is inserted into the storage, the method removes all outputs
older than MAX_PRINT_OUTPUT_AGE
. The actual age is calculated from the current time
stamp and the time stamp of the document output when enqueued.
enqueueDocumentOutput
in interface DocumentOutputStorage
id
- Id of the document output.docOutput
- The object that encapsulates the document output being enqueued.public DocumentOutput dequeueDocumentOutput(java.lang.String id)
enqueueDocumentOutput(String, DocumentOutput)
.
The returned entry is removed from the storage before it is returned to the caller.dequeueDocumentOutput
in interface DocumentOutputStorage
id
- Id of the document output.null
when the id is invalid or doesn't
represent a previously enqueued document output.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 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(java.io.InputStream data, java.lang.String ptrName)
createMousePointer
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
data
- cursor dataptrName
- pointer namenull
public void setCursor(MousePtrWrapper ptr)
public void setCursor(java.lang.String icon)
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, boolean boldFont, boolean webScale)
isFontInstalled
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
fontName
- The target font name.boldFont
- Indicates that the bold font is queried.webScale
- Check if the installed font should be ready for web scaling.
That is, the font should be installed on the Web client and
locally in order to compute the metrics.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 NativeDimension getVirtualScreenSize()
getVirtualScreenSize
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
public boolean isWindowDecorationSupported()
isWindowDecorationSupported
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
public boolean isEmbeddedClient()
isEmbeddedClient
in interface EmbeddedClient
public NativePoint getMousePosition()
getMousePosition
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
null
public int[] getTextWidths(java.lang.String text, FontDetails<java.lang.Integer> fd)
getTextWidths
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
getTextWidths
in class AbstractGuiDriver<java.lang.Integer>
text
- The text.fd
- The font details used to draw and measure the text.public int getTextWidth(java.lang.String text, FontDetails<java.lang.Integer> fd)
getTextWidth
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
getTextWidth
in class AbstractGuiDriver<java.lang.Integer>
text
- The text.fd
- The font details used to draw and measure the text.public void setGuiFont(FontDetails<java.lang.Integer> font)
setGuiFont
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
setGuiFont
in class AbstractGuiDriver<java.lang.Integer>
font
- Drawing font.public void drawString(java.lang.String text, int x, int y)
drawString
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
drawString
in class AbstractGuiDriver<java.lang.Integer>
text
- text string to draw.x
- left position.y
- top position.public void drawStringCentered(java.lang.String text, int x, int height)
drawStringCentered
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
drawStringCentered
in class AbstractGuiDriver<java.lang.Integer>
text
- text string to draw.x
- left position.height
- the height to center on.public void drawCursor(LightweightTextWidget widget)
drawCursor
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
drawCursor
in class AbstractGuiDriver<java.lang.Integer>
widget
- The text widgetpublic void doTextShift(java.lang.String text, int widthHint)
doTextShift
in class AbstractGuiDriver<java.lang.Integer>
text
- The text widgetwidthHint
- The text hint widthpublic void fillRectAroundText(int x, int y, int textWidthHint, int textHeightHint, java.lang.String text)
fillRectAroundText
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
fillRectAroundText
in class AbstractGuiDriver<java.lang.Integer>
x
- The text left positiony
- The text top positiontextWidthHint
- The text hint widthtextHeightHint
- The text hint heighttext
- The given textpublic void deliverDocumentOutput(java.util.function.Consumer<java.io.OutputStream> consumer, java.lang.Runnable finalizer, MediaType format, java.lang.String uuid, boolean promptUser)
This implementation stores the provided consumer with
enqueueDocumentOutput(String, DocumentOutput)
and notifies the JavaScript part
to download the document output. The document output is identified with a random UUID
generated by this method.
deliverDocumentOutput
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
consumer
- Output consumer, must not be null. See above.finalizer
- Finalizer callback, may be null. See above.format
- Report output format.uuid
- Unique id of the operation.promptUser
- if true
the user is eventually prompted for a name for the output file,
otherwise a name is picked automatically if needed.public void openMimeResource(boolean deleteContent, java.lang.String mimeType, java.lang.String uriString, boolean embedded) throws java.net.URISyntaxException
openMimeResource
in interface ScreenDriver<GuiOutputManager>
deleteContent
- Indicates if the source content will be deleted after the document is loaded by
the client.mimeType
- The resource mime type.uriString
- The string presentation of the target resource.embedded
- The document is embedded in the template document.java.net.URISyntaxException
- If this string presentation of the target resource is not formatted strictly
according to to RFC2396 and cannot be converted to a URI.java.lang.RuntimeException
- For other IO errors during file operations.java.lang.String resolveResourceId(boolean deleteContent, java.lang.String mimeType, ContentDisposition contentDisposition, java.io.File originalFile)
deleteContent
- Indicates if the original file will be deleted after its content loaded by
the client.mimeType
- The mime type of the original file contentcontentDisposition
- The value of content-disposition http headeroriginalFile
- The original file to be loaded by the clientjava.lang.String resolveResourceId(boolean deleteContent, java.lang.String mimeType, ContentDisposition contentDisposition, java.io.File originalFile, java.util.function.BiConsumer<java.io.File,java.io.File> customCopy)
deleteContent
- Indicates if the original file will be deleted after its content loaded by
the client.mimeType
- The mime type of the original file contentcontentDisposition
- The value of content-disposition http headeroriginalFile
- The original file to be loaded by the clientcustomCopy
- Do a custom copy process. If this is null
, a simple byte-base copy is done.public void addMessageListener(MsgBlasterPeer listener, int windowId, int widgetId)
addMessageListener
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
listener
- The listener to be added.windowId
- The windows id.widgetId
- The widget's id.public void removeMessageListener(MsgBlasterPeer listener, int windowId, int widgetId)
removeMessageListener
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
listener
- The listener to be removed.windowId
- The windows id.widgetId
- The widget's id.public void lowLevelEvent(int widgetId, int winId, int messageId, int p1, int p2, int p3)
lowLevelEvent
in interface ClientProtocolHooks
widgetId
- The id of the widget that generated the event.winId
- The id of the parent window.messageId
- The id of the event.p1
- The first parameter of the event.p2
- The first parameter of the event.p3
- The first parameter of the event.public void lowLevelMouseEvent(java.awt.event.MouseEvent evt, MouseOps mop, int windowId)
evt
- The mouse event to send.mop
- The mouse operation type.windowId
- The ID of the target window.public void notifyWait()
notifyWait
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
public void setNeedsNotificationOnWait(boolean newState)
setNeedsNotificationOnWait
in interface ClientProtocolHooks
newState
- true
turns ON the notification while false
turns it OFF.public void cacheTextMetrics(java.util.Map<FontDetails<java.lang.Integer>,java.util.Set<java.lang.String>> texts, java.lang.Integer windowId)
cacheTextMetrics
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
cacheTextMetrics
in class AbstractGuiDriver<java.lang.Integer>
texts
- Map of texts for which metrics should be calculated, keyed by fonts which are used
for drawing specific texts.windowId
- ID of the parent window. Can be null
if there is no need to select a
window.public boolean needsExplicitTextMetricsCaching()
true
if getting actual text metrics is an expensive operation for this
driver and you want to manually manage metrics cache using
GuiDriver.cacheTextMetrics(Map, Integer)
.needsExplicitTextMetricsCaching
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
needsExplicitTextMetricsCaching
in class AbstractGuiDriver<java.lang.Integer>
private java.lang.String writeLauncherWrapper(java.lang.String uriString)
uriString
- The target resource.java.io.IOException
- For IO errors during file operations.private java.lang.String mimeType(java.lang.String icon)
icon
- Image file namenull
if not.private void syncDesktopDimensions()
updateDesktopDimensions(int, int)
with the result.private void updateDesktopDimensions(int width, int height)
width
- New desktop width.height
- New desktop height.public int[] getBasicWebPalette()
null
or incomplete can be returned.
The basic palette has five entries: BACKGROUND, FOREGROUND, NORMAL, HIGHLIGHTED and DISABLED
in that order.
The returned palette can contain null
values that will not overwrite the default
entries of the Theme
.
Additional entries will be ignored.getBasicWebPalette
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
public void createWidget(java.lang.String type, int widgetId)
createWidget
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
type
- The widget type, one of the LegacyResource
widget names.widgetId
- The widget ID to be set.public <T extends DriverWidget> void createWidget(java.lang.Class<T> widgetClass, int widgetId)
createWidget
in interface GuiDriver<java.lang.Integer,java.awt.image.BufferedImage>
widgetClass
- The widget class.widgetId
- The widget ID to be set.public boolean isWeb()
true
.isWeb
in interface ScreenDriver<GuiOutputManager>
public ChooseFileResult chooseFiles(java.lang.String title, boolean multiple, boolean upload, java.lang.String uploadDir, java.lang.String[] filters)
chooseFiles
in interface ScreenDriver<GuiOutputManager>
title
- Upload title.multiple
- true
to allow upload or selection of multiple files.upload
- When true
the selected files will be uploaded to the web server, when false
only the selected file names will be returned.uploadDir
- The directory on the web server the files will be uploaded to.filters
- Defines the file types the file input should accept. The first element denotes a filter name
and the next element defines a file specification expression.ChooseFileResult
instance.