|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object chrriis.dj.nativeswing.NativeComponentWrapper
public class NativeComponentWrapper
A wrapper for a native component, so that it becomes part of the Native Swing framework. This class should be used by developers who want to have some native component be properly integrated in Swing applications.
Constructor Summary | |
---|---|
NativeComponentWrapper(Component nativeComponent)
Construct a NativeComponentWrapper. |
Method Summary | |
---|---|
void |
createBackBuffer()
Create an image of the native peer as a back buffer, which can be used when painting the component, or to simulate alpha blending. |
Component |
createEmbeddableComponent(Map<Object,Object> optionMap)
A native component instance cannot be added directly to a component hierarchy: this method creates a component that will host the native component but which can be added to the component hierarchy. |
Component |
createEmbeddableComponent(NSOption... options)
A native component instance cannot be added directly to a component hierarchy: this method creates a component that will host the native component but which can be added to the component hierarchy. |
void |
destroyBackBuffer()
Destroy the back buffer. |
void |
disposeNativeComponent()
Explicitely dispose the native resources. |
protected String |
getComponentDescription()
Get a description of this component wrapper, which is used for example to improve debug messages. |
boolean |
hasBackBuffer()
Indicate whether a back buffer is (still) stored in the component. |
void |
paintBackBuffer(Graphics g,
boolean isPaintingProxy)
Paint the back buffer, if one was created, to a graphic context. |
protected void |
paintNativeComponent(BufferedImage image,
Rectangle[] rectangles)
Paint the native component including its native peer in an image, in the areas that are specified. |
protected void |
restoreFromHiddenParent()
|
protected void |
setNativeComponentEnabled(boolean isEnabled)
This method is invoked to enable or disable the native component at its native level, to prevent focus and input problems. |
protected void |
storeInHiddenParent()
|
void |
transferFocus(boolean isForward)
This method should be invoked by the native component when it wants to transfer the focus. |
void |
updateBackBuffer(Rectangle[] rectangles)
Update (eventually creating an empty one if it does not exist) the back buffer on the area specified by the rectangles. |
void |
updateBackBufferOnVisibleTranslucentAreas()
Update the back buffer on the areas that have non opaque overlays and that are not covered by opaque components. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public NativeComponentWrapper(Component nativeComponent)
nativeComponent
- the native component to wrap.Method Detail |
---|
protected void paintNativeComponent(BufferedImage image, Rectangle[] rectangles)
image
- the image to paint to.rectangles
- the area in which the component should be painted, or null to paint everything.protected void setNativeComponentEnabled(boolean isEnabled)
isEnabled
- true if the native component should be enabled, false otherwise.protected String getComponentDescription()
public Component createEmbeddableComponent(NSOption... options)
options
- the options to configure the behavior of this component.
public Component createEmbeddableComponent(Map<Object,Object> optionMap)
optionMap
- the options to configure the behavior of this component.
public void disposeNativeComponent()
public void paintBackBuffer(Graphics g, boolean isPaintingProxy)
g
- the graphic context to paint to.isPaintingProxy
- true to paint even if the buffer is handled by a proxy.public boolean hasBackBuffer()
public void createBackBuffer()
public void updateBackBufferOnVisibleTranslucentAreas()
public void updateBackBuffer(Rectangle[] rectangles)
rectangles
- the area to update.public void destroyBackBuffer()
public void transferFocus(boolean isForward)
isForward
- true if the focus should be transfered forward, false if it should be backward.protected void storeInHiddenParent()
protected void restoreFromHiddenParent()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |