APIdia Launch Partner
Top Description Inners Fields Constructors Methods
jdk.swing.interop

public abstract Class LightweightContentWrapper

extends Object
Class Inheritance
Imports
java.awt.Component, java.awt.dnd.DragGestureRecognizer, .DragGestureListener, .DragSource, .DragGestureEvent, .InvalidDnDOperationException, .DropTarget, java.awt.dnd.peer.DragSourceContextPeer, javax.swing.JComponent, sun.swing.LightweightContent

This class provides a wrapper over inner LightweightContentProxy class which implements jdk internal sun.swing.LightweightContent interface and provides APIs to be used by FX swing interop to access and use LightweightContent APIs.
Since
11

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class

Field Summary

Modifier and TypeField and Description
private LightweightContentWrapper.LightweightContentProxy

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public abstract void
public abstract <T extends DragGestureRecognizer> T
createDragGestureRecognizer(Class<T> abstractRecognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl)

public abstract DragSourceContextWrapper
public abstract void
public abstract void
public abstract JComponent
pack-priv LightweightContentWrapper.LightweightContentProxy
public abstract void
imageBufferReset(int[] data, int x, int y, int width, int height, int linestride)

public abstract void
imageBufferReset(int[] data, int x, int y, int width, int height, int linestride, double scaleX, double scaleY)

public abstract void
imageReshaped(int x, int y, int width, int height)

public abstract void
imageUpdated(int dirtyX, int dirtyY, int dirtyWidth, int dirtyHeight)

public abstract void
maximumSizeChanged(int width, int height)

public abstract void
minimumSizeChanged(int width, int height)

public abstract void
public abstract void
public abstract void
preferredSizeChanged(int width, int height)

public abstract void
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

lwCntback to summary
private LightweightContentWrapper.LightweightContentProxy lwCnt

Constructor Detail

LightweightContentWrapperback to summary
public LightweightContentWrapper()

Method Detail

addDropTargetback to summary
public abstract void addDropTarget(DropTarget dt)
createDragGestureRecognizerback to summary
public abstract <T extends DragGestureRecognizer> T createDragGestureRecognizer(Class<T> abstractRecognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl)
createDragSourceContextback to summary
public abstract DragSourceContextWrapper createDragSourceContext(DragGestureEvent dge) throws InvalidDnDOperationException
focusGrabbedback to summary
public abstract void focusGrabbed()
focusUngrabbedback to summary
public abstract void focusUngrabbed()
getComponentback to summary
public abstract JComponent getComponent()
getContentback to summary
pack-priv LightweightContentWrapper.LightweightContentProxy getContent()
imageBufferResetback to summary
public abstract void imageBufferReset(int[] data, int x, int y, int width, int height, int linestride)
imageBufferResetback to summary
public abstract void imageBufferReset(int[] data, int x, int y, int width, int height, int linestride, double scaleX, double scaleY)
imageReshapedback to summary
public abstract void imageReshaped(int x, int y, int width, int height)
imageUpdatedback to summary
public abstract void imageUpdated(int dirtyX, int dirtyY, int dirtyWidth, int dirtyHeight)
maximumSizeChangedback to summary
public abstract void maximumSizeChanged(int width, int height)
minimumSizeChangedback to summary
public abstract void minimumSizeChanged(int width, int height)
paintLockback to summary
public abstract void paintLock()
paintUnlockback to summary
public abstract void paintUnlock()
preferredSizeChangedback to summary
public abstract void preferredSizeChanged(int width, int height)
removeDropTargetback to summary
public abstract void removeDropTarget(DropTarget dt)
jdk.swing.interop back to summary

private Class LightweightContentWrapper.LightweightContentProxy

extends Object
implements LightweightContent
Class Inheritance
  • java.lang.Object
  • jdk.swing.interop.LightweightContentWrapper.LightweightContentProxy
All Implemented Interfaces
sun.swing.LightweightContent

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
addDropTarget(DropTarget dt)

Overrides default sun.swing.LightweightContent.addDropTarget.

Adds a drop target to the lightweight frame.

public <T extends DragGestureRecognizer> T
createDragGestureRecognizer(Class<T> abstractRecognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl)

Overrides default sun.swing.LightweightContent.createDragGestureRecognizer.

Create a drag gesture recognizer for the lightweight frame.

public DragSourceContextPeer
createDragSourceContextPeer(DragGestureEvent dge)

Overrides default sun.swing.LightweightContent.createDragSourceContextPeer.

Create a drag source context peer for the lightweight frame.

public void
focusGrabbed()

