com.develop.jawin
Class AXComponent

java.lang.Object
  |
  +--java.awt.Component
        |
        +--java.awt.Canvas
              |
              +--com.develop.jawin.AXComponent
All Implemented Interfaces:
javax.accessibility.Accessible, java.awt.event.ComponentListener, java.util.EventListener, java.awt.image.ImageObserver, java.awt.MenuContainer, java.io.Serializable

public class AXComponent
extends java.awt.Canvas
implements java.awt.event.ComponentListener

ActiveX holder component. Should be inherited by developer class. Creates ActiveX container.

Author:
Vitally Shelest
See Also:
Serialized Form

Inner classes inherited from class java.awt.Canvas
java.awt.Canvas.AccessibleAWTCanvas
 
Inner classes inherited from class java.awt.Component
java.awt.Component.AccessibleAWTComponent, java.awt.Component.AWTTreeLock
 
Field Summary
private  java.lang.String coClass
           
private  java.lang.Class comProxyClass
           
private  DispatchPtr control
           
private  boolean created
           
 int host
          container object
 int hwnd
          canvas (base component) window handle
private  GUID iid
           
private  java.util.Vector impls
           
private  java.util.Vector itfs
           
private  int thread
           
 
Fields inherited from class java.awt.Canvas
base, nameCounter, serialVersionUID
 
Fields inherited from class java.awt.Component
accessibleContext, actionListenerK, adjustmentListenerK, appContext, background, BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, changeSupport, componentListener, componentListenerK, componentOrientation, componentSerializedDataVersion, containerListenerK, cursor, dbg, dropTarget, enabled, eventMask, focusListener, focusListenerK, font, foreground, graphicsConfig, hasFocus, height, hierarchyBoundsListener, hierarchyBoundsListenerK, hierarchyListener, hierarchyListenerK, incRate, inputMethodListener, inputMethodListenerK, isInc, isPacked, itemListenerK, keyListener, keyListenerK, LEFT_ALIGNMENT, locale, LOCK, metrics, minSize, mouseListener, mouseListenerK, mouseMotionListener, mouseMotionListenerK, name, nameExplicitlySet, newEventsOnly, ownedWindowK, parent, peer, peerFont, popups, prefSize, privateKey, RIGHT_ALIGNMENT, textListenerK, TOP_ALIGNMENT, valid, visible, width, windowClosingException, windowListenerK, x, y
 
Fields inherited from interface java.awt.image.ImageObserver
ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH
 
Constructor Summary
AXComponent(GUID iid)
          Creates a new instance of AXComponent
AXComponent(java.lang.String coClass)
          Creates a new instance of AXComponent
 
Method Summary
private  int _getHWND()
           
 void addEventListener(java.lang.Class itf, java.lang.Object impl)
          Adds listener to COM Object
 void addNotify()
          Creates ActiveX
static void callInit(AXComponent obj)
          For internal use
protected  void close()
           
 void componentHidden(java.awt.event.ComponentEvent componentEvent)
          Canvas listener function
 void componentMoved(java.awt.event.ComponentEvent componentEvent)
          Canvas listener function
 void componentResized(java.awt.event.ComponentEvent componentEvent)
          Canvas listener function
 void componentShown(java.awt.event.ComponentEvent componentEvent)
          Canvas listener function
private  void create()
           
static int createControl(AXComponent obj)
          For internal usage
private static int createControl(AXComponent obj, int host, int window, int w, int h)
           
private static int createHost(AXComponent obj, byte[] guid)
           
(package private)  void createHost(GUID iid)
           
(package private)  void createHost(java.lang.String coClass)
           
private static int createHostStr(AXComponent obj, java.lang.String guid)
           
private  void deleteHost(int host)
           
private  void destroy()
           
protected  void exitInstance()
           
protected  void finalize()
          Finalize object
 DispatchPtr getControl()
          Returns ActiveX object from host ActiveX container.
private  int getControl(int host)
           
private  int getHWND()
           
protected  void initInstance()
          Called by ActiveX container (host) before showing COM Object.
private static void invalidate(AXComponent obj, boolean eraseBkg)
           
 void invalidate(boolean eraseBkg)
           
