public interface GuiDriver<F,I> extends ScreenDriver<GuiOutputManager>
Modifier and Type | Method and Description |
---|---|
java.lang.String |
clipboardContents()
Get the current contents from the OS clipboard.
|
void |
copyToClipboard(java.lang.String txt)
Copy the given text to the system clipboard.
|
FontDetails<F> |
createFont(FontDetails<F> details)
Create a font with the given details and register it with the driver.
|
ImageWrapper<I> |
createGreyImage(I imageIni)
Create a native grey image from the original initial image to be used for disabled control
states.
|
ImageWrapper<I> |
createIcon(byte[] byts,
boolean small)
Create a native icon from the raw bytes and return a generic wrapper that can be used
for operations.
|
MousePtrWrapper |
createMousePointer(byte[] data,
java.lang.String ptrName)
Load mouse pointer from the InputStream
|
void |
deiconifyWindow(int sourceId)
De-iconify the window.
|
void |
deregisterTooltipWorkers(int wid)
Deregister the tooltip workers already registered with mouse handler.
|
void |
deregisterWidget(int wid)
Deregister the specified widget for mouse events.
|
void |
deregisterWindow(int windowId)
Deregister a given window from the driver.
|
void |
draw(NativePoint origin,
NativeRectangle clip,
java.lang.Runnable core)
Execute a widget drawing bracket.
|
void |
draw(WidgetId id,
NativePoint origin,
NativeRectangle clip,
java.lang.Runnable core)
Execute a widget drawing bracket.
|
void |
draw3DRect(int x,
int y,
int width,
int height,
boolean raised)
Draws a 3-D highlighted outline of the specified rectangle.
|
void |
drawFromOrigin(NativePoint origin,
NativeRectangle clip,
java.lang.Runnable core)
Execute a widget drawing bracket.
|
void |
drawHighlight(int x,
int y,
int width,
int height,
ColorRgb color)
Draws a highlighted rectangular area of the specified color and bounds.
|
void |
drawImage(ImageWrapper<I> img,
int x,
int y,
int w,
int h,
int xoff,
int yoff,
boolean transparent,
boolean stretch,
boolean retain,
boolean convert3D)
Draw an image at the specified location.
|
void |
drawLine(int x1,
int y1,
int x2,
int y2)
Draws a line, using the current color, between the points
(x1, y1) and (x2, y2)
in this graphics context's coordinate system. |
void |
drawParagraph(java.lang.String text,
FontDetails<F> font,
int x,
int y,
int maxWidth)
Draws a multiline text (paragraph) at the supplied position and
with the specified font.
|
void |
drawRect(int x,
int y,
int width,
int height)
Draw a rectangle.
|
void |
drawRoundRect(int x,
int y,
int width,
int height,
int arcDiameter)
Draw a rounded rectangle.
|
void |
drawSelection(int x,
int y,
int width,
int height,
boolean clear)
Draw a selection box rectangular area with current color.
|
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 |
drawStringCentered(java.lang.String text,
int legacyWidth,
int legacyHeight,
int x,
int height)
Draw a string using the current font, which will be scaled so that the final string will
have the specified legacy width and height.
|
void |
drawStringScaled(java.lang.String text,
int legacyWidth,
int legacyHeight,
int x,
int y)
Draw a string using the current font, which will be scaled so that the final string will
have the specified legacy width and height.
|
void |
drawStringWithMnemonic(java.lang.String text,
NativePoint tp,
MnemonicInfo info,
GuiFontResolver gf,
AbstractWidget<GuiOutputManager> widget,
boolean centered)
Draw a string with a mnemonic.
|
void |
enableEvents(int[] windowIds,
boolean process)
Enable or Disable OS-level events for the specified windows.
|
void |
endBatch()
End a batch drawing routine.
|
void |
fill3DRect(int x,
int y,
int width,
int height,
boolean raised)
Paints a 3-D highlighted rectangle filled with the current color.
|
void |
fillPolygon(int[] xPoints,
int[] yPoints)
Fill polygon.
|
void |
fillRect(int x,
int y,
int width,
int height)
Fill a rectangle.
|
void |
fillRoundRect(int x,
int y,
int width,
int height,
int arcDiameter)
Fill a rounded rectangle.
|
void |
flush()
Force screen buffer draw.
|
ColorRgb |
getBgColor(int index)
Get BGCOLOR color.
|
ColorRgb |
getBgStdColor(java.lang.String stdColor)
Get background color for a standard color like NORMAL, INPUT or MESSAGES.
|
NativeRectangle |
getDisplayBounds(int windowId)
Returns bounds of a physical screen the passed in window is positioned on.
|
NativeRectangle |
getDisplayWorkArea(int windowId)
Returns an application-usable display area.
|
ColorRgb |
getFgColor(int index)
Get FGCOLOR color.
|
ColorRgb |
getFgStdColor(java.lang.String stdColor)
Get foreground color for a standard color like NORMAL, INPUT or MESSAGES.
|
int |
getFontHeight(FontDetails<F> font)
Get the height of the specified font.
|
int |
getFontMaxWidth(FontDetails<F> font)
Get the maximum font width, for the given font.
|
int |
getFontWidth(FontDetails<F> font)
Get the width of the specified font.
|
int[] |
getFontWidths(FontDetails<F> fd)
Report the advance widths of the first 256 characters in the font.
|
int |
getParagraphHeight(java.lang.String text,
FontDetails<F> font,
int maxWidth)
The method performs a layout operation on the supplied text and
returns the resulting paragraph height while maintaining the
supplied maximum width.
|
int |
getScreenResolution()
Reports the screen resolution in dots per inch (DPI).
|
ColorRgb |
getSysColor(int index)
Get a system color.
|
int |
getTextHeight(java.lang.String text,
FontDetails<F> font)
Get the height of the specified text, using the given font.
|
int |
getTextWidth(java.lang.String text,
FontDetails<F> font)
Get the width of the specified text, using the given font.
|
int[][] |
getTextWidths(java.lang.String[] texts,
FontDetails<F> font)
Get the widths of the specified texts, using the given font.
|
int[] |
getTextWidths(java.lang.String text,
FontDetails<F> font)
Get the widths of the specified text, using the given font.
|
NativeDimension |
getWindowDimension()
Get the physical window dimension, in pixel units.
|
NativePoint |
getWindowLocation()
Get the window location on screen.
|
boolean |
hasWindowEmulator(int windowId)
Check if window has an emulator for the given window id.
|
void |
iconifyWindow(int sourceId,
boolean postEvent)
Iconify the window.
|
boolean |
isFontInstalled(java.lang.String fontName)
Queries if the target font is installed.
|
boolean |
isIconified(int windowId)
Check if the specified window is iconified or not.
|
boolean |
isWindowDecorationSupported()
Returns true if a window can be decorated in this graphics environment, otherwise false.
|
boolean |
isWindowVisible()
Check if the currently selected window is visible.
|
void |
listenAnyMouseEvent(int id,
long when)
Notify the widget of any mouse events, generated after the given timestamp (in millis).
|
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.
|
default int[][] |
parseEditorContent(int widgetId,
int windowId,
int maxWidth,
java.lang.String text,
int delta,
FontDetails<F> font)
Split the text for a editor widget, so that it fits the specified maximum width.
|
default void |
propagateWaitState(boolean isWaitState)
Propagate wait state
|
void |
registerChildWindow(int ownerId,
int windowId,
java.lang.String windowTitle,
boolean resizable,
boolean isShareActivationWithOwner,
boolean modal)
Register new child window with the driver.
|
void |
registerDirectManipulation(Widget<GuiOutputManager> widget)
Register the specified widget as a container able to use direct manipulation via mouse.
|
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 driver.
|
void |
registerMoveableWidget(int wid)
Register the specified widget as a moveable widget, via mouse.
|
void |
registerPendingTooltipWorkers(int wid)
Register the tooltip workers if this process was dalayed with regular registration.
|
void |
registerResizeableWidget(int wid)
Register the specified widget as a resizeable widget, via mouse.
|
void |
registerTooltipWorker(Widget<GuiOutputManager> widget,
int font,
boolean now)
Register this widget as having tooltip functionality reacting on mouse entering and exiting
events.
|
void |
registerWidgetPopup(int wid,
int btn,
int pid)
Register the specified widget for popup events, via mouse.
|
void |
registerWindow(int windowId)
Register a new window with the driver.
|
void |
releaseWindow()
Release the last window used by the current thread.
|
void |
resetComposite()
Reset composite mode and return to normal drawing mode.
|
default void |
resetSelection()
Reset selection boxes painting mode and return to normal drawing mode.
|
void |
resizeWindow(int width,
int height)
Resize window.
|
void |
restoreDrawingState(java.lang.Object state)
Restore the drawing state to the specified state.
|
java.lang.Object |
saveDrawingState()
Save the current drawing state and release the drawing lock, so that other threads can
acquire it.
|
void |
scaleFont(FontDetails<F> font)
Scale the font so its width and height match the legacy values.
|
void |
selectWindow(int windowId)
On a GUI interface multiple windows could be created.
|
void |
setColor(java.awt.Color color)
Set current color used on draw operations.
|
void |
setColor(ColorRgb color)
Set current color used on draw operations.
|
void |
setCurrentSelection(java.lang.String txt)
Sets the current selection.
|
default void |
setCursor(MousePtrWrapper ptr)
Set the mouse cursor
|
void |
setDesktopBgColor(ColorRgb color)
Set the desktop background color.
|
void |
setDrawingArea(NativeRectangle bounds)
Limit the available drawing area to the specified boundaries.
|
void |
setDrawingAreas(java.util.Set<NativeRectangle> bounds)
Limit the available drawing area to the specified boundaries provided in the
bounds parameter. |
void |
setFontStyle(FontStyle style)
Set the style of the current font used on draw operations.
|
void |
setGuiFont(FontDetails<F> font)
Set current font used on draw operations.
|
void |
setIcon(ImageWrapper<I> icon,
int x,
int y,
int width,
int height,
int xoff,
int yoff,
boolean transparent,
boolean stretch,
boolean retain,
boolean convert3D)
Sets the image to the window to be displayed as the window icon representation
for the system task bar, the title window panel or the system tray icons panel.
|
void |
setLineStroke(LineStroke stroke)
Set the style of the current line drawing primitives.
|
void |
setLineStroke(LineStroke stroke,
float width)
Set the style of the current line drawing primitives.
|
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(java.lang.String message)
Set status text message of current window.
|
void |
setStatusText(Window<?> window,
java.lang.String message)
Set status text message of specified window.
|
void |
setTitle(java.lang.String title)
Set the window title at the OS level.
|
void |
setWindowBounds(int x,
int y,
int width,
int height)
Set window bounds.
|
void |
setWindowEnabled(boolean enable)
Set the window's sensitive state, depending on the
enable flag. |
void |
setWindowLocation(int left,
int top)
Set window location.
|
void |
setWindowVisible(boolean visible)
Hide or show the window, depending on the
visible flag. |
void |
setXORComposite()
Set "XOR composite" mode: color of the drawn elements is calculated as XOR (for each RGB
component) of their color with color of underlying pixels.
|
void |
setXORMode(ColorRgb color)
Set XOR mode painting allowing to invert the destination color with current drawing
primitive color.
|
void |
stackWindows(int[] windowIds)
Force the list of all GUI windows to be stacked as in the specified order.
|
void |
startBatch()
Start a batch drawing routine.
|
void |
translatePop()
Reverses the translation at the top of the stack.
|
void |
translatePush(int x,
int y)
Translates the origin of the graphics context to the point (x, y) in the
current coordinate system.
|
default void |
withSelectedWindow(int windowId,
java.lang.Runnable run)
The method works as an envelope for
selectWindow(int) and
releaseWindow() methods. |
beep, captureMouseEvents, clear, clientReady, createOutputManager, getChildProcessFactory, getFactory, getPrimitives, getWindowSystem, handleMouseEvent, inBackgroundMode, inBatchMode, init, isChui, lockMousePointer, openURL, propagate, readKey, resetMode, resume, setCursorStatus, setTerminalType, shutdown, suspend, terminalType
void translatePush(int x, int y)
All usage of this method MUST be paired with a subsequent translatePop()
. A stack
of translations is maintained, so that translate calls can be nested.
x
- the specified x coordinatey
- the specified y coordinatevoid translatePop()
void drawStringWithMnemonic(java.lang.String text, NativePoint tp, MnemonicInfo info, GuiFontResolver gf, AbstractWidget<GuiOutputManager> widget, boolean centered)
text
- The full text, which needs to be drawn.tp
- The text's coordinates. If centered
parameter is set to
true
, then the NativePoint.y
will represent the height on
which centerin will be done.info
- The mnemonic details.gf
- The widget's font details.widget
- The widget instance to which the text belongs.centered
- Flag indicating if the text needs to be centered vertically.void drawString(java.lang.String text, int x, int y)
text
- text string to draw.x
- left position.y
- top position.void drawStringCentered(java.lang.String text, int x, int height)
text
- text string to draw.x
- left position.height
- the height to center on.void drawStringScaled(java.lang.String text, int legacyWidth, int legacyHeight, int x, int y)
The string will be drawn at the specified location.
text
- text string to draw.legacyWidth
- The legacy width, which needs to be matched when drawing.legacyHeight
- The legacy width, which needs to be matched when drawing.x
- left position.y
- top position.void drawStringCentered(java.lang.String text, int legacyWidth, int legacyHeight, int x, int height)
The string will be drawn at the specified location.
text
- text string to draw.legacyWidth
- The legacy width, which needs to be matched when drawing.legacyHeight
- The legacy width, which needs to be matched when drawing.x
- left position.height
- the height to center on.int getParagraphHeight(java.lang.String text, FontDetails<F> font, int maxWidth)
Note that the algorithm for text layout is compatible with
drawParagraph(String, FontDetails, int, int, int)
and so
can be used in conjunction with this method.
text
- The text to measure.font
- The font to use during layout.maxWidth
- The maximum paragraph width.void drawParagraph(java.lang.String text, FontDetails<F> font, int x, int y, int maxWidth)
Note that the algorithm for text layout is compatible with
getParagraphHeight(String, FontDetails, int)
and so
can be used in conjunction with this method.
text
- The text to draw.font
- The drawing font.x
- The x position.y
- The y position.maxWidth
- The maximum paragraph width.void drawLine(int x1, int y1, int x2, int y2)
(x1, y1)
and (x2, y2)
in this graphics context's coordinate system.x1
- the first point's x coordinate.y1
- the first point's y coordinate.x2
- the second point's x coordinate.y2
- the second point's y coordinate.void drawRect(int x, int y, int width, int height)
x
- left positiony
- top positionwidth
- rectangle width.height
- rectangle height.void drawRoundRect(int x, int y, int width, int height, int arcDiameter)
x
- left positiony
- top positionwidth
- rectangle width.height
- rectangle height.arcDiameter
- diameter of the arc at corners.void fillRect(int x, int y, int width, int height)
x
- left positiony
- top positionwidth
- rectangle width.height
- rectangle height.void fillRoundRect(int x, int y, int width, int height, int arcDiameter)
x
- left positiony
- top positionwidth
- rectangle width.height
- rectangle height.arcDiameter
- diameter of the arc at corners.void drawSelection(int x, int y, int width, int height, boolean clear)
x
- left positiony
- top positionwidth
- rectangle width.height
- rectangle height.clear
- TRUE
means clean up area instead of drawing selections.default void resetSelection()
void fillPolygon(int[] xPoints, int[] yPoints)
xPoints
- X coordinates.yPoints
- Y coordinates.void fill3DRect(int x, int y, int width, int height, boolean raised)
ColorRgb
. This method uses
the current ColorRgb
exclusively and ignores the current
Paint
.x
- the x coordinate of the rectangle to be filled.y
- the y coordinate of the rectangle to be filled.width
- the width of the rectangle to be filled.height
- the height of the rectangle to be filled.raised
- a boolean value that determines whether the rectangle appears
to be raised above the surface or etched into the surface.void draw3DRect(int x, int y, int width, int height, boolean raised)
The colors used for the highlighting effect are determined
based on the current color.
The resulting rectangle covers an area that is
width + 1
pixels wide
by height + 1
pixels tall. This method
uses the current ColorRgb
exclusively and ignores
the current Paint
.
x
- the x coordinate of the rectangle to be drawn.y
- the y coordinate of the rectangle to be drawn.width
- the width of the rectangle to be drawn.height
- the height of the rectangle to be drawn.raised
- A boolean that determines whether the rectangle appears to be raised
above the surface or sunk into the surface.void drawImage(ImageWrapper<I> img, int x, int y, int w, int h, int xoff, int yoff, boolean transparent, boolean stretch, boolean retain, boolean convert3D)
img
- Image to draw.x
- left location.y
- top location.w
- the image width.h
- the image height.xoff
- x offset inside image to start drawing.yoff
- y offset inside image to start drawing.transparent
- Flag indicating to use lower-left pixel as color marker to draw part of image as
transparent.stretch
- Flag indicating stretch or shrink the image to fit display area.retain
- Flag indicating keep original image aspect ratio when stretching the image.convert3D
- Flag indicating autoconvert some image colors to the corresponding system wide 3D
colors.void drawHighlight(int x, int y, int width, int height, ColorRgb color)
x
- left positiony
- top positionwidth
- area widthheight
- area heightcolor
- the highlight colorvoid setColor(ColorRgb color)
color
- Drawing color.void setColor(java.awt.Color color)
color
- Drawing color.void setDesktopBgColor(ColorRgb color)
color
- The new desktop background color.void setXORComposite()
void setXORMode(ColorRgb color)
color
- XOR alternation color.void resetComposite()
void setTitle(java.lang.String title)
title
- The window's title.void setGuiFont(FontDetails<F> font)
font
- Drawing font.void scaleFont(FontDetails<F> font)
font
- The font to be scaled. This will be modified on return.void setFontStyle(FontStyle style)
style
- Font style.void setLineStroke(LineStroke stroke)
stroke
- Line style.void setLineStroke(LineStroke stroke, float width)
stroke
- Line style.width
- Width value for the line.void resizeWindow(int width, int height)
width
- new width.height
- new heightvoid setWindowBounds(int x, int y, int width, int height)
x
- new xy
- new ywidth
- new width.height
- new heightboolean hasWindowEmulator(int windowId)
windowId
- Window ID.true
if window has an associated emulator, true
otherwise.void registerWindow(int windowId)
windowId
- The window ID.void registerChildWindow(int ownerId, int windowId, java.lang.String windowTitle, boolean resizable, boolean isShareActivationWithOwner, boolean modal)
ownerId
- The owning window ID.windowId
- The window ID.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.void deregisterWindow(int windowId)
windowId
- The window ID.void selectWindow(int windowId)
The GUI driver primitives can be accessed by only a single thread at a time. This requires
all GUI driver API calls to be bracketed in selectWindow(int)
and releaseWindow()
calls.
If the thread drawing owner is null
, the current thread will gain exclusive
access immediately and will hold it until has finished work.
windowId
- Window ID.default void withSelectedWindow(int windowId, java.lang.Runnable run)
selectWindow(int)
and
releaseWindow()
methods.windowId
- Window ID.run
- The code to run after the window is selected in the driver.void releaseWindow()
If no more windows are in use by the current thread, then the exclusive drawing access is
released and other other threads waiting in selectWindow(int)
can acquire it.
java.lang.Object saveDrawingState()
void restoreDrawingState(java.lang.Object state)
state
- The drawing state.void setWindowLocation(int left, int top)
left
- left coordinatetop
- top coordinatevoid setResizeableWindow(boolean resize, int minWidth, int minHeight, int maxWidth, int maxHeight)
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.NativePoint getWindowLocation()
ImageWrapper<I> createGreyImage(I imageIni)
imageIni
- The image to be used as source for grey transformation.null
if the
image cannot be created (e.g. if the bytes are not a valid image type).ImageWrapper<I> createIcon(byte[] byts, boolean small)
byts
- The image as persisted in the file system or a JAR file.small
- true
if the small icon size is to be loaded.null
if the
icon cannot be created (e.g. if the bytes are not a valid icon type).FontDetails<F> createFont(FontDetails<F> details)
details
- The font specifications.boolean isFontInstalled(java.lang.String fontName)
fontName
- The target font name.int getFontWidth(FontDetails<F> font)
font
- The font.int getFontMaxWidth(FontDetails<F> font)
int[] getFontWidths(FontDetails<F> fd)
fd
- The font details.int getFontHeight(FontDetails<F> font)
font
- The font.int getTextWidth(java.lang.String text, FontDetails<F> font)
text
- The text.font
- The font used to draw and measure the text.int getTextHeight(java.lang.String text, FontDetails<F> font)
text
- The text.font
- The font used to draw and measure the text.void setWindowVisible(boolean visible)
visible
flag.visible
- The window visibility state.void setWindowEnabled(boolean enable)
enable
flag.enable
- The window sensitive state.void iconifyWindow(int sourceId, boolean postEvent)
sourceId
- The root ID of the sub-tree which was iconified, and triggered iconification of
this window.postEvent
- When true
the method posts the WINDOW-MINIMIZED legacy event,
false
means no event is posted.void deiconifyWindow(int sourceId)
sourceId
- The root ID of the sub-tree which was deiconified, and triggered restoration of
this window.boolean isIconified(int windowId)
windowId
- The window ID.NativeDimension getWindowDimension()
void draw(WidgetId id, NativePoint origin, NativeRectangle clip, java.lang.Runnable core)
id
- When not-null, it caches the drawing result of this widget.origin
- The drawing origin.clip
- Clip rectangle.core
- The drawing worker.void draw(NativePoint origin, NativeRectangle clip, java.lang.Runnable core)
The method intersects the supplied clip
with the screen bitmap rectangles
retrieved by ScreenBitmap.getClippings(NativeRectangle)
.
origin
- The drawing origin.clip
- Clip rectangle.core
- The drawing worker.void drawFromOrigin(NativePoint origin, NativeRectangle clip, java.lang.Runnable core)
The translated origin (as before this was called) needs to be restored, before this call ends.
origin
- The drawing origin (relative to window's real origin).clip
- Clip rectangle.core
- The drawing worker.void setDrawingAreas(java.util.Set<NativeRectangle> bounds)
bounds
parameter. The individual rectangular areas may or may not overlap.bounds
- The bounds for the drawing area.void setDrawingArea(NativeRectangle bounds)
bounds
- The bounds for the drawing area.void registerMoveableWidget(int wid)
wid
- The widget ID.void registerResizeableWidget(int wid)
wid
- The widget ID.void deregisterWidget(int wid)
wid
- The widget ID.void registerWidgetPopup(int wid, int btn, int pid)
The popup with the given ID will be shown when the specified mouse button is pressed inside the specified widget.
wid
- The widget id.btn
- The button to be pressed, when showing the popup.pid
- The popup widget ID.void registerHoverableWidget(MouseHoverAction action)
action
- The widget mouse action.void registerTooltipWorker(Widget<GuiOutputManager> widget, int font, boolean now)
widget
- The widget object to register.font
- The font to draw tooltip text.now
- The flag indicating whether the action be registered immediately or later.void registerPendingTooltipWorkers(int wid)
wid
- The widget id. 0 means register all pending workers.void deregisterTooltipWorkers(int wid)
wid
- The widget id. 0 means deregister all registered workers.void registerDirectManipulation(Widget<GuiOutputManager> widget)
widget
- The widget object to register.ColorRgb getBgColor(int index)
index
- Color number.ColorRgb getFgColor(int index)
index
- Color number.ColorRgb getSysColor(int index)
index
- Color index.ColorRgb getFgStdColor(java.lang.String stdColor)
stdColor
- Color name.ColorRgb getBgStdColor(java.lang.String stdColor)
stdColor
- Color name.void flush()
void setStatusText(java.lang.String message)
message
- Text message.void setStatusText(Window<?> window, java.lang.String message)
message
- Text message.window
- Window instance.void listenAnyMouseEvent(int id, long when)
id
- The widget to be notified.when
- Only events generated after this timestamp will be notified.void startBatch()
void endBatch()
boolean isWindowVisible()
void stackWindows(int[] windowIds)
windowIds
- The stack order to be enforced.void moveToTop(int windowId, boolean focus)
windowId
- The window to be moved.focus
- If true
, the window will become the focused window
and its state changed to active.void moveToBottom(int windowId)
windowId
- The window to be moved.void enableEvents(int[] windowIds, boolean process)
windowIds
- The window IDs which need to be processed.process
- Flag indicating OS level events are captured (when true
).NativeRectangle getDisplayBounds(int windowId)
TopLevelWindow
.
For single-display setups the top-left corner of the returned rectangle is always 0,0. For multiple-display setups it can be 0,0 or positive.
windowId
- A valid window id.NativeRectangle getDisplayWorkArea(int windowId)
windowId
- A valid window id.int getScreenResolution()
void copyToClipboard(java.lang.String txt)
txt
- The text to be copied.java.lang.String clipboardContents()
void setCurrentSelection(java.lang.String txt)
txt
- The current selection.void registerMouseWidgets()
void setIcon(ImageWrapper<I> icon, int x, int y, int width, int height, int xoff, int yoff, boolean transparent, boolean stretch, boolean retain, boolean convert3D)
icon
- The wrapped icon.x
- The icon left location.y
- The icon top location.width
- The icon width.height
- The icon height.xoff
- x offset inside image of the icon to select drawing region.yoff
- y offset inside image of the icon to select drawing region.transparent
- Flag indicating to use lower-left pixel as color marker to draw part of image as
transparent.stretch
- Flag indicating stretch or shrink the image to fit display area.retain
- Flag indicating keep original image aspect ratio when stretching the image.convert3D
- Flag indicating autoconvert some image colors to the corresponding system wide 3D
colors.MousePtrWrapper createMousePointer(byte[] data, java.lang.String ptrName)
data
- cursor dataptrName
- pointer namenull
default void propagateWaitState(boolean isWaitState)
isWaitState
- wait statedefault void setCursor(MousePtrWrapper ptr)
ptr
- mouse cursorboolean isWindowDecorationSupported()
default int[][] parseEditorContent(int widgetId, int windowId, int maxWidth, java.lang.String text, int delta, FontDetails<F> 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.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.int[] getTextWidths(java.lang.String text, FontDetails<F> font)
text
- The text.font
- The font details used to draw and measure the text.int[][] getTextWidths(java.lang.String[] texts, FontDetails<F> font)
texts
- The texts.font
- The font details used to draw and measure the text.