|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectjava.awt.Component
java.awt.Canvas
chrriis.dj.nativeswing.swtimpl.NativeComponent
public abstract class NativeComponent
A native component that gets connected to a native peer.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class java.awt.Canvas |
|---|
Canvas.AccessibleAWTCanvas |
| Nested classes/interfaces inherited from class java.awt.Component |
|---|
Component.AccessibleAWTComponent, Component.BaselineResizeBehavior, Component.BltBufferStrategy, Component.FlipBufferStrategy |
| Field Summary | |
|---|---|
protected EventListenerList |
listenerList
|
| Fields inherited from class java.awt.Component |
|---|
BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT |
| Fields inherited from interface java.awt.image.ImageObserver |
|---|
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH |
| Constructor Summary | |
|---|---|
NativeComponent()
Construct a native component. |
|
| Method Summary | ||
|---|---|---|
void |
addMouseMotionListener(MouseMotionListener listener)
|
|
void |
addNotify()
|
|
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. |
|
protected Component |
createEmbeddableComponent(Map<Object,Object> optionMap)
A native component instance cannot be added directly to a component hierarchy. |
|
void |
destroyBackBuffer()
Destroy the back buffer. |
|
protected void |
disposeNativePeer()
Explicitely dispose the native resources. |
|
protected int |
getComponentID()
Get the unique identifier of this native component, used as a reference to communicate with the native peer. |
|
protected static ObjectRegistry |
getControlRegistry()
Get the registry of the controls, which references created controls using the component ID. |
|
|
getListeners(Class<T> listenerType)
|
|
Dimension |
getMinimumSize()
|
|
protected static ObjectRegistry |
getNativeComponentRegistry()
Get the registry of the components, which references created components using the component ID. |
|
protected Object[] |
getNativePeerCreationParameters()
Get the parameters that are passed to the creation method. |
|
Dimension |
getPreferredSize()
|
|
boolean |
hasFocus()
|
|
void |
initializeNativePeer()
Force the component to initialize. |
|
boolean |
isNativePeerDisposed()
Indicate whether the native peer is disposed. |
|
boolean |
isNativePeerInitialized()
Indicate whether the native peer initialization phase has happened. |
|
boolean |
isNativePeerValid()
Indicate if the native peer is valid, which means initialized, not disposed, and alive (communication channel is alive). |
|
void |
paint(Graphics g)
Paint the component, which also paints the back buffer if any. |
|
void |
paintComponent(BufferedImage image)
Paint the native component including its native peer in an image. |
|
void |
paintComponent(BufferedImage image,
Rectangle[] rectangles)
Paint the native component including its native peer in an image, in the areas that are specified. |
|
void |
print(Graphics g)
Print the component, which also prints the native peer. |
|
protected void |
processKeyEvent(KeyEvent e)
|
|
void |
removeMouseMotionListener(MouseMotionListener listener)
|
|
void |
removeNotify()
|
|
void |
reshape(int x,
int y,
int width,
int height)
|
|
void |
runAsync(CommandMessage commandMessage,
Object... args)
Run the given command if the control is created, or store it to run it when the creation occurs. |
|
void |
runInSequence(Runnable runnable)
Run a command in sequence with other calls from this class. |
|
Object |
runSync(CommandMessage commandMessage,
Object... args)
Run the given command if the control is created, or store it to run it when the creation occurs. |
|
void |
setEnabled(boolean isEnabled)
Set whether this component and its native peer are enabled. |
|
String |
toString()
|
|
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.awt.Canvas |
|---|
createBufferStrategy, createBufferStrategy, getAccessibleContext, getBufferStrategy, update |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected EventListenerList listenerList
| Constructor Detail |
|---|
public NativeComponent()
| Method Detail |
|---|
public void runInSequence(Runnable runnable)
runnable - the command to run in sequence with other method calls.
public Object runSync(CommandMessage commandMessage,
Object... args)
commandMessage - the command message to run.args - the arguments to pass to the command message.
public void runAsync(CommandMessage commandMessage,
Object... args)
commandMessage - the command message to run.args - the arguments to pass to the command message.protected static ObjectRegistry getNativeComponentRegistry()
protected static ObjectRegistry getControlRegistry()
protected int getComponentID()
protected void processKeyEvent(KeyEvent e)
processKeyEvent in class Component
public void reshape(int x,
int y,
int width,
int height)
reshape in class Componentpublic void addMouseMotionListener(MouseMotionListener listener)
addMouseMotionListener in class Componentpublic void removeMouseMotionListener(MouseMotionListener listener)
removeMouseMotionListener in class Componentpublic void paint(Graphics g)
paint in class Canvasg - the graphics to paint to.public void print(Graphics g)
print in class Componentg - the graphics to paint to.public void addNotify()
addNotify in class Canvaspublic void initializeNativePeer()
protected Object[] getNativePeerCreationParameters()
public void removeNotify()
removeNotify in class Componentprotected void disposeNativePeer()
public boolean isNativePeerDisposed()
public boolean isNativePeerInitialized()
public boolean isNativePeerValid()
public String toString()
toString in class Componentprotected Component createEmbeddableComponent(Map<Object,Object> optionMap)
optionMap - the options to configure the behavior of this component.
public void setEnabled(boolean isEnabled)
setEnabled in class ComponentisEnabled - true it the component and its native peer should be enabled, false otherwise.public boolean hasFocus()
hasFocus in class Componentpublic Dimension getPreferredSize()
getPreferredSize in class Componentpublic void paintComponent(BufferedImage image)
image - the image to paint to.
public void paintComponent(BufferedImage image,
Rectangle[] rectangles)
image - the image to paint to.rectangles - the area in which the component should be painted.public Dimension getMinimumSize()
getMinimumSize in class Componentpublic void createBackBuffer()
public void updateBackBufferOnVisibleTranslucentAreas()
public void updateBackBuffer(Rectangle[] rectangles)
rectangles - the area to update.public void destroyBackBuffer()
public <T extends EventListener> T[] getListeners(Class<T> listenerType)
getListeners in class Component
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||