JIDLCanvas

Declaration

public abstract class JIDLCanvas extends java.awt.Canvas implements JIDLObjectI, java.awt.event.ComponentListener, java.awt.event.KeyListener, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, JIDLMouseListener, JIDLMouseMotionListener, JIDLKeyListener, JIDLComponentListener, JIDLCursorSupport

 

java.lang.Object

|

+--java.awt.Component

|

+--java.awt.Canvas

|

+--com.idl.javaidl.JIDLCanvas

All Implemented Interfaces

javax.accessibility.Accessible, java.awt.event.ComponentListener, java.util.EventListener, java.awt.image.ImageObserver, JIDLComponentListener, JIDLCursorSupport, JIDLKeyListener, JIDLMouseListener, JIDLMouseMotionListener, JIDLObjectI, java.awt.event.KeyListener, java.awt.MenuContainer, java.awt.event.MouseListener, java.awt.event.MouseMotionListener, java.io.Serializable

Description

This class wraps an IDL object of type IDLitWindow in a java.awtCanvas providing direct rendering of the object from IDL.

Note: JIDLCanvas is not supported on macOS.

In many of the methods of this class, one or more flags are required to be specified for parameters being passed to or from the bridge. These flags follow the following guidelines:

For all types of parameters (subclasses of JIDLNumber, JIDLString, JIDLObjectI and JIDLArray), a flag should be set that determines whether the parameter is in-only (const) or in-out (we expect it to be changed by IDL). The constants that determine this are either JIDLConst.PARMFLAG_CONST or JIDLConst.PARMFLAG_IN_OUT.

For parameters that are arrays, a flag should be set that tells the bridge whether the array is to be convolved when passed to IDL. If the PARM_IN_OUT flag is set, this flag will also tell the bridge whether to convolve the array when it is copied back to Java. The constants that determine this are either JIDLConst.PARMFLAG_CONVMAJORITY or JIDLConst.PARMFLAG_NO_CONVMAJORITY.

For example, if the parameter in question is an array that is to be modified by IDL (in-out) and needs to be convolved when passed to and from IDL, set its argpal array member as follows:

argpal[2] = JIDLConst.PARMFLAG_IN_OUT | JIDLConst.PARMFLAG_CONV MAJORITY;

Member Summary

Fields

static int

IDL_SOFTWARE_RENDERER

Internal use

static int

OPENGL_RENDERER

Internal use

Constructors

JIDLCanvas(java.lang.String sClass, int iOPSFlags, java.lang.String sProcessName)

Construct a JIDLCanvas

JIDLCanvas(java.lang.String sClass, java.lang.String sProcessName)

Construct a JIDLCanvas Note that constructing the JIDLObject does NOT create the object on the IDL-side of the bridge.

Methods

void

abort()

Requests that the IDL process containing the underlying IDL object abort its current activity.

void

addIDLComponentListener(JIDLComponentListener listener)

Adds the specified JIDLComponentListener to a list of listeners that receive notification of Component events.

void

addIDLKeyListener(JIDLKeyListener listener)

Adds the specified JIDLKeyListener to a list of listeners that receive notification of Key events.

void

addIDLMouseListener(JIDLMouseListener listener)

Adds the specified JIDLMouseListener to a list of listeners that receive notification of Mouse events.

void

addIDLMouseMotionListener(JIDLMouseMotionListener listener)

Adds the specified JIDLMouseMotionListener to a list of listeners that receive notification of MouseMotion events.

void

addIDLMouseWheelListener(JIDLMouseWheelListener listener)

Adds the specified JIDLMouseWheelListener to a list of listeners that receive notification of MouseWheel events.

void

addIDLNotifyListener(JIDLNotifyListener listener)

Adds the specified IDL notify listener to receive IDL notification events on this object.

void

addIDLOutputListener(JIDLOutputListener listener)

Adds the specified IDL output listener to receive IDL output events on this object.

java.lang.Object

callFunction(java.lang.String sMethodName, int iPalFlag)

Call IDL function that accepts zero parameters.

java.lang.Object

callFunction(java.lang.String sMethodName, int argc, java.lang.Object argv, int[] argpal, int iPalFlag)

Call IDL function.

void

callProcedure(java.lang.String sMethodName)

Call IDL procedure that accepts zero parameters.

void

callProcedure(java.lang.String sMethodName, int argc, java.lang.Object argv, int[] argpal)

Call IDL procedure.

void

componentHidden(java.awt.event.ComponentEvent e)

Called when the component is hidden.

void

componentMoved(java.awt.event.ComponentEvent e)

Called when the component is moved.

void

componentResized(java.awt.event.ComponentEvent e)

Internal use.

void

componentShown(java.awt.event.ComponentEvent e)

Called when the component is shown.

void

createObject()

Create the wrapped object by calling IDL’s ::INIT method.

void

createObject(int argc, java.lang.Object argv, int[] argpal)

Create the wrapped object by calling IDL’s ::INIT method.

void

createObject(int argc, java.lang.Object argv, int[] argpal, com.idl.javaidl.JIDLProcessInitializer initializer)

Create the wrapped object by calling IDL’s ::INIT method.

void

createObject(com.idl.javaidl.JIDLProcessInitial izer initializer)

Create the wrapped object by calling IDL’s ::INIT method.

void

destroyObject()

Destroys the underlying IDL object associated with the wrapper.

void

draw()

Internal use.

void

executeString(java.lang.String sCmd)

Execute the given command string in IDL.

java.lang.String

getClassName()

Get the class name of the object.

long

getCookie()

Internal use.

java.lang.String

getIDLObjectClassName()

Retrieves the IDL object class name of the underlying IDL object.

java.lang.String

getIDLObjectVariableName()

When the underlying IDL object was created in the IDL process, it was assigned a variable name.

java.lang.Object

getIDLVariable(java.lang.String sVar)

Given a variable name, return the IDL variable.

java.lang.String

getObjVariableName()

Get the IDL Variable name of the given object

java.lang.String

getProcessName()

Returns the name of the process that contains the underlying IDL object.

java.lang.Object

getProperty(java.lang.String sProperty, int iPalFlag)

Call IDL getProperty method to get named property.

void

IDLcomponentExposed(JIDLObjectI obj)

Called when the JIDLCanvas is exposed.

void

