jruby/docs BETA
org.eclipse.swt.graphics 36
E AutoscalingMode
C Color
C Cursor
C Device
C DeviceData
I Drawable
C Font
C FontData
C FontMetrics
C GC
C GCData
C GlyphMetrics
C Image
C ImageData
I ImageDataAtSizeProvider
I ImageDataProvider
I ImageFileNameProvider
I ImageGcDrawer
C ImageLoader
C ImageLoaderEvent
I ImageLoaderListener
C LineAttributes
C PaletteData
C Path
C PathData
C Pattern
C Point
C RGB
C RGBA
C Rectangle
C Region
C Resource
E RoundingMode
C TextLayout
C TextStyle
C Transform
Resource — members 5
C new()
M device() Device
C dispose()
M disposed?() boolean
C non_dispose_handler=(reporter)

org.eclipse.swt.graphics.Resource

class abstract 5 members

This class is the abstract superclass of all graphics resource objects. Resources created by the application must be disposed.

IMPORTANT: This class is intended to be subclassed only within the SWT implementation. However, it has not been marked final to allow those outside of the SWT development team to implement patched versions of the class in order to get around specific limitations in advance of when those limitations can be addressed by the team. Any class built using subclassing to access the internals of this class will likely fail to compile or run between releases and may be strongly platform specific. Subclassing should not be attempted without an intimate and detailed understanding of the workings of the hierarchy. No support is provided for user-written classes which are implemented as subclasses of this class.

Constructors

new

new ( )
Java: <init>()

Class Methods

non_dispose_handler=

non_dispose_handler= ( Consumer<Error> reporter )
Java: setNonDisposeHandler(java.util.function.Consumer<Error> reporter) · also: set_non_dispose_handler

Enables detection of Resource objects for which #dispose() wasn't called, which means a leak of native memory and/or OS resources. WARNING: the reporter will be called from a different thread. Do not block it and do not throw any exceptions. It's best to queue the errors for some other worker to process.

nametypedescription
reporterjava.util.function.Consumer<Error>object used to report detected errors. Use null to disable tracking. Setting a new reporter has an immediate effect.

Instance Methods

device

Device device ( )
Java: getDevice() · also: get_device

Returns the Device where this resource was created.

Returns: Device the device of the receiver

dispose

dispose ( )
Java: dispose()

Disposes of the operating system resources associated with this resource. Applications must dispose of all resources which they allocate. This method does nothing if the resource is already disposed.

disposed?

boolean disposed? ( )
Java: isDisposed() · also: is_disposed

Returns true if the resource has been disposed, and false otherwise.

This method gets the dispose state for the resource. When a resource has been disposed, it is an error to invoke any other method (except #dispose()) using the resource.

Returns: true when the resource is disposed and false otherwise