Implements sun.swing.LightweightContent.focusGrabbed.

JLightweightFrame calls this method to notify the client application that the frame has grabbed focus.

public void
focusUngrabbed()

Implements sun.swing.LightweightContent.focusUngrabbed.

JLightweightFrame calls this method to notify the client application that the frame has ungrabbed focus.

public JComponent
getComponent()

Implements sun.swing.LightweightContent.getComponent.

The client application overrides this method to return the JComponent instance which the JLightweightFrame container will paint as its lightweight content.

public void
imageBufferReset(int[] data, int x, int y, int width, int height, int linestride)

Overrides default sun.swing.LightweightContent.imageBufferReset.

The default implementation for #imageBufferReset uses a hard-coded value of 1 for the scale factor.

public void
imageBufferReset(int[] data, int x, int y, int width, int height, int linestride, double scaleX, double scaleY)

Overrides default sun.swing.LightweightContent.imageBufferReset.

JLightweightFrame calls this method to notify the client application that a new data buffer has been set as a content pixel buffer.

public void
imageReshaped(int x, int y, int width, int height)

Implements sun.swing.LightweightContent.imageReshaped.

JLightweightFrame calls this method to notify the client application that the content image bounds have been changed within the image's pixel buffer.

public void
imageUpdated(int dirtyX, int dirtyY, int dirtyWidth, int dirtyHeight)

Implements sun.swing.LightweightContent.imageUpdated.

JLightweightFrame calls this method to notify the client application that a part of the content image, or the whole image has been updated.

public void
maximumSizeChanged(int width, int height)

Implements sun.swing.LightweightContent.maximumSizeChanged.

JLightweightFrame calls this method to notify the client application that the content maximum size has changed.

public void
minimumSizeChanged(int width, int height)

Implements sun.swing.LightweightContent.minimumSizeChanged.

JLightweightFrame calls this method to notify the client application that the content minimum size has changed.

public void
paintLock()

Implements sun.swing.LightweightContent.paintLock.

JLightweightFrame calls this method to notify the client application that it acquires the paint lock.

public void
paintUnlock()

Implements sun.swing.LightweightContent.paintUnlock.

JLightweightFrame calls this method to notify the client application that it releases the paint lock.

public void
preferredSizeChanged(int width, int height)

Implements sun.swing.LightweightContent.preferredSizeChanged.

JLightweightFrame calls this method to notify the client application that the content preferred size has changed.

public void
removeDropTarget(DropTarget dt)

Overrides default sun.swing.LightweightContent.removeDropTarget.

Removes a drop target from the lightweight frame.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

LightweightContentProxyback to summary
private LightweightContentProxy()

Method Detail

addDropTargetback to summary
public void addDropTarget(DropTarget dt)

Overrides default sun.swing.LightweightContent.addDropTarget.

Doc from sun.swing.LightweightContent.addDropTarget.

Adds a drop target to the lightweight frame.

createDragGestureRecognizerback to summary
public <T extends DragGestureRecognizer> T createDragGestureRecognizer(Class<T> abstractRecognizerClass, DragSource ds, Component c, int srcActions, DragGestureListener dgl)

Overrides default sun.swing.LightweightContent.createDragGestureRecognizer.

Doc from sun.swing.LightweightContent.createDragGestureRecognizer.

Create a drag gesture recognizer for the lightweight frame.

createDragSourceContextPeerback to summary
public DragSourceContextPeer createDragSourceContextPeer(DragGestureEvent dge) throws InvalidDnDOperationException

Overrides default sun.swing.LightweightContent.createDragSourceContextPeer.

Doc from sun.swing.LightweightContent.createDragSourceContextPeer.

Create a drag source context peer for the lightweight frame.

focusGrabbedback to summary
public void focusGrabbed()

Implements sun.swing.LightweightContent.focusGrabbed.

Doc from sun.swing.LightweightContent.focusGrabbed.

JLightweightFrame calls this method to notify the client application that the frame has grabbed focus.

focusUngrabbedback to summary
public void focusUngrabbed()

Implements sun.swing.LightweightContent.focusUngrabbed.

Doc from sun.swing.LightweightContent.focusUngrabbed.

JLightweightFrame calls this method to notify the client application that the frame has ungrabbed focus.

getComponentback to summary
public JComponent getComponent()

Implements sun.swing.LightweightContent.getComponent.

Doc from sun.swing.LightweightContent.getComponent.

The client application overrides this method to return the JComponent instance which the JLightweightFrame container will paint as its lightweight content. A hierarchy of components contained in this component should not contain any heavyweight objects.