IDLcomponentResized(JIDLObjectI obj, java.awt.event.ComponentEvent e)

Called when the JIDLCanvas is resized.

void

IDLkeyPressed(JIDLObjectI obj, java.awt.event.KeyEvent e, int x, int y)

Called when the JIDLCanvas has focus and a key is pressed.

void

IDLkeyReleased(JIDLObjectI obj, java.awt.event.KeyEvent e, int x, int y)

Called when the JIDLCanvas has focus and a key is released.

void

IDLmouseDragged(JIDLObjectI obj, java.awt.event.MouseEvent e)

Called when the mouse is dragged in a JIDLCanvas.

void

IDLmouseEntered(JIDLObjectI obj, java.awt.event.MouseEvent e)

Called when the mouse enters a JIDLCanvas.

void

IDLmouseExited(JIDLObjectI obj, java.awt.event.MouseEvent e)

Called when the mouse exits a JIDLCanvas.

void

IDLmouseMoved(JIDLObjectI obj, java.awt.event.MouseEvent e)

Called when the mouse is moved in a JIDLCanvas.

void

IDLmousePressed(JIDLObjectI obj, java.awt.event.MouseEvent e)

Called when the mouse is pressed in a JIDLCanvas.

void

IDLmouseReleased(JIDLObjectI obj, java.awt.event.MouseEvent e)

Called when the mouse is released in a JIDLCanvas.

void

initListeners()

Initialize listeners.

boolean

isFocusTraversable()

Internal use.

boolean

isObjCreated()

Determine if object has been created successfully.

boolean

isObjectCreated()

Determine if object has been created successfully.

boolean

isObjectDisplayable()

void

keyPressed(java.awt.event.KeyEvent e)

Internal use.

void

keyReleased(java.awt.event.KeyEvent e)

Internal use.

void

keyTyped(java.awt.event.KeyEvent e)

Internal use.

int

mapIDLCursorToJavaCursor(java.lang.String idlCursor)

Maps the IDL cursor to a suitable Java cursor.

void

mouseClicked(java.awt.event.MouseEvent e)

Internal use.

void

mouseDragged(java.awt.event.MouseEvent e)

Internal use.

void

mouseEntered(java.awt.event.MouseEvent e)

Internal use.

void

mouseExited(java.awt.event.MouseEvent e)

Internal use.

void

mouseMoved(java.awt.event.MouseEvent e)

Internal use.

void

mousePressed(java.awt.event.MouseEvent e)

Internal use.

void

mouseReleased(java.awt.event.MouseEvent e)

Internal use.

void

paint(java.awt.Graphics g)

Internal use.

void

removeIDLComponentListener(JIDLComponentListener listener)

Remove the specified JIDLComponentListener from a list of listeners that receive notification of Component events.

void

removeIDLKeyListener(JIDLKeyListener listener)

Removes the specified JIDLKeyListener from a list of listeners that receive notification of Key events.

void

removeIDLMouseListener(JIDLMouseListener listener)

Removes the specified JIDLMouseListener from a list of listeners that receive notification of Mouse events.

void

removeIDLMouseMotionListener(JIDLMouseMotionListener listener)

Removes the specified JIDLMouseMotionListener from a list of listeners that receive notification of MouseMotion events.

void

removeIDLMouseWheelListener(JIDLMouseWheelListener listener)

Removes the specified JIDLMouseWheelListener from a list of listeners that receive notification of MouseWheel events.

void

removeIDLNotifyListener(JIDLNotifyListener listener)

Removes the specified IDL notify listener so it no longer receives IDL notifications.

void

removeIDLOutputListener(JIDLOutputListener listener)

Removes the specified IDL output listener on this object.

void

setCursor(java.lang.String idlCursor)

Set the JIDLCanvas cursor.

void

setIDLVariable(java.lang.String sVar, java.lang.Object obj)

Set/Create an IDL variable of the given name and value.

void

setProcessName(java.lang.String process)

Set the process name that the object will be created in.

void

setProperty(java.lang.String sProperty, java.lang.Object obj, int iPalFlag)

Call IDL setProperty method to set named property.

java.lang.String

toString()

Returns a string representation of the object.

void

update(java.awt.Graphics g)

Internal use.

Inherited Member Summary

Fields inherited from class Component

BOTTOM_ALIGNMENT, CENTER_ALIGNMENT, LEFT_ALIGNMENT, RIGHT_ALIGNMENT, TOP_ALIGNMENT

Fields inherited from interface ImageObserver

ABORT, ALLBITS, ERROR, FRAMEBITS, HEIGHT, PROPERTIES, SOMEBITS, WIDTH

Methods inherited from class Canvas

addNotify(), createBufferStrategy(int, BufferCapabilities), createBufferStrategy(int, BufferCapabilities), getAccessibleContext(), getBufferStrategy()

Methods inherited from class Component

