Previous IDL Connectivity Bridges: Writing IDL Objects for Exporting Next

Drawable Object Canvas Examples

The following examples use the three object classes as canvases for drawable objects. You can use them with the Export Bridge by following Java Wrapper Example or use them with the Export Bridge Assistant (for more information, see Using the Export Bridge Assistant). For information about a COM example, see COM Wrapper Example.

IDLgrWindow Example

The IDLgrWindow example uses object graphics to create a map that lets you click on and transform it with a trackball.


Example Code
The procedure file idlgrwindowexample__define.pro, located in the examples/doc/bridges/ subdirectory of the IDL distribution, contains the example code. You can view the file in an IDL Editor window by entering .EDIT idlgrwindowexample__define.pro.

IDLitDirectWindow Example

The IDLitDirectWindow example uses direct graphics to create a palette on which you can draw and erase lines.


Example Code
The procedure file idliddirectwindowexample__define.pro, located in the examples/doc/bridges/ subdirectory of the IDL distribution, contains the example code. You can view the file in an IDL Editor window by entering .EDIT idlitdirectwindowexample__define.pro.

IDLitWindow Example

The IDLitWindow example uses the iSurface tool to plot a Hanning transform on a surface.


Example Code
The procedure file idlitwindowexample__define.pro, located in the examples/doc/bridges/ subdirectory of the IDL distribution, contains the example code. You can view the file in an IDL Editor window by entering .EDIT idlitwindowexample__define.pro.

Java Wrapper Example

An example Java wrapper that works with all three of the canvas types described above is included in the IDL distribution. The application accepts a parameter that specifies the name of the IDL class to use.


Note
Drawable Java objects are not supported on Macintosh OS X.


Note
The Export Bridge Assistant creates wrapper objects comparable to the code in this example. Your applications should not need to include such code if they are using Assistant-generated wrappers.


Note
The following steps assume you are working on a UNIX platform. If you are working on a Windows platform, substitute the appropriate paths and path-separator characters.

  1. Copy the file IDLWindowExample.java from the
  2. IDL_DIR/examples/doc/bridges/java  
    

     

    directory to a new directory where you will compile the Java code. In this example, we assume you will build the Java example in the /tmp/idljavatest directory.

     

  3. Change directories to the /tmp/idljavatest directory.
  4.  

  5. Source the bridge_setup file from the bin subdirectory of the IDL installation. If you use a C shell:
  6. source IDL_DIR/bin/bridge_setup  
    

     

    where IDL_DIR is the path to your IDL installation. (There are bridge_setup files for the C shell, korn shell, and bash shell. Use the proper source command and bridge_setup file for your installation.)

     

  7. Compile the IDLWindowExample.java file with the following command:
  8. javac IDLWindowExample.java  
    

     

    This command creates two class files: IDLWindow.class and IDLWindowExample.class.

     

  9. Execute the example code with the following command:
  10. java IDLWindowExample <IDL_classname>  
    

     

    where <IDL_classname> is the name of one of the example classes described above.

     


    Note
    The bridge_setup file sets your CLASSPATH environment variable to include both the current directory (".") and the IDL_DIR/resource/bridges/export/java/javaidlb.jar file. See Java Requirements for additional information about the class path

     

    For example, if you sourced the bridge_setup file and compiled the IDLWindowExample.java file in the /tmp/idljavatest directory, the following commands would execute the three examples described above:

     

    java IDLWindowExample IDLgrWindowExample  
    java IDLWindowExample IDLitDirectWindowExample  
    java IDLWindowExample IDLitWindowExample  
    

COM Wrapper Example

See Tri-Window COM Export Example for the steps needed to include controls based on the three drawable objects in a Visual Basic .NET Windows application.

  IDL Online Help (March 06, 2007)