static int newHost(AXComponent obj, byte[] guid)
          For internal usage
static int newHost(AXComponent obj, java.lang.String guid)
          For internal usage
 void onWindowMsg(int msgID, long w, long l)
           
 void preCreateInit()
          For internal usage
private  void redrawHost()
           
 void removeNotify()
           
 void reshape(int x, int y, int w, int h)
           
private  void resizeHost(int w, int h)
           
 
Methods inherited from class java.awt.Canvas
, constructComponentName, getAccessibleContext, paint, postsOldMouseEvents
 
Methods inherited from class java.awt.Component
action, add, addComponentListener, addFocusListener, addHierarchyBoundsListener, addHierarchyListener, addInputMethodListener, addKeyListener, addMouseListener, addMouseMotionListener, addPropertyChangeListener, addPropertyChangeListener, areInputMethodsEnabled, bounds, checkGD, checkImage, checkImage, checkWindowClosingException, coalesceEvents, contains, contains, createChildHierarchyEvents, createHierarchyEvents, createImage, createImage, deliverEvent, disable, disableEvents, dispatchEvent, dispatchEventImpl, doLayout, enable, enable, enableEvents, enableInputMethods, eventEnabled, firePropertyChange, getAccessibleIndexInParent, getAccessibleStateSet, getAlignmentX, getAlignmentY, getBackground, getBounds, getBounds, getColorModel, getComponentAt, getComponentAt, getComponentOrientation, getCursor, getDropTarget, getFont_NoClientCode, getFont, getFontMetrics, getForeground, getGraphics, getGraphicsConfiguration, getHeight, getInputContext, getInputMethodRequests, getListeners, getLocale, getLocation, getLocation, getLocationOnScreen_NoTreeLock, getLocationOnScreen, getMaximumSize, getMinimumSize, getName, getNativeContainer, getParent_NoClientCode, getParent, getPeer, getPreferredSize, getSize, getSize, getToolkit, getToolkitImpl, getTreeLock, getWidth, getWindowForObject, getX, getY, gotFocus, handleEvent, hasFocus, hide, imageUpdate, initIDs, inside, invalidate, isDisplayable, isDoubleBuffered, isEnabled, isEnabledImpl, isFocusTraversable, isLightweight, isOpaque, isRecursivelyVisible, isShowing, isValid, isVisible, keyDown, keyUp, layout, lightweightPaint, lightweightPrint, list, list, list, list, list, locate, location, lostFocus, minimumSize, mouseDown, mouseDrag, mouseEnter, mouseExit, mouseMove, mouseUp, move, nextFocus, numListening, paintAll, paintHeavyweightComponents, paramString, postEvent, preferredSize, prepareImage, prepareImage, print, printAll, printHeavyweightComponents, processComponentEvent, processEvent, processFocusEvent, processHierarchyBoundsEvent, processHierarchyEvent, processInputMethodEvent, processKeyEvent, processMouseEvent, processMouseMotionEvent, readObject, remove, removeComponentListener, removeFocusListener, removeHierarchyBoundsListener, removeHierarchyListener, removeInputMethodListener, removeKeyListener, removeMouseListener, removeMouseMotionListener, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, repaint, requestFocus, resetGC, resize, resize, setBackground, setBounds, setBounds, setComponentOrientation, setCursor, setDropTarget, setEnabled, setFont, setForeground, setLocale, setLocation, setLocation, setName, setSize, setSize, setVisible, show, show, size, toString, transferFocus, update, validate, writeObject
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, registerNatives, wait, wait, wait
 

Field Detail

hwnd

public int hwnd
canvas (base component) window handle

host

public int host
container object

thread

private int thread

control

private DispatchPtr control

iid

private GUID iid

coClass

private java.lang.String coClass

comProxyClass

private java.lang.Class comProxyClass

created

private boolean created

itfs

private java.util.Vector itfs

impls

private java.util.Vector impls
Constructor Detail

AXComponent

public AXComponent(GUID iid)
            throws COMException
Creates a new instance of AXComponent
Parameters:
iid - ActiveX GUID
Throws:
COMException - JNI/COM error

AXComponent

public AXComponent(java.lang.String coClass)
            throws COMException