action(Event, Object), add(PopupMenu), addComponentListener(ComponentListener), addFocusListener(FocusListener), addHierarchyBoundsListener(HierarchyBoundsListener), addHierarchyListener(HierarchyListener), addInputMethodListener(InputMethodListener), addKeyListener(KeyListener), addMouseListener(MouseListener), addMouseMotionListener(MouseMotionListener), addMouseWheelListener(MouseWheelListener), addPropertyChangeListener(String, PropertyChangeListener), addPropertyChangeListener(String, PropertyChangeListener), applyComponentOrientation(ComponentOrientation), areFocusTraversalKeysSet(int), bounds(), checkImage(Image, ImageObserver), checkImage(Image, ImageObserver), contains(Point), contains(Point), createImage(ImageProducer), createImage(ImageProducer), createVolatileImage(int, int, ImageCapabilities), createVolatileImage(int, int, ImageCapabilities), deliverEvent(Event), disable(), dispatchEvent(AWTEvent), doLayout(), enable(boolean), enable(boolean), enableInputMethods(boolean), getAlignmentX(), getAlignmentY(), getBackground(), getBounds(Rectangle), getBounds(Rectangle), getColorModel(), getComponentAt(Point), getComponentAt(Point), getComponentListeners(), getComponentOrientation(), getCursor(), getDropTarget(), getFocusCycleRootAncestor(), getFocusListeners(), getFocusTraversalKeys(int), getFocusTraversalKeysEnabled(), getFont(), getFontMetrics(Font), getForeground(), getGraphics(), getGraphicsConfiguration(), getHeight(), getHierarchyBoundsListeners(), getHierarchyListeners(), getIgnoreRepaint(), getInputContext(), getInputMethodListeners(), getInputMethodRequests(), getKeyListeners(), getListeners(Class), getLocale(), getLocation(Point), getLocation(Point), getLocationOnScreen(), getMaximumSize(), getMinimumSize(), getMouseListeners(), getMouseMotionListeners(), getMouseWheelListeners(), getName(), getParent(), getPeer(), getPreferredSize(), getPropertyChangeListeners(String), getPropertyChangeListeners(String), getSize(Dimension), getSize(Dimension), getToolkit(), getTreeLock(), getWidth(), getX(), getY(), gotFocus(Event, Object), handleEvent(Event), hasFocus(), hide(), imageUpdate(Image, int, int, int, int, int), inside(int, int), invalidate(), isBackgroundSet(), isCursorSet(), isDisplayable(), isDoubleBuffered(), isEnabled(), isFocusCycleRoot(Container), isFocusOwner(), isFocusable(), isFontSet(), isForegroundSet(), isLightweight(), isOpaque(), isShowing(), isValid(), isVisible(), keyDown(Event, int), keyUp(Event, int), layout(), list(PrintWriter, int), list(PrintWriter, int), list(PrintWriter, int), list(PrintWriter, int), list(PrintWriter, int), locate(int, int), location(), lostFocus(Event, Object), minimumSize(), mouseDown(Event, int, int), mouseDrag(Event, int, int), mouseEnter(Event, int, int), mouseExit(Event, int, int), mouseMove(Event, int, int), mouseUp(Event, int, int), move(int, int), nextFocus(), paintAll(Graphics), postEvent(Event), preferredSize(), prepareImage(Image, ImageObserver), prepareImage(Image, ImageObserver), print(Graphics), printAll(Graphics), remove(MenuComponent), removeComponentListener(ComponentListener), removeFocusListener(FocusListener), removeHierarchyBoundsListener(HierarchyBoundsListener), removeHierarchyListener(HierarchyListener), removeInputMethodListener(InputMethodListener), removeKeyListener(KeyListener), removeMouseListener(MouseListener), removeMouseMotionListener(MouseMotionListener), removeMouseWheelListener(MouseWheelListener), removeNotify(), removePropertyChangeListener(String, PropertyChangeListener), removePropertyChangeListener(String, PropertyChangeListener), repaint(long, int, int, int, int), repaint(long, int, int, int, int), repaint(long, int, int, int, int), repaint(long, int, int, int, int), requestFocus(), requestFocusInWindow(), reshape(int, int, int, int), resize(Dimension), resize(Dimension), setBackground(Color), setBounds(Rectangle), setBounds(Rectangle), setComponentOrientation(ComponentOrientation), setCursor(Cursor), setDropTarget(DropTarget), setEnabled(boolean), setFocusTraversalKeys(int, Set), setFocusTraversalKeysEnabled(boolean), setFocusable(boolean), setFont(Font), setForeground(Color), setIgnoreRepaint(boolean), setLocale(Locale), setLocation(Point), setLocation(Point), setName(String), setSize(Dimension), setSize(Dimension), setVisible(boolean), show(boolean), show(boolean), size(), transferFocus(), transferFocusBackward(), transferFocusUpCycle(), validate()

Methods inherited from class Object

equals(Object), getClass(), hashCode(), notify(), notifyAll(), wait(long, int), wait(long, int), wait(long, int)

Fields

IDL_SOFTWARE_RENDERER

public static final int IDL_SOFTWARE_RENDERER

Internal use

OPENGL_RENDERER

public static final int OPENGL_RENDERER

Internal use

Constructors

JIDLCanvas(String, int, String)

public JIDLCanvas(java.lang.String sClass, int iOPSFlags, java.lang.String sProcessName)

Deprecated.

Replaced by constructor taking 2 parameters

Construct a JIDLCanvas

Parameters:

sClass - IDL Class name

iOPSFlags - Unused. The process name determines the OPS flags.

sProcessName - The process name. If null or “”, in-process is used.

JIDLCanvas(String, String)

public JIDLCanvas(java.lang.String sClass, java.lang.String sProcessName)

Construct a JIDLCanvas Note that constructing the JIDLObject does NOT create the object on the IDL-side of the bridge. This is done using the createObject method.

Parameters:

sClass - IDL Class name

sProcessName - The process name. If null or “”, in-process is used.

Methods

abort()

public void abort()

Requests that the IDL process containing the underlying IDL object abort its current activity.

This is only a request and IDL may take a long time before it actually stops.

The client can only Abort the current IDL activity if that wrapper object is the current “owner” of the underlying IDL.

Specified By:

abort in interface JIDLObjectI

Throws:

JIDLException - If IDL encounters an error.

See Also:

JIDLAbortedException

addIDLComponentListener(JIDLComponentListener)

public void addIDLComponentListener(com.idl.javaidl.JIDLComponentListener listener)

Adds the specified JIDLComponentListener to a list of listeners that receive notification of Component events.

Note that registering/unregistering for events should happen in the initListeners method or AFTER the createObject method.

Parameters:

listener - the listener

See Also:

JIDLComponentListener

addIDLKeyListener(JIDLKeyListener)

public void addIDLKeyListener(com.idl.javaidl.JIDLKeyListener listener)

Adds the specified JIDLKeyListener to a list of listeners that receive notification of Key events.

Note that registering/unregistering for events should happen in the initListeners method or AFTER the createObject method.

Parameters:

listener - the listener

See Also:

JIDLKeyListener

addIDLMouseListener(JIDLMouseListener)

public void addIDLMouseListener(com.idl.javaidl.JIDLMouseListener listener)

Adds the specified JIDLMouseListener to a list of listeners that receive notification of Mouse events.

Note that registering/unregistering for events should happen in the initListeners method or AFTER the createObject method.

Parameters:

listener - the listener

See Also:

JIDLMouseListener

addIDLMouseMotionListener(JIDLMouseMotionListener)

public void addIDLMouseMotionListener(com.idl.javaidl.JIDLMouseMotionListener listener)

Adds the specified JIDLMouseMotionListener to a list of listeners that receive notification of MouseMotion events.