imageBufferResetback to summary
public void imageBufferReset(int[] data, int x, int y, int width, int height, int linestride)

Overrides default sun.swing.LightweightContent.imageBufferReset.

Doc from sun.swing.LightweightContent.imageBufferReset.

The default implementation for #imageBufferReset uses a hard-coded value of 1 for the scale factor. Both the old and the new methods provide default implementations in order to allow a client application to run with any JDK version without breaking backward compatibility.

imageBufferResetback to summary
public void imageBufferReset(int[] data, int x, int y, int width, int height, int linestride, double scaleX, double scaleY)

Overrides default sun.swing.LightweightContent.imageBufferReset.

Doc from sun.swing.LightweightContent.imageBufferReset.

JLightweightFrame calls this method to notify the client application that a new data buffer has been set as a content pixel buffer. Typically this occurs when a buffer of a larger size is created in response to a content resize event.

The method reports a reference to the pixel data buffer, the content image bounds within the buffer and the line stride of the buffer. These values have the following correlation. The width and height matches the layout size of the content (the component returned from the getComponent method). The x and y is the origin of the content, (0, 0) in the layout coordinate space of the content, appearing at data[y * scaleY * linestride + x * scaleX] in the buffer. A pixel with indices (i, j), where (0 <= i < width) and (0 <= j < height), in the layout coordinate space of the content is represented by a scaleX * scaleY square of pixels in the physical coordinate space of the buffer. The top-left corner of the square has the following physical coordinate in the buffer: data[(y + j) * scaleY * linestride + (x + i) * scaleX].

imageReshapedback to summary
public void imageReshaped(int x, int y, int width, int height)

Implements sun.swing.LightweightContent.imageReshaped.

Doc from sun.swing.LightweightContent.imageReshaped.

JLightweightFrame calls this method to notify the client application that the content image bounds have been changed within the image's pixel buffer.

imageUpdatedback to summary
public void imageUpdated(int dirtyX, int dirtyY, int dirtyWidth, int dirtyHeight)

Implements sun.swing.LightweightContent.imageUpdated.

Doc from sun.swing.LightweightContent.imageUpdated.

JLightweightFrame calls this method to notify the client application that a part of the content image, or the whole image has been updated. The method reports bounds of the rectangular dirty region. The dirtyX and dirtyY is the origin of the dirty rectangle, which is relative to the origin of the content, appearing at data[(y + dirtyY] * linestride + (x + dirtyX)] in the pixel buffer (see imageBufferReset). All indices data[(y + dirtyY + j) * linestride + (x + dirtyX + i)] where (0 <= i < dirtyWidth) and (0 <= j < dirtyHeight) will represent valid pixel data, (i, j) in the coordinate space of the dirty rectangle.

maximumSizeChangedback to summary
public void maximumSizeChanged(int width, int height)

Implements sun.swing.LightweightContent.maximumSizeChanged.

Doc from sun.swing.LightweightContent.maximumSizeChanged.

JLightweightFrame calls this method to notify the client application that the content maximum size has changed.

minimumSizeChangedback to summary
public void minimumSizeChanged(int width, int height)

Implements sun.swing.LightweightContent.minimumSizeChanged.

Doc from sun.swing.LightweightContent.minimumSizeChanged.

JLightweightFrame calls this method to notify the client application that the content minimum size has changed.

paintLockback to summary
public void paintLock()

Implements sun.swing.LightweightContent.paintLock.

Doc from sun.swing.LightweightContent.paintLock.

JLightweightFrame calls this method to notify the client application that it acquires the paint lock. The client application should implement the locking mechanism in order to synchronize access to the content image data, shared between JLightweightFrame and the client application.

paintUnlockback to summary
public void paintUnlock()

Implements sun.swing.LightweightContent.paintUnlock.

Doc from sun.swing.LightweightContent.paintUnlock.

JLightweightFrame calls this method to notify the client application that it releases the paint lock. The client application should implement the locking mechanism in order to synchronize access to the content image data, shared between JLightweightFrame and the client application.

preferredSizeChangedback to summary
public void preferredSizeChanged(int width, int height)

Implements sun.swing.LightweightContent.preferredSizeChanged.

Doc from sun.swing.LightweightContent.preferredSizeChanged.

JLightweightFrame calls this method to notify the client application that the content preferred size has changed.

removeDropTargetback to summary
public void removeDropTarget(DropTarget dt)

Overrides default sun.swing.LightweightContent.removeDropTarget.

Doc from sun.swing.LightweightContent.removeDropTarget.

Removes a drop target from the lightweight frame.