Creates a new instance of AXComponent
Parameters:
coClass - COM ProgID
Throws:
COMException - JNI/COM error
Method Detail

createHost

void createHost(java.lang.String coClass)
          throws COMException

createHost

void createHost(GUID iid)
          throws COMException

addEventListener

public final void addEventListener(java.lang.Class itf,
                                   java.lang.Object impl)
                            throws COMException
Adds listener to COM Object
Parameters:
itf - class object of interface implemented
impl - object which implements interface
Throws:
COMException - JNI/COM error

initInstance

protected void initInstance()
                     throws COMException
Called by ActiveX container (host) before showing COM Object. Used in derived classes to initialize ActiveX.
Throws:
COMException - JNI/COM error

exitInstance

protected void exitInstance()
                     throws COMException

preCreateInit

public final void preCreateInit()
                         throws COMException
For internal usage
Throws:
COMException - JNI/COM error

create

private final void create()
                   throws COMException

componentHidden

public void componentHidden(java.awt.event.ComponentEvent componentEvent)
Canvas listener function
Specified by:
componentHidden in interface java.awt.event.ComponentListener
Parameters:
componentEvent - canvas event

componentMoved

public void componentMoved(java.awt.event.ComponentEvent componentEvent)
Canvas listener function
Specified by:
componentMoved in interface java.awt.event.ComponentListener
Parameters:
componentEvent - canvas event

componentResized

public void componentResized(java.awt.event.ComponentEvent componentEvent)
Canvas listener function
Specified by:
componentResized in interface java.awt.event.ComponentListener
Parameters:
componentEvent - canvas event

componentShown

public void componentShown(java.awt.event.ComponentEvent componentEvent)
Canvas listener function
Specified by:
componentShown in interface java.awt.event.ComponentListener
Parameters:
componentEvent - canvas event

reshape

public void reshape(int x,
                    int y,
                    int w,
                    int h)
Overrides:
reshape in class java.awt.Component

finalize

protected void finalize()
                 throws java.lang.Throwable
Finalize object
Overrides:
finalize in class java.lang.Object
Throws:
COMException - JNI/COM error

addNotify

public void addNotify()
Creates ActiveX
Overrides:
addNotify in class java.awt.Canvas

destroy

private final void destroy()
                    throws COMException
Throws:
COMException -  

close

protected void close()

removeNotify

public void removeNotify()
Overrides:
removeNotify in class java.awt.Component

getControl

public final DispatchPtr getControl()
Returns ActiveX object from host ActiveX container.
Returns:
DispatchPtr object

newHost

public static int newHost(AXComponent obj,
                          byte[] guid)
                   throws COMException
For internal usage
Parameters:
obj -  
guid -  
Returns:
 
Throws:
COMException - JNI/COM error

newHost

public static int newHost(AXComponent obj,
                          java.lang.String guid)
For internal usage
Parameters:
obj -  
guid -  
Returns:
 

createControl

public static int createControl(AXComponent obj)
                         throws COMException
For internal usage
Parameters:
obj -  
Returns:
 
Throws:
COMException - JNI/COM error

callInit

public static void callInit(AXComponent obj)
                     throws COMException
For internal use
Parameters:
obj -  
Throws:
COMException - JNI/COM error

invalidate

public final void invalidate(boolean eraseBkg)

onWindowMsg

public void onWindowMsg(int msgID,
                        long w,
                        long l)

_getHWND

private int _getHWND()

getHWND

private final int getHWND()

deleteHost

private final void deleteHost(int host)

resizeHost

private final void resizeHost(int w,
                              int h)

redrawHost

private final void redrawHost()

getControl

private final int getControl(int host)

createHostStr

private static final int createHostStr(AXComponent obj,
                                       java.lang.String guid)

createHost

private static final int createHost(AXComponent obj,
                                    byte[] guid)

createControl

private static final int createControl(AXComponent obj,
                                       int host,
                                       int window,
                                       int w,
                                       int h)

invalidate

private static final void invalidate(AXComponent obj,
                                     boolean eraseBkg)


New Jawin designed by Vitally Shelest. This product includes software developed by the DevelopMentor OpenSource Project (http://www.develop.com/OpenSource).