Note that registering/unregistering for events should happen in the initListeners method or AFTER the createObject method.

Parameters:

listener - the listener

See Also:

JIDLMouseMotionListener

addIDLMouseWheelListener(JIDLMouseWheelListener)

public void addIDLMouseWheelListener(com.idl.javaidl.JIDLMouseWheelListener listener)

Adds the specified JIDLMouseWheelListener to a list of listeners that receive notification of MouseWheel events.

Note that registering/unregistering for events should happen in the initListeners method or AFTER the createObject method.

Parameters:

listener - the listener

See Also:

JIDLMouseWheelListener

addIDLNotifyListener(JIDLNotifyListener)

public void addIDLNotifyListener(com.idl.javaidl.JIDLNotifyListener listener)

Adds the specified IDL notify listener to receive IDL notification events on this object.

Note that registering/unregistering for events should happen in the initListeners method or AFTER the createObject method.

Specified By:

addIDLNotifyListener in interface JIDLObjectI

Parameters:

listener - the listener

addIDLOutputListener(JIDLOutputListener)

public void addIDLOutputListener(com.idl.javaidl.JIDLOutputListener listener)

Adds the specified IDL output listener to receive IDL output events on this object. Note that registering/unregistering for events should happen in the initListeners method or AFTER the createObject method.

Specified By:

addIDLOutputListener in interface JIDLObjectI

Parameters:

listener - the listener

callFunction(String, int)

public java.lang.Object callFunction(java.lang.StringsMethodName, int iPalFlag)

Call IDL function that accepts zero parameters.

Parameters:

sMethodName - the function name

iPalFlag - a flag determining whether a returned array is convolved or not. If the returned value is not an array, this value is zero. See class description for more information.

Returns:

an Object of type JIDLNumber, JIDLString, JIDLObject or JIDLArray. The caller must know the type of the Object being returned and cast it to its proper type. May also return null.

Throws:

JIDLException - If IDL encounters an error.

See Also:

callFunction(String, int, Object[], int[], int)

callFunction(String, int, Object[], int[], int)

public java.lang.Object callFunction(java.lang.String sMethodName, int argc, java.lang.Object[] argv, int[] argpal, int iPalFlag)

Call IDL function.

The argpal parameter is an array of flags created by OR-ing constants from class JIDLConst. Each array element corresponds to the equivalent parameter in argv.

Specified By:

callFunction in interface JIDLObjectI

Parameters:

sMethodName - the procedure name

argc - the number of parameters

argv - array of Objects to be passed to IDL. This array should be of length argc and should contain objects of type JIDLNumber, JIDLObject, JIDLString or JIDLObject.

argpal - array of flags denoting whether each argv parameter passed to be bridge is 1) in-out vs constant; or 2) a convolved or non-convolved array This array should be of length argc.

iPalFlag - a flag determining whether a returned array if convolved or not. If the returned value is not an array, this value is zero.

Returns:

an Object of type JIDLNumber, JIDLString, JIDLObjectI or JIDLArray. The caller must know the type of the Object being returned and cast it to its proper type.

Throws:

JIDLException - If IDL encounters an error.

See Also:

JIDLNumber, JIDLObject, JIDLString, JIDLArray, JIDLConst.PARMFLAG_CONST, JIDLConst.PARMFLAG_IN_OUT, JIDLConst.PARMFLAG_CONVMAJORITY, JIDLConst.PARMFLAG_NO_CONVMAJORITY

callProcedure(String)

public void callProcedure(java.lang.String sMethodName)

Call IDL procedure that accepts zero parameters.

Parameters:

sMethodName - the procedure name

Throws:

JIDLException - If IDL encounters an error.

See Also:

callProcedure(String, int, Object[], int[])

callProcedure(String, int, Object[], int[])

public void callProcedure(java.lang.String sMethodName, int argc, java.lang.Object[] argv, int[] argpal)

Call IDL procedure.

The argpal parameter is an array of flags created by OR-ing constants from class JIDLConst. Each array element corresponds to the equivalent parameter in argv.

Specified By:

callProcedure in interface JIDLObjectI

Parameters:

sMethodName - the procedure name

argc - the number of parameters

argv - array of Objects to be passed to IDL. This array should be of length argc and should contain objects of type JIDLNumber, JIDLObject, JIDLString or JIDLObject.

argpal - array of flags denoting whether each argv parameter passed to be bridge is 1) in-out vs constant; or 2) a convolved or non-convolved array This array should be of length argc.

Throws:

JIDLException - If IDL encounters an error.

JIDLNumber, JIDLObject, JIDLString, JIDLArray, JIDLConst.PARMFLAG_CONST, JIDLConst.PARMFLAG_IN_OUT, JIDLConst.PARMFLAG_CONVMAJORITY, JIDLConst.PARMFLAG_NO_CONVMAJORITY

componentHidden(ComponentEvent)

public void componentHidden(java.awt.event.ComponentEvent e)

Called when the component is hidden.

This method does nothing because IDL does not care about this event. This could be overridden by a child of JIDLCanvas if these events were of interest to the client application

Specified By:

componentHidden in interface ComponentListener

See Also:

java.awt.event.ComponentListener

componentMoved(ComponentEvent)

public void componentMoved(java.awt.event.ComponentEvent e)

Called when the component is moved.

This method does nothing because IDL does not care about this event. This could be overridden by a child of JIDLCanvas if these events were of interest to the client application

Specified By:

componentMoved in interface ComponentListener

See Also:

java.awt.event.ComponentListener

componentResized(ComponentEvent)

public final void componentResized(java.awt.event.ComponentEvent e)

Internal use.

Called when the JIDLCanvas is resized.

If interested in resize events, use IDLcomponentResized. This method should NOT be overridden by a child of JIDLCanvas.

Specified By:

componentResized in interface ComponentListener

See Also:

JIDLComponentListener, IDLcomponentResized(JIDLObjectI, ComponentEvent)

componentShown(ComponentEvent)

public void componentShown(java.awt.event.ComponentEvent e)

Called when the component is shown.

This method does nothing because IDL does not care about this event. This could be overridden by a child of JIDLCanvas if these events were of interest to the client application

Specified By:

componentShown in interface ComponentListener

See Also:

java.awt.event.ComponentListener

createObject()

public void createObject()

Create the wrapped object by calling IDL’s ::INIT method. Used for ::INIT methods that take zero parameters.

Throws:

JIDLException - If IDL encounters an error.

See Also:

createObject(int, Object[], int[])

createObject(int, Object[], int[])

public void createObject(int argc, java.lang.Object[] argv, int[] argpal)

Create the wrapped object by calling IDL’s ::INIT method.

Note that the GUI that this Canvas lives in must be exposed before the createObject method is called.

createObject does the following:

The argpal parameter is an array of flags created by OR-ing constants from class JIDLConst. Each array element corresponds to the equivalent parameter in argv. See the class description for more information.

Specified By:

createObject in interface JIDLObjectI

Parameters:

argc - the number of parameters

argv - array of Objects to be passed to IDL. This array should be of length argc and should contain objects of type JIDLNumber, JIDLObject, JIDLString or JIDLObject.

argpal - array of flags denoting whether each argv parameter passed to be bridge is 1) in-out vs constant; or 2) a convolved or non-convolved array This array should be of length argc.

Throws:

JIDLException - If IDL encounters an error.

See Also:

JIDLConst, initListeners()

createObject(int, Object[], int[], JIDLProcessInitializer)

public void createObject(int argc, java.lang.Object[] argv, int[] argpal, com.idl.javaidl.JIDLProcessInitializer initializer)

Create the wrapped object by calling IDL’s ::INIT method.

Note that the GUI that this Canvas lives in must be exposed before the createObject method is called.

createObject does the following:

• Calls ::Init method in the IDL object

• Calls the superclass initListeners method to initialize any event handlers. The initListeners method has default behavior, which is different for graphical and non-graphical objects. If the default behavior is not desired, a sub-class to modify the listener initialization may override the initListeners method.

Specified By:

createObject in interface JIDLObjectI

Parameters:

argc - the number of parameters to be passed to INIT

argv - array of Objects to be passed to IDL. This array should be of length argc and should contain objects of type JIDLNumber, JIDLObject, JIDLString or JIDLArray.

argpal - array of flags denoting whether each argv parameter that is of type array should be convolved or not. For parameters that are not arrays, the value within the array will always be 0.

initializer - a JIDLProcessInitializer object that specifies IDL process initialization parameters such as the licensing mode to be used..

Throws:

JIDLException - If IDL encounters an error.

createObject(JIDLProcessInitializer)

public void createObject(com.idl.javaidl.JIDLProcessInitializer initializer)

Create the wrapped object by calling IDL’s ::INIT method. Used for ::INIT methods that take zero parameters.

The initializer parameter is used to supply IDL process initialization values.

Note that the GUI that this Canvas lives in must be exposed before the createObject method is called.

Parameters:

initializer - a JIDLProcessInitializer object that specifies IDL process initialization parameters such as the licensing mode to be used..

Throws:

JIDLException - If IDL encounters an error.

destroyObject()

public void destroyObject()

Destroys the underlying IDL object associated with the wrapper.

If the object being destroyed is the last object within an OPS process, the OPS process is also destroyed.

Note that this does not destroy the actual wrapper object. Because the wrapper object is a Java object, it follows all the Java reference counting/garbage collection schemes. Once all references to the wrapper object are released from Java code and once the Java Virtual Machine calls the garbage collector, the wrapper object may be deleted from memory.

Specified By:

destroyObject in interface JIDLObjectI

draw()

public void draw()

Internal use.

Call IDL to inform the Canvas has been exposed to cause a redraw.

This in turn calls all the JIDLComponentListeners. Should not be overridden.

executeString(String)

public void executeString(java.lang.String sCmd)

Execute the given command string in IDL.

Specified By:

executeString in interface JIDLObjectI

Parameters:

sCmd - the single-line command to execute in IDL.

Throws:

JIDLException - If IDL encounters an error.

getClassName()

public java.lang.String getClassName()

Deprecated.

Replaced by getIDLObjectClassName() Get the class name of the object.

Returns:

class name (“” if object not created yet)

getCookie()

public long getCookie()

Internal use.

Specified By:

getCookie in interface JIDLObjectI

getIDLObjectClassName()

public java.lang.String getIDLObjectClassName()

Retrieves the IDL object class name of the underlying IDL object.

Specified By:

getIDLObjectClassName in interface JIDLObjectI

Returns:

the IDL object class name

getIDLObjectVariableName()

public java.lang.String getIDLObjectVariableName()

When the underlying IDL object was created in the IDL process, it was assigned a variable name. This method retrieves that name.

Specified By:

getIDLObjectVariableName in interface JIDLObjectI

Returns:

the variable name

getIDLVariable(String)

public java.lang.Object getIDLVariable(java.lang.String sVar)

Given a variable name, return the IDL variable.

Note that in the case of arrays, the array will ALWAYS be convolved when passed between Java and IDL.

Specified By:

getIDLVariable in interface JIDLObjectI

Parameters:

sVar - The IDL variable name

Returns:

an Object of type JIDLNumber, JIDLString, JIDLObject or JIDLArray. The caller must know the type of the Object being returned and cast it to its proper type. May also return null.

Throws:

JIDLException - If IDL encounters an error.

getObjVariableName()

public java.lang.String getObjVariableName()

Deprecated.

Replaced by getIDLObjectVariableName()

Get the IDL Variable name of the given object

Returns:

a String representing the IDL Variable name

getProcessName()

public java.lang.String getProcessName()

Returns the name of the process that contains the underlying IDL object. For an in- process object, returns an empty string.

Specified By:

getProcessName in interface JIDLObjectI

Returns:

process name. Empty string if the process is in-process.

getProperty(String, int)

public java.lang.Object getProperty(java.lang.StringsProperty, int iPalFlag)

Call IDL getProperty method to get named property.

Specified By:

getProperty in interface JIDLObjectI

Parameters:

sProperty - the property name

iPalFlag - a flag determining whether a returned array will be convolved or not. If the returned value is not is ignored.

Returns:

an Object of type JIDLNumber, JIDLString, JIDLObject or JIDLArray. The caller must know the type of the Object being returned and cast it to its proper type. May also return null.

Throws:

JIDLException - If IDL encounters an error.

See Also:

JIDLNumber, JIDLObjectI, JIDLString, JIDLArray, JIDLConst.PARMFLAG_CONVMAJORITY, JIDLConst.PARMFLAG_NO_CONVMAJORITY

IDLcomponentExposed(JIDLObjectI)

public void IDLcomponentExposed(com.idl.javaidl.JIDLObjectI obj)

Called when the JIDLCanvas is exposed.

The default behavior of this method is to lock the Canvas, pass the event on to IDL to handle (i.e. redraw), and then unlock the Canvas.

The behavior may be changed by overriding this method in a sub-class. For example, the sub-class may want to do something special before or after the redraw happens. The method would be implemented as follows:

public class mySubClass extends JIDLCanvas {

public void IDLcomponentExposed() {

// do something here before IDL is called

super.IDLcomponentExposed();

// do something if desired afterwards

}

}

Specified By:

IDLcomponentExposed in interface JIDLComponentListener

See Also:

JIDLComponentListener, initListeners()

IDLcomponentResized(JIDLObjectI, ComponentEvent)

public void IDLcomponentResized(com.idl.javaidl.JIDLObjectI obj, java.awt.event.ComponentEvent e)

Called when the JIDLCanvas is resized.

The default behavior of this method is to send the resize event to IDL to handle.

Specified By:

IDLcomponentResized in interface JIDLComponentListener

See Also:

JIDLComponentListener, initListeners()

IDLkeyPressed(JIDLObjectI, KeyEvent, int, int)

public void IDLkeyPressed(com.idl.javaidl.JIDLObjectI obj, java.awt.event.KeyEvent e, int x, int y)

Called when the JIDLCanvas has focus and a key is pressed.

The default behavior of this method is pass the event to IDL which, if registered for the event will call ::OnKeyboard.

The behavior may be changed by overriding this method in a sub-class. For example, the sub-class may want to ignore the event by providing an empty implementation of the method. Or the sub-class may do something special before or after the event happens.

See IDLcomponentExposed for an example of how this would be done.

Specified By:

IDLkeyPressed in interface JIDLKeyListener

See Also:

JIDLKeyListener, IDLcomponentExposed(JIDLObjectI), initListeners()

IDLkeyReleased(JIDLObjectI, KeyEvent, int, int)

public void IDLkeyReleased(com.idl.javaidl.JIDLObjectI obj, java.awt.event.KeyEvent e, int x, int y)

Called when the JIDLCanvas has focus and a key is released.

The default behavior of this method is pass the event to IDL which, if registered for the event will call ::OnKeyboard. The behavior may be changed by overriding this method in a sub-class. For example, the sub-class may want to ignore the event by providing an empty implementation of the method. Or the sub-class may do something special before or after the event happens. See IDLcomponentExposed for an example of how this would be done.

Specified By:

IDLkeyReleased in interface JIDLKeyListener

See Also:

JIDLKeyListener, IDLcomponentExposed(JIDLObjectI), initListeners()

IDLmouseDragged(JIDLObjectI, MouseEvent)

public void IDLmouseDragged(com.idl.javaidl.JIDLObjectI obj, java.awt.event.MouseEvent e)

Called when the mouse is dragged in a JIDLCanvas.

The default behavior of this method is pass the event to IDL which, if registered for the event, will call ::OnMouseMotion.

The behavior may be changed by overriding this method in a sub-class. For example, the sub-class may want to ignore the event by providing an empty implementation of the method. Often our IDL IDLitWindow is only interested in one type of motion event and not another. Or the sub-class may do something special before or after the event happens.

See IDLcomponentExposed for an example of how this would be done.

Specified By:

IDLmouseDragged in interface JIDLMouseMotionListener

See Also:

JIDLMouseMotionListener, IDLcomponentExposed(JIDLObjectI), initListeners()

IDLmouseEntered(JIDLObjectI, MouseEvent)

public void IDLmouseEntered(com.idl.javaidl.JIDLObjectI obj, java.awt.event.MouseEvent e)

Called when the mouse enters a JIDLCanvas.

The default behavior of this method is to ignore the event.

The behavior may be changed by overriding this method in a sub-class.

Specified By:

IDLmouseEntered in interface JIDLMouseListener

See Also:

JIDLMouseListener, initListeners()

IDLmouseExited(JIDLObjectI, MouseEvent)

public void IDLmouseExited(com.idl.javaidl.JIDLObjectI obj, java.awt.event.MouseEvent e)

Called when the mouse exits a JIDLCanvas.

The default behavior of this method is to ignore the event.

The behavior may be changed by overriding this method in a sub-class.

Specified By:

IDLmouseExited in interface JIDLMouseListener

See Also:

JIDLMouseListener, initListeners()

IDLmouseMoved(JIDLObjectI, MouseEvent)

public void IDLmouseMoved(com.idl.javaidl.JIDLObjectI obj, java.awt.event.MouseEvent e)

Called when the mouse is moved in a JIDLCanvas.

The default behavior of this method is pass the event to IDL which, if registered for the event, will call ::OnMouseMotion.

The behavior may be changed by overriding this method in a sub-class. For example, the sub-class may want to ignore the event by providing an empty implementation of the method. Often our IDL IDLitWindow is only interested in one type of motion event and not another. Or the sub-class may do something special before or after the event happens.

See IDLcomponentExposed for an example of how this would be done.

Specified By:

IDLmouseMoved in interface JIDLMouseMotionListener

See Also:

JIDLMouseMotionListener, IDLcomponentExposed(JIDLObjectI), initListeners()

IDLmousePressed(JIDLObjectI, MouseEvent)

public void IDLmousePressed(com.idl.javaidl.JIDLObjectIobj, java.awt.event.MouseEvent e)

Called when the mouse is pressed in a JIDLCanvas.

The default behavior of this method is pass the event to IDL which, if registered for the event, will call ::OnMouseDown.

The behavior may be changed by overriding this method in a sub-class. For example, the sub-class may want to ignore the event by providing an empty implementation of the method. Or the sub-class may do something special before or after the event happens.

See IDLcomponentExposed for an example of how this would be done.

Specified By:

IDLmousePressed in interface JIDLMouseListener

See Also:

JIDLMouseListener, IDLcomponentExposed(JIDLObjectI), initListeners()

IDLmouseReleased(JIDLObjectI, MouseEvent)

public void IDLmouseReleased(com.idl.javaidl.JIDLObjectI obj, java.awt.event.MouseEvent e)

Called when the mouse is released in a JIDLCanvas.

The default behavior of this method is pass the event to IDL which, if registered for the event, will call ::OnMouseUp.

The behavior may be changed by overriding this method in a sub-class. For example, the sub-class may want to ignore the event by providing an empty implementation of the method. Or the sub-class may do something special before or after the event happens.

See IDLcomponentExposed for an example of how this would be done.

Specified By:

IDLmouseReleased in interface JIDLMouseListener

See Also:

JIDLMouseListener, IDLcomponentExposed(JIDLObjectI), initListeners()

initListeners()

public void initListeners()

Initialize listeners.

This method is always called by createObject. The JIDLCanvas listens to the following events:

• JIDLComponentListener

• JIDLKeyListener

• JIDLMouseListener

• JIDLMouseMotionListener

The method may be overridden by sub-classes to initialize a different set of listeners (or none at all). For example if a sub-class of JIDLCanvas only wished to listen to key and component events, it would override initListeners as follows:

public void initListeners()

{

addIDLComponentListener(this);

addIDLKeyListener(this);

}

As another example, if a sub-class of JIDLCanvas wished to listen to key events, component events, and notify events, it would need to implement JIDLNotifyListener and register to listen for these events in initListeners, as follows:

public class newCanvas extends JIDLCanvas implements JIDLNotifyListener

{

public void initListeners()

{

addIDLComponentListener(this);

addIDLKeyListener(this);

addIDLNotifyListener(this);

}

void OnIDLNotify(JIDLObjectI obj, String s1, String s2)

{

// do something with the notify

}

}

Specified By:

initListeners in interface JIDLObjectI

See Also:

JIDLComponentListener, JIDLKeyListener, JIDLMouseListener, JIDLMouseMotionListener, JIDLNotifyListener, JIDLOutputListener

isFocusTraversable()

public boolean isFocusTraversable()

Internal use.

Overrides:

isFocusTraversable in class Component

isObjCreated()

public boolean isObjCreated()

Deprecated.

Replaced by isObjectCreated()

Determine if object has been created successfully.

Returns:

true if object created successfully, or false if object not created or creation was unsuccessful.

isObjectCreated()

public boolean isObjectCreated()

Determine if object has been created successfully.

Specified By:

isObjectCreated in interface JIDLObjectI

Returns:

true if object created successfully, or false if object not created, destroyed, or creation was unsuccessful.

See Also:

createObject()

isObjectDisplayable()

public boolean isObjectDisplayable()

Specified By:

isObjectDisplayable in interface JIDLObjectI

keyPressed(KeyEvent)

public final void keyPressed(java.awt.event.KeyEvent e)

Internal use.

Called when a key is pressed when the JIDLCanvas has focus.

If interested in this event, use IDLkeyPressed. This method should NOT be overridden by a child of JIDLCanvas.

Specified By:

keyPressed in interface KeyListener

See Also:

JIDLKeyListener, IDLkeyPressed(JIDLObjectI, KeyEvent, int, int)

keyReleased(KeyEvent)

public final void keyReleased(java.awt.event.KeyEvent e)

Internal use.

Called when a key is released when the JIDLCanvas has focus.

If interested in this event, use IDLkeyReleased. This method should NOT be overridden by a child of JIDLCanvas.

Specified By:

keyReleased in interface KeyListener

See Also:

JIDLKeyListener, IDLkeyReleased(JIDLObjectI, KeyEvent, int, int)

keyTyped(KeyEvent)

public void keyTyped(java.awt.event.KeyEvent e)

Internal use.

Called when a key is typed.

This method does nothing because IDL does not care about this event, using keyPressed to trigger its mouse events. This method should NOT be overridden by a child of JIDLCanvas.

Specified By:

keyTyped in interface KeyListener

mapIDLCursorToJavaCursor(String)

public int mapIDLCursorToJavaCursor(java.lang.String idlCursor)

Maps the IDL cursor to a suitable Java cursor. This is called internally by setCursor when the IDL drawable changes the cursor.

May be overridden to change the mapping. The default mapping is as follows:

Specified By:

mapIDLCursorToJavaCursor in interface JIDLCursorSupport

Parameters:

idlCursor - a String representing the IDL cursor

Returns:

the Cursor constant representing the Java Cursor style

See Also:

setCursor(String)

mouseClicked(MouseEvent)

public void mouseClicked(java.awt.event.MouseEvent e)

Internal use.

Called when the mouse is clicked.

This method does nothing because IDL does not care about this event, using mousePressed to trigger its mouse events. This method should NOT be overridden by a child of JIDLCanvas.

Specified By:

mouseClicked in interface MouseListener

mouseDragged(MouseEvent)

public final void mouseDragged(java.awt.event.MouseEvent e)

Internal use.

Called when the mouse is dragged in the JIDLCanvas.

If interested in this event, use IDLmouseDragged. This method should NOT be overridden by a child of JIDLCanvas.

mouseEntered(MouseEvent)

public final void mouseEntered(java.awt.event.MouseEvent e)

Internal use.

Called when the mouse enters the JIDLCanvas.

If interested in this event, use IDLmouseEntered. This method should NOT be overridden by a child of JIDLCanvas.

Specified By:

mouseEntered in interface MouseListener

See Also:

JIDLMouseListener, IDLmouseEntered(JIDLObjectI, MouseEvent)

mouseExited(MouseEvent)

public final void mouseExited(java.awt.event.MouseEvent e)

Internal use.

Called when the mouse exits the JIDLCanvas.

If interested in this event, use IDLmouseExited. This method should NOT be overridden by a child of JIDLCanvas.

Specified By:

mouseExited in interface MouseListener

See Also:

JIDLMouseListener, IDLmouseExited(JIDLObjectI, MouseEvent)

mouseMoved(MouseEvent)

public final void mouseMoved(java.awt.event.MouseEvent e)

Internal use.

Called when the mouse moves in the JIDLCanvas.

If interested in this event, use IDLmouseMoved. This method should NOT be overridden by a child of JIDLCanvas.

Specified By:

mouseMoved in interface MouseMotionListener

See Also:

JIDLMouseMotionListener, IDLmouseMoved(JIDLObjectI, MouseEvent)

mousePressed(MouseEvent)

public final void mousePressed(java.awt.event.MouseEvent e)

Internal use.

Called when the mouse is pressed.

If interested in this event, use IDLmousePressed. This method should NOT be overridden by a child of JIDLCanvas.

Specified By:

mousePressed in interface MouseListener

See Also:

JIDLMouseListener, IDLmousePressed(JIDLObjectI, MouseEvent)

mouseReleased(MouseEvent)

public final void mouseReleased(java.awt.event.MouseEvent e)

Internal use.

Called when the mouse is released.

If interested in this event, use IDLmouseReleased. This method should NOT be overridden by a child of JIDLCanvas.

Specified By:

mouseReleased in interface MouseListener

See Also:

JIDLMouseListener, IDLmouseReleased(JIDLObjectI, MouseEvent)

paint(Graphics)

public void paint(java.awt.Graphics g)

Internal use. Paint the Canvas. (Do not override this method)

Overrides:

paint in class Canvas

removeIDLComponentListener(JIDLComponentListener)

public void removeIDLComponentListener(com.idl.javaidl.JIDLComponentListener listener)

Remove the specified JIDLComponentListener from a list of listeners that receive notification of Component events.

Note that registering/unregistering for events should happen in the initListeners method or AFTER the createObject method.

Parameters:

listener - the listener

See Also:

JIDLComponentListener

removeIDLKeyListener(JIDLKeyListener)

public void removeIDLKeyListener(com.idl.javaidl.JIDLKeyListener listener)

Removes the specified JIDLKeyListener from a list of listeners that receive notification of Key events.

Note that registering/unregistering for events should happen in the initListeners method or AFTER the createObject method.

Parameters:

listener - the listener

See Also:

JIDLKeyListener

removeIDLMouseListener(JIDLMouseListener)

public void removeIDLMouseListener(com.idl.javaidl.JIDLMouseListener listener)

Removes the specified JIDLMouseListener from a list of listeners that receive notification of Mouse events.

Note that registering/unregistering for events should happen in the initListeners method or AFTER the createObject method.

Parameters:

listener - the listener

See Also:

JIDLMouseListener

removeIDLMouseMotionListener(JIDLMouseMotionListener)

public void removeIDLMouseMotionListener(com.idl.javaidl.JIDLMouseMotionListen er listener)

Removes the specified JIDLMouseMotionListener from a list of listeners that receive notification of MouseMotion events.

Note that registering/unregistering for events should happen in the initListeners method or AFTER the createObject method.

Parameters:

listener - the listener

See Also:

JIDLMouseMotionListener

removeIDLMouseWheelListener(JIDLMouseWheelListener)

public void removeIDLMouseWheelListener(com.idl.javaidl.JIDLMouseWheelListener listener)

Removes the specified JIDLMouseWheelListener to a list of listeners that receive notification of MouseWheel events.

Note that registering/unregistering for events should happen in the initListeners method or AFTER the createObject method.

Parameters:

listener - the listener

See Also:

JIDLMouseWheelListener

removeIDLNotifyListener(JIDLNotifyListener)

public void removeIDLNotifyListener(com.idl.javaidl.JIDLNotifyListener listener)

Removes the specified IDL notify listener so it no longer receives IDL notifications.

Note that registering/unregistering for events should happen in the initListeners method or AFTER the createObject method.

Specified By:

removeIDLNotifyListener in interface JIDLObjectI

Parameters:

listener - the listener

removeIDLOutputListener(JIDLOutputListener)

public void removeIDLOutputListener(com.idl.javaidl.JIDLOutputListener listener)

Removes the specified IDL output listener on this object.

Note that registering/unregistering for events should happen in the initListeners method or AFTER the createObject method.

Specified By:

removeIDLOutputListener in interface JIDLObjectI

Parameters:

listener - the listener

setCursor(String)

public void setCursor(java.lang.String idlCursor)

Set the JIDLCanvas cursor. Called automatically when the IDL cursor changes. This in turn calls mapIDLCursorToJavaCursor to map the IDL cursor name to a suitable Java cursor type.

Specified By:

setCursor in interface JIDLCursorSupport

Parameters:

idlCursor - A String representing the IDL cursor name.

See Also:

mapIDLCursorToJavaCursor(String)

setIDLVariable(String, Object)

public void setIDLVariable(java.lang.String sVar, java.lang.Object obj)

Set/Create an IDL variable of the given name and value.

Note that in the case of arrays, the array will ALWAYS be convolved when passed between Java and IDL.

Specified By:

setIDLVariable in interface JIDLObjectI

Parameters:

sVar - the IDL variable name

obj - object to be passed to IDL. Should be an object of type JIDLNumber, JIDLObject, JIDLString or JIDLArray.

Throws:

JIDLException - If IDL encounters an error.

setProcessName(String)

public void setProcessName(java.lang.String process)

Set the process name that the object will be created in.

The process name may only be set before createObject is called. If called after the object has been created, this method call does nothing.

Specified By:

setProcessName in interface JIDLObjectI

Parameters:

process - Process name. Empty String means create in same process (in-process).

setProperty(String, Object, int)

public void setProperty(java.lang.String sProperty, java.lang.Object obj, int iPalFlag)

Call IDL setProperty method to set named property.

The iPalFlag parameter is a set of flags that are or-ed together. Currently this parameter is only used to specify whether a JIDLArray being passed in to IDL is convolved or not. For arrays argpal should be set to either JIDLConst.PARMFLAG_CONVMAJORITY or JIDLConst.PARMFLAG_NO_CONVMAJORITY.

Specified By:

setProperty in interface JIDLObjectI

Parameters:

sProperty - the property name

obj - object to be passed to IDL. Should be an object of type JIDLNumber, JIDLObject, JIDLString or JIDLObject.

iPalFlag - flag denoting whether the passed in parameter is convolved or not. Note: setProperty does not allow obj to be modified by IDL

Throws:

JIDLException - If IDL encounters an error.

See Also:

JIDLNumber, JIDLObject, JIDLString, JIDLArray, JIDLConst.PARMFLAG_CONVMAJORITY, JIDLConst.PARMFLAG_NO_CONVMAJORITY

toString()

public java.lang.String toString()

Returns a string representation of the object.

Overrides:

toString in class Component

update(Graphics)

public void update(java.awt.Graphics g)

Internal use. Update the Canvas. (Do not override this method)

Overrides:

update in class Canvas