Home

ION Java User's Guide

image

Contents

1. lt Create an IONGraphicApplet applet named SURFAPP that generates some data and creates a shaded surface Note that the CODEBASE attribute is set to classes This is the proper path for the example as installed with the ION documentation files gt lt APPLET NAME SURFAPP CODE com rsi ion IONGraphicApplet class CODEBASE classes WIDTH 200 HEIGHT 200 gt lt PARAM NAME DEBUG_MODE VALUE YES gt lt PARAM NAME SERVER_DISCONNECT VALUE NO gt lt PARAM NAME DECOMPOSED_COLOR VALUE NO gt lt PARAM NAME IDL_COMMAND_0 VALUE a EXP SHIFT DIST 30 15 15 7 2 gt lt PARAM NAME IDL_COMMAND_1 VALUE LOADCT 5 gt lt PARAM NAME IDL_COMMAND_2 VALUE SHADE SURF a gt lt APPLET gt lt BR gt lt Create the pulldown menu of rotation values gt lt SELECT NAME rot_value SIZE 1 gt lt OPTION VALUE 15 gt 15 lt OPTION VALUE 30 SELECTED gt 30 lt OPTION VALUE 45 gt 45 lt OPTION VALUE 60 gt 60 lt OPTION VALUE 75 gt 75 Considerations Specific to ION Applets ION Java User s Guide Chapter 5 Building ION Applets and Applications 111 lt OPTION VALUE 90 gt 90 lt SELECT gt lt Create the Rotate Surface button which calls the JavaScript function rot_surf gt lt INPUT TYPE BUTTON NAME rot_button VALUE Rotate Surface onClick rot_surf gt lt
2. lt APPLET NAME MyApplet WIDTH 100 HEIGHT 100 CODE com rsi ion IONGraphicApplet class gt ARCHIVE ion_61 zip CODEBASE classes gt lt PARAM NAME SERVER_NAME VALUE Serverl1 gt lt PARAM NAME SERVER_DISCONNECT VALUE NO gt lt Other applet cod gt lt APPLET gt ION Java User s Guide Parameters Specified via lt PARAM gt Tags 72 Chapter 4 Using ION s Pre Built Applets Using the Same Connection for Multiple Applets Multiple ION applets can share a single connection to the ION Server Since each open connection consumes network bandwidth it is often efficient to let several applets share the same connection To specify an existing connection for a new applet use the ION_CONNECTION_NAME parameter rather than the SERVER_NAME PORT_NUMBER and SERVER_DISCONNECT parameters Note All applets using the same connection must be loaded into the browser at the same time In general this means that applets that share a connection should be included in the same HTML page ION_CONNECTION_NAME Set the value of this parameter equal to the name of the applet whose connection you wish to share The applet s name is specified by the NAME attribute in the APPLET tag Example The following creates a second applet named AnotherApplet and specifies that it share the server connection created for MyApplet l
3. isArray The isArray method determines if the value of the variable is an array Syntax public final boolean isArray lIONVariable Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 279 Return Value This method returns true if the variable is an array and false if the variable is not Arguments None Exceptions None Example boolean bIsArray myVariable isArray toString The toString method returns a string representation of the variables value Syntax public final String toString Return Value A string that represents the value of the variable The string is in a format that can be understood by IDL Arguments None Exceptions None Example String s myVariable toString ION Java User s Guide lIONVariable Class 280 Chapter 6 ION Java Class and Method Reference type The typeQ method returns the type of the value the variable contains This return value is one of the constant type codes which are a part of this object Syntax public final int typeQ Return Value This function returns the type code of the variable Arguments None Exceptions None Example int typeCode myVariable type IONVariable Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 281 IONWindowingClient Class The IONWindowingClient class provides mechanisms to handle the processing of the windowing commands that are part of an IDL Direct
4. smsg Communication error te getMessage else if e instanceof IONSecurityException smsg ION Java security error else if e instanceof IONIllegalCommandException smsg Illegal IDL Command detected on server else smsg Unknown error e getMessage System err printin Error smsqg writeMessage Error smsg return writeMessage Done KKK KKK KKK KKK KKK KKK KKK KKK KKK KKK KKK KKK KKK KKK KKK KKK TONDisconnection Purpose Considerations Specific to ION Applets ION Java User s Guide Chapter 5 Building ION Applets and Applications 107 Called when the connection is broken can report reason ey public void IONDisconnection int i System err printin Server Connection Closed writeMessage Server Connection Closed if c_bConnected 1 c_bConnected 0 KKK KKK KKK KK KKK KKK KKK KKK KKK KKK KKK KKK KKK KKK KKK KKK writeMessage Purpose x Utility method that is used to write a string to the X screen using Java ff private void writeMessage String sMsqg showStatus sMsg System out printin sMsg Further Examples Example code illustrating ION features is included in the installed ION distribution You will find example HTML files located in the examples directory in your installed ION distribution The raw Java source files for the example ION classes are included in the src subdirectory of the ex
5. Disables operating system access by disallowing use of the following routines CD CALL_FUNCTION CALL_METHOD CALL_PROCEDURE DEFINE_KEY DELETE_SYMBOL DELLOG EXECUTE FILEPATH FINDFILE GETENV POPD PRINTD PUSHD SETENV SPAWN timeout Table 1 6 Active Security Group Tokens Set this switch to the number of seconds ION will wait to receive a response If no response is received within the timeout interval ION will make a second attempt it will ping the remote machine If no response is received within the second timeout interval ION will close the connection The default timeout value is 60 seconds You may wish to increase the timeout value with extremely slow network connections Configuring ION Java for UNIX ION Java User s Guide Chapter 1 Configuring ION Java 25 Starting the ION Daemon at Boot Time You can automatically start the ION daemon by adding the command RSI DIR ion_6 1 ion_java bin iond to your system startup script or by installing and configuring the sys5_iond boot time startup script as described below Note _ OS sSSSSSS S SS The following instructions may differ for your platform For additional information refer to your host operating system documentation or the man pages for init rco rc2 and rc3 e Linux Using any text editor add the ION daemon startup command RSI DIR ion_6 1 ion_java bin iond to the end of the etc rce d rc local file
6. setIONDrawable Sets the current drawable Subclasses IONGrConnection ONJGrConnection Class IONWindowingClient Class ION Java User s Guide IONGraphicsClient Class 162 Chapter 6 ION Java Class and Method Reference lONGraphicsClient The IONGraphicsClient method constructs an object of the LONGraphicsClient class Syntax public IONGraphicsClient Arguments None Exceptions None Example IONGraphicsClient iclient new IONGraphicsClient addlIONDrawable The addIONDrawable method adds an object that implements the ONDrawable interface to the internal list of drawing areas maintained by this object An IONDrawable represents an area that graphic primitives can be rendered onto When the window is added to this class that drawing area is made the current drawing area being used for graphical output The developer has the option of telling ION what index to use and also requesting that the method send information about the new drawable to the server The function returns the window index number that is used by IDL to reference the drawing area Syntax public final int addIONDrawableIONDrawable drawable public final int addIONDrawableIONDrawable drawable int index public final int addIONDrawableIONDrawable drawable boolean bSendAttr public final int addIONDrawableIONDrawable drawable int index boolean bSendAttr IONGraphicsClient Class ION Java User s Guide Chapter 6 ION Java Class a
7. Arguments PropertyName The name of the property Exceptions None Example protected registerProperty PropertyName ION Java User s Guide IONGrGraphic Class 200 Chapter 6 ION Java Class and Method Reference setNoErase The setNoErase method is defined by subclasses to set the appropriate property for the graphic object that corresponds to the concept of no erase Syntax public void setNoErase boolean bFlag Arguments bFlag If true the object is not erased when other objects are drawn Exceptions None Example setNoErase bFlag setProperty The setProperty method is used to set the value of a property in the objects property list If the property already exists in the property list its value is replaced otherwise the property is added to the property list Syntax public void setProperty String sName ION Variable vValue Arguments sName The name of the property to set vValue The value of the property This must be an object or an array IONGrGraphic Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 201 Exceptions None Example void setProperty sProperty value ION Java User s Guide IONGrGraphic Class 202 Chapter 6 ION Java Class and Method Reference IONGrMap Class IONGrMap is an IONGrGraphic that encapsulates the functionality of IDL s MAP_SET procedure IONGrMap is used to set up a drawing area IONGrDrawable to di
8. Sun Solaris SGI IRIX You must place a controlling script in a directory usually etc init dor sbin init d and create links to that script which runs at system startup and shutdown A template for the controlling script can be found in the file RSI DIR ion_6 1 ion_java bin sys5_iond This file contains instructions on how to customize this script for your system copy the file to the appropriate directory and create the links that will automatically run the script at boot time Checking the Status of the ION Daemon Use the ionstat utility to determine the current status of the ION Daemon or Tunnel Broker The status report includes the start time of the daemon and information about clients currently connected to the ION Server The ionstat command uses the following syntax ionstat host hostname port port The switches to the ionstat command are described below host Set this switch to the name of the host on which the ION Daemon or HTTP Tunnel Broker is running Unless the rutil switch was set when the ION Daemon was started ionstat requests are only accepted from the host on which the daemon is running ION Java User s Guide Configuring ION Java for UNIX 26 Chapter 1 Configuring ION Java port Set this switch to the port number of the port that the ION Daemon or HTTP Tunnel Broker is listening The default is port 7085 which is the default port for the ION Daemon To check the status of the ION HTTP Tunnel
9. Text to the left and right of the applet is aligned with the bottom edge of the applet The ALT attribute specifies a text string to be displayed if for some reason the applet cannot be loaded The ALT attribute is not required but consider adding something The lt APPLET gt Tag ION Java User s Guide Chapter 4 Using ION s Pre Built Applets 67 like the following to your applet description to enhance the user friendliness of your HTML page ALT ION Applet failed to load Is Java enabled in your browser Note If you include HTML formatted text within your lt APPLET gt tag it will be displayed only if the Java Virtual Machine fails to start This is slightly different from the ALT attribute which contains text to be displayed only if the Java applet fails to load ARCHIVE The ARCHIVE attribute is not required However it is recommended that you download all of the ION classes as a single package See Supporting Java Archive Files on page 101 for a discussion of Java archive files CODE A string specifying the name of the applet class The CODE attribute should specify the fully qualified class name relative to the directory in which the HTML file is located If the CODEBASE attribute is included the class name specified in the CODE attribute should be relative to the directory specified by CODEBASE For example if you were to place an HTML file that used the IONPlotApplet in an html subdirectory of the ION directo
10. The getPropertyNames method returns a string that contains the names of all the properties contained in the object The string is formatted such that each property name makes up an IDL keyword This string can be appended to an IDL graphics command string Syntax public final Enumeration getProperty Names Arguments None Exceptions None getPropertyString The getPropertyString method returns a string that contains the values of all the properties contained in the object The string is formatted such that each property name makes up an IDL keyword and the value of the property is the value of the keyword This string can be appended to an IDL graphics command string Noe This is a protected method and can only be accessed from objects that subclass the IONGrGraphic class IONGrGraphic Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 199 Syntax protected final String getPropertyString Arguments None Exceptions None Example String sProperties getPropertyString registerProperty The registerProperty method is used to register a property name as being valid When the setProperty or getProperty methods are called they check the validity of the object against the list of valid properties Noe This is a protected method and can only be accessed from objects that subclass the IONGrGraphic class Syntax registerProperty String PropertyName
11. s Guide Chapter 5 Building ION Applets and Applications 97 Debug Mode The IONGrConnection IONJGrConnection Class on page 172 and the TONGrDrawable IONJGrDrawable Class on page 187 both supply a debugMode method that allows you to view the IDL command log output Enable debug mode by adding the following to the Java code which establishes the connection to the ION Server connection debugMode true where connection is the IONGrConnection object or IONGrDrawable object When debug mode is in effect holding down the Shift key and clicking on the ION drawing area associated with the connection a separate window opens and displays the output that would typically appear in the IDL command log Tip For those classes that do not have a debugMode method you can use the IONOutputListener Interface to return IDL output Debugging Your Application When developing your applications you can use the Java method System out printi1n to print any type of Java program information As the previous method can be used to view IDL command log output this methods returns comparable Java program information When running a standalone application not an applet in a web browser these log messages will be printed to your command line console When running an applet from a browser the information will be printed in your Java console See Check the Java Console Log on page 289 for instructions on how to open the Java consol
12. IONComplex Class The I ONComplex class represents a complex number Class Declaration public class IONComplex extends Number Methods e IONComplex Constructs an object of the IONComplex class e doubleValue Returns the real portion of the number as a double e floatValue Returns the real portion of the number as a float e getDImaginary Returns the imaginary portion of the number as a double e getImaginary Returns the imaginary portion of the number as a float e intValue Returns the real portion of the number as an integer e longValue Returns the real portion of the number as a long e toString Returns the string value of the real portion of the number IONComplex The I ONComplex method constructs an object of the IONComplex class Syntax public IONComplex float r float i Arguments r The real portion of the number i The imaginary portion of the number ION Java User s Guide IONComplex Class 140 Chapter 6 ION Java Class and Method Reference Exceptions None Example IONComplex complexvar new IONComplex 3 0 2 0 doubleValue The doubleValue method returns the real portion of the complex number as a double precision floating point value Syntax public final double doubleValue Arguments None Exceptions None Example double d complexvar doubleValue floatValue The floatValue method returns the real portion of the c
13. The ION Daemon watches a specific port on the ION Server s host computer When the daemon receives a request for connection it performs basic security screening before connecting the ION client to the ION Server The ION Daemon is discussed in detail in Chapter 1 Configuring ION Java The ION Daemon is responsible for the following e Parsing command line parameters e Establishing the security level and initializing security levels e Maintaining server logs e Managing the number of current connections e Receiving connections and starting ION Server processes e Verifying incoming requests as valid ION clients ION HTTP Tunnel Broker The ION HTTP Tunnel Broker is a program that allows ION client applets running in World Wide Web browsers located behind network firewalls to communicate with ION Java User s Guide ION Java Architecture 40 Chapter 2 Overview an ION Server on the other side of the firewall The Tunnel Broker is discussed in detail in Configuring The ION HTTP Tunnel Broker on page 29 Network firewalls work by isolating a network from the Internet as a whole and allowing only pre specified network operations to take place In many cases this means that traffic between an internal network and the Internet must go through a single computer which allows connections of specified types and denies other connections Firewalls allow computers and data on the inside to be relatively safe from intrusio
14. WM lt AFPPLE T gt TA ouii aces raa a E E A eras deeded 66 PNG E E 66 Supporting Java Incapable Browsers sseseseeeeseseeseeseessrssrrsressererssrerseesresees 69 Parameters Specified via lt PARAM gt Tags scc cccesscecoeeecerseceesseesesteccerseees 70 Connecting to the TIN Server 6 ere cee eect eee 70 Bebaviot Farametets ceca etc gprs cs vect ne e a EE A a Ea ESERE 72 TIO NGrapMicApplet ennon iinei E E A 74 TOD Contout Applet osann iae eric nie eet ee eee 76 TONM pApplet eresiaren enis tesisse ae aa EEEa 79 ME I east ccs ear ar aa A aa E AS ERa E 82 T N S rfaceApplet accu sacicveasesnecneiasbasauiashoennetadbavnstandeensesnsentsadhavenvesbarasesadeeeenesncenane 84 Chapter 5 Building ION Applets and Applications ssssseceeesseeeeeees 87 Direct Graphics in TON sonranessnneminidn a a a E 88 The TON Deye ocreninren nopia a EREE E A R 88 Keywords Accepted by the ION Devitt wicca pasate tiessic emerson 88 Object Graphics 1 MON nssircsxyaniessszsnstseceaavenseassazancasdenedcpadiesuiacashenenannenvenassanatiuasens 92 Psm Object PUG sess caceceesvnncndadesa sdienpacarduecraaeact eave ieee 93 ION Java User s Guide Contents Compiling Jova Piles st ieee cases woes aye duns oa iA REA E EEE EEEE ia 94 Error Handling and ION Exceptions ssseseseseesssseessrsssesressesrrseeeseessesressressesereseesse 96 DERAS DINOS casten a A a ees 97 Debugging Your Application sesesssssssssesssessessesseessessossessseesresessesse
15. X X_VALUES parameter 76 82 84 X Y plots 59 82 ION Java User s Guide Y Y_VALUES parameter 76 82 84 Z Z_VALUES parameter 76 84 zip file of Java class files 51 ION Java User s Guide 305 Index
16. c_ionCon getIDLVariable my3dByteArr byte b3d try b3d byte myVariable getDimensionedByteArray catch IONNotAnArrayException e System err println Variable is not an array getDimensionedDoubleArray Returns the double array value of the variable The result contains the same number of dimensions as the variable Syntax public final Object getDimensionedDoubleArray where Object can be a 1 to 8 dimensional array of Java primitive type double Return The method returns the multidimensional double array value of the variable Arguments None Exceptions IONNotAnArrayException ION Java User s Guide IONVariable Class 268 Chapter 6 ION Java Class and Method Reference Example TONVariable myVariable c_ionCon getIDLVariable my3dDoubleArr double d3d try d3d double myVariable getDimensionedDoubleArray catch IONNotAnArrayException e System err println Variable is not an array getDimensionedFloatArray Returns the float array value of the variable The result contains the same number of dimensions as the variable Syntax public final Object getDimensionedFloatArray where Object can be a 1 to 8 dimensional array of Java primitive type float Return The method returns the multidimensional float array value of the variable Arguments None Exceptions IONNotAnArrayException Example TONVariable myVar
17. install the service until a new version of ION is released See Windows Command Line Installation of the ION Daemon on page 19 for more information regarding the ion_srvinst utility Table 1 1 ION Java Properties Control Tab Configuring ION Java for Windows ION Java User s Guide Chapter 1 Configuring ION Java 13 Attribute Description Start Stop Starts or stops the ION service This button performs the same actions as the Services dialog described in the section Using Windows Services Manager to Start the ION Daemon on page 20 Note Occasionally the service may be unable to respond to a request For more information see Troubleshooting ION Service Problems on page 287 ION Port Number Defines the port number the ION Service listens to for connection requests ION Specifies the number of seconds ION will wait before closing Communication a connection Timeout Allow Remote Utility Connections Select this checkbox to allow the iondown and ionstat utility programs to be run from computers other than the one on which the ION service is installed Table 1 1 ION Java Properties Control Tab Continued ION Java User s Guide Configuring ION Java for Windows 14 Chapter 1 Configuring ION Java The Locations Tab The Locations Tab of the ION Java Properties dialog configures the paths used by ION Java gt ION Properties x Control Locations Securty Comman
18. listeners the method returns silently Syntax public final void removel ONCommandDoneListener IONCommandDoneListener listener Arguments listener An object that implements the IONCommandDoneListener interface that is to be removed from the internal listener list Exceptions None removelONDisconnectListener The removeIONDisconnectListener method removes an object that implements the IONDisconnectListener interface from the internal Disconnect callback list If the listener is not contained in the internal list of listeners the method returns silently Syntax public final void removel ONDisconnectListener ONDisconnectListener listener Arguments listener The object that implements an ONDisconnectListener interface that should be removed from the listener callback list Exceptions None IONCallableClient Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 129 removelONOutputListener The removelONOutputListener method removes the given listener from the internal list of listeners If the listener is not contained in the internal list of listeners the method returns silently Syntax public final void removel ONOutputListenerONOutputListener listener Arguments listener The object that implements an ONOutputListener interface that should be removed from the listener callback list Exceptions None sendiIDLCommand The sendIDLCommand method asynchronously se
19. setNoErase method continued IONGrGraphic class 200 IONGrPlot class 222 IONGrSurface class 228 IONSurface class 254 setProperty method 217 IONContour class 148 IONGrContour class 182 IONGrGraphic class 200 IONGrPlot class 222 IONGrSurface class 228 IONMap class 235 IONPlot class 248 IONSurface class 255 setStart method 217 setX Value method IONContour class 148 IONGrContour class 183 IONGrPlot class 223 IONGrSurface class 229 IONPlot class 249 IONSurface class 256 setY Value method IONContour class 149 IONGrConnection class 185 IONGrPlot class 223 IONGrSurface class 229 IONPlot class 249 IONSurface class 256 setZValue method IONContour class 150 IONGrContour class 185 IONGrSurface class 230 IONSurface class 257 show Window method 283 shutting down the ION daemon 26 simple applet example 103 status utility 18 status checking on UNIX 25 status checking on Windows 18 surface plots 60 84 Index surface_property parameter 85 Swing 62 T tips and tricks building applets 113 toString method 155 IONComplex class 143 IONVariable class 279 true color displays 88 Tunnel Broker 39 configuring 29 configuring on UNIX 23 configuring on Windows 17 connection types 29 ion_httpd command 30 starting 30 type method 280 U URL CODEBASE attribute 68 URL linking to 73 V VBScript 107 VSPACE attribute 68 W WIDTH attribute 68
20. 1111 1111 1010 1010 Sign Extension The signed value of this is still 86 Due to how two s complement numbers function however simply negating this number will not return the original unsigned value If this was an unsigned data type its 16 bit value would be 65450 When a byte value is transferred from IDL to Java and the unsigned value is needed the number must be converted to a positive number with the lower 8 bits staying the same To accomplish this use a bitmask to turn the high order bits to 0 and preserve the low order bits Converting Between IDL and Java Bytes ION Java User s Guide Chapter 5 Building ION Applets and Applications 99 byte javaByte 86 short javaShort short javaByte cast the byte to a short short unsignedValue javaShort amp Ox0OOFF After this conversion unsignedValue is 170 the original value from IDL So why does ION not do this under the hood The simple answer is that we have taken the approach that Java rules apply on the Java side and IDL rules apply on the IDL side Understanding the differences will help in application development and allow the developer to have more fine grained control over how the application works ION Java User s Guide Converting Between IDL and Java Bytes 100 Chapter 5 Building ION Applets and Applications Considerations Specific to ION Applets When creating your ION applet keep the following points in mind Tip ARH_J_ A AHHoa Am
21. Built Applets lONContourApplet The I ONContourApplet displays an IDL contour plot The X Y and Z values of the plot and any IDL Contour properties supported by ION can be set through parameters to the applet Note You can also create contour plots using the IONGraphicApplet specifying the contour properties in IDL command strings The IONContourApplet is merely a simplified way to display contour plots Parameters In addition to the parameters described in Parameters Specified via lt PARAM gt Tags on page 70 the IONContourApplet accepts the following parameters X_VALUES Set the value of this parameter equal to a valid IDL expression that evaluates to a vector or two dimensional array specifying the X coordinates for the contour surface If X_VALUES specifies a vector each element specifies the X coordinate for a column in the Z_VALUES array e g X 0 specifies the X coordinate for Z 0 If X_VALUES specifies a two dimensional array each element specifies the X coordinate of the corresponding point in the Z_VALUES array Y_VALUES Set the value of this parameter equal to a valid IDL expression that evaluates to a vector or two dimensional array specifying the Y coordinates for the contour surface If Y_VALUES specifies a vector each element specifies the Y coordinate for a column in the Z_VALUES array e g Y 0 specifies the Y coordinate for Z 0 If Y_VALUES specifies a two dimensional
22. FORM gt lt BODY gt lt HTML gt See Notes on the Differences Between the JavaScript and VBScript Versions on page 113 Example Using VBScript The following HTML code demonstrates the use of VBScript to interactively update an ION graphic The example includes an IONGraphicApplet that displays a shaded surface uses a VBScript select object to create a pulldown list of rotation values and adds a button to rotate the surface to the selected angle The line numbers are provided to aid in discussion they are not part of the HTML code Noe The following script shown will work in Microsoft s Internet Explorer browser but not in the Netscape Navigator browser lt Define the HTML header Note that the VBScript is included in the HEAD section gt lt HTML gt lt HEAD gt lt TITLE gt Simple VBScript Applet Test lt TITLE gt lt The script language is VBScript We declare the variable rotation with an initial value of 30 degrees gt lt SCRIPT language VBScript gt Dim rotation rotation 30 The rot_button_OnClick subroutine retrieves the index of the value selected in the pulldown list uses the index to retrieve the text value and executes the IDL command to redraw the graphic sub rot_button_OnClick ind document command_form rot_value selectedIndex rotation document command_form rot_value options ind value document SURFAPP execu
23. IDL documentation on keywords available for use with the MAP_CONTINENTS procedure for an explanation of each property Exceptions None IONGrMapContinents Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 211 IONGrMapGrid Class An IONGrMapGrid object is an IONGrGraphic that encapsulates the functionality of IDL s MAP_GRID procedure which is used to draw lat lon lines on a map projection This is used in conjunction with an IONGrMap Class Declaration public class IONGrMapGrid extends IONGrGraphic Methods e IONGrMapGridQ Constructs an object of the IONGrMapGrid class e draw Calls the MAP_GRID procedure to add a lat lon grid to the current map projection e getProperty Retrieves the specified property e setProperty Sets the value of the specified property IONGrMapGrid The IONGrMapGrid method constructs an object of the IONGrMapGrid class Syntax public IONGrMapGridQ Arguments None Exceptions None draw The draw method calls the MAP_GRID procedure to add a lat lon grid to the current map projection ION Java User s Guide IONGrMapGrid Class 212 Chapter 6 ION Java Class and Method Reference Syntax public void draw IONGraphicConnection grConn Arguments grConn The name of the connection Exceptions None getProperty The getProperty method retrieves the value of the specified property Syntax public final ION Variable getPro
24. ION Java uses Java and Internet technology to deliver efficient data analysis and visualization capabilities to World Wide Web client applications ION Java is ideal for organizations that have shared data that needs to be accessed and visualized by a wide variety of users ION Java can be configured as part of a public Web server a proprietary intranet server or as both at the same time ION Java combines both IDL the Interactive Data Language and Java into a single powerful tool for building Web based applications Both IDL and Java are cross platform interpreted languages In contrast to Java IDL is specifically designed for the visualization and analysis of large multi dimensional technical datasets IDL is the language of choice for technical professionals offering simple syntax array oriented architecture and rich library of analysis and visualization routines ION Java ideal for client server applications or Web applets gives Java developers the power to deploy their applications for data sharing and data analysis more rapidly ION Java allows access to IDL from virtually any computer in the world Updating and maintaining ION is simple since the product resides only on the server Applets are sent to clients over the Web as needed Recommended Skills ION is designed to make it easy for you to create interactive Web pages or Internet Intranet applications that use IDL The following competencies are recommended for efficien
25. ION Daemon css cnsndastasus dsassnnsdebsesguincasacieddbndessdestacntendeaes 26 ION Java User s Guide 3 Manually Configuring Your Web Server o c1ccc2s0ccccccsseesocceauvoecnecesecessensscesnseneees 27 Configuring The ION HTTP Tunnel Broker aisssdesceissctebicdascanadanccscessseniatiacusiunsion 29 Using the Tonnel Broker osisssa a E EE E ede 29 Starting the ION Tunnel Broker Daemon sssseesseseesseeereserrererrersrssrrrrersersrssres 30 Command OCI cieoiroeei turens erent n R REE EEE EEE EERS TESE 32 Security Command FeS ooma a ee a R a 32 U T E A A A 33 Connection LAMIE rneer teow Reece ETE eee eS 33 Chapter 2 e E E A A A A E E 35 Wis TON JOVIE reece cca che ncenew crte iapa e saena nE e e p naei 36 Recommended Skills ersi reansi eactasa deed eaS ra Ea a RD aa 36 TON Java Architect re acs dheira se Geoewesssdenndin de voneteadhoedededletenyetbtenesacdeeetin anaE 38 TON SOO cata cesses E nce tees ease ee 38 EN DR ice cad at ies ae decal Ach ood a dace led gait A hacen dace aude 39 TON HTTP Tonnel Broker visiini aiig iaria EEEE 39 Pre Built ION Client Applets nirrecnisiissasesrnsiiirsiiiisnsniiasinenii 41 IOUN Component Casses oo ciocaipscarvvasns aaa csancdesswatiaveszeascmnssancoavstassaneasaneeusaenenate 41 ION Low L vel Classo enii orae aaa e a a a SE 41 ION Java Limitations ccecisicrirsrsiiiin isir tanier ta a tene lcddeaea yocdeeusactesveln iias a SEs 42 Server Le aoii E EEE A ete ad abies 42 IDE Limans enea aa a a a E ERSS 42 ION
26. ION Java User s Guide Chapter 6 ION Java Class and Method Reference 119 Exceptions The Exceptions section lists the ION exception values that are thrown when your error handling code detects an error For more information on exception handling consult your Java manual Refer to the following descriptions for each exception IOException A network communication error was detected Server is disconnected IONIIlegalCommandException The specified IDL command was illegal IONIsAnArrayException The variable contains an array value IONLicenseException An ION license could not be obtained IONNotAnArrayException The IONVariable is not an array lONSecurityException The specified IDL command is not allowed under the current ION security rules NumberFormatException The variable is a string that cannot be converted UnknownHostException The given hostname is unknown Example Where appropriate the Example section includes a short example that demonstrates the use of the method ION Java User s Guide How to Use this Chapter 120 Chapter 6 ION Java Class and Method Reference IONCallableClient Class The IONCallableClient class provides mechanisms to handle communication with the server execution of IDL commands retrieval of IDL command log output and getting and setting IDL variables on the ION Server In order to provide support for mouse operations the IDL CURSOR procedure the main thread that handle
27. ION applets running IDL routines that accept mouse input Example The following specifies that the MyApplet applet will display debug information and will link to the RSI web page if the user clicks in the applet drawing area lt APPLET NAME MyApplet WIDTH 100 HEIGHT 100 CODE com rsi ion IONGraphicApplet class ARCHIVE ion_61 zip CODEBASE classes gt lt PARAM NAME SERVER_NAME VALUE Serverl1 gt lt PARAM NAME SERVER_DISCONNECT VALUE NO gt lt PARAM NAME DEBUG_MODE VALUE YES gt lt PARAM NAME LINK_URL VALUE http www researchsystems com gt lt Other applet cod gt lt APPLET gt ION Java User s Guide Parameters Specified via lt PARAM gt Tags 74 Chapter 4 Using ION s Pre Built Applets lONGraphicApplet The IONGraphicApplet is used to execute a series of IDL commands and display the results Any valid IDL commands that are not explicitly excluded by the ION security mechanism see Command Security on page 32 can be passed to the IONGraphicApplet for execution Using the ION Applet parameters the Applet can also display debug information and be used as a hyperlink to another HTML page The IDL commands can be sent synchronously or asynchronously By default each command is sent and the client blocks stops accepting commands until the command is complete However in some circumstances
28. If the command inclusion check passes the routine is then checked against the command exclusion list routines that should not be run on the server If the command is in the command exclusion list it is rejected If the command passes the exclusion list check it is sent to the ION Server process for execution Note ION s command security configurations are designed to prevent IDL commands from being used in an unauthorized or hostile manner during connections to your ION Server Remember that you must also properly configure your Web server to prevent unauthorized access to your site via other mechanisms Security Command Files Using a text file you can specify IDL commands to be included or excluded from the ION Server Inclusion and exclusion text files consist of a single command on each line Lines that are blank or start with the character are ignored For example you could create an ION exclude file containing the following lines Commands to prevent execution of CALL_FUNCTION XBM_EDIT To use an include or exclude file see the following directions for your platform e On UNIX start the ION Daemon using the infile and exfil command line switches See Starting the ION Daemon on UNIX on page 21 e On Windows see The Security Tab on page 15 Command Security ION Java User s Guide Chapter 1 Configuring ION Java 33 Client Verification When the ION Daemon detects an incoming server connectio
29. It s a good idea to shut down and restart the browser any time you make changes to your HTML or class files Check the Java Console Log If your applet fails to function properly always check the Java console To open the java console complete the following steps for your browser Open the Netscape Navigator Java Console 1 Open the Netscape browser 2 Select Communicator gt Tools gt Java Console Open the Internet Explorer Java Console 1 Open the IE browser 2 Select View gt Java Console If Java Console is not an active option complete the following steps A Select Tools Internet Options and click the Advanced tab B Select the Java Console Enabled and Java Logging Enabled options located at the bottom of the scroll window Apply the changes C Restart your browser D Open the Java Console by selecting View gt Java Console Note If you are running the client and the server on the same machine setting the system CLASSPATH environment variable can result in errors similar to the following appearing in your browser s Java console ION Java User s Guide 290 Chapter 7 Troubleshooting Netscape Java Console Applet exception error java lang ClassFormatError class already loaded IE Java Console Error getting package information com rsi ion To avoid such errors specify the class path when compiling as described in the section Compiling java Files on page 94 C
30. Java classes that make up ION Java The following topics are covered in this chapter e The ION Java Class Hierarchy e AWT vs Swing e Using the Component Classes ION Java User s Guide 53 54 Chapter 3 Overview of the ION Java Classes The ION Java Class Hierarchy ION Java consists of three levels of Java classes e ION Low level classes e ION Component classes e ION Pre built Applet classes The relationship between the ION Java classes is illustrated in Figure 3 1 in the Unified Modeling Language UML ION Low level Classes ION Component Classes 1ONGrDrawable ral IONJGrDrawable ot IONCanvas i aK ee S La IONJCanvas i Interface i i ION Component A i IONGrCe t IONDrawable IONJ Component rComponeni lONOffscreen i Interface 1ONGraphicConnection lONGraphicsClient lt 1 i IONGrConnection l IONJGrConnection Interface bog lONMouseListener y f ION Pre Built IONCallableClient a Applet Classes I E i LA Interface ONGraphicApplet ONOutputListener H iraphicApplet IONWindowingClient lONVariable Interface ONComplex ONCommandDoneListener ION Component Applet IONJ Component Applet IONDComplex _interface lONDisconnectListener Legend A B Inheritance A is a B A lt B Aggregation A has a B Figure 3 1 The ION Java Classes The ION Ja
31. NOCLIP NODATA NOERASE NORMAL OVERPLOT PATH_DATA_COORDS PATH_FILENAME PATH_INFO PATH_XY POLAR POSITION SUBTITLE T3D TICKLEN TITLE TRIANGULATION XCHARSIZE Y CHARSIZE ZCHARSIZE XGRIDSTYLE YGRIDSTYLE ZGRIDSTYLE XLOG YLOG XMARGIN Y MARGIN ZMARGIN XMINOR YMINOR ZMINOR XRANGE YRANGE ZRANGE XSTYLE YSTYLE ZSTYLE XTICKFORMAT Y TICKFORMAT ZTICKFORMAT XTICKLEN YTICKLEN ZTICKLEN XTICKNAME YTICKNAME ZTICKNAME XTICKS YTICKS ZTICKS XTICKV YTICKV ZTICKV XTITLE YTITLE ZTITLE XTICKINTERVAL Y TICKINTERVAL ZTICKINTERVAL XTICKLAYOUT YTICKLAY OUT ZTICKLAY OUT XTICKUNITS YTICKUNITS ZTICKUNITS XTICK_GET YTICK_GET ZTICK_GET ZAXIS ZVALUE Exceptions None ION Java User s Guide IONContour ONJContour Class 148 Chapter 6 ION Java Class and Method Reference Example IONVariable value getProperty Property setNoErase The setNoErase method of the ONContour class overrides setNoErase in the IONGrDrawable class The setNoErase method of the I ONJContour class overrides setNoErase in the IONJGrDrawable class See setNoErase on page 194 for the syntax of this method setProperty The setProperty method sets a property for the contour object Syntax public final void setProperty String sName IONVariable vValue Arguments sName The name of the property to set vValue The value of the property Properties Supported The IDL Contour properties are supported by IONContour get set Property a
32. PARAM gt tag In the example in the next section both TITLE and LEGO are surface properties with values of Surface and 1 respectively The following IDL Surface properties are supported by the IONSurfaceApplet Refer to the IDL documentation on keywords available for use with the SURFACE procedure for an explanation of each property AX AZ BOTTOM HORIZONTAL LEGO LOWER_ONLY SAVE SHADES UPPER_ONLY ZAXIS BACKGROUND CHARSIZE CLIP COLOR DATA DEVICE FONT LINESTYLE NOCLIP NODATA NOERASE NORMAL POSITION SUBTITLE T3D TICKLEN TITLE MAX_VALUE MIN_VALUE NSUM POLAR XLOG YNOZERO YLOG XCHARSIZE YCHARSIZE ZCHARSIZE XGRIDSTYLE YGRIDSTYLE ZGRIDSTYLE XMARGIN YMARGIN ZMARGIN XMINOR YMINOR ZMINOR XRANGE YRANGE ZRANGE XSTYLE YSTYLE ZSTYLE XTICKFORMAT YTICKFORMAT ZTICKFORMAT XTICKLEN YTICKLEN ZTICKLEN XTICKNAME YTICKNAME ZTICKNAME XTICKS YTICKS ZTICKS XTICKV YTICKYV ZTICKV XTITLE YTITLE ZTITLE ZVALUE ZLOG Example The following example creates an IONSurface Applet that connects to the same server used by the Connection applet defined in the IONGraphicApplet example The applet generates some data for the Z value of the plot and sets the Title and Lego properties of the plot lt APPLET NAME SURFACE CODE I10NSurfaceApplet class WIDTH 200 HEIGHT 200 ARCHIVE ion_61 zip CODEBASE classes gt lt This applet
33. PLAIN BOLD e For font angle ITALIC For example the following commands tell ION to use TrueType fonts change the font and then make a simple plot ion executeIDLCommand P FONT 1 ion executeIDLCommand DEVICE FONT Helvetica Bold Italic TI_FONT ion executeIDLCommand PLOT FINDGEN 10 TITLE IDL Plot GET_CURRENT_FONT Set this keyword to a named variable in which the name of the current font is returned as a scalar string GET_FONTNAMES Set this keyword to a named variable in which a string array containing the names of available fonts is returned If no fonts are found a null scalar string is returned This keyword must be used in conjunction with the FONT keyword Set the FONT keyword to a scalar string containing the name of the desired font or a wildcard GET_GRAPHICS_FUNCTION Set this keyword to a named variable that returns the value of the current graphics function which is set with the SET_GRAPHICS_FUNCTION keyword This can be used to remember the current graphics function change it temporarily and then restore it See the SET_GRAPHICS_FUNCTION keyword for an example GET_SCREEN_SIZE Set this keyword to a named variable in which to return a two word array that contains the width and height of the server s screen in pixels SET_CHARACTER_SIZE The standard size and vertical spacing of vector drawn fonts can be changed by specifying this keyword with a two element vect
34. System err printin Error Unknown Host writeMessage Error Unknown Host c_bConnected 1 return catch IOException eI0O System err printin Error Establishing Connection ION Java Server Down writeMessage Error Establishing Connection ION Java Server Down c_bConnected 1 return catch IONLicenseException eLic System err printin Error ION Java License Unavailable writeMessage Error ION Java License Unavailable c_bConnected 1 ION Java User s Guide Considerations Specific to ION Applets 106 Chapter 5 Building ION Applets and Applications return c_bConnected 1 c_ionCon addIONDisconnectListener this Since we are only working with 8 bit set decompose c_ionCon setDecomposed false Add the drawable to the connection c_ionCon addDrawable c_ionDrw writeMessage Drawing Graphics message to screen Issue IDL commands to generate a plot try Set the color table c_ionCon executeIDLCommand loadct 15 Create some data c_ionCon executeIDLCommand a dist 30 Draw a contour plot c_ionCon executeIDLCommand show3 a Note that it is generally faster to package multiple IDL commands into a single pro to call This example sends commands separately so that the code is easier to follow catch Exception e String smsg if e instanceof IOException
35. Your Web Server If you skipped the Web Server Configuration step during installation you will need create directories and copy files from the ION installation to your Web server directory after installing and configuring a Web server Follow the steps for your platform On UNIX Run the configuration script java_config located in the default installation directory RSI DIR ion_6 1 ion_java bin This script will create directories and copy the required files to your Web server s HTML files directory as well as configure the IDL_PATH On Windows Manually copy files from the ION distribution into the Web server s HTML files directory as follows 1 Create a directory named 1ONJava in the Web Server htdocs directory or the Web Server wwwroot directory for IIS Copy index html from the main ION installation directory RSI DIR IDL61 products ION61 ion_java directory to the Web Server htdocs 10NJava directory Create a subdirectory named classes in the Web Server htdocs IONJava directory Copy the following files from RSI DIR IDL61 products ION61 ion_java classes to the new directory Web Server htdocs IONJava classes ion_61 jar ion_61 zip all class files Note You do not need to copy the com directory contained in the classes directory or any of its subdirectories All of these files are packaged into the ion jar and ion zip files Copy the entire examples directory including all files and subdirectories fr
36. addIONOutputListener method 123 ALIGN attribute 66 ALT attribute 66 APPLET tag ALIGN attribute 66 ALT attribute 66 ION Java User s Guide APPLET tag continued ARCHIVE attribute 67 CODE attribute 67 CODEBASE attribute 67 HEIGHT attribute 68 HSPACE attribute 68 NAME attribute 68 VSPACE attribute 68 WIDTH attribute 68 applets attributes 66 compiling 94 controlling with scripts 107 creating 100 debugging 72 including in HTML pages 100 ION pre built 41 IONContourApplet 59 76 295 296 applets continued IONGraphicApplet 59 74 IONPlotApplet 59 82 IONSurfaceApplet 60 84 sharing connections 72 applications performance 44 ARCHIVE attribute 67 arrayDimensions method 262 attributes ALIGN 66 ALT 66 ARCHIVE 67 CODE 67 CODEBASE 67 HEIGHT 68 HSPACE 68 NAME 68 PARAM tags 70 VSPACE 68 WIDTH 68 AWT 62 AYSNC_COMMANDS parameter 74 B bandwidth 44 byte data type converting between IDL and Ja va 98 C character size setting 91 class files class path 94 location 51 class path 94 client applet verification 33 CODE attribute 67 CODEBASE attribute 67 color ION device 88 Index command line parameters ION daemon 21 command security 32 compiling applets 94 configuring ION daemon Windows 11 connect method IONCallableClient class 123 IONGraphicsClient class 163 IONGrConnection class 174 IONWindowingClient class 282
37. any of these suggestions Local Netscape Users If your installation is used only by a known set of users who all use Netscape s Navigator version 4 or later you can eliminate the need to download the Java class files when an applet loads Do the following 1 Have each of your users install a copy of the ion_release jar file in the Program java classes subdirectory of their local Netscape directory 2 Remove the ARCHIVE attribute from the APPLET tag in your HTML code Note _______ SS SSsSsSS FeFSSSSSSSS The Java security mechanism requires that applet classes must be loaded from the server on which ION is running This means that the approach described here will fail with a security error if the applet class files are not located in the com rsi ion subdirectory of the directory specified by the CODEBASE attribute Stop Methods If your applet includes a stop method it will be invoked automatically when the browser leaves the browser window In your applets it is good practice to include a stop method that closes the ION connection and does any other cleanup that may be necessary ION Java User s Guide Considerations Specific to ION Applets 114 Chapter 5 Building ION Applets and Applications Client side Animation IDL s animation routines all rely on the IDL widget toolkit and are thus not suitable for use with ION You can however use IDL to create the individual frames of an animation a
38. applications must have access to the ION class files in order to run There are two ways to provide access to the ION class files e Use the lt APPLET gt tag s CODEBASE attribute to point to the directory that contains the required classes e Place the required class files in the same directory that contains the HTML page that loads the applet Placing class files and HTML files in the same directory saves you from having to use the CODEBASE attribute but we recommend that you point to the jar or zip files described in the following section and create separate directories for class and HTML files For example suppose you are using the Apache Web server You could create a subdirectory under the htdocs directory called IONJava classes in which you place all the required class files Assuming that your HTML files are in the IONJava html directory you would specify the CODEBASE attribute as follows CODEBASE classes See CODEBASE on page 67 for further details Where to Place HTML and Class Files ION Java User s Guide Chapter 2 Overview 51 What Are the Required Class Files During installation ION class files are installed in the following location on the ION Server machine Windows RST_DIR IDL61 products ION61 ion_java classes UNIX RSI_DIR ion_6 1 ion_java classes where RSI_DIR is the location of the RSI directory on your system The ION installation program also copies these files to yo
39. b public ION Variable short s public ION Variable int i public ION Variable float f public ION Variable double d public ION Variable String s public IONVariable String s boolean b public ION Variable JONDComplex cmplx Arrays public IONVariable byte b int dims public ION Variable short if int dims public ION Variable int i int dims public ION Variable float f int dims public ION Variable double d int dims public IONVariable String s int dims public ION VariableJIONComplex cmp x int dims public ION VariableJONDComplex cmp x int dims Arguments Most arguments are straightforward If no arguments are specified the ION Variable object corresponds to an IDL variable of type Undefined Type short corresponds to IDL type integer and type int corresponds to IDL type long integer The ION Java User s Guide IONVariable Class 262 Chapter 6 ION Java Class and Method Reference size of arrays and the array dimension array are determined through the use of the Java array length property Example To create an ION Variable object of type float IONVariable oVariable new IONVariable 1234 5678 To create an IONVariable object of type float array of size 100 100 3 float farr new float 100 100 3 int dims new int 3 dims 0 100 dims 1 100 dims 2 3 oVariable new IONVariable farr dims arrayD
40. by an error Normally due to an interruption in the communication channel e JON_DIS_SERVER Disconnection due to server shutdown lIONDisconnection If registered the IONDisconnection method is called when the connection between the client and the server is broken to report the reason for disconnection Syntax public abstract void IONDisconnection int iStatus IONDisconnectListener Interface ION Java User s Guide Chapter 6 ION Java Class and Method Reference 157 Arguments iStatus An integer corresponding to the reason for the disconnection These are defined by the constants mentioned in the previous section Exceptions None Example import javax swing import java io import java net import com rsi ion public class disconnectEx extends JApplet implements IONDisconnectListener TONGrConnection ionCon IONGrDrawable iondraw public void init ionCon new IONGrConnection ionCon addIONDisconnectListener this connect to server and do ION commands public void IONDisconnection int iStatus if iStatus IONDisconnectListener ION_DIS_OK System out printin ION disconnection error do anything else to clean up ION Java User s Guide lIONDisconnectListener Interface 158 Chapter 6 ION Java Class and Method Reference lIONDrawable Interface The IONDrawable interface defines the methods that an object must implement to act as an ION drawable object An I ONDraw
41. client platforms Extra communication layers are necessary when executing an IDL command in ION Java and then displaying the results When an IDL command is called from an ION Java applet or Java application the following required steps impact execution time 1 The Java Virtual Machine interprets the Java code 2 The initial connection to the ION Server initiates an IDL session 3 The client browser running the Java applet sends requests to the ION Server Network traffic and bandwidth affects transmission rates 4 The ION Server translates each request into commands that can be processed by IDL This may involve security command screening 5 IDL interprets and executes the commands 6 The ION Server returns output from IDL to the client for display 7 The Java application draws graphic primitives received from the ION Server in the browser Java drawing routines are slower than raw UNIX motif or Windows GDI devices The drawing time can even vary between Java Virtual Machines Note Using the same machine as both the client and the server can further degrade ION Java performance Although network traffic is not an issue communication must still be routed through sockets and HTTP Depending on the server machine specifications the extra resources required for context switching between the server and the browser may hinder performance Tips for Increasing Execution Speed in ION Java The following items can increase the executi
42. complicated plots transfer more graphics primitives and take a longer time to be drawn You can decrease the amount of information sent to the client and time required to draw complicated plots by doing one of the following e Render the plot to an off screen pixmap in IDL and then use DEVICE with the COPY keyword to capture the image e Use the z buffer in conjunction with an off screen pixmap and then capture the image using TVRD in conjunction with TV These methods send a single image to the client to be drawn For very complicated plots this can be more efficient For simple plots however this could increase the amount of data that is sent to the client so using the default graphics primitives may be more efficient An example is included in Advanced section of the ION Examples See Running the ION Java Examples on page 46 Bandwidth Issues Because ION Java applications can be image intensive their performance depends strongly on network bandwidth Bandwidth may not be an issue if you are serving your ION Java applications only to the users of your high speed company intranet ION Java Performance Considerations ION Java User s Guide Chapter 2 Overview 45 but if your users are likely to be accessing your application over the Internet through an analog telephone line and low speed modem then close consideration must be given to the size of data transferred to and from the ION Server For example if your applicatio
43. dcomplexvar intValue longValue The longValue method returns the real portion of the complex number as a long integer value Syntax public final long longValueQ Arguments None IONDComplex Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 155 Exceptions None Example long 1 dcomplexvar longValue toString The toString method returns the real portion of the complex number as a string value Syntax public final String toString Arguments None Exceptions None Example String s dcomplexvar toString ION Java User s Guide IONDComplex Class 156 Chapter 6 ION Java Class and Method Reference lONDisconnectListener Interface The IONDisconnectListener interface defines a method that is called when the connection between the client and the server is disconnected The reason for disconnection is defined by one of the constants that are a part of this interface To use this interface your class must implement this interface and then register the listener using addIONDisconnectListener See LONCallableClient Class from more information Class Declaration public interface IONDisconnectListener Methods e TONDisconnection If registered the method is called when client and server are disconnected Implementing Classes None Constants e JION_DIS_OK Normal disconnection due to disconnect method being called e JION_DIS_ERR Disconnection caused
44. default port number is used If the connection type is either SOCK_CON or BEST_CON this argument specifies the port on which the ION Server is running If the connection type is HTTP_CON and the iHttpPort argument is not specified this argument specifies the port on which the HTTP Tunnel Broker is running sHttpHost The name of the host on which the ION HTTP Tunnel Broker is running If all four arguments to the connect method are supplied the connection type is automatically set to BEST_CON iHttpPort The port number to use when connecting to the ION HTTP Tunnel Broker If all four arguments to the connect method are supplied the connection type is automatically set to BEST_CON Exceptions IOException UnknownHostException ONLicenseException IONCallableClient Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 125 disconnect Call the disconnect method to shut down the ION Server the daemon remains active close the connection between the server and the client and free any resources that were being used by the connection Once this method has been called the object should be considered invalid and not used Syntax public final void disconnect Arguments None Exceptions None executelDLCommand The executeI DLCommand method sends an IDL command to the ION Server for execution The function returns when the command is complete on the server S
45. does not contain a drawing area Use IONMap if you want a map object and a drawing area managed by a single object IONGrMap extends IONGrGraphic The IONGr components are useful for overlaying graphics on top of one another IONGrMapContinents An IONGrMapContinents object allows you to get and set properties of map outlines such as continental and political boundaries coastlines and rivers IONGrMapGrid An IONGrMapGrid object allows you to get and set properties of map grids to be drawn on a map projection IONGrMapImage An IONGrMapImage object allows you to get and set properties of images to be projected onto a map projection IONGrPlot An IONGrPlot object is a property manager for a plot graphic IONGrPlot allows you to get and set properties of the plot via keywords to the IDL PLOT procedure but The ION Java Class Hierarchy ION Java User s Guide Chapter 3 Overview of the ION Java Classes 59 does not contain a drawing area Use IONPlot if you want a plot object and a drawing area managed by a single object IONGrPlot extends I ONGrGraphic The IONGr components are useful for overlaying graphics on top of one another lONGrSurface An IONGrSurface object is a property manager for a surface graphic I ONGrSurface allows you to get and set properties of the surface via keywords to the IDL SURFACE procedure but does not contain a drawing area Use IONSurface if you want a surface object and a drawing area manage
46. double d myVariable getDoubleArray catch IONNotAnArrayException e System err println Variable is not an array getFloat The getFloat method returns the float value of the variable If the value is not of type float the scalar value is converted to a float ION Java User s Guide IONVariable Class 272 Chapter 6 ION Java Class and Method Reference Syntax public final float getFloat Return Value The method returns the float value of the variable Arguments None Exceptions IONIsAnArrayException NumberFormatException Example try float f myVariable getFloat catch IONIsAnArrayException e System err println Variable is an array catch NumberFormatException e System err printin String Cannot be converted IONVariable Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 273 getFloatArray The getFloatArray method returns the float array value of the variable If the value is not of type float java lang ClassCastException exception will be thrown To avoid this exception check the type of the data and call the correct method for that type Syntax public final float getFloatArray Return Value The method returns the float array value of the variable Arguments None Exceptions IONNotAnArrayException Example try float f myVariable getFloatArray catch IONNotAnArrayException e System err printin Variable
47. getProperty Gets the value of a property e setNoErase Specifies whether the object should be erased when another object is drawn e setProperty Sets a property for the graphic e setX Value Sets the X value of the plot e setY Value Sets the Y value of the plot IONGrPlot The IONGrPlot method constructs an object of the IONGrPlot class Syntax public IONGrPlot public IONGrPlot int X public IONGrPlot float X public IONGrPlot double X public IONGrPlot String sName public IONGrPlot int X int Y public IONGrPlot float X float Y ION Java User s Guide IONGrPlot Class 220 Chapter 6 ION Java Class and Method Reference public IONGrPlot double X double Y public IONGrPlot String sxName String sYName Arguments X X values of the plot Y Y values of the plot sXName The name of an IDL variable to use for the X values in this plot sYName The name of an IDL variable to use for the Y values in this plot Exceptions None draw The draw method displays the plot in the drawing area that makes up this object Syntax public void draw IONGraphicConnection grConn Arguments grConn IONGraphicConnection used to issue the drawing commands to the server Exceptions None IONGrPlot Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 221 Example draw con getProperty The getProperty method retrieves the current
48. gt lt HTML gt Considerations Specific to ION Applets ION Java User s Guide Chapter 5 Building ION Applets and Applications 109 Note __W _ S S SsS S S FFFSSSSSSSS S S S The script above assumes that the browser is either Navigator or Internet Explorer Currently the vast majority of browsers in use are one of these two still you may wish to make your own gateway HTML page more robust Methods Available The following methods are available for communication between scripting languages and ION applets executelDLCommand string where string is a valid IDL command string The executeIDLCommand method allows you to execute any IDL command via a script with IDL s output going to the specified applet s drawing area For example if you have an IONSurfaceApplet named MYSURF you could use the following JavaScript statement to change the color table when the user presses a button document MYSURF executeIDLCommand LOADCT 5 See Example Using JavaScript on page 109 for a more complete discussion disconnect Use this method to disconnect from the ION Server Example Using JavaScript The following HTML code demonstrates the use of JavaScript to interactively update an ION graphic The example includes an I ONGraphicApplet that displays a shaded surface uses a JavaScript select object to create a pulldown list of rotation values and adds a button to rotate t
49. iWidth int iHeight int Z int X int Y public IONSurface int iWidth int iHeight float Z float X float Y public IONSurface int iWidth int iHeight double Z double X double Y public I ONSurface int iWidth int iHeight String sZName String sXName String sYName Arguments iWidth The width of the plot iHeight The height of the plot Z The Z data values for the surface sName sZName The name of the IDL variable to use for the Z data values of the surface lIONSurface ONJSurface Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 253 X An array holding the values for the X coordinates of the grid Y An array holding the values for the Y coordinates of the grid sXName The name of the IDL variable holding the values for the X coordinates of the grid sYName The name of the IDL variable holding the values for the Y coordinates of the grid Exceptions None draw The draw method produces and displays a graphic in the drawing area that makes up this object Syntax public void draw Arguments None Exceptions None getProperty The getProperty method retrieves the current value of the specified property Syntax public final ION Variable getProperty String sName ION Java User s Guide lIONSurface ONJSurface Class 254 Chapter 6 ION Java Class and Method Reference Arguments sName The name of the property Properties S
50. lIONMouseListener Interface ION Java User s Guide Chapter 6 ION Java Class and Method Reference 239 when The time when the event happened mask The button that was pressed Exceptions None mouseReleased Call the mouseReleased method when a mouse button is released in a drawable Note that the Mouse Listener must have been registered in the drawable prior to calling mouseReleased Syntax public abstract void mouseReleased IONDrawable drawable int X int Y long when int mask Arguments drawable The I ONDrawable object in which the event occurred X The X location of the mouse Y The Y location of the mouse when The time when the event happened mask Current mouse button state The left mouse button is represented by 1 one the middle mouse button by 2 and the right mouse button by 4 ION Java User s Guide lIONMouseListener Interface 240 Chapter 6 ION Java Class and Method Reference In Unix versions of Java it is impossible to determine which mouse button was released if more than one button was pressed before the button release As a result on Unix platforms ION reports the following button release events Buttons Button Release Pressed Reported by ION left and middle left left and right left middle and right right left middle and left right Button release events are reported correctly in Windows versions of Java Exceptions None lIONMouseListener I
51. method are a number of sections that describe the syntax for calling the method and its arguments if any These sections are described below Syntax The Syntax section shows the proper syntax for calling the method Data Types Java is a strongly typed language which means that input and output data variables must be created as or cast to the proper type before use The Syntax description includes the data type of each variable specified For example the following is a syntax description for the ION method that sets the value of an IDL variable setIDLVariable String sName IONVariable oVar In this case there are two arguments to the setIDLVariable method sName and oVar The word String defines sName as a variable of type string Similarly the word TONVariable defines oVar as a variable of type ION Variable Multiple Syntax Definitions Many ION Java methods can be called in more than one way In these cases all of the available syntax definitions are listed together For example the following are all valid ways to call the setX Value method of the ONContour class setX Value int X J setX Value float X setX Value double X setX Value String sName ION Java User s Guide How to Use this Chapter 118 Chapter 6 ION Java Class and Method Reference This means that the argument to the setX Value method can be either an integer single precision floating point or double precision floating p
52. plot and most IDL Surface properties supported by ION can be set through parameters to the applet The ION Java Class Hierarchy ION Java User s Guide Chapter 3 Overview of the ION Java Classes 61 Using the Component Classes The ION Component classes have a number of common features The contour map plot and surface objects all allow you to set the data values retrieve and set properties and draw the object See Chapter 6 ION Java Class and Method Reference for a complete list of methods for each class Setting Values The ION Graphics objects that include data all allow you to set the initial data values when you create the object You can also reset the data values using the set XValue setYValue setZValue methods The set methods enable you to change the value of the displayed data on the fly without re creating the object in question Getting and Setting Properties The contour map plot and surface objects can all be modified by changing the value of a set of properties associated with the objects The list of properties available for modification is a subset of the list of properties controlled by keywords to the corresponding IDL Direct Graphics routine CONTOUR MAP_SET PLOT or SURFACE Consult the IDL Reference Guide for details about the settings for individual properties Drawing With the exception of the IONGrConnection object all of the ION component objects have a draw method Calling the draw met
53. side representation of an IDL variable ONVariable objects are used to read and write data between the IDL server and clients IONComplex This class is the client side representation of IDL s single precision complex number IONDComplex This class is the client side representation of IDL s double precision complex number ION Component Classes The ION Component classes are a set of high level Java classes that provide a rapid and powerful way to include IDL graphics in a Java application or Java applet Built on top of the low level classes the Component classes encapsulate specific IDL functionality and provide a simpler interface which allows you to connect to the ION Server and display graphics generated by IDL The component classes are easier to use than the low level classes while providing less flexibility The ION Java Class Hierarchy ION Java User s Guide Chapter 3 Overview of the ION Java Classes 57 lONGrConnection An IONGrConnection object provides a connection between the ION Server and the client In addition to establishing and ending the connection IONGrConnection allows you to get and set the values of IDL variables on the ION Server add and remove drawable objects to the connection and execute IDL commands directly It also logs server messages automatically and displays them via IONGrDrawable IONJGrDrawable lIONGrDrawable IONJGrDrawable An IONGrDrawable object creates a drawing area that presents
54. the client needs to regain control of the application immediately to be able to process user input An example of this situation would be when a command starts an IDL routine that requires a large amount of processing If the command is blocking the client will not be free to receive user input or possibly even redraw itself Parameters In addition to the parameters described in Parameters Specified via lt PARAM gt Tags on page 70 the I ONGraphicsApplet accepts the following parameters IDL_COMMAND 0 IDL_COMMAND_n The IDL_COMMAND_ parameters specify the IDL commands to send to the ION Server The value of each IDL_COMMAND is a valid single line IDL command the line continuation is not supported by ION Note that commands that are explicitly excluded via the ION security mechanism are not processed Noe Command numbers must be continuous beginning with zero and ending with n AYSNC_COMMANDS Set the value of this parameter to YES if the client should send commands asynchronously All commands are sent in order and control is returned to the applet as soon as the commands are sent The default value is NO DECOMPOSED_COLOR If set to YES the applet will treat pixel values as RGB triplets when on a true color 24 bit or 32 bit device This is the default If set to NO the applet will treat the first eight bits the red portion of the pixel value as an index into the curr
55. 30 SELECTE lt OPTION VALUE 45 gt 45 lt OPTION VALUE 60 gt 60 lt OPTION VALUE 75 gt 75 lt OPTION VALUE 90 gt 90 lt SELECT gt ZE 1 gt D gt 30 lt Create the Rotate Surface button The rot_button_OnClick when this button is cl subroutine is called automatically icked gt lt INPUT TYPE BUTTON NAME rot_button VALUE Rotate Surface gt lt FORM gt lt BODY gt lt HTML gt Considerations Specific to ION Applets ION Java User s Guide Chapter 5 Building ION Applets and Applications 113 Notes on the Differences Between the JavaScript and VBScript Versions 1 Interaction between the applet and the script language takes place in JavaScript statements in the Netscape Navigator version and in VBScript statements in the Microsoft Internet Explorer version The syntax of the scripting language is slightly different 2 Inthe JavaScript version the applet is included within the HTML FORM definition Internet Explorer requires that the applet be located outside the FORM In JavaScript you must explicitly tie a control a button for example to a JavaScript function VBScript automatically looks for a subroutine name based on the name of the button Tips and Tricks This section includes suggestions that may be useful in some situations Make sure your installation meets the criteria defined here before implementing
56. 69 page containing the applet code is assumed to be located in the directory vsi IDL61 products ION61 classes sono CODEBASE attribute is included lt APPLET NAME MyApplet WIDTH 100 HI lt Other applet code gt lt APPLET gt EIGHT 100 CODE com rsi ion IONGraphicApplet class Supporting Java Incapable Browsers You can include HTML text within an applet tag but the text will only be displayed if the Java virtual machine fails to start You may like the following lt APPLET attributes gt lt Applet code gt find it useful to include something lt B gt Java virtual machine failed to start Is Java enabled in your browser lt APPLET gt lt B gt People with browsers that do not support Java would see the text Java virtual machine failed to start Is Java enabled on your browser while those with browsers that do support Java ION Java User s Guide would see only the applet The lt APPLET gt Tag 70 Chapter 4 Using ION s Pre Built Applets Parameters Specified via lt PARAM gt Tags The HTML lt PARAMS tag is more like an attribute of the lt APPLET gt tag than a separate HTML tag Although it is a tag it is valid only inside an lt APPLET gt tag or an lt OBJECT gt tag It functions to pass parameters to the applet This section discusses parameters common to all ION Applets Parameters specific to individual applets included in the ION pac
57. Area method copies an area from one drawable to another Syntax public void copyArea int iSource int iDest int x int y int width int height int x2 int y2 Arguments iSource The index of the source drawable iDest The index of the destination drawable x y The lower left corner of the area to copy width height The dimensions of the copy area x2 y2 The location of the lower left corner of the copy area in the destination Exceptions None getCurrentindex The getCurrentIndex method retrieves the index of the current drawable Syntax public int getCurrentIndex Return Value The current drawable index If no drawable is current 1 is returned ION Java User s Guide IONGraphicsClient Class 166 Chapter 6 ION Java Class and Method Reference Arguments None Exceptions None Example int index getCurrentIndex getlONDrawablelndices The getlONDrawableIndices method fills an array with the indices of the available drawables Syntax public void getlIONDrawableIndices int iIndices Arguments ilndices An array of length getNumIndices that will be filled with the index values Exceptions None getNumIndices The getNumIndices method returns the number of drawable indices currently allocated Syntax public int getNumIndices Return Value The number of indices IONGraphicsClient Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 167 A
58. Broker you must specify the port on which the Tunnel Broker is listening the default is 9085 Shutting Down the ION Daemon Use the iondown utility to shut down the ION Daemon or Tunnel Broker The iondown command uses the following syntax iondown force host hostname port port Note Under Windows you will generally use the ION service rather than starting and stopping the ION Daemon manually However if you used the iond command to start the ION Daemon on your machine you can use the iondown command to stop it The switches to the iondown command are described below force Set this switch to force the ION Daemon or HTTP Tunnel Broker to shut down without prompting If force is not specified iondown will prompt you before shutting down the daemon host Set this switch to the name of the host on which the ION Daemon or HTTP Tunnel Broker is running Unless the rutil switch was set when the ION Daemon was started i ondown requests are only accepted from the host on which the daemon is running port Set this switch to the port number of the port that the ION Daemon or HTTP Tunnel Broker is watching The default is port 7085 which is the default port for the ION Daemon To shut down the ION HTTP Tunnel Broker you must specify the port on which the Tunnel Broker is listening the default is 9085 Configuring ION Java for UNIX ION Java User s Guide Chapter 1 Configuring ION Java 27 Manually Configuring
59. D This keyword is used to control the way in which graphics color index values are interpreted when using displays with decomposed color TrueColor visuals This keyword has no effect with other types of visuals Direct Graphics in ION ION Java User s Guide Chapter 5 Building ION Applets and Applications 89 Set this keyword to 1 to cause color indices to be interpreted as 3 8 bit color indices where the least significant 8 bits contain the red value the next 8 bits contain the green value and the most significant 8 bits contain the blue value This is the way IDL has always interpreted pixels when using visual classes with decomposed color Set this keyword to 0 to cause the least significant 8 bits of the color index value to be interpreted as a PseudoColor index This setting allows users with TrueColor displays to use IDL programs written for standard PseudoColor displays without modification In older versions of IDL color index values higher than D N_COLORS 1 were clipped to D N_COLORS 1 in the higher level graphics routines In some cases this clipping caused the exclusive OR graphics mode to malfunction with raster displays This clipping has been removed Programs that incorrectly specified color indices higher than D N_COLORS 1 will now probably exhibit different behavior FONT Set this keyword to a scalar string specifying the name of the font used when the hardware font is selected Noe The hardware f
60. DEVICE DOWNHILL FILL FOLLOW FONT IRREGULAR LEVELS MAX_VALUE MIN_VALUE NLEVELS NOCLIP NODATA NOERASE NORMAL OVERPLOT PATH_DATA_COORDS PATH_DOUBLE PATH_FILENAME PATH_INFO PATH_XY POLAR POSITION SUBTITLE T3D TICKLEN TITLE TRIANGULATION XCHARSIZE YCHARSIZE ZCHARSIZE XGRIDSTYLE YGRIDSTYLE ZGRIDSTYLE XLOG YLOG XMARGIN Y MARGIN ZMARGIN XMINOR YMINOR ZMINOR XRANGE YRANGE ZRANGE XSTYLE YSTYLE ZSTYLE XTICKFORMAT Y TICKFORMAT ZTICKFORMAT XTICKLEN YTICKLEN ZTICKLEN XTICKNAME YTICKNAME ZTICKNAME XTICKS YTICKS ZTICKS XTICKV YTICKV ZTICKV XTITLE YTITLE ZTITLE XTICKINTERVAL YTICKINTERVAL ZTICKINTERVAL XTICKLAYOUT YTICKLAY OUT ZTICKLAYOUT XTICKUNITS YTICKUNITS ZTICKUNITS XTICK_GET YTICK_GET ZTICK_GET ZAXIS ZLOG ZVALUE Exceptions None Example TONVariable value getProperty Property setProperty The setProperty method sets a property for the contour object Syntax public void setProperty String Property ION Variable Value Arguments Property The name of the property to set IONGrContour Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 183 Value The value of the property Properties Supported The IDL Contour properties are supported by IONGrContour get set Property are the same as those covered in getProperty on page 181 Refer to the IDL documentation on keywords available for use with the CONTOUR procedure for an explanation of eac
61. DP TaT ARS cesacucena siesta E E 258 DESI ay cs sca ccecingactccdzns sdyenpadqnduaspas iniia aaas ieai ieaiai 281 Chapter 7 WOUNDED cites viens caeasecetestereceneswavatenavedandsanetetesaradxntdeeetans 285 Avoiding Conflicting ION Installations ccscc scccscccsceeccssstecesteetesecasseeeeeeeees 286 Checking Web Server Communication ances dese ced reset ened eaewe stdin leak 287 Troubleshooting ION Service Problems a socccccceissestonsaccvsueseeaseayvosestenssiemetes 287 Troubleshooting Applets that Fail to Display eeeesesseseseesesrssrrseresererrseeseee 288 Troubleshooting Not Found Errors os desasdsuesesessctanvenvsnassesanssononisacaevncranre 290 Troubleshooting Licensing Errors sssseeseseeseeseesseseresersresrrsrenserseesreeseeseee 291 Setting the IDL Path annesine ni e E E eia 291 Troubleshooting Security ENOS aecerscirsotennisnnieitiani niia 292 Encountering Browser Timeouts with Java Errors eessessseeeeereerrrereeeee 293 ION Serv r Timeout ao sacs cp tase pee dented dade cde baadceed ana iae 293 JIDE 1 2 Reguired for Cie sussies ae aei oiae N ERS 293 ION Java User s Guide Contents Contents ION Java User s Guide Chapter 1 Configuring ION Java This chapter discusses the process of setting up and starting the ION Daemon after it has been installed and discusses strategies for locating your HTML and Java class files The following topics are covered e Configuring ION Java for Windows e Configuring ION Java for U
62. Exceptions None IONGrPlot Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 225 lONGrSurface Class The IONGrSurface class produces an IDL generated surface using SHADE_SURF or SURFACE in a drawing area The class allows the user to enter data and set surface attributes at the program level Class Declaration public class IONGrSurface extends IONGrGraphic Methods e TIONGrSurface Constructs an object of the IONGrSurface class e draw Produces the output graphic and displays the graphic on the drawing surface of this class e getProperty Gets the value of a property e setNoErase Specifies whether the object should be erased when another object is drawn e setProperty Sets a property for the graphic e setX Value Sets the X value of the surface e setY Value Sets the Y value of the surface e setZValue Sets the Z data of the surface lONGrSurface The IONGrSurface method constructs an object of the IONGrSurface class Syntax public IONGrSurface public IONGrSurface int Z J D public IONGrSurface float Z public IONGrSurface double Z public IONGrSurface int Z J int X int Y ION Java User s Guide IONGrSurface Class 226 Chapter 6 ION Java Class and Method Reference public IONGrSurface float Z float X float Y public IONGrSurface double Z double X double Y public IONGrSurfac
63. Graphics driver This includes the creation deletion showing hiding and iconization of windows on the client Class Declaration public class IONWindowingClient extends IONGraphicsClient Methods e TIONWindowingClient Constructs an object of the IONWindowingClient class e connect Connects to the server e createWindow Creates a window on the client e deleteWindow Deletes a given window or pixmap e showWindow Shows hides a window lIONWindowingClient The IONWindowingClient method constructs an ION WindowingClient object The connect method from IONGraphicsClient must be called to establish a connection between the client and the server Syntax public IONWindowingClient Component comp Arguments comp A Java AWT Component that is used to reference the display being used for the graphics This is needed for creating offscreen images ION Java User s Guide IONWindowingClient Class 282 Chapter 6 ION Java Class and Method Reference Exceptions None connect See connect on page 123 createWindow The createWindow method creates a drawing area of the given size places that area in its own window frame make the window the current destination for graphics output and returns the IDL window index of the new window If a title is not specified the default IDL windowing convention is used IDL 0 IDL 1 Syntax public int createWindow int xsize int ysize pub
64. Guide Chapter 6 ION Java Class and Method Reference 209 draw The draw method calls the IDL MAP_CONTINENTS procedure to add boundaries to the current map projection Syntax public void draw ONGraphicConnection grConn Arguments grConn The name of the connection Exceptions None getProperty The getProperty method retrieves the specified value of the property Syntax public final ION Variable getProperty String sName Arguments sName The name of the property to retrieve Properties Supported The following IDL MAP_CONTINENTS properties are supported by the IONGrMapContinents get set Property Refer to the IDL documentation on keywords available for use with the MAP_CONTINENTS procedure for an explanation of each property COASTS COLOR CONTINENTS COUNTRIES FILL_CONTINENTS HIRES LIMIT MLINESTYLE ORIENTATION RIVERS SPACING T3D USA ZVALUE ION Java User s Guide IONGrMapContinents Class 210 Chapter 6 ION Java Class and Method Reference Exceptions None Example setProperty The setProperty method set the specified property to the specified value Syntax public final void setProperty string sName ION Variable vValue Arguments sName The name of the property to set vValue The value to which to set the property Properties Supported The properties supported by IONGrMapContinents get set Property are the same as those supported by getProperty on page 209 Refer to the
65. ION Java User s Guide RSI Research Systems Inc ION Version 6 1 July 2004 Edition Copyright Research Systems Inc All Rights Reserved 0704ION61JVA Restricted Rights Notice The IDL ION Script and ION Java software programs and the accompanying procedures functions and documentation described herein are sold under license agreement Their use duplication and disclosure are subject to the restrictions stated in the license agreement Research Systems Inc reserves the right to make changes to this document at any time and without notice Limitation of Warranty Research Systems Inc makes no warranties either express or implied as to any matter not expressly set forth in the license agreement including without limitation the condition of the software merchantability or fitness for any particular purpose Research Systems Inc shall not be liable for any direct consequential or other damages suffered by the Lic ensee or any others resulting from use of the IDL or ION software packages or their documentation Permission to Reproduce this Manual If you are a licensed user of this product Research Systems Inc grants you a limited nontransferable license to reproduce this particular document provided such copies are for your use only and are not sold or distrib uted to third parties All such copies must contain the title page and this notice page in their entirety Acknowledgments IDL isa r
66. ION applet there is a chance that the connection to the ION Server is still active when you close your browser In this case your browser may not start again immediately it will wait for the ION socket connection to time out before shutting down and allowing you to start the browser again On Unix systems you can use the kill command to prematurely kill the browser process and close the socket connection On Windows NT systems use the Processes tab of the Task Manager dialog to end a browser process If you do not manually kill the browser process the socket connection will automatically time out in 60 seconds ION Server Timeout The ION Server may time out if you leave an applet unattended You can change the amount of time the ION Server will wait before timing out For more information see Chapter 1 Configuring ION Java JDK 1 2 Required for Clients Clients may encounter problems if they are using a pre JDK 1 2 virtual machine JDK 1 2 1 3 or 1 4 is required for connections to ION Java 6 1 Users can check their browser configurations for information on which version they are using ION Java User s Guide 294 Chapter 7 Troubleshooting ION Java User s Guide Index Symbols line continuation character 42 A addDrawable method 173 addGraphic method 188 addIONCommandDoneListener method 122 addIONDisconnectListener method 122 addIONDrawable method 162 addIONMouseListener method 133
67. JCanvas Class IONComplex Class IONDComplex Class IONDrawable Interface IONGraphicConnection Interface IONGrContour Class IONGrGraphic Class IONGrMapContinents Class IONGrMapImage Class IONGrSurface Class 115 116 Chapter 6 ION Java Class and Method Reference IONMap IONJMap Class e IONMouseListener Interface IONOffScreen Class e IONOutputListener Interface IONPlot IONJPlot Class e TONSurface IONJSurface Class IONVariable Class e IONWindowingClient Class Note __ S SS _ SS OE SSSS eFeFeFFSSSSSSSSSSSS For descriptions of the ION Java applet classes see Chapter 4 Using ION s Pre Built Applets ION Java User s Guide Chapter 6 ION Java Class and Method Reference 117 How to Use this Chapter The elements of the ION Java class library are documented alphabetically in this chapter The page or pages describing each class include a description of the class declaration which provides pointers to the Java class or other ION class that the class inherits from if any Note that this chapter does not provide documentation for the Java classes themselves see your Java API reference materials for descriptions of the Java classes Class methods are documented alphabetically with the exception of the constructor method for the class which is documented first following the description of the class itself A description of each method follows its name Beneath the general description of the
68. Java Performance Considerations seseesseeesesrsssesresstssseereseessesreesressesereseesse 43 Tips for Increasing Execution Speed in ION Java seessssseseseseseressrrsrseesse 43 Baadwidih ISSUES oscitans icare rdis ae i esias isase 44 Running the TON Java Examples iicieiiisscosseitiiesrisssrinisesevessasiusens sisson sa airaa 46 Where to Place HTML and Class Files csssiscisisiissisicsisieississirsisisiiiseiasiiis 49 Testing ION Applications Locally seisine ansrnicerninresniisiiia an 49 Publishing ION Applications on Your Web Server esssseeseseseeeseerersrreresresse 49 Where t Locate the ION Class Files scceciccsccedsctcccdectnattoniehacetatieceiniedaneaes 50 What Are the Required Class Files nininini inisin 51 Contents ION Java User s Guide Chapter 3 Overview of the ION Java Classes ccccsssseeeeeseeseeeeeeeeeseenes 53 The ION Java Class Hierarchy asserted iain 54 TON Low Level CISSE veascaiacticsasicasnntincentesasiccasnedsdosncavincesasndeseansnnentenvtioanaed 55 ION Component Class asda cd ccdasvdcacsicdaccesaondsaddaanudead A EA E ES 56 ION Pre Emit Applets eniros i E E a 59 Usine he Component Casses enesesse teesin Eee s Neon E EE aN s 61 stack tices E E tena 61 Getting and Setting Properties siessicicessiaseascesasiteadsassensadiassasadaonenctasbevenvasessvees 61 Bs o E A E paeroerrore 61 AWT Y SNE o E ese eee 62 Chapter 4 Using ION s Pre Built Applets nnnssssssnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnnn 65
69. KEK KKK KKK KEK KK KKK KKKKKKK KK KKK KK KKK KKK import java awt import java applet import java io import java net import com rsi ion Import the ION Package ION Java User s Guide Considerations Specific to ION Applets 104 Chapter 5 Building ION Applets and Applications public class commands extends Applet implements IONDisconnectListener Instance Vars IONGrConnection c_ionCon the ion connection IONGrDrawable c_ionDrw the ION drawable Dimension c_dimApp Size of drawing area int c_bConnected 0 0 gt conn 1 gt conn 1 gt conn failed KKKKK KKK KKK KKK KKK KK KKK KKK KKK KK Init Method iif KKK KKK KKK KKK KKK KKK KKK KKK KKK KKK public void init Create connection and drawable objects c_ionCon new IONGrConnection c_dimApp getSize c_ionDrw new IONGrDrawable c_dimApp width c_dimApp height Add the drawable to the AWT tree setLayout new GridLayout 1 1 add c_ionDrw KKK KKK KKK KEK KKK KKK KKK KEK KKK KKK KEK KKK KKK KKK KKKKK KKK KK Inorder to display status messages at startup and also to be able to disconnect when the page is not being viewed we override the Applets start and stop methods KKK KK KKK KKK KKK KKK KKK KEK KKK KKK KK KKK KKK KKK KKK KK KK KKK start Purpose Overide the applet s start method Connect to IONJ if not already connected Note in pre ION1 4 releases this me
70. LOT BACKGROUND CHARSIZE CLIP COLOR DATA DEVICE FONT LINESTYLE NOCLIP NODATA NOERASE NORMAL POSITION SUBTITLE T3D TICKLEN TITLE MAX_VALUE MIN_VALUE NSUM POLAR XLOG YNOZERO YLOG XCHARSIZE YCHARSIZE ZCHARSIZE XGRIDSTYLE YGRIDSTYLE ZGRIDSTYLE XMARGIN YMARGIN ZMARGIN XMINOR YMINOR ZMINOR XRANGE YRANGE ZRANGE XSTYLE YSTYLE ZSTYLE XTICKFORMAT YTICKFORMAT ZTICKFORMAT XTICKLEN YTICKLEN ZTICKLEN XTICKNAME YTICKNAME ZTICKNAME XTICKS YTICKS ZTICKS XTICKV YTICKV ZTICKV XTITLE Y TITLE ZTITLE ZVALUE ZAXIS Example The following example creates an ONContourA pplet that connects to the same server used by the Connection applet defined in the IONGraphicApplet example The applet generates some data for the Z value of the contour and sets the Title property of the contour plot lt APPLET NAME CONTOUR CODE IONContourApplet class WIDTH 200 HEIGHT 200 ARCHIVE ion_61 zip CODEBASE classes gt lt This applet uses the applet CONNECTION to connect to the server gt lt PARAM NAME ION_CONNECTION_NAME VALUE CONNECTION gt lt PARAM NAME Z_ VALUES VALUE exp shift dist 30 15 P5 TAZ gt lt PARAM NAME TITLE VALUE Contour gt lt APPLET gt ION Java User s Guide IONContourApplet 78 Chapter 4 Using ION s Pre Built Applets Note that the example uses an IDL expr
71. NCTION keyword 90 GET_SCREEN_SIZE keyword 90 keywords accepted 88 SET_CHARACTER_ SIZE keyword 90 SET_GRAPHICS_FUNCTION keyword 91 ION Graphics Java Classes 41 ION HTTP Tunnel Broker 29 39 ION Java Properties dialog 11 ION Low Level Java Classes 41 ION methods available 109 ION package importing 100 ION server 38 connection limit 33 security 32 security files 32 security system 39 ION Service See also ION daemon ION Tunnel Broker port number 30 ION_CONNECTION_NAME parameter 72 ion_httpd command 30 IONCallableClient class 55 120 122 addIJONCommandDoneListener method 122 addIONDisconnectListener method 122 addIONOutputListener method 123 connect method 123 disconnect method 125 executeIDLCommand method 125 getCConnectionType method 126 getClientVersion method 126 getIDLVariable method 127 IONCallableClient method 121 removelONCommandDoneListener meth od 128 removelONDisconnectListener method 128 removelONOutputListener method 129 sendIDLCommand method 129 ION Java User s Guide 299 IONCallableClient class 55 120 122 contin ued setConnectionMethod method 130 setConnectionTimeout method 130 setIDLVariable method 131 IONCallableClient method 121 IONCanvas class 56 132 addIONMouseListener method 133 getDownButtons method 134 getGraphics method 135 getImage method 135 getMousePos method 136 IONCanvas meth
72. NIX e Configuring The ION HTTP Tunnel Broker e Command Security ION Java User s Guide 9 10 Chapter 1 Configuring ION Java Starting and Configuring the ION Daemon The ION Daemon is a process that listens to a specified socket port waiting for a communication request Once a connection is received and verified the daemon starts up an ION Server process connects the client to the server process and waits for further connection requests Note If you are unfamiliar with ION Java it may be helpful to refer to Chapter 2 Overview for information regarding general ION Java architecture including an overview of the ION server client relationship the ION Daemon and ION Tunnel Broker services before beginning the configuration process If you have client applets located behind a firewall which attempt and fail to communicate with an ION Server on the other side of a firewall you will need to start and configure the ION Tunnel Broker in addition to the ION Daemon See Configuring The ION HTTP Tunnel Broker on page 29 for more information ION provides a set of utility programs that allow you start configure and manage the ION Daemon and the HTTP Tunnel Broker See the following section for your platform e On UNIX platforms run the utility programs from the shell prompt See Configuring ION Java for UNIX on page 21 for more information e On Windows platforms use the GUI utilities described in the section Config
73. ON Java User s Guide Chapter 6 ION Java Class and Method Reference 121 e removeIONDisconnectListener Removes a disconnect listener from the client object e removelONOutputListener Removes a listener from the client object sendIDLCommand Posts an IDL command to the ION Server Control is returned as soon as the command is sent e setConnectionMethod Sets the type of connection for the client e setConnectionTimeout Sets the timeout for socket connections e setIDLVariable Sets the value of an IDL variable on the ION Server Subclasses e JONGraphicsClient Class Constants e HTTP_CON e SOCK_CON e BEST_CON e NO_CON IONCallableClient The IONCallableClient method constructs an IONCallableClient object When it returns all internal initialization is complete No connection is made at this time Syntax public IONCallableClient Arguments None Example IONCallableClient client new IONCallableClient ION Java User s Guide IONCallableClient Class 122 Chapter 6 ION Java Class and Method Reference addlIONCommandDoneListener The addI ONCommandDoneListener method is used to register an object that implements the IONCommandDoneListener interface with this object Syntax public final void addJONCommandDoneListener LONCommandDoneListener listener Arguments listener An object that implements the IONCommandDoneListener interface The listener is a
74. Plot get set Property are the same as those supported by getProperty on page 247 Refer to the IDL documentation on keywords available for use with the PLOT procedure for an explanation of each property IONPlot IONJPlot Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 249 Exceptions None setXValue The setX Value method resets the X value of the plot Syntax public void setX Value int X public void setX Value float X public void setX Value double X public void setX Value String sName Arguments X The new X value of the plot sName The name of an IDL variable to use for the X value Exceptions None setYValue The setY Value method resets the Y value of the plot Syntax public void setY Value int Y public void setY Value float Y public void setY Value double Y public void setY Value String sName ION Java User s Guide IONPlot IONJPlot Class 250 Chapter 6 ION Java Class and Method Reference Argument Y The new Y value of the plot sName The name of the IDL variable to use for the Y value Exceptions None IONPlot IONJPlot Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 251 lONSurface ONJSurface Class The IONSurface class extends the IONGrDrawable class and contains an IONGrSurface object to provide a easy way of drawing IDL surfaces It can be inserted into an AWT tree The IONJSurfac
75. RIZONTAL IMAGE LEGO LINESTYLE LOWER_ONLY MAX_VALUE MIN_VALUE NOCLIP NODATA NOERASE NORMAL PIXELS POSITION SAVE SHADES SKIRT SUBTITLE T3D TICKLEN TITLE UPPER_ONLY XLOG YLOG ZLOG XCHARSIZE Y CHARSIZE ZCHARSIZE XGRIDSTYLE YGRIDSTYLE ZGRIDSTYLE XMARGIN Y MARGIN ZMARGIN XMINOR YMINOR ZMINOR XRANGE YRANGE ZRANGE XSTYLE YSTYLE ZSTYLE XTICKFORMAT Y TICKFORMAT ZTICKFORMAT ION Java User s Guide IONGrSurface Class 228 Chapter 6 ION Java Class and Method Reference XTICKINTERVAL YTICKINTERVAL ZTICKINTERVAL XTICKLAYOUT YTICKLAY OUT ZTICKLAY OUT XTICKLEN YTICKLEN ZTICKLEN XTICKNAME YTICKNAME ZTICKNAME XTICKS YTICKS ZTICKS XTICKUNITS YTICKUNITS ZTICKUNITS XTICKV YTICKV ZTICKV XTICK_GET YTICK_GET ZTICK_GET XTITLE YTITLE ZTITLE ZAXIS ZVALUE Exceptions None Example IONVariable value getProperty Property setNoErase The setNoErase method of the I ONGrSurface class overrides setNoErase in the IONGrGraphic class See setNoErase on page 200 for the syntax of this method setProperty The setProperty method sets a property for the surface object Syntax public void setProperty String sName IONVariable v Arguments sName The name of the property to set V The value of the property Properties Supported The properties supported by the IONGrSurface get set Property as the same as those supported by the getProperty on page 227 Refer to the IDL documentation on IONGrSu
76. SAT_P SCALE STANDARD PARALLELS Graphics POSITION T3D ZVALUE Exceptions None setLat setLon The setLat setLon methods set the latitude and longitude for the map projection Syntax public void setLat int lat ublic void setLat float lat public void setLat double lat public void setLat String lat IONMap IONJMap Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 235 public void setLon int lon public void setLon float on public void setLon double lon public void setLon String lon Arguments lat The latitude of the point on the Earth s surface to be mapped to the center of the projection plane Latitude is measured in degrees north of the equator and at must be in the range 90 lt lat lt 90 The default is 0 lon The longitude of the point on the Earth s surface to be mapped to the center of the projection plane Longitude is measured in degrees east of the Greenwich meridian and lon must be in the range 180 lt lon lt 180 The default is 0 Exceptions None setProperty The setProperty method sets the specified property to the specified value Syntax public final void setProperty String sName IONVariable vValue Arguments sName The name of the property to set vValue The value to which to set the property ION Java User s Guide IONMap IONJMap Class 236 Chapter 6 ION Java Class and Method Reference Properties Supported The prop
77. Short method 276 getShortArray method 276 getString method 277 getStringArray method 278 graphics devices ION 88 graphics java classes 41 H HEIGHT attribute 68 HSPACE attribute 68 HTTP ION Tunnel Broker 29 39 l IDL command execution 120 command log output 97 search path 14 Widgets 42 IDL_COMMAND parameter 74 images size of 44 importing the ION package 100 include commands 22 include file 22 Index including applets in HTML pages 100 intValue method IONComplex class 142 IONDComplex class 154 ION class files 51 connecting to the server 70 controlling applets with scripts 107 error handling 96 graphics device 88 keywords accepted 88 graphics objects drawing 61 getting properties 61 setting properties 61 setting values 61 IDL limitations 42 low level classes 55 pre built applets 59 65 server limitations 42 using graphics classes 61 ION daemon 39 checking status UNIX 25 checking status Windows 18 client verification 33 command line parameters 21 configuring on UNIX 21 configuring on Windows 11 overview 10 port number 13 23 security 33 security tokens 23 shutting down 26 starting on UNIX 21 starting on Windows 12 starting with Services Manager 20 ION device COPY keyword 88 DECOMPOSED keyword 88 FONT keyword 89 GET_CURRENT_FONT keyword 90 ION Java User s Guide ION device continued GET_FONTNAMES keyword 90 GET_GRAPHICS_FU
78. Syntax public abstract Graphics getIONGraphics Arguments None ION Java User s Guide IONDrawable Interface 160 Chapter 6 ION Java Class and Method Reference Exceptions None Example Graphics g draw getIONGraphics IONDrawable Interface ION Java User s Guide Chapter 6 ION Java Class and Method Reference 161 lIONGraphicsClient Class The IONGraphicsClient class provides mechanisms to handle the processing of a graphic primitive data set from the IDL server Information sent by the server is read by mechanisms provided by the super class IONCallableClient Class Declaration public class IONGraphicsClient extends IONCallableClient implements IONMouseListener IONGR2PropListener Methods IONGraphicsClient Constructs an object of the IONGraphicsClient class addIONDrawable Adds an object that implements the IONDrawable interface windows or off screen images connect Connects the client with the ION Server copyArea Copies an area from one drawable to another getCurrentIndex Gets the index of the current drawable getIONDrawableIndices Gets a list of assigned drawable indices getNumIndices Gets the number of drawable indices allocated readImage Reads the current contents of the drawable removelIONDrawable Removes an object from the internal list of IONDrawables maintained by this object setDecomposed Sets decomposed mode on the connection
79. The IDL Search Path is used to specify the search path used by IDL for pro and sav files If you call user written IDL routines from an applet make sure that the pro files are located in IDL s path You can set the IDL Path using one of the following methods e Place the directory that contains your pro files in the path specified by the IDL_PATH environment variable by adding your directory in the Path tab of the Preferences dialog accessed by selecting File gt Preferences in the IDL Development Environment ION Java User s Guide 292 Chapter 7 Troubleshooting e Explicitly alter the value of the IDL system variable PATH within your applet code e Set the IDL Path on Windows using the Locations tab of ION Java Properties dialog See The ION Java Properties Dialog on page 11 To specify multiple IDL Path search directories separate each directory with a semicolon Windows or a colon UNIX Place the symbol at the beginning of a directory to indicate that all subdirectories of a specified directory should be searched For example the following Windows IDL Search Path specifies that the directory C Program Files Apache Group apache2 htdocs IONJava and all its subdirectories be searched as well as the C java_source directory C Program Files Apache Group apache2 htdocs TONJava C java_source On UNIX the following IDL Search Path specifies that the directory usr local apache2 htdocs ionjav
80. Using ION s Pre Built Applets 81 Map Characteristics ADVANCE CHARSIZE CLIP COLOR CONTINENTS CON_COLOR HIRES E_CONTINENTS E_GRID E_LHORIZON GLINESTYLE GLINETHICK GRID HORIZON LABEL LATALIGN LATDEL LATLAB LONDEL LONLAB MLINESTYLE MLINETHICK NOBORDER NOERASE TITLE USA XMARGIN YMARGIN Projection Parameters CENTRAL_AZIMUTH ELLIPSOID ISOTROPIC LIMIT SAT_P SCALE STANDARD_ PARALLELS Graphics POSITION T3D ZVALUE ION Java User s Guide IONMapApplet 82 Chapter 4 Using ION s Pre Built Applets IONPlotApplet The IONPlotApplet displays an IDL plot The X and Y values of the plot and any IDL plot properties supported by ION can be set through parameters to the applet Note You can also create plots using the IONGraphicApplet specifying the plot properties in IDL command strings The IONPlotApplet is merely a simplified way to display plots Parameters In addition to the parameters described in Parameters Specified via lt PARAM gt Tags on page 70 the IONPlotApplet accepts the following parameters X_VALUES Set the value of this parameter equal to a valid IDL expression that evaluates to a vector of X data If X_VALUES is not specified the data in Y_VALUES is plotted as a function of point number starting at zero If both arguments are provided Y_VALUES is plotted as a function of X_VALUES Y_ VALUES Set the value of this parameter equal to a valid IDL expression that eval
81. When you compile an ION applet or application the ION class files must be in the Java compiler s class path Since ION is a package the class files are stored in a directory structure The ION class files are located in the following ION installation subdirectory of the classes directory Root_ION com rsi ion Where Root_ION indicates the path to the classes directory If you have installed ION in the default directory Root_ION would be On UNIX usr local rsi ion_6 1 ion_java classes On Windows C rsi IDL61 products ION61 ion_java classes Depending on your specific Java compiler this can be accomplished by defining the system CLASSPATH environment variable See Setting the Class Path Environment Variable on page 95 for more information However the recommended method is to specify the class path on the command line when you are compiling your program See the following section for more information Setting the Class Path When Compiling Because browsers react differently to a class path system definition another way to specify the class path is to specify the ION path on the command line when you compile your Java program If you have installed ION in the default directory this might be similar to one of the following On UNIX javac classpath usr local rsi ion_6 1 ion_java classes mylonApp java On Windows javac classpath C rsi IDL61 products ION61 ion_java classes mylonApp java This method of specifying
82. a It s a good idea to shut down and restart the browser any time you make a changes to your HTML file or your class files Import the ION Package In addition to the standard Java packages and any other packages used in your applet you must import the ION package with the statement import com rsi ion ION Applets Extend the Java Applet Class ION applets are subclassed from they extend the Java Applet class When defining your applet class use a statement similar to the following public class MyIONApplet extends Applet where MyIONApplet is the name of your applet class See Simple Applet Example on page 103 for an example For a basic overview of Applets consult a Java reference Including Applets in HTML Pages To include your compiled applet in an HTML page use the lt APPLET gt tag with the NAME CODE WIDTH and HEIGHT attributes lt APPLET NAME myIONApplet CODE myIONApplet class WIDTH 300 HEIGHT 300 gt lt APPLET gt For more information see Chapter 4 Using ION s Pre Built Applets Locating the Class Files for use by ION Applets ION applets must have access to the ION class files in order to run While you can use the CODEBASE attribute to specify a relative path from the location of an HTML page containing an ION applet tag to the location of the class files it is often easier to copy the class files or provide a symbolic link if your system supports symbolic links t
83. a and all of its subdirectories be searched as well as the home java directory usr local apache2 htdocs ionjava home java If ION attempts to compile and run a pro file that is not in the path no output will be generated but no error will be displayed The best way to catch errors like this is to enable the ION applet Debug Mode and check the IDL command log output See Debug Mode on page 97 for more information Troubleshooting Security Errors Use http Instead of file with Internet Explorer Security errors result when attempting to open HTML files containing applets using the IE browser s File Open command or when double clicking an html file to open it in the browser When using Internet Explorer always use an URL to specify the file location for example http www mydomain com htmlfiles index html Check Security Command Settings Applets that violate the screening process specified by security command settings will result in errors See Command Security on page 32 to see if your applet is failing the ION Service s security criteria ION Java User s Guide Chapter 7 Troubleshooting 293 Encountering Browser Timeouts with Java Errors If you do encounter an error when running a Java applet some browsers Java virtual machines will hang requiring you to shut down and restart the browser It is generally a good idea to restart your browser after a Java error When the error is in an
84. able is an object that can be drawn to by an IONGraphicsClient IONCanvas and IONOffScreen are both implementations of IONDrawable Class Declaration public interface IONDrawable Methods No public methods Implementing Classes IONCanvas IONJCanvas Class I ONOffScreen Class e createImage Creates an offscreen image e getImage Returns the image that is being drawn e getlONGraphics Returns an ION graphics context for the device createlmage Use the createImage method to create an image of a given size Syntax public abstract Image createImage int width int height Arguments width The width of the requested image height The height of the requested image IONDrawable Interface ION Java User s Guide Chapter 6 ION Java Class and Method Reference 159 Exceptions None Example Image im draw createImage 300 300 getimage The getImage method returns the image of the current drawing area Syntax public abstract Image getImage Arguments None Exceptions None Example Image im draw getImage getlONGraphics The getlONGraphics method returns a Graphics object that you can use to get graphics information on ION s drawing buffer or draw directly to Unlike the getGraphics method getIONGraphics allows you to affect the actual IDL drawable area For example you would use the getlONGraphics method when manipulating the buffer using the COPY keyword to IDL s DEVICE procedure
85. amed ion_61 jar contains the Java class files included in the ION package This JAR file is located in the classes directory of the ION distribution and can be downloaded via a single connection to the server Use the JAR file with browsers that support uncompressed archive files For example version 3 and later of Netscape s Navigator supports uncompressed JAR files Supporting Multiple Browser Types Noe This section is relevant only for ensuring support of browsers prior to Netscape 4 or Internet Explorer 5 Use the following procedure to create a set of HTML pages that will use the most efficient download method for any of the three browser types defined above 1 Ensure that the archive files are in the same directory By default they are located in the classes subdirectory of the ION distribution This directory should be specified via the CODEBASE attribute to the APPLET tag See CODEBASE on page 67 for more information 2 Create two versions of each HTML page that contains an ION applet One page should include a reference to the uncompressed archive file via the ARCHIVE attribute to the APPLET tag ARCHIVE ion_61 zip The other page should include a reference to the compressed archive file ARCHIVE ion_61 jar Browsers that do not support the ARCHIVE attribute will ignore it and download the unarchived files 3 Create a switch page that includes JavaScript The switch page determines whi
86. amples directory Also included in the examples directory are a number of IDL pro files that are called by the ION demonstration applets See Running the ION Java Examples on page 46 for more information Note e e For the examples to function properly you must have the ION Server running on your server machine If you do not yet have the ION Server running on your system visit RSI s ION Web site and view ION examples there ION Applets and Scripting Languages You can use scripting languages such as JavaScript and VBScript to control ION applets included on an HTML page by calling ION methods that are available to all applets Communication between scripts and applets gives you a simple way to create interactive HTML pages that build on ION s pre built applets ION Java User s Guide Considerations Specific to ION Applets 108 Chapter 5 Building ION Applets and Applications Browser and Script Language Differences Two competing scripting languages are currently available for use in HTML pages JavaScript and VBScript JavaScript was developed by Netscape for use in its Navigator browser VBScript was developed by Microsoft for use in its Internet Explorer browser While the two scripting languages have much in common they do differ in ways that are beyond the scope of this manual to describe In the context of writing scripts that communicate with ION applets the important differences are e Netscape browsers have a mech
87. anism called LiveConnect that allows communication between JavaScript and applets e While Microsoft browsers support JavaScript as well as VBScript they do not allow communication between JavaScript and applets In Microsoft browsers communication between scripts and applets must occur through VBScript The practical result of this situation is that in order to create HTML pages that allow users of both Netscape s Navigator and Microsoft s Internet Explorer to interact with ION applets via scripts you must write HTML code that decides on the fly which scripting language to use Choosing Between JavaScript and VBScript The simplest way to provide pages that use JavaScript for Netscape browsers and pages that use VBScript for Microsoft browsers is to use a gateway HTML page that loads one of two other HTML pages depending on the type of browser The following HTML page uses JavaScript statements to detect whether the browser accessing the page is Netscape Navigator If so it loads a JavaScript version of the HTML page otherwise it loads a VBScript version of the HTML page lt HTML gt lt This page refers IE or Netscape to the proper ION example gt lt SCRIPT language JavaScript gt II lt var browser navigator appName if browser indexOf Netscape 1 location Jjavascript html jump to JavaScript page else location vbscript html jump to VBScript page Lt gt lt SCRIPT
88. array each element specifies the Y coordinate of the corresponding point in the Z_VALUES array Z VALUES Set the value of this parameter equal to a valid IDL expression that evaluates to a one or two dimensional array containing the values that make up the contour surface If the X_VALUES and Y_VALUES parameters are provided the contour is plotted as a function of the X Y locations specified by their contents Otherwise the contour is generated as a function of the two dimensional array index of each element of Z_VALUES IONContourApplet ION Java User s Guide Chapter 4 Using ION s Pre Built Applets 77 contour_property_7 contour_property_n Here contour_property_ is the name of a contour property supported by the IONGrContour class Properties for the LONContourApplet reflect the capabilities implemented in keywords to the IDL CONTOUR procedure The syntax above refers to the fact that you can supply more than one contour property to the applet via the lt PARAM S gt tag In the example in the next section TITLE is a contour property with the value of Contour The following IDL Contour properties are supported by IONContourApplet Refer to the IDL documentation on keywords available for use with the CONTOUR procedure for an explanation of each property C_ANNOTATION C_CHARSIZE C_COLORS C_LABELS C_LINESTYLE C_ORIENTATION C_SPACING CLOSED DOWNHILL FILL CELL_FILL FOLLOW IRREGULAR LEVELS NLEVELS OVERP
89. ass Declaration public class IONGrContour extends IONGrGraphic Methods e TIONGrContour Constructs an object of the ONGrContour class e draw Produces and displays the graphic on the drawing surface of this class e getProperty Gets the value of a property e setProperty Sets a property for the graphic e setNoErase Specifies whether the object should be erased when another object is drawn e setX Value Sets the X value of the contour e setY Value Sets the Y value of the contour e setZValue Sets the Z data of the contour IONGrContour The IONGrContour method constructs an I ONGrContour object Syntax IONGrContour IONGrContour int Z D IONGrContour float Z J D IONGrContour double Z J D IONGrContour int Z IONGrContour float Z ION Java User s Guide IONGrContour Class 180 Chapter 6 ION Java Class and Method Reference IONGrContour double Z IONGrContour String sName IONGrContour int Z int X int Y IONGrContour int Z int X int Y IONGrContour float Z float X float Y IONGrContour float Z float X float Y IONGrContour double Z double X double Y IONGrContour double Z double X double Y IONGrContour String sZName String sXName String sYName Arguments Z The Z values data to use in the contour sName sZName The name of the IDL variable to use for the Z data
90. at public IONMap int iWidth int iHeight float lat public IONMap int iWidth int iHeight double lat public IONMap int iWidth int iHeight int lat int lon public IONMap int iWidth int iHeight float lat float lon public IONMap int iWidth int iHeight double lat double lon public IONMap int iWidth int iHeight int lat int lon int rot public IONMap int iWidth int iHeight float lat float lon float rot public IONMap int iWidth int iHeight double lat double lon double rot Arguments iHeight The height of the drawing area iWidth The width of the drawing area lat The latitude of the point on the Earth s surface to be mapped to the center of the projection plane Latitude is measured in degrees north of the equator and at must be in the range 90 lt lat lt 90 The default is 0 IONMap IONJMap Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 233 lon The longitude of the point on the Earth s surface to be mapped to the center of the projection plane Longitude is measured in degrees east of the Greenwich meridian and lon must be in the range 180 lt lon lt 180 The default is 0 rot The angle through which the North direction should be rotated around the line L between the Earth s center and the point lat lon This angle is measured in degrees with the positive direction being clockwise around the line L and must be in the range 180 lt
91. ay method 278 toString method 279 type method 280 IONVariable method 261 IONWindowingClient class 55 281 createWindow method 282 deleteWindow method 283 IONWindowingClient method 281 show Window method 283 ION WindowingClient method 281 isArray method 278 isConnected method 191 J jar files 51 101 Java applets pre built 59 65 Java archive files 101 Java classes ION low level 55 Index java console 289 JavaScript 107 JavaScript and VBScript differences between 113 L limitations IDL 42 server 42 line continuation character 42 LINK_URL parameter 73 LiveConnect Netscape browers 108 log file 22 31 longValueQ method IONComplex class 142 IONDComplex class 154 low level Java classes 41 M maximum number of connections 23 31 33 mouse operations 120 mouseMoved method 237 mousePressed method 238 mouseReleased method 239 N NAME attribute 68 O object graphics 92 object references 93 output log file 22 31 ION Java User s Guide P packages archive files 101 PARAM Tags 70 parameters ASYNC_COMMANDS 74 contour_property 77 DEBUG_MODE 72 DECOMPOSED_COLOR 74 IDL_COMMAND 74 ION_CONNECTION_NAME 72 LINK_URL 73 plot_property 82 PORT_NUMBER 70 SERVER_DISCONNECT 70 SERVER_NAME 70 surface_property 85 X_VALUES 76 82 84 Y_VALUES 76 82 84 Z_VALUES 76 84 path IDL search 14 performance 44 pixel copy
92. ble Z D public void setZValue String sName Argument Z The new Z value of the contour sName The name of the IDL variable that contains the new Z value of the contour Exceptions None IONContour ONJContour Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 151 IONDComplex Class The IONDComplex class represents a double precision complex number Class Declaration public class IONDComplex extends Number Methods e IONDComplex Constructs an object of the IONComplex class e doubleValue Returns the double value of the real portion of the number e floatValue Returns the float value of the real portion of the number e getDImaginary Returns the imaginary value as a double e getImaginary Returns the imaginary value of the number e intValue Returns the int value of the real portion of the number e longValue Returns the long value of the real portion of the number e toString Returns the string value of the real portion of the number IONDComplex The IONDComplex method constructs an object of the IONDComplex class Syntax public IONDComplex double r double i Arguments r The real portion of the number i The imaginary portion of the number ION Java User s Guide IONDComplex Class 152 Chapter 6 ION Java Class and Method Reference Exceptions None Example IONDComplex dcomplexvar new IONDComplex 3 0 2 0 d
93. bleClient HTTP_CON setConnectionTimeout The setConnectionTimout method sets the timeout period of a socket connection Syntax public final void setConnectionTimeout long iTime Arguments iTime The number of milliseconds the connection should stay alive without any client requests IONCallableClient Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 131 Exceptions None setIDLVariable The setIDLVariable method sets the value of a variable in the ION Server If the variable doesn t exist it is created Syntax public final void setIDLVariable String sName IONVariable oVar Arguments sName The name of the variable to set on the server oVar An object of type ION Variable that contains the value of the variable Exceptions IOException ION Java User s Guide IONCallableClient Class 132 Chapter 6 ION Java Class and Method Reference lIONCanvas IONJCanvas Class Objects of the IONCanvas class represents a visible drawing area in which graphic output can be drawn The IONJCanvas class is the Swing implementation of the IONCanvas class Class Declaration public class IONCanvas extends Canvas implements IONDrawable public class IONJCanvas extends JComponent implements IONDrawable Methods e TIONCanvas IONJCanvas Constructs an object of the IONCanvas IONJCanvas class Note The following methods have been deprecated in ION 1 4 and later These m
94. ch version of the browser is present and loads the appropriate HTML page Considerations Specific to ION Applets ION Java User s Guide Chapter 5 Building ION Applets and Applications 103 lt SCRIPT language JavaScript gt lt navigator onerror null version parseInt navigator appVersion gt 3 4 3 if version 4 Version 4 can handle jar files load the Jar page location replace JAR_page html else location replace ZIP_page htm1 gt lt SCRIPT gt where JAR_PAGE htm1 is the name of the HTML page that references the ion_61 jar file and ZIP_PAGE html1 is the name of the HTML page that references the ion_61 zip file For example you may name the page that references the JAR file myfile_j html and the file that references the ZIP file myfile_z html Simple Applet Example The following Java code creates a simple applet that displays an IDL graphic The example constructs an applet named Commands the code is available in the examples src directory in a file named commands java Note The characters denote comments in Java code fc SSC St commands java KK KK KA AR A RAK A IR A I A A I I OH Copyright c 1997 2002 Research Systems Inc All rights reserved Unauthorized reproduction prohibited Of course because these ar xamples feel fr to remove thes lines and modify to suit your needs KKK KKK KKK KKK KK KKK KKK KKK KK KKK KKK
95. connecting to the ION server 70 connections limit 33 maximum number 23 31 sharing 72 contour plots 59 76 contour_property parameter 77 COPY keyword ION device 88 copyArea method 165 createImage method 158 242 createWindow method 282 creating ION applets 100 current font 90 D daemon 39 debug mode 97 DEBUG_MODE parameter 72 debugging 72 debugging applications 97 debugMode method 97 IONGrConnection class 174 IONGrDrawable class 189 DECOMPOSED keyword ION device 88 DECOMPOSED_COLOR parameter 74 deleteWindow method 283 disconnect method for scripts 109 IONCallableClient class 125 IONGrConnection class 175 doubleValue method 140 152 ION Java User s Guide draw method IONContour class 146 IONGrContour class 181 IONGrDrawable class 190 IONGrGraphic class 197 IONGrMap class 203 IONGrMapContinents class 209 IONGrMapGrid class 211 IONGrMapImage class 215 IONGrPlot class 220 IONGrSurface class 226 IONMap class 233 IONPlot class 247 IONSurface class 253 drawing 61 E error handling 96 examples running applets 65 simple applet 103 using JavaScript 109 using VBScript 111 exceptions handling 96 exclude commands 22 exclude file 21 executeIDLCommand method for scripts 109 IONCallableClient class 125 IONGrConnection class 175 IONGrDrawable class 190 execution of IDL commands 120 F filtering 32 float Value method IONComplex cla
96. d Reference Arguments ionConnection The connection with which to associate this IONGrDrawable object Exceptions None setMulti The setMulti method sets the P multi system variable that determines how multiple IDL plots or IONGrGraphics objects are displayed on the drawing area Syntax public void setMulti int iMulti D Arguments iMulti Array defining the layout See the IDL documentation for more information Exceptions None setNoErase The setNoErase method specifies whether or not the drawable should be erased between IONGrGraphic objects when the draw method is called Syntax public void setNoErase boolean bNoErase Arguments bNoErase If true the drawing area should not be erased IONGrDrawable ONJGrDrawable Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 195 Exceptions None ION Java User s Guide IONGrDrawable ONJGrDrawable Class 196 Chapter 6 ION Java Class and Method Reference lIONGrGraphic Class The IONGrGraphic abstract class implements methods that are used by sub classes to manage and store properties Class Declaration public abstract class IONGrGraphic extends Object Methods e IONGrGraphic Constructs an object of the IONGrGraphic class e draw Draws the object e getProperty Gets the value of the given property e getPropertyNames Gets the names of the properties e getPropertyString G
97. d by a single object IONGrSurface extends IONGrGraphic The IONGr components are useful for overlaying graphics on top of one another ION Pre Built Applets The ION Pre Built Applets allow you to interact with the ION Server with a minimum of Java knowledge or experience Because the applets are pre built you can include them in Web pages using only HTML code lIONGraphicApplet The I ONGraphicApplet is a general purpose applet that is used to execute a series of IDL commands and display the results lONContourApplet The ONContourApplet displays an IDL contour plot The X Y and Z values of the plot and most IDL Contour properties supported by ION can be set through parameters to the applet IONMapApplet The IONMapApplet is an applet that displays 2D data on a map projection The data can be displayed as an image or a contour plot and can contain latitude longitude grid lines and landmass and political boundaries The applet is capable of projecting multiple contour plots one image latitude longitude grid lines and boundaries onto the drawing area IONPlotApplet The IONPlotApplet displays an IDL plot The X and Y values of the plot and most IDL plot properties supported by ION can be set through parameters to the applet ION Java User s Guide The ION Java Class Hierarchy 60 Chapter 3 Overview of the ION Java Classes lONSurfaceApplet The IONSurfaceApplet displays an IDL Surface plot The X Y and Z values of the
98. d in degrees with the positive direction being clockwise around the line L and must be in the range 180 lt rot lt 180 The default is 0 If the center of the map is at the North pole North is in the direction lon 180 If the origin is at the South pole North is in the direction on Exceptions None ION Java User s Guide IONGrMap Class 208 Chapter 6 ION Java Class and Method Reference IONGrMapContinents Class An IONGrMapContinents object is an I ONGrGraphic that encapsulates the functionality of IDL s MAP_CONTINENTS procedure which is used to draw continental boundaries filled continents political boundaries coastlines and rivers over an existing map projection This is used in conjunction with an IONGrMap All IDL MAP_CONTINENTS keywords are accepted except CONTINENTS LIMIT T3D AND ZVALUE Class Declaration public class IONGrMapContinents extends IONGrGraphic Methods e TIONGrMapContinents Constructs an object of the IONGrMapContinents class e draw Calls the MAP_CONTINENTS procedure to add boundaries to the current map projection e getProperty Retrieves the specified property e setProperty Sets the value of the specified property IONGrMapContinents The IONGrMapContinents method constructs an object of the IONGrMapContinents class Syntax public IONGrMapContinents Arguments None Exceptions None IONGrMapContinents Class ION Java User s
99. d in the previous section ION Java User s Guide Compiling java Files 96 Chapter 5 Building ION Applets and Applications Error Handling and ION Exceptions When the ION Server detects an error it throws an exception value you can detect and act upon using error handling code Consult the reference page for the method you are using to determine which exceptions ION can detect in a given situation Error handling is generally accomplished via a Java try catch code segment The following skeleton try catch code illustrates how to catch exceptions and display an error message on the Java console For a more detailed example see Simple Applet Example on page 103 Noe If an ION method or any Java method for that matter throws a checked exception value you must handle the exception in your code The Java compiler will complain if you do not properly handle all possible exception values Refer to a Java manual for more information on Java exception handling try some ION command catch IOException e IO Error System err printin Error Communication error te getMessage return catch IONIllegalCommandException e Illegal Command System err printin Error Illegal Command te getMessage return catch IONSecurityException e Security Violation System err printin Error Security Violation te getMessage return Error Handling and ION Exceptions ION Java User
100. dded to the internal listener list Exceptions None addlONDisconnectListener The addIONDisconnectListener method adds an object that implements the IONDisconnectListener interface to the internal list of registered listeners When the client server connection is disconnected callback methods are called on the objects that are registered with the IONCallableClient Syntax public final void addIONDisconnectListener IONDisconnectListener listener Arguments listener An object that implements the IONDisconnectListener interface The listener is added to the internal listener list Exceptions None IONCallableClient Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 123 addliONOutputListener The addIONOutputListener method is used to add an object that implements the IONOutputListener interface to the internal list of listeners kept by this object When any IDL output is sent from the server to the client the output is sent to the objects contained in the listener list through the callback method defined by the IONOutputListener interface This provides an efficient method of passing IDL output to the client and mimics the Java 1 1 event model Syntax public final void addlONOutputListener I ONOutputListener listener Arguments listener This is an object that implements the I ONOuptutListener interface This interface defines the format of the callback method used to pass IDL output t
101. developed your ION applications you will need to place the HTML files on your Web server The recommended method is to create a subdirectory for ION Java User s Guide Where to Place HTML and Class Files 50 Chapter 2 Overview ION applications under the default documents directory on your Web server For example suppose you are using the Apache Web server You could create a subdirectory under the htdocs directory called IONJava myhtml in which you place all your HTML files The URL of such a page might be http myhost mydomain com myhtml index html You can then develop and test your applications locally When everything is working correctly you can publish your application by copying the myhtm1 directory containing your HTML files and your class files to your web server If you do not place HTML files in a directory that is in or under the default documents directory on your Web server such as the htdocs directory on the Apache Web server you need to configure your Web server to allow access to files in your directory For example if you place your HTML pages in a directory called C rsi IDL61 products ion_java html you need to configure your Web server to allow access to this directory Using Apache modify DocumentRoot in the httpd conf file to include additional directories or modify Alias in the httpd conf file to add aliases to directories where you can place HTML files Where to Locate the ION Class Files ION applets and
102. ds Broker About ION Directory C RSINIONT1 Browse IDL Director C ASINIDL50 ION Logfile JC RSINION11 oofile txt View Browse Cancel Apply Use the Location Tab to define the following settings Attribute Description ION Directory Specifies the ION installation directory on your server machine IDL Directory Specifies the IDL directory on your server machine ION Log File Specifies the location of a text file that will contain the ION Server logs Click View to view the contents of the log file IDL Path Specifies the search path to the directory or directories containing the IDL library pro and sav files In this field specify the Web server s ION Java directory where IDL files were copied during ION installation For example using the Apache web server this path may be C Program Files Apache Group Apache2 htdocs I0O NJava 66 99 You can enter either a separated list of multiple directories or use a in front of a directory indicating that all subdirectories of the specified directory should be searched See Setting the IDL Path on page 291 if you need more information Table 1 2 ION Java Properties Locations Tab Configuring ION Java for Windows ION Java User s Guide Chapter 1 Configuring ION Java 15 The Security Tab The Security Tab pictured in the following figure allows you to define the commands that ION
103. e ION Java User s Guide Debug Mode 98 Chapter 5 Building ION Applets and Applications Converting Between IDL and Java Bytes It is important to understand the differences between byte data types in IDL and Java in order to ensure that byte arrays are transferred correctly between IDL and Java IDL and Java both have a basic byte data type however IDL s byte is unsigned and Java s is signed Java does not support the concept of unsigned types When a byte in Java is cast to an integer the sign is preserved via sign extension This can cause problems when transferring byte data between IDL and Java To understand the problem consider the following unsigned IDL byte BYTE idlByte 170 The binary representation of this byte is 1010 1010 Unsigned 8 bit bytes give a numeric range of 0 to 255 while signed bytes have a range of 128 to 127 Signed numbers are represented using two s complement In two s complement the highest bit is the sign bit and determines whether the number is negative or positive This is not a simple negation however and does change the unsigned value of the number Using Java s signed two s complement numbers this same set of bits corresponds to byte javaByte 86 When the value is cast to an integer the sign bit is extended to fill in the new bits so that the value of the number is preserved If the integer is 16 bits long the sign extended byte becomes in binary
104. e 21 for details 3 Using the ion_httpd command at the command line The ion_httpd command uses the following syntax ion_httpd ionhost hostname ionport port port port logfile filename maxpeer number_of_peers timeout minutes Command line switches for the ion_httpd command are listed below ionhost Set this switch equal to the name of the host on which the ION Daemon is running Note that the ION Tunnel Broker may be running on a different host than the ION Daemon and ION Server Note that Java applet security requires that the Tunnel Broker be run on the same machine from which the ION Java classes were loaded ionport Set this switch equal to the port number on which the ION Daemon is listening If not specified the ION Daemon listens on port 7085 Noe The ION Tunnel Broker must be listening to a different port than the ION Daemon port Set this switch to the port number that the ION HTTP Tunnel Broker should watch for connection requests If you do not specify a value for the httpport switch the default port is 9085 Configuring The ION HTTP Tunnel Broker ION Java User s Guide Chapter 1 Configuring ION Java 31 logfile Set this switch to the name of the file in which you wish to save informational messages from the ION Tunnel Broker If no logfile is specified messages will be written to the standard output Under UNIX you can create a log file by redirecting the output from ion_
105. e Control Tab on page 12 to install remove start or stop the ION Daemon service e See The Locations Tab on page 14 to set ION and IDL directory paths the ION log file and IDL search path e See The Security Tab on page 15 and The Commands Tab on page 16 to define which IDL commands should or should not be executed e See The Broker Tab on page 17 to configure the ION Tunnel Broker After making changes click OK to accept the change and close the dialog Apply to accept the change but leave the dialog open or Cancel to close the dialog without making any changes ION Java User s Guide Configuring ION Java for Windows 12 Chapter 1 Configuring ION Java The Control Tab The Control Tab is used to start stop or remove the ION Service and to configure the ION daemon attributes DION Properties Ea Control Locations Security Commands Broker About MION Service Remove ION Service Start Start ION Service Daemon Attributes 7085 ION Port Number feo ION Communication Timeout Secs T Allow Remote Ulitity Connections Use the Control tab to make the following changes Attribute Description Remove Install Removes or installs the ION Service in the Windows service registry Note The service was automatically installed during your installation which called ion_srvinst exe with the install option so you will probably not need to remove or
106. e String sZname public IONGrSurface String sZname String sXname String sYname Arguments Z Z data values for the surface sName sZName Name of the IDL variable to use for the Z data of the surface X Array holding the values for the X coordinates of grid Y Array holding the values for the Y coordinates of grid sXName Name of the IDL variable holding the values for X coordinates of the grid sYName Name of the IDL variable holding the values for Y coordinates of the grid Exceptions None draw The draw method displays the surface in the drawing area that makes up this object Syntax public void draw IONGraphicConnection grConn IONGrSurface Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 227 Arguments grConn IONGraphicConnection used to issue the drawing commands to the server Exceptions None getProperty The getProperty method retrieves the current value of the specified property Syntax public ION Variable getProperty String sName Arguments sName The name of the property Return Value The function returns the current value of a property Properties Supported The following IDL Surface properties are supported by IONGrSurface get set Property Refer to the IDL documentation on keywords available for use with the SURFACE procedure for an explanation of each property AX AZ BACKGROUND BOTTOM CHARSIZE CLIP COLOR DATA DEVICE FONT HO
107. e class extends the IONJGrDrawable class and contains an IONGrSurface object It can be inserted into a component tree Class Declaration public class IONSurface extends IONGrDrawable public class IONJSurface extends IONJGrDrawable Methods e TONSurface IONJSurface Constructs an object of the IONSurface class e draw Produces and displays the graphic on the drawing surface of this class e getProperty Gets the value of a property e setNoErase Specifies whether the object should be erased when another object is drawn e setProperty Sets a property for the graphic e setX Value Sets the X value of the surface e setY Value Sets the Y value of the surface e setZValue Sets the Z data of the surface ION Java User s Guide lIONSurface ONJSurface Class 252 Chapter 6 ION Java Class and Method Reference lONSurface ONJSurface The IONSurface method constructs an object of the I ONSurface class Syntax Note ___SSSS S SsSSSSSSSSSSSS The following is the syntax for the IONSurface method For the IONJSurface method replace ONSurface with IONJSurface public IONSurface int iWidth int iHeight public IONSurface int iWidth int iHeight int Z public IONSurface int iWidth int iHeight float Z public IONSurface int iWidth int iHeight double Z D public I ONSurface int iWidth int iHeight String sName public IONSurface int
108. e requested type is detected the mouse listener interface callback function is called Only one mouse listener is active at one time Note that only one mouse listener is allowed at a time Any previously set mouse listener is removed Syntax public final void addIONMouseListener IONMouseListener listener int breq ION Java User s Guide IONCanvas IONJCanvas Class 134 Chapter 6 ION Java Class and Method Reference Arguments listener Object that implements the mouse listener interface request breq The mouse event type that is requested This integer is a bit file that contains one or more of the following values e int IONMouseListener ION MOUSE_DOWN e int IONMouseListener ION MOUSE_MOVE e int IONMouseListener ION MOUSE_UP e int IONMouseListener ION MOUSE_ANY Exceptions None getDownButtons The getDownButtons method returns the current state of the mouse buttons in the canvas The return value is a bit field where bit 1 is mouse button 1 bit 2 is mouse button 2 and bit three is mouse button 3 If a bit is set the specific mouse button is down Syntax public final int getDownButtons Arguments None Exceptions None Example int iState getDownButtons IONCanvas IONJCanvas Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 135 getimage The getImage method returns the image of the current drawing area Syntax public abstract Image getImage Arguments None Exce
109. e setProperty method sets a property for the plot object Syntax public final void setProperty String sName IONVariable vValue Arguments sName The name of the property to set vValue The value to which to set the property Properties Supported The properties supported by the IONSurface get set Property are the same as those supported by the getProperty on page 253 Refer to the IDL documentation on keywords available for use with the SURFACE procedure for an explanation of each property Exceptions None ION Java User s Guide lIONSurface ONJSurface Class 256 Chapter 6 ION Java Class and Method Reference setXValue The setX Value method resets the X value of the surface Syntax public void setX Value int X public void setX Value float X public void setX Value double X public void setX Value String sName Arguments X The new X value of the surface sName The name of the IDL variable that contains the new X value of the surface Exceptions None setY Value The setY Value method resets the Y value of the surface Syntax public void setY Value int Y public void setY Value float Y public void setY Value double Y public void setY Value String sName Arguments Y The new Y value of the surface lIONSurface ONJSurface Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 257 sName The name of the IDL variable that contains the ne
110. ection Where to Place HTML and Class Files on page 49 for strategies on where to store the files required for your applications Note If you are using Internet Explorer you must access any HTML page that calls an applet by specifying a URL Attempting to open such a page using the browser s File gt Open command or by double clicking on an html file fails to display the applet and results in security errors Use a URL that contains http rather than file ION Java User s Guide Running the ION Java Examples 48 Chapter 2 Overview Noe The source for a freestanding Java Console application has also been provided See the getversion java file in the RSI DIR idl61 products ion61 ion_java examples src directory Windows or RSI DIR ion_6 1 ion_java examples src directory UNIX You can compile and run this example Running the ION Java Examples ION Java User s Guide Chapter 2 Overview 49 Where to Place HTML and Class Files When you begin developing your own applications you ll need to decide where you will put the HTML and Java class files that make up your applications This section discusses some strategies for locating your files Web based ION Java applications consist of at least two types of files e HTML files the containers for your Java applets e class files the containers for the Java applets themselves HTML files must reside on your Web server which may or may not be the same machine
111. egistered trademark and ION ION Script ION Java are trademarks of Research Systems Inc registered in the United States Patent and Trademark Office for the computer program described herein Numerical Recipes is a trademark of Numerical Recipes Software Numerical Recipes routines are used by permission GRG2 is a trademark of Windward Technologies Inc The GRG2 software for nonlinear optimization is used by permission NCSA Hierarchical Data Format HDF Software Library and Utilities Copyright 1988 2001 The Board of Trustees of the University of Illinois All rights reserved NCSA HDFS5 Hierarchical Data Format 5 Software Library and Utilities Copyright 1998 2002 by the Board of Trustees of the University of Illinois All rights reserved CDF Library Copyright 2002 National Space Science Data Center NASA Goddard Space Flight Center NetCDF Library Copyright 1993 1999 University Corporation for Atmospheric Research Unidata HDF EOS Library Copyright 1996 Hughes and Applied Research Corporation This software is based in part on the work of the Independent JPEG Group Portions of this software are copyrighted by DataDirect Technologies 1991 2003 Portions of this software were developed using Unisearch s Kakadu software for which Kodak has a commercial license Kakadu Software Copyright 2001 The University of New South Wales UNSW Sydney NSW 2052 Australia and Unisearch Ltd Australia Portions of th
112. egrees north of the equator and at must be in the range 90 lt lat lt 90 The default is 0 lon The longitude of the point on the Earth s surface to be mapped to the center of the projection plane Longitude is measured in degrees east of the Greenwich meridian and lon must be in the range 180 lt lon lt 180 The default is 0 rot The angle through which the North direction should be rotated around the line L between the Earth s center and the point lat lon This angle is measured in degrees with the positive direction being clockwise around the line L and must be in the range 180 lt rot lt 180 The default is 0 If the center of the map is at the North pole North is in the direction lon 180 If the origin is at the South pole North is in the direction on sLat sLon sRot Strings representing the latitude longitude and rotation Exceptions None draw The draw method calls the IDL MAP_SET procedure to draw the map projection ION Java User s Guide IONGrMap Class 204 Chapter 6 ION Java Class and Method Reference Syntax public void draw IONGraphicConnection grConn Arguments grConn The name of the connection Exceptions None getProperty The getProperty method retrieves the value of the specified property Syntax public final ION Variable getProperty String sName Arguments sName The name of the property to retrieve Properties Supported The follow
113. ener see the Version example on the page of Basic ION Java Applets provided with the ION Java installation See Running the ION Java Examples on page 46 for more information lONOutputText The ONOutputText method is called when a line of output text is available from the ION Server Syntax public abstract void ONOutputText String sLine Arguments sLine A line of output text from the ION Server Exceptions None IONOutputListener Interface ION Java User s Guide Chapter 6 ION Java Class and Method Reference 245 IONPlot IONJPlot Class The IONPlot class extends the IONGrDrawable class and contains an IONGrPlot to provide a easy way of drawing IDL plots It can be inserted into an AWT tree The IONJPlot class extends the IONJGrDrawable class and contains an IONGrPlot object It can be inserted into a component tree Class Declaration public class IONPlot extends IONGrDrawable public class IONJPlot extends IONJGrDrawable Methods e IONPlot IONJPlotQ Constructs an object of the IONPlot class e draw Produces and displays the graphic on the drawing surface of this class e getProperty Gets the value of a property e setProperty Sets a property for the graphic e setX Value Sets the X value of the plot e setY Value Sets the Y value of the plot IONPlot IONJPlot The IONPlot method constructs an object of the IONPlot class Syntax No
114. ent color table when displaying on a true color device For more information on decomposed IONGraphicApplet ION Java User s Guide Chapter 4 Using ION s Pre Built Applets 75 color mode see the documentation for the DECOMPOSED keyword to the DEVICE procedure in the IDL Reference Guide Example The following example creates an IONGraphicsApplet that connects to a server generates some data sets the color table and displays the data using IDL s SHOW3 procedure In the example debugging mode is enabled and the applet drawing area is a link to the RSI Web page lt APPLET NAME CONNECTION CODE IONGraphicApplet class WIDTH 200 HEIGHT 200 ARCHIVE ion_61 zip CODEBASE classes gt lt This applet connects to host KIROC port 8084 gt lt PARAM NAME SERVER_NAME VALUE KIROC gt lt PARAM NAME PORT_NUMBER VALUE 8084 gt lt PARAM NAME LINK_URL VALUE http www researchsystems com gt lt PARAM NAME DEBUG_MODE VALUE YES gt lt PARAM NAME SERVER_DISCONNECT VALUE YES gt lt PARAM NAME IDL_COMMAND_0 VALUE a exp shift dist 30 15 15 7 2 gt lt PARAM NAME IDL_COMMAND_1 VALUE loadct 1 gt lt PARAM NAME IDL_COMMAND_2 VALUE show3 a gt lt APPLET gt ION Java User s Guide IONGraphicApplet 76 Chapter 4 Using ION s Pre
115. ent graphics device to ion graphics output from IDL is sent directly to the ION Server You do not need to explicitly set the graphics device to ion unless you have explicitly used the IDL SET_PLOT procedure to change the current device to some other device For example suppose you wish to include a Print button in a Java application Your applet might include something like the following ion executeIDLCommand SET_PLOT printer execute more IDL commands to draw an image on the printer ion executeIDLCommand SET_PLOT ion Note The IDL TVRD function is not supported by the ION Device Keywords Accepted by the ION Device The following keywords to the IDL DEVICE routine are available when the current graphics device is set to ion Except where indicated keywords to the ION device work just as they do for other IDL graphics devices COPY Use this keyword to copy a rectangular area of pixels from one region of a window to another COPY should be set to a six or seven element array X Y Ny Ny Xa Ya W where X Y is the lower left corner of the source rectangle N N are the number of columns and rows in the rectangle and X4 Y is the coordinate of the destination rectangle Optionally W is the index of the window from which the pixels should be copied to the current window If it is not supplied the current window is used as both the source and destination DECOMPOSE
116. er s Guide Chapter 6 ION Java Class and Method Reference 231 IONMap IONJMap Class IONMap is an IONGrDrawable object that creates a map projection on which to display data Displayed data can be any combination of IONGrMapImage IONGrMapGrid ONGrMapContinents and IONGrContour objects Data is displayed in the order it is added The IONJMap class extends the IONJGrDrawable class and contains an IONGrMap object It can be inserted into a component tree Class Declaration public class IONMap extends IONGrDrawable public class IONJMap extends IONJGrDrawable Methods IONMap IONJMap Constructs a new map centered at lat lon with rotation rot draw Produces and displays the graphic on the drawing surface of this class getProperty Retrieves the specified property setLat setLon Sets the lat lon on which to center the projection setProperty Sets the value of the specified property setRotation Sets the rotation of the map projection ION Java User s Guide IONMap IONJMap Class 232 Chapter 6 ION Java Class and Method Reference IONMap IONJMap The IONMap method constructs a new map centered at lat lon with rotation rot Syntax Note ___SSSSSSSSS SSSSSSSSSSSS The following is the syntax for the IONMap method For the IONJMap method replace IONMap with IONJMap public IONMap int iWidth int iHeight public IONMap int iWidth int iHeight int l
117. er will listen The default value is 9085 Maximum HTTP Enter the maximum number of HTTP connections allowed Connections at any one time Timeout minutes Enter the number of minutes an ION peer should wait before closing a connection Broker Log File Specifies the location of a text file that will contain the ION Tunnel Broker logs Click View to view the contents of the log file Table 1 4 ION Java Properties Broker Tab ION Java User s Guide Configuring ION Java for Windows 18 Chapter 1 Configuring ION Java Checking Status with the ION Java Status Utility The ION Java Status utility allows you to obtain information about the current state of the ION Daemon and ION Tunnel Broker Access the ION Java Status utility from the Start menu by selecting Programs Research Systems ION 6 1 ION Java Status This program wionstat exe is located in the bin directory of your ION Java installation SION Status ixi Daemon Location Host localhost Port Number 7085 ION Daemon status on 12 10 97 at 15 11 52 Server gt localhost Port Number 7085 Version 1 0 System Win32 x86 Start Time 15 11 29 Number of active ION Servers 0 To check the status of a service set the following fields Field Description Host Set this field to the name of the computer on which either the ION Daemon or ION Tunnel Broker is running Table 1 5 ION Status Configuring ION Java for W
118. erties supported by the IONMap get set Property are the same as those supported by getProperty on page 233 Refer to the IDL documentation on keywords available for use with the MAP_SET procedure for an explanation of each property Exceptions None setRotation The setRotation method sets the rotation for the map projection Syntax public void setRotation int rot public void setRotation float rot public void setRotation double rot public void setRotation String rot Arguments rot The angle through which the North direction should be rotated around the line L between the Earth s center and the point lat lon This angle is measured in degrees with the positive direction being clockwise around the line L and must be in the range 180 lt rot lt 180 The default is 0 If the center of the map is at the North pole North is in the direction lon 180 If the origin is at the South pole North is in the direction lon Exceptions None IONMap IONJMap Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 237 lIONMouseListener Interface The IONMouseListener interface defines the callback methods an object must define to be notified of mouse events occurring on an object that implements the IONDrawable interface In ION 1 4 this interface uses the AWT event model It is recommended that you use the AWT events directly java awt event MouseListener and or java awt eve
119. es the applet CONNECTION to connect to the server gt lt PARAM NAME ION_CONNECTION_NAME VALUE CONNECTION gt lt PARAM NAME LINK_URL VALUE plotappletsrc html gt lt PARAM NAME X_VALUES VALUE exp shift dist 30 15 15 7 82 gt lt PARAM NAME TITLE VALUE Plot gt lt PARAM NAME LINESTYLE VALUE 2 gt lt APPLET gt ION Java User s Guide IONPlotApplet 84 Chapter 4 Using ION s Pre Built Applets lONSurfaceApplet The IONSurfaceApplet displays an IDL Surface plot The X Y and Z values of the plot and any IDL Surface properties supported by ION can be set through parameters to the applet Noe You can also create surface plots using the IONGraphicApplet specifying the plot properties in IDL command strings The IONSurfaceApplet is merely a simplified way to display surface plots Parameters In addition to the parameters described in Parameters Specified via lt PARAM gt Tags on page 70 the IONSurfaceApplet accepts the following parameters X_VALUES Set the value of this parameter equal to a valid IDL expression that evaluates to a vector or two dimensional array specifying the X coordinates for the surface If X_VALUES specifies a vector each element specifies the X coordinate for a column in the Z_VALUES array e g X 0 specifies the X coordinate for Z 0 If X_VALUES specifies a tw
120. esressesess 97 Converting Between IDL and Java Bytes ssssessesseseeseeseessrsssesressesressressesereseesse 98 Considerations Specific to ION Applets sisessseissrsssscessssscirssrsseeressenesresssseseess 100 Including Applets in HTML Pages crruo isnie 100 Supporting Java Archive Files sssssessssisserssiessseisrsorssesssessssasseressrssesersosis 101 Browser Support of ION Class Library Versions ccsscceesseeeeeeeeeeeeees 101 Supporting Multiple Browser Types sssesesesssesssesseresesesseeesseessresseresesesssees 102 Simple Applet Example lois ccc solisa sated exe epgdasa steels baeeatbanesateinaens ciadeonse 103 Further Examples eerie nssacae vanscacanvassanndbashovedyasieendosmaacdevasnerespasnielars 107 ION Applets and Scripting Languages cocci ected rence 107 e a a see eee eee E 113 Chapter 6 ION Java Class and Method Reference sssssssssseunsenunnnnnnnnnnnnnne 115 How to Use this Chapt t aoe scat tect isi aiii ia 117 a e E T E E 117 O L AE E E oce dace cascade entantaa dened eee 118 BO oesreste rooit EEs ERE EEEE AE terre OERE A 119 EAP e E E EE A E E A at 119 TON C alabla ent SAG eacee enoar E ES R ES 120 ION Canvas TONJCanyas Casg css cess cranes xe ctueseserin te teseseiwncduceessecavatanieteaiees 132 TON CommaancdDonelistener Interface siirius 137 En ses cestecass asa eiere ee sigi eis E SESE EEEE EEE 139 TONContour IONJContour Class so ss oso osc dee ead is dead ine sa serentis isa sisaiis 144 TIONDCompl
121. ession to generate the Z values for the contour The Z values could also have been specified as an IDL array with a statement like lt PARAM NAME Z_VALUES VALUE 1 2 3 4 2 3 4 5 3 4 5 6 4 5 6 7 gt IONContourApplet ION Java User s Guide Chapter 4 Using ION s Pre Built Applets 79 IONMapApplet The IONMapApplet is an applet that displays 2D data on a map projection The data can be displayed as an image or a contour plot and can contain latitude longitude grid lines and landmass and political boundaries The applet is capable of projecting multiple contour plots one image latitude longitude grid lines and boundaries onto the drawing area In the case of multiple datasets the drawing order is as follows e Images are always drawn first e Any ordering of the following e Grid Lines drawn once e Boundaries continents drawn once e Contours in numerical order The IONMapApplet is based on the ION Gr Map and IONGrContour objects Note You can also create plots using the ONGraphicApplet specifying the map properties in IDL command strings The IONMapApplet is merely a simplified way to display maps Parameters In addition to the standard IONApplet parameters the ONMapApplet accepts the following parameters IDL_COMMAND_n A set of IDL commands starting with n 0 that are executed before the map commands MAP_GRID Display latitude longitude lines on the map MAP_CONT Display continents
122. est connection it can IONCallableClient Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 127 These values are defined as constants in the I ONCallableClient class definition The example below shows how to compare the returned value with the value defined in the IONCallableClient class Arguments None Exceptions None Example To determine whether the connection in use is a socket only connection use a statement like the following if getConnectionType IONCallableClient SOCK_CON getIDLVariable The getIDLVariable method requests the value of an IDL variable from the server The value of the variable is then returned as an IONVariable object If the variable does not exist on the server it is created as an undefined type Syntax public final ION Variable getIDLVariable String sName Return Value The function returns the value of the requested IDL variable in an ION Variable object An empty IDL string is returned as a string in Java Arguments sName The variable name whose value is desired Exceptions IOException ION Java User s Guide IONCallableClient Class 128 Chapter 6 ION Java Class and Method Reference removelONCommandDoneListener The removelONCommandDoneListener method removes an object that implements the IONCommandDoneListener interface from the list of listeners maintained by this object If the listener is not contained in the internal list of
123. ethods will continue to function as specified in ION 1 2 but it is recommended that you implement one of the Java methods MouseListener or MouseMotionListener which have more robust functionality e addIONMouseListener Adds a MouseListener object to the current canvas object e getDownButtons Reports mouse button status e getImage Returns the image that is being drawn e getlONGraphics Returns an ION graphics context for the device e getMousePos Reports position of the mouse cursor on the canvas object e removelONMouseListener Removes a MouseListener object from the current canvas object IONCanvas IONJCanvas Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 133 See also the descriptions of the ONDrawable Interface and the Java Canvas class Subclasses e JONGrDrawable IONJGrDrawable Class IONCanvas IONJCanvas The I ONCanvas method constructs an IONCanvas object of the given size This object can then be placed in a Java AWT tree The IONJCanvas method constructs an IONJCanvas object Syntax public IONCanvas int width int height public IONJCanvas int width int height Arguments width The width of the canvas height The height of the canvas Exceptions None addlONMouseListener The addIONMouseListener method sets the object that implements the IONMouseListener interface as the current Mouse listener When a mouse event of th
124. ets a string that represents the properties This string can then used with an IDL command e setNoErase Specifies whether the object should be erased when another object is drawn e setProperty Sets the value of a property in the property list Subclasses IONGrContour Class IONGrMap Class ONGrMapContinents Class IONGrMapGrid Class IONGrMapImage Class IONGrPlot Class IONGrSurface Class IONGrGraphic The I ONGrGraphic method constructs an object of the I ONGrGraphic class Syntax public I ONGrGraphic IONGrGraphic Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 197 Arguments None Exceptions None draw The draw method is defined by sub classes to issue the appropriate IDL command to draw the graphic object Syntax public void draw IONGraphicConnection con Arguments con IONGraphicConnection used to issue the drawing commands to the server Exceptions None Example draw con getProperty The getProperty method returns the value of a property The property is returned as an object It is the responsibility of the caller to cast the object to the correct type Syntax public ION Variable getProperty String sName ION Java User s Guide IONGrGraphic Class 198 Chapter 6 ION Java Class and Method Reference Arguments sName The name of the property Exceptions None Example IONVariable getProperty sProperty getPropertyNames
125. ex Class so eccesstcicits sasnesntsastavazn sa otai Eana AEA EERE 151 TONDisconnectListener Mierna ccc settee st ered aa 156 WON Drawable et gt ose eri nen learn er ERE RE EEE ETE TEE 158 TONGraphicsC hent Se aan Pe Be nr eee ey ae EE ai 161 ION GraphicConncetion Interface oricine ee ee eee eee mete eres nee SP ear 171 Contents ION Java User s Guide IONGrConnection TONJGrConnection Class 0 0 cee eeeeeseecsseceseeeeeeeeneeeaeenes 172 TONGrContour Class cise sce ccad ached gdh gee iinitan ia i a eis 179 IONGrDrawable IONJGrDrawable Class sssseseessssseeeesseresesressersrrrrensesssesees 187 TONO rape CSS eeen i es i aa eaa S a 196 TONG Map Cast cnie reee ar kea AEE EEEE REE EEEE 202 TONOrMapContinents Class omsien ee Reine ek 208 TIUNGrMapGrid Clisg niecce saesae S aa E RE aS 211 IONGrMaplmaze asst secaureaeaecpauceigateniiee ine inate r E 214 TONG Plot Class eniinn A aaabenadvadnacasteseadadsachodacvastooes 219 WN Se sereins epinis eroe erea Aa SEE NEER S asii 225 TON Map 7 IONJMap CISS ce cts psc eae cae uadnngacgabdeag haaspbebraed anesaceiesersclesesdeaseasee 231 TONMouseListener Interface cedecss ececsaccectd is iecedenstpereducacieeed ast cate vscecedeaateedeaacezent 237 TONON Sereen CIES aioe esi chee eee Gee 241 WES ae Interface ta cash snc candace dicen teen dceetcestadscusiecatasamiantagatdaad 244 TONPlot TONJ Plot Clas oosina asias 245 TIONS raice TIONI Surtace Class as oes sce sce casted cassettes ia 251
126. false the red component of the pixel is treated as an index into the current color table For more information on decomposed color mode see the documentation for the DECOMPOSED keyword to the DEVICE procedure in the JDL Reference Guide IONGraphicsClient Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 169 Once set decomposed color mode applies to all drawables associated with a given connection Note Decomposed color functionality is not supported Syntax public final void setDecomposed boolean bDecomposed Arguments bDecomposed If bDecomposed is set to True pixel values are interpreted as RGB triplets This is the default behavior If bDecomposed is set to False the first eight bits of the pixel value the red portion are used as an index value into the currently loaded IDL color table Exceptions None setIONDrawable The setIONDrawable method selects which IONDrawable to use from the internal list of IONDrawable objects Syntax public final boolean setIONDrawable int i ndex Arguments ilndex The index that was returned from the addIONDrawable method when the object was added Return Value The function returns the true on success or false otherwise ION Java User s Guide IONGraphicsClient Class 170 Chapter 6 ION Java Class and Method Reference Exceptions None IONGraphicsClient Class ION Java User s Guide Chapter 6 ION Java Class and Method Refe
127. fully installed on your site Consult your Web server documentation to find out how to test your Web server Troubleshooting ION Service Problems Make Sure the ION Service is Started On Windows select Start Programs Research Systems ION 6 1 gt ION Java Status In the ION Status dialog enter the hostname of your computer and click Query If you receive a message Unable to connect to the ION Java Daemon you should make sure the service is started and that the port number is correct Use the Control tab of the ION Java Properties utility to start the ION service and to check the port number See The ION Java Properties Dialog on page 11 On UNIX change to the RSIT DIR ion_6 1 ion_java bin directory and enter ionstat to query the ION Service If you receive the message Error Unable to locate ION Java Server see Starting the ION Daemon on UNIX on page 21 for instructions on how to start the ION Service Check File Permissions On Windows NT systems only users with the administrator privileges are allowed to start and stop the ION service using the Services Control Panel If you have Administrator privileges but continue to experience problems when trying to start or stop the ION service using the utility described in the section The ION Java Properties Dialog on page 11 you may need to use the Windows task manager to end the process or reboot the server to resolve the problem Troubles
128. graphics produced by the ION Server IONGrDrawable allows you to configure the drawing area to draw one or more objects add and remove graphic objects from a drawable and execute IDL commands directly An IONGrDrawable also contains a debug window Objects of this type can be inserted into the AWT tree The LONGrDrawable class is the AWT implementation and IONJGrDrawable is the Swing implementation lONContour ONJContour An IONContour object represents a contour graphic and a drawing area ONContour allows you to get and set properties of the contour via keywords to the IDL CONTOUR routine and to draw the contour object ONContour extends IONGrDrawable and includes an ONGrContour object ONContour is the AWT implementation and IONJContour is the Swing implementation IONMap IONJMap An IONMap object represents a map graphic and drawing area IONMap allows you to get and set map properties via keywords to the IDL MAP_SET procedure and to draw the map Several other classes can be used with IONMap including IONGrMapContinents IONGrMapGrid and IONGrMapImage IONMap extends IONGrDrawable and includes an IONGrMap object IONMap is the AWT implementation and IONJMap is the Swing implementation IONPlot IONJPlot An IONPIlot object represents a plot and a drawing area IONPlot allows you to get and set properties of the plot via keywords to the IDL PLOT routine and to draw the plot object IONPlot extends ONGrDrawable and inc
129. h property Exceptions None setNoErase The setNoErase method of the ONGrContour class overrides setNoErase in the IONGrGraphic class See setNoErase on page 200 for the description and syntax of this method setXValue The setX Value method resets the X value of the contour Syntax public void setX Value int X public void setX Value float X public void setX Value double X public void setX Value String sName Arguments X The new X value of the contour sName The name of the IDL variable that contains the new X value of the surface ION Java User s Guide IONGrContour Class 184 Chapter 6 ION Java Class and Method Reference Exceptions None IONGrContour Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 185 setY Value The setY Value method resets the Y value of the contour Syntax public void setY Value int Y public void setY Value float Y public void setY Value double Y public void setY Value String sName Arguments Y The new Y value of the contour sName The name of the IDL variable that contains the new Y value of the contour Exceptions None setZValue The setZValue method resets the Z value of the contour Syntax public void setZValue int Z public void setZValue float Z J public void setZValue double Z public void setZValue int Z D public void setZValue float Z public void setZValue doub
130. he surface to the selected angle Note The following script will work in Netscape s Navigator browser but not in the Microsoft s Internet Explorer browser lt Define the HTML header Note that the JavaScript is included in the HEAD section gt lt HTML gt lt HEAD gt lt TITLE gt Simple JavaScript Applet Test lt TITLE gt lt The script language is JavaScript We declare the variable rotation with an initial value of 30 degrees gt lt SCRIPT language JavaScript gt ION Java User s Guide Considerations Specific to ION Applets 110 Chapter 5 Building ION Applets and Applications var rotation 30 The getSelectedValue function returns the text associated with the value chosen from the pulldown list function getSelectedValue sel return sel options sel selectedIndex text The rot_surf function retrieves the rotation value and executes the IDL command to re draw the graphic It is called when the button is clicked function rot_surf rotation getSelectedValue document command_form rot_value document SURFAPP executeIDLCommand SHADE _ SURF a AZ rotation lt SCRIPT gt lt HEAD gt lt BODY gt lt JavaScript input controls must be contained in an HTML form gt lt FORM NAME command_form gt
131. heck the Debug Window It is also helpful to set the ION applet Debug Mode which allows you to check for IDL command log output or java program output for errors See Debug Mode on page 97 for more information Note Applets may also fail display because of security errors See Troubleshooting Security Errors on page 292 for more information Troubleshooting Not Found Errors Check the Location of Class Files If you encounter an error that looks like Applet xxx can t start class xxx not found in the message area of your browser or in the Java Console check to make sure that the ION package the directory hierarchy com rsi ion or the appropriate ION archive file is located either in the same directory as the HTML page that contains the applet or in the directory specified by the CODEBASE attribute of the APPLET tag See Locating the Class Files for use by ION Applets on page 100 and Supporting Java Archive Files on page 101 for details Note Class names are case sensitive Within your Java code calling customaction class when the file has been saved as CustomAction class and can produce a class not found error Check File Permissions The ION Daemon runs with the user and group ID of the user who started it This means that the daemon will have the same file access permissions as that user While it is not necessary to start the ION Daemon as a particularly privileged user make ION Java Use
132. his method setProperty The setProperty method sets a property for the plot object Syntax public void setProperty String Property ION Variable Value Arguments Property The name of the property to set Value The value of the property Properties Supported The properties supported by the IONGrPlot get set Property are the same as those supported by the getProperty on page 221 Refer to the IDL documentation on keywords available for use with the PLOT procedure for an explanation of each property Exceptions None IONGrPlot Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 223 Example setProperty Property Value setXValue The setX Value method resets the X value of the plot Syntax public void setX Value int X public void setX Value float X public void setX Value double X public void setX Value String sXname Arguments X The new X value of the plot sXname The name of an IDL variable to use for the X value Exceptions None setYValue The setY Value method resets the Y value of the plot Syntax public void setY Value int Y public void setY Value float Y public void setY Value double Y public void setY Value String sYname ION Java User s Guide IONGrPlot Class 224 Chapter 6 ION Java Class and Method Reference Arguments Y The new Y value of the plot sYname The name of the IDL variable to use for the Y value
133. hod on a given object causes it to be displayed in the associated drawing area ION Java User s Guide Using the Component Classes 62 Chapter 3 Overview of the ION Java Classes AWT vs Swing Each ION Java component is shipped in two forms one built on AWT classes the other on Swing classes This section discusses the difference between AWT and Swing the advantages and disadvantages of each and how to distinguish between the ION AWT classes and the ION Swing classes AWT and Swing are both part of a group of Java class libraries called the Java Foundation Classes JFC The Abstract Windowing Toolkit AWT is the original GUI toolkit shipped with the Java Development Kit JDK The AWT provides a basic set of graphical interface components similar to those available with HTML forms Swing is the latest GUI toolkit and provides a richer set of interface components than the AWT In addition Swing components offer the following advantages over AWT components e The behavior and appearance of Swing components is consistent across platforms whereas AWT components will differ from platform to platform e Swing components can be given their own look and feel e Swing uses a more efficient event model than AWT therefore Swing components can run more quickly than their AWT counterparts On the other hand Swing components can take longer to load than AWT components ION Applications should use either all AWT based components or al
134. hoot Port Number Problems If the ION Service is not running on the default port number 7085 then the applet code must specify the port number See Connecting to the ION Server on page 70 information about including a port number connection parameter within an applet ION Java User s Guide 288 Chapter 7 Troubleshooting Enable SOCKS Proxy to Resolve Firewall Connection Problems If the client machine is located behind a firewall and the socket connection between the ION server and the client machine cannot be established the user on the client machine should verify that the SOCKS proxy is enabled in their browser Verify SOCKS Proxy on Netscape Navigator 1 From the browser select Edit Preferences 2 Expand the Advanced heading and select Proxies 3 In the Proxies section of the Preferences dialog select the Manual proxy configuration option and click View to view the SOCKS proxy settings Verify SOCKS Proxy on Internet Explorer 1 From the browser select Tools Internet Options 2 Select the Connections tab and click the LAN Settings button 3 In the Proxy server field check the Use a proxy server box if necessary and click the Advanced button to view the SOCKS proxy settings On each browser you will see a list of the proxies supported by the browser as well as other information your site uses to implement the proxy If the SOCKS proxy field is blank check with your System Administra
135. httpd to a log file of your choosing using the normal system output redirection mechanism maxpeer Set this switch to the maximum number of ION Tunnel Broker peers that can be active at once If set to 0 the default setting the maximum number of peers will be equal to the number of IDL licenses you have available timeout Set this switch to the number of minutes the ION Tunnel Broker HTTP peer should stay alive without hearing from the client A timeout is necessary to close Tunnel Broker peer processes that may be left running if a browser crashes or experiences some other error that disconnects the browser without shutting down the peer process If set to 0 the peer will never time out ION Java User s Guide Configuring The ION HTTP Tunnel Broker 32 Chapter 1 Configuring ION Java Command Security The ION Server implements a security system based on IDL command filtering The security system has two internal command lists one list consists of commands that are not allowed to be run on the IDL server process the other list specifies commands that are allowed If an IDL command is included in both lists it will not be allowed to run When an ION client sends an IDL command to the ION Server for execution the command line is scanned for function and procedure names These names are first checked against the command inclusion list commands that can be run on the server and if the command is not in the list it is rejected
136. httpport Set this switch to the port number that the ION HTTP Tunnel Broker should watch for connection requests If you do not specify a value for the httpport switch the ION Tunnel Broker watches port 9085 httptimeout Set this switch to the number of minutes the ION Tunnel Broker HTTP peer should stay alive for without hearing from the client A timeout is necessary to close Tunnel Broker peer processes that may be left running if a browser crashes or experiences some other error that disconnects the browser without shutting down the peer process If set to 0 the peer will never time out maxconn Set this switch to the maximum number of connections that can be active at once If you do not specify a value for the maxconn switch the maximum number of connections will be equal to the number of IDL licenses you have available port Set this switch to the port number that the ION Daemon should watch for connection requests If you do not specify a value for the port switch the ION Daemon watches port 7085 rutil Set this switch to allow the utility routines iondown and ionstat to be run from any host By default connections from these routines are allowed only if the routines are run on the same host as the ION Daemon security Set this switch to a comma separated list of tokens that define a list of IDL routines IDL routines specified via a token in the security list will not be passed through to the IDL session by
137. iable c_ionCon getIDLVariable my3dFloatArr float f3d try f3d float myVariable getDimensionedFloatArray catch IONNotAnArrayException e System err printin Variable is not an array lIONVariable Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 269 getDimensionedintArray Returns the integer array value of the variable The result contains the same number of dimensions as the variable Syntax public final Object getDimensionedIntArray where Object can be a 1 to 8 dimensional array of Java primitive type int Return The method returns the multidimensional int array value of the variable Arguments None Exceptions IONNotAnArrayException Example IONVariable myVariable c_ionCon getIDLVariable my3dIdlLongArr int i3d try i3d int myVariable getDimensionedIntArray catch IONNotAnArrayException e System err printin Variable is not an array getDimensionedShortArray Returns the short array value of the variable The result contains the same number of dimensions as the variable Syntax public final Object getDimensionedShortArray where Object can be a 1 to 8 dimensional array of Java primitive type short ION Java User s Guide IONVariable Class 270 Chapter 6 ION Java Class and Method Reference Return The method returns the multidimensional short array value of the variable Argu
138. iated with a connection e removeGraphic Removes a graphic object from the drawable e resetMulti Resets multi mode to one visible drawable at a time e sendIDLCommand Sends an IDL command to the ION Server e setConnection Associates this IONGrDrawable object with an IONGraphicConnection ION Java User s Guide IONGrDrawable ONJGrDrawable Class 188 Chapter 6 ION Java Class and Method Reference e setMulti Specifies how multiple graphic objects will be drawn in the server e setNoErase Specifies whether the drawable should be erased when new graphic is drawn Subclasses IONContour IONJContour Class IONMap IONJMap Class IONPlot IONJPlot Class ONSurface IONJSurface Class IONGrDrawable ONJGrDrawable The I ONGrDrawable method constructs an ONGrDrawable object of a specified size Syntax public IONGrDrawable int iWidth int iHeight public IONJGrDrawable int iWidth int iHeight Arguments iWidth The width of the drawing area iHeight The height of the drawing area Exceptions None addGraphic The addGraphic method adds an IONGrGraphic to the drawable Calling the drawQ method causes all the graphics added in this manner to be displayed in the drawing area Syntax public void addGraphic ONGrGraphic ionGraphic IONGrDrawable ONJGrDrawable Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 189 Arguments i
139. ic final void setProperty string sName ION Variable vValue Arguments sName The name of the property to set vValue The value of the property Properties Supported The IDL map properties are supported by IONGrMapImage get set Property are the same as those covered in getProperty on page 215 Refer to the IDL documentation on keywords available for use with the MAP_IMAGE procedure for an explanation of each property Exceptions None setStart The setStart method defines the coordinates of the lower left corner of the image Syntax public void setStart int x int y public void setStart float x float y public void setStart double x double y ION Java User s Guide IONGrMaplmage Class 218 Chapter 6 ION Java Class and Method Reference Arguments x The x coordinate position of the left edge of the image y The y coordinate position of the left edge of the image Exceptions None IONGrMaplmage Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 219 IONGrPlot Class The IONGrPlot class produces an IDL generated plot in a drawing area The class allows the user to enter data and plot attributes at the program level Class Declaration public class IONGrPlot extends IONGrGraphic Methods e TIONGrPlot Constructs an object of the IONP1ot class e draw Produces the output graphic and displays the graphic on the drawing surface of this class e
140. ices dialog select ION Java Daemon 6 1 and use the interface to modify the settings The following figure shows the Windows NT Services dialog with the ION Daemon selected Services Service Status Startup Close Alerter Manual a ClipBook Server Manual Computer Browser Started Automatic DHCP Client Disabled Directory Replicator Manual EventLog Started Automatic Started Automatic Stop Pause Started Automatic Startu MGACtl Started Automatic we Hw Profiles Startup Parameters Help AAA Configuring ION Java for Windows ION Java User s Guide Chapter 1 Configuring ION Java 21 Configuring ION Java for UNIX This section covers the following topics e Starting the ION Daemon on UNIX on page 21 e Starting the ION Daemon at Boot Time on page 25 e Checking the Status of the ION Daemon on page 25 e Shutting Down the ION Daemon on page 26 Starting the ION Daemon on UNIX Start the ION Daemon process by executing the iond command at the shell prompt The iond command uses the following syntax iond exfile filename infile filename excomm routineog routine routine incomm routineyg routine routine http httplog filename httpport port httptimeout minutes maxconn connections port port rutil security device df filein fileout fileio linking none os timeout seconds Note You must execute the ion_se
141. imensions The arrayDimensions method returns an int array that contains the size of the dimensions of the array variable If the variable is not an array an exception is thrown Syntax public final int arrayDimensions Return Value The function returns an int array that contains the size of each dimension in the corresponding element of the array The number of dimensions available can be determined through the length property of the returned array Arguments None Exceptions IONNotAnArrayException Example try int dims arrayDimensions lIONVariable Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 263 catch IONNotAnArrayException e System err println Variable is not an array getByte The getByte method returns the byte value of the variable If the value is not of type byte the scalar value is converted to a byte Syntax public final byte getByteQ Return Value The method returns the byte value of the variable Arguments None Exceptions IONIsAnArrayException NumberFormatException Example try byte b myVariable getByte catch IONIsAnArrayException e System err println Variable is an array catch NumberFormatException e System err printin String Cannot be converted getByteArray The getByteArray method returns the byte array value of the variable If the value is not of type byte a java lang ClassCastExceptio
142. index The IDL Window index of the window to iconize show Flag used indicate if the window should be shown or hidden Exceptions None IONWindowingClient Class ION Java User s Guide Chapter 7 Troubleshooting Using ION applets over the World Wide Web requires interaction between your Web server the ION Server and IDL This section discusses some possible ION Server and IDL problems you may encounter Avoiding Conflicting ION Installations Checking Web Server Communication Troubleshooting ION Service Problems Troubleshooting Applets that Fail to Display Troubleshooting Not Found Errors Troubleshooting Licensing Errors Setting the IDL Path Troubleshooting Security Errors Encountering Browser Timeouts with Java Errors ION Java User s Guide 285 286 Chapter 7 Troubleshooting Avoiding Conflicting ION Installations Unexpected errors occur when attempting to use previous ION classes with the ION 6 1 server or vice versa To avoid conflicts remove the previous ION installations s service and all previous ION class zip and jar files from your system before installing ION 6 1 Removing Previous ION Service To remove the previous ION Service complete the following steps On Windows 1 Open the ION Properties utility wionprop exe located in RSI DIR ion ion_java bin directory where RSI DIR is the directory where you have installed your outdated ION version 2 Stop the ION Service by selecting the S
143. indows ION Java User s Guide Chapter 1 Configuring ION Java 19 Field Description Port Number Set this field equal to the port being watched by either the ION Daemon or the ION Tunnel Broker The default is port 7085 which is the default port for the ION Daemon To check the status of the ION HTTP Tunnel Broker you must specify the port on which the Tunnel Broker is listening the default is 9085 Click Query to retrieve information on the Daemon or Tunnel Broker running on the specified host and port Click Clear to clear the display or OK to dismiss the dialog Table 1 5 ION Status Continued Windows Command Line Installation of the ION Daemon Use the ion_srvinst exe program to install control and check the status of the ION Daemon Windows service The ION installation process automatically calls ion_srvinst with the instal1 flag so you do not need to install it again You can use this program to remove the service or configure how the daemon is started Note To start stop and remove the ION Daemon service you can also use the ION Java Properties dialog described in Configuring ION Java for Windows on page 11 To configure manual or automatic startup you can also use the Windows Services dialog described in Using Windows Services Manager to Start the ION Daemon on page 20 The ion_srvinst command uses the following syntax ion_srvinst install remove start auto ma
144. ing Your Web Server on page 27 for instructions The examples illustrate ION features and many of the examples allow you to view the Java source within your browser These examples consist of at least two types of files HTML files that contain the Java applets and the Java applets themselves which are contained in class files The raw Java source files for the example ION Java classes are included in the src subdirectory of the examples directory Also included in the examples directory are a number of IDL pro files that are called by the ION demonstration applets To run the ION Java examples complete the following steps 1 Add the ION Java examples directory to IDL s Search path note that this step may have been completed during the installation of ION Java if you completed the ION Java Web Server Configuration dialog On Windows add Web_Server IONJava examples to the IDL Search path For example using the Apache web server this might be c Program Files Apache Group Apache2 htdocs On UNIX add Web_Server IONJava examples to the IDL Search path For example using the Apache web server this might be usr local apache2 htdocs Wweb_Server is the path specifying the location of the Web server s HTML files directory For more information about modifying the IDL Search Path see Setting the IDL Path on page 291 Running the ION Java Examples ION Java User s Guide Chapter 2 Overview 47 2 Open your bro
145. ing IDL map properties are supported by IONGrMap get set Property Refer to the IDL documentation on keywords available for use with the MAP_SET procedure for an explanation of each property Projection Types AITOFF ALBERS AZIMUTHAL CONIC CYLINDRICAL GNOMIC GOODESHOMOLOSINE HAMMER LAMBERT MERCATOR MILLER_CYLINDRICAL MOLLEWIDE ORTHOGRAPHIC ROBINSON SATELLITE SINUSOIDAL STEREOGRAPHIC TRANS VERSE_MERCATOR Map Characteristics ADVANCE CHARSIZE CLIP COLOR CONTINENTS CON_COLOR HIRES E_CONTINENTS E_GRID E_HORIZON GLINESTYLE GRID HORIZON LABEL LATALIGN LATDEL LATLAB LONDEL LONLAB MLINESTYLE NAME NOBORDER NOERASE REVERSE TITLE USA XMARGIN YMARGIN IONGrMap Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 205 Projection Parameters CENTRAL_AZIMUTH ELLIPSOID ISOTROPIC LIMIT SAT_P SCALE STANDARD_ PARALLELS Graphics POSITION T3D ZVALUE Exceptions None setLat setLon Sets the lat lon on which to center the projection Syntax public void setLat int lat public void setLat float lat public void setLat double lat public void setLat String lat public void setLon int lon public void setLon float lon public void setLon double lon public void setLon String lon Arguments lat The latitude of the point on the Earth s surface to be mapped to the center of the projection plane Latitude is measured in degrees north of the equator and at must be i
146. ions IOException setDrawable The setDrawable method designates which IONGRDrawable object will receive graphical output from the ION Server Syntax public boolean setDrawableIONGrDrawable ionGraphic public boolean setDrawableIONJGrDrawable ionGraphic public boolean setDrawable int iGraphic Return Value This routine returns False if the specified drawable is not registered with the connection or True otherwise Arguments ionGraphic An instance of an IONGrDrawable object to set as the current drawable This graphic must have been registered with the LONGrConnection object via the addDrawable method ION Java User s Guide IONGrConnection ONJGrConnection Class 178 Chapter 6 ION Java Class and Method Reference iGraphic A zero based integer index designating which IONGrDrawable object to set as the current drawable This graphic must have been registered with the I ONGrConnection object via the addDrawable method Exceptions None Example con setDrawable ionGraphic con setDrawable 1 boolean bSuccess boolean bSuccess setIDLVariable See setIDLVariable on page 131 IONGrConnection ONJGrConnection Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 179 lIONGrContour Class The I ONGrContour class produces an IDL generated contour in a drawing area The class allows the user to enter data and set contour attributes at the program level Cl
147. ions to interact with IDL The ION Component classes and the ION pre built applets are both built directly from the ION low level classes See ION Low Level Classes on page 55 for details ION Java User s Guide ION Java Architecture 42 Chapter 2 Overview ION Java Limitations Server Limitations If the server is behind a firewall you can use the ION Tunnel Broker which uses HTTP Protocol to pass ION information through the firewall See Configuring The ION HTTP Tunnel Broker on page 29 for details on the Tunnel Broker IDL Limitations The following IDL features are unavailable with ION Java e IDL Widgets e The IDL line continuation character All of IDL s analytical routines and all of the IDL Direct Graphics and Object Graphics routines are available subject to the constraints imposed by the ION security mechanism See Command Security on page 32 for more on ION s security mechanism ION Java Limitations ION Java User s Guide Chapter 2 Overview 43 ION Java Performance Considerations There are several issues which impact ION Java performance While steps can be taken to improve performance see Tips for Increasing Execution Speed in ION Java on page 43 many users note that execution of ION Java applications are slower than equivalent applications executed in IDL Also IDL commands called from an applet execute more slowly than IDL command line execution Performance can also differ between
148. is computer program are copyright 1995 1999 LizardTech Inc All rights reserved MrSID is protected by U S Patent No 5 710 835 Foreign Patents Pending Portions of this software are copyrighted by Merge Technologies Incorporated This product includes software developed by the Apache Software Foundation http www apache org IDL Wavelet Toolkit Copyright 2002 Christopher Torrence Other trademarks and registered trademarks are the property of the respective trademark holders Contents Chapter 1 Configuring ION Java cas cs cee deca aren eta 9 Starting and Configuring the ION Daemon 22 1 22 2122cccsescseeesenesecessoeadeesecetsenesceeee 10 Configuring JON Java Tor Windows cicssccssssesssnscedsandevasssasdasendascssessssdencevasnasenve 11 The TON Java Properties Dialog nccce esc cnntiarte Gar eicditineinntinwaGic 11 Checking Status with the ION Java Status Utility 0 eeeeeeereeeneeeees 18 Windows Command Line Installation of the ION Daemon eee 19 Using Windows Services Manager to Start the ION Daemon 0 20 mrs TION Jara Tor UNIX casas caxsodowecsanspsanpaarasunenancenvsnscsasenscavenviucasswaprioatens 21 Starting the ION Daemon on UNIX ops cesisscensed neg acga pass nacdcocsucensseebectenqedeestaateae 21 Starting the ION Daemon at Boot Time ssssseeeeseseesseerssrseresresserererrersersresres 25 Checking the Status of the ION Daemon o issirssisisisreirssisniiisressiseisreirss 25 Shutting Down the
149. is not an array getimaginary The getImaginary method returns the imaginary value of the complex variable If the value is not of type complex zero is returned Syntax public final float getImaginary Return Value The method returns the imaginary value of the complex variable ION Java User s Guide lIONVariable Class 274 Chapter 6 ION Java Class and Method Reference Arguments None Exceptions IONIsAnArrayException Example try float i myVariable getImaginary j catch IONISAnArrayException e System err println Variable is an array getint The getInt method returns the int value of the variable If the value is not of type int IDL type long the scalar value is converted to an int Syntax public final int getIntQ Return Value The method returns the int value of the variable Arguments None Exceptions IONIsAnArrayException NumberFormatException IONVariable Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 275 Example try int i myVariable getInt catch IONISAnArrayException e System err println Variable is an array catch NumberFormatException e System err printin String Cannot be converted getintArray The getIntArray method returns the int array value of the variable If the value is not of type int java lang ClassCastException exception will be thrown To avoid thi
150. kage are discussed in the applet specific sections below The syntax of the lt PARAMS gt tag is as follows lt PARAM NAME name VALUE value gt The NAME attribute can be set to one of the following parameters Connecting to the ION Server Before IDL commands can be executed and graphics created the ION applet must connect to the ION Server Establish a connection by including the following connection parameters in the HTML code that creates the applet SERVER_NAME Set this value of this parameter equal to the name of the computer on which the ION Server is running The server name can be either a simple host name i e myhost or a fully qualified domain name i e myhost mycompany com Java security mechanisms require that the applet be located on the same machine as the ION Server If the server name is not provided the host name of the machine from which the applet was loaded is used PORT_NUMBER The port number of the port on the server where the ION Daemon is listening By default the ION Server listens to port 7085 SERVER_DISCONNECT Set the value of this parameter equal to YES if you want the applet to disconnect from the server when all commands have been processed Note that if more than one applet is using the connection the connection will not be closed until all commands from all of the connected applets have been completed The default value is NO Parameters Specified via lt PARAM gt Tags ION Java U
151. l Swing based components Mixing AWT and Swing components in the same application can cause problems with the stacking order of your components The ION Swing components can be identified by a J For example the Swing version of the IONPlot class is called IONJPlot Note If you use Swing components you need to define the certain attributes in your HTML file This is due to certain browsers not supporting Swing components For example CODE com rsi ion IONJPlotApplet class CODEBASE classes ARCHIVE ion_61 jar swingall jar If you are not running your Java application through a browser you need to set AWT vs Swing ION Java User s Guide Chapter 3 Overview of the ION Java Classes 63 CLASSPATH to include the swingall jar file The swingall jar file is available from http java sun com ION Java User s Guide AWT vs Swing 64 Chapter 3 Overview of the ION Java Classes AWT vs Swing ION Java User s Guide Chapter 4 Using ION s Pre Built Applets The simplest way to create an ION Java application is to plug existing ION Java applets into a Web page The pre built applets included with ION Java allow you to interact with the ION Server with a minimum of Java knowledge or experience Because the applets are pre built you can include them in Web pages using only HTML code This chapter discusses the lt APPLET gt and lt PARAM gt tags describes how to set up and customize each of ION s p
152. lass 56 237 mouseMoved method 237 mousePressed method 238 mouseReleased method 239 IONOffScreen class 56 241 createImage method 242 getGraphics method 243 getImage method 243 IONOffScreen method 241 IONOffScreen method 241 IONOutputListener interface 56 244 IONOutputListener interface class ONOut putText method 244 IONOutputText method 244 IONPlot class 57 245 draw method 247 getProperty method 247 IONPlot method 245 setProperty method 248 setX Value method 249 setY Value method 249 IONPlot method 245 IONPlotApplet 59 82 ionstat utility 25 IONSurface class 57 251 draw method 253 getProperty method 253 IONSurface method 252 setNoErase method 254 setProperty method 255 setX Value method 256 setY Value method 256 setZValue method 257 IONSurface method 252 Index 302 IONSurfaceApplet 60 84 IONVariable class 56 258 arrayDimensions method 262 getByte method 263 getByteArray method 263 getComplexArray method 264 getDComplexArray method 265 getDImaginary method 266 getDimensionedByteArray method 266 getDouble method 270 getDoubleArray method 271 getFloat method 271 getFloatArray method 273 getImaginary method 273 getInt method 274 getIntArray method sal getShort method 276 getShortArray method 276 getString method 277 getStringArray method 278 IONVariable method 261 isArr
153. le Z D public void setZValue String sName ION Java User s Guide IONGrContour Class 186 Chapter 6 ION Java Class and Method Reference Arguments Z The new Z value of the contour sName The name of the IDL variable that contains the new Z value of the contour Exceptions None IONGrContour Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 187 IONGrDrawable ONJGrDrawable Class Objects of the IONGrDrawable class represent a drawing area for IDL produced graphics that can be part of a Java AWT The IONGrDrawable can act alone as a drawing area or it can contain many ONGrGraphic objects The way in which multiple Graphic objects are displayed in the drawable can be controlled using setNoErase and setMulti Class Declaration public class IONGrDrawable extends IONCanvas implements java awt event MousesListener public class IONJGrDrawable extends IONJCanvas implements java awt event MousesListener Methods e TIONGrDrawable IONJGrDrawable Constructs an object of the IONGrDrawable class e addGraphic Adds a graphic object to be drawn e debugMode Enables Disables the debug mode of the class e draw Draws all graphic objects in the drawable e executeIDLCommand Executes an IDL command on the ION Server e getConnection Gets the connection object associated with this drawable e isConnected Returns true if the drawable is assoc
154. lic int createWindow int xsize int ysize String title public int createWindow int index int xsize int ysize public int createWindow int index int xsize int ysize String title public int createWindow int index int xsize int ysize int xpos int ypos String title Return Value This method returns the IDL window index of the newly created window Arguments xsize The width in pixels of the window to be created ysize The height in pixels of the window to be created title The title of the window to be created IONWindowingClient Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 283 index The desired IDL window index of the window Exceptions None Example TONWindowingClient ionWin New IONWindowingClient int index ionWin createWindow xsize ysize title For another detailed example see the window java example located in the examples src directory deleteWindow Use the deleteWindow method to delete the window pixmap that is referenced by the given IDL Window index Syntax public void deleteWindow int index Arguments index The IDL Window index of the window pixmap to destroy Exceptions None showWindow Use the showWindow method to raise or lower the Z order of the given window Syntax public void show Window int index boolean show ION Java User s Guide IONWindowingClient Class 284 Chapter 6 ION Java Class and Method Reference Arguments
155. lication and IDL The ION Server translates requests from ION clients into commands that can be processed by IDL and then passes output from IDL back to the client for display The ION Server is discussed in detail in Chapter 1 Configuring ION Java Once the incoming client has been verified by the ION Daemon the ION Daemon starts an ION Server process and connects the client with the ION Server process The ION Server process checks out an ION license and then begins command processing The ION Server process is responsible for the following ION Java Architecture ION Java User s Guide Chapter 2 Overview 39 e Reading requests from the ION client e Performing security checks on the client request e Executing valid ION IDL commands e Sending graphic information and data to the ION client Security Checks Once a command is received from the client the request is passed through the ION security system Any security failure causes the command to be logged and an error condition to be sent to the client If the command passes the security system it is passed to IDL for execution Command Execution When a command is executed all graphic and command log information is sent to the client Once the command is completed the error status is sent to the client and the ION Server process waits for the next request ION Daemon The ION Daemon is a program that makes the initial connection between an ION client and the ION Server
156. lly when an ION client makes a connection the ION Daemon sets up a direct socket connection between the client and an ION Server process In the Tunnel model ION clients connect to the ION Tunnel Broker rather than to the ION Daemon The Tunnel Broker requests that the ION Daemon start an ION Server process and attaches a peer to the server The peer then acts as the client for communication with the ION Server The peer buffers server responses packs them into HTTP messages and sends them through the Tunnel Broker back to the ION client ION Java Architecture ION Java User s Guide Chapter 2 Overview 41 Pre Built ION Client Applets The ION package includes a set of pre built Java applets The pre built applets allow you to begin using ION immediately without the need to write Java code See Chapter 4 Using ION s Pre Built Applets for details ION Component Classes The ION Component classes provide a simple straightforward interface that allows you to create ION client applets and applications quickly and easily While using the ION Component classes does require that you write Java code the classes handle most of the details of writing applications to interact with IDL seamlessly See Chapter 3 Overview of the ION Java Classes for details ION Low Level Classes The ION low level classes are the backbone of the ION Java system they provide the tools a professional Java programmer needs to create robust applicat
157. ludes an IONGrPlot object IONPIlot is the AWT implementation and IONJPlot is the Swing implementation lONSurface ONJSurface An IONSurface object represents a surface graphic and a drawing area ONSurface allows you to get and set properties of the surface via keywords to the IDL ION Java User s Guide The ION Java Class Hierarchy 58 Chapter 3 Overview of the ION Java Classes SURFACE routine and to draw the surface object IONSurface extends IONGrDrawable and includes an I ONGrSurface object I ONSurface is the AWT implementation and IONJSurface is the Swing implementation IONGrGraphic An IONGrGraphic object provides methods used to manage graphic properties The other IONGr objects extend this object IONGrGraphic allows you to get and set graphic properties and to manage property lists for the graphic object lONGrContour An IONGrContour object is a property manager for a contour graphic IONGrContour allows you to get and set properties of the contour plot via keywords to the IDL CONTOUR procedure but does not contain a drawing area Use IONContour if you want a contour an object and a drawing area managed by a single object LONGrContour extends ONGrGraphic The IONGr components are useful for overlaying graphics on top of one another IONGrMap An IONGrMap object is a property manager for a map graphic IONGrMap allows you to get and set the properties of the map via keywords to the IDL MAP_SET procedure but
158. me Arguments sName The name of the property Properties Supported The following IDL Plot properties are supported by IONPlot get set Property Refer to the IDL documentation on keywords available for use with the PLOT procedure for an explanation of each property BACKGROUND CHARSIZE CLIP COLOR DATA DEVICE FONT ISOTROPIC LINESTYLE MAX_VALUE MIN_VALUE NOCLIP NODATA NOERASE NORMAL NSUM POLAR POSITION PSYM SUBTITLE SYMSIZE T3D TICKLEN TITLE XCHARSIZE Y CHARSIZE Z CHARSIZE XGRIDSTYLE YGRIDSTYLE ZGRIDSTYLE XLOG XMARGIN Y MARGIN ZMARGIN XMINOR YMINOR ZMINOR XRANGE YRANGE ZRANGE XSTYLE YSTYLE ZSTYLE ION Java User s Guide IONPlot IONJPlot Class 248 Chapter 6 ION Java Class and Method Reference XTICKFORMAT Y TICKFORMAT ZTICKFORMAT XTICKINTERVAL Y TICKINTERVAL ZTICKINTERVAL XTICKLAYOUT YTICKLAY OUT ZTICKLAY OUT XTICKLEN YTICKLEN ZTICKLEN XTICKNAME YTICKNAME ZTICKNAME XTICKS YTICKS ZTICKS XTICKUNITS YTICKUNITS ZTICKUNITS XTICKV YTICKV ZTICKV XTICK_GET YTICK_GET ZTICK_GET XTITLE YTITLE ZTITLE YLOG YNOZERO ZVALUE Exceptions None Example TONVariable value getProperty Property setProperty The setProperty method sets a property for the plot object Syntax public final void setProperty String sName IONVariable vValue Arguments sName The name of the property to set vValue The value of the property Properties Supported The IDL Plot properties supported by ION
159. ments None Exceptions IONNotAnArrayException Example IONVariable myVariable c_ionCon getIDLVariable my3dIdlintArr short short3d 111 try short3d short myVariable getDimensionedShortArray catch IONNotAnArrayException e System err println Variable is not an array getDouble The getDouble method returns the double value of the variable If the value is not of type double the scalar value is converted to a double Syntax public final double getDouble Return Value The method returns the double value of the variable Arguments None Exceptions IONIsAnArrayException NumberFormatException IONVariable Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 271 Example try double d myVariable getDouble catch IONIsAnArrayException e System err println Variable is an array catch NumberFormatException e System err printin String Cannot be converted getDoubleArray The getDoubleArray method returns the double array value of the variable If the value is not of type double a java lang ClassCastException exception will be thrown To avoid this exception check the type of the data and call the correct method for that type Syntax public final double getDoubleArray Return Value The method returns the double array value of the variable Arguments None Exceptions IONNotAnArrayException Example try
160. method returns the value of the double complex array variable Arguments None Exceptions IONNotAnArrayException Example try IONDComplex dc myVariable getDComplexArray catch IONNotAnArrayException e System err printin Variable is not an array ION Java User s Guide IONVariable Class 266 Chapter 6 ION Java Class and Method Reference getDImaginary The getDImaginary method returns the imaginary value of the double complex variable If the value is not of type double complex zero is returned Syntax public final double getDImaginary Return Value The method returns the imaginary value of the double complex variable Arguments None Exceptions IONIsAnArrayException Example try double i myVariable getDImaginary catch IONISAnArrayException e System err printin Variable is an array getDimensionedByteArray The getDimensionedByteArray method returns the byte array value of the variable The result contains the same number of dimensions as the variable Syntax public final Object getDimensionedB yteArray where Object can be a 1 to 8 dimensional array of Java primitive type byte Return The method returns the multidimensional byte array value of the variable IONVariable Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference Arguments None Exceptions IONNotAnArrayException 267 Example IONVariable myVariable
161. n exception will be thrown To avoid this exception check the type of the data and call the correct method for that type Syntax public final byte getByteArray ION Java User s Guide lIONVariable Class 264 Chapter 6 ION Java Class and Method Reference Return Value The method returns the byte array value of the variable Arguments None Exceptions IONNotAnArrayException Example try byte b myVariable getByteArray catch IONNotAnArrayException e System err println Variable is not an array getComplexArray The getComplexArray method returns the value of the complex array variable Syntax public final I ONComplex getComplexArray Return Value The method returns the value of the complex array variable Arguments None Exceptions IONNotAnArrayException IONVariable Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 265 Example try IONComplex c myVariable getComplexArray catch IONNotAnArrayException e System err println Variable is not an array getDComplexArray The getDComplexArray method returns the value of the double complex array variable If the value is not of type double complex a java lang ClassCastException exception will be thrown To avoid this exception check the type of the data and call the correct method for that type Syntax public final IONDComplex getDComplexArray Return Value The
162. n the daemon verifies that the client is a valid ION client ION clients are valid if they have been created using the ION Java classes described in this document If the client is not valid the daemon rejects the connection and no ION Server process is started Connection Limit There are two limits set on the number of connections the ION Server will accept If you have specified a maximum number of connections via the maxconn switch to the ION Daemon process the ION Daemon will reject new clients after reaching that limit If no maximum number of connections is specified to the daemon the maximum number of connections allowed is defined by the ION Server license If the limit is reached the ION Daemon will notify new ION clients that the limit has been reached and will close the connection ION Java User s Guide Command Security 34 Chapter 1 Configuring ION Java Command Security ION Java User s Guide Chapter 2 Overview This chapter introduces ION Java and discusses the ION Java architecture including the ION Service and Tunnel Broker Daemons This chapter includes the following topics e What is ION Java e ION Java Architecture e ION Java Limitations e ION Java Performance Considerations e Running the ION Java Examples e Where to Place HTML and Class Files ION Java User s Guide 35 36 Chapter 2 Overview What is ION Java ION Java is a sophisticated system that brings the power of IDL to the Internet
163. n allows the user to zoom in on a region of interest then you could provide the smallest lowest quality image necessary to give the user the required information at each stage in the drill down process Avoid Using Device Fonts Both TrueType and hardware fonts can cause increased download times to client machines When a TrueType font is rendered in IDL it is sent to the device as a set of polygons Depending on the symbol being rendered the number of polygons generated can be quite large which can increase download times If you use hardware fonts the amount of data being sent to the client can be decreased in certain situations since only the attributes and parameters of the fonts are being sent Another workaround is to render the graphic before sending it to the client See Send Complex Plots as a Single Image on page 44 for more information ION Java User s Guide ION Java Performance Considerations 46 Chapter 2 Overview Running the ION Java Examples Once you have the ION Server properly configured and started you are ready to run the example applications Several example applications are placed in your Web server directory during the ION Java installation process Note If you skipped the step which provided the location of your Web server s HTML files directory during the installation process you will need to copy the appropriate files to your Web server before running the examples See Manually Configur
164. n by outsiders while allowing the inside computers to make connections with computers on the Internet via a set of relatively limited protocols such as HTTP and FTP The ION client server model is based on a persistent two way socket connection between the client and server Firewalls in most cases do not allow arbitrary processes to open socket connections to remote servers Because ION communication is not based on any standard protocol it may not be able to penetrate a firewall that allows connection through only the standard and well known protocols HTTP FTP Freestanding ION Java applications running behind a firewall have little chance of obtaining a connection through the firewall However ION applets running in a web browser can take advantage of the HTTP connections provided by the browser and use them to tunnel through the firewall and communicate with an external ION Server The ION HTTP Tunnel Broker provides all the functionality necessary for ION Applets to successfully tunnel across most firewalls The Tunnel Model The ION Tunnel model includes an HTTP communications layer on the ION Client that maintains a connection to an ION HTTP Tunnel Broker The Broker manages a set of peers that communicate with and control ION Servers HTTP requests sent from the client to the server are dispatched to the appropriate peer and peer responses are sent back to the client through the Broker in the form of an HTTP response Norma
165. n grConn Arguments grConn The name of the connection Exceptions None getProperty The getProperty method retrieves the specified value of the property Syntax public final ION Variable getProperty String sName Arguments sName The name of the property to retrieve ION Java User s Guide IONGrMaplmage Class 216 Chapter 6 ION Java Class and Method Reference Properties Supported The following IDL MAP_IMAGE properties are supported by the IONGrMapImage get set Property Refer to the IDL documentation on keywords available for use with the MAP_IMAGE procedure for an explanation of each property BILINEAR COMPRESS LATMAX LATMIN LONMAX LONMIN MAX_VALUE MIN_VALUE MISSING SCALE Exceptions None setimage The setImage method defines the image that will be projected It can either be in the form of a two dimensional array or the name of the IDL variable Syntax public void setImage byte image public void setImage int image public void setImage float image public void setImage double image public void setImage String image Arguments image A two dimensional array containing the image to be overlaid on the map or a variable containing an array Exceptions None IONGrMapImage Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 217 setProperty The setProperty method sets the specified property to the specified value Syntax publ
166. n the range 90 lt lat lt 90 The default is 0 lon The longitude of the point on the Earth s surface to be mapped to the center of the projection plane Longitude is measured in degrees east of the Greenwich meridian and lon must be in the range 180 lt lon lt 180 The default is 0 ION Java User s Guide IONGrMap Class 206 Chapter 6 ION Java Class and Method Reference Exceptions None setProperty The setProperty method sets the specified property to the specified value Syntax public final void setProperty string sName ION Variable vValue Arguments sName The name of the property to set vValue The value of the property to set Properties Supported The IDL Map properties are supported by IONGrMap get set Property are the same as those covered in getProperty on page 204 Refer to the IDL documentation on keywords available for use with the MAP_SET procedure for an explanation of each property Exceptions None setRotation Sets the rotation of the map projection Syntax public void setRotation int rot public void setRotation float rot public void setRotation double rot IONGrMap Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 207 public void setRotation String rot Arguments rot The angle through which the North direction should be rotated around the line L between the Earth s center and the point lat lon This angle is measure
167. nd Method Reference 163 Arguments drawable An object that implements the I ONDrawable interface index The index to assign to the drawable If no index is supplied a free index is used bSendAttr If true the server is notified of the change to the current drawable Return Value The function returns the window index number that is used by IDL to reference the drawable Exceptions None Example int iIndex addIONDrawable drawable int iIndex addIONDrawable drawable index connect The connect method establishes a connection between the client and the IDL server The client and the server make validity checks and the communication protocol is established Syntax public void connect String sHostname public void connect String sHostname int iPort ION Java User s Guide IONGraphicsClient Class 164 Chapter 6 ION Java Class and Method Reference Arguments sHostname The name of the host that the ION Server is running on If the class is being created as part of a Java applet most web browsers require that the host name be the same host that the applet is being served from iPort The port number to use when connecting to the IDL server If this number is not provided the default port number is used Exceptions IOException UnknownHostException ONLicenseException IONGraphicsClient Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 165 copyArea The copy
168. nd create an ION applet to build an array of frames and display the animation on the client side in a browser or Java application An example application that does this sort of client side animation is included in the ION distribution Point your browser at the file animation htm1 in the demo subdirectory of the examples directory The Java sources for the animation classes are included in the src subdirectory of the classes directory Note that the animation demo relies on an IDL pro file see Running the ION Java Examples on page 46 Tip AAH_AYHA ii A You can create an MPEG file on the fly with IDL and then supply a link to it If the client browser has a common MPEG plug in you can play back the animation without requiring a special java applet MPEG support in IDL requires a special license For more information contact your RSI sales representative Considerations Specific to ION Applets ION Java User s Guide Chapter 6 ION Java Class and Method Reference This chapter describes the ION Java classes and their methods The following classes are covered in this chapter e IONCallableClient Class e IONCommandDoneListener Interface e IONContour I ONJContour Class e IONDisconnectListener Interface e IONGraphicsClient Class e IONGrConnection IONJGrConnection Class e IONGrDrawable IONJGrDrawable Class e IONGrMap Class e IONGrMapGrid Class e IONGrPlot Class ION Java User s Guide IONCanvas ION
169. nd did not execute successfully Arguments sIDLCommand A string containing a valid IDL command Exceptions IOException IONIIlegalCommandException I ONSecurityException IONGrDrawable ONJGrDrawable Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 191 getConnection The getConnection method is used to retrieve the I ONGraphicConnection object with which this object is associated Syntax public IONGraphicConnection getConnection Return Value Returns the I ONGraphicConnection object that this object is associated with If no connection is associated with this object null is returned Arguments None Exceptions None Example TONGraphicConnection conn getConnection isConnected The isConnected method is used to determine whether the drawable is associated with an IONGraphicConnection Syntax public boolean isConnected Return Value The method returns true if the drawable is associated with an IONGraphicConnection and false otherwise Arguments None ION Java User s Guide IONGrDrawable ONJGrDrawable Class 192 Chapter 6 ION Java Class and Method Reference Exceptions None Example boolean connected isConnected removeGraphic The removeGraphic method removes an I ONGrGraphic from the drawable Syntax public boolean removeGraphic I ONGrGraphic ionGraphic Return Value The method returns true on success or false if the specified graphic i
170. nds an IDL command to the ION Server for execution The IDL command is posted to the server for execution and the function immediately returns Notification of the commands completion is performed via the IONCommandDoneListener interface Syntax public void sendIDLCommand String sCommand Arguments sCommand The IDL Command that is to be executed on the IDL server The use of the IDL command to open a shell or command window and the line continuation character are prohibited for security reasons and because they can hang the server Exceptions IOException ION Java User s Guide IONCallableClient Class 130 Chapter 6 ION Java Class and Method Reference setConnectionMethod The setConnectionMethod method sets the type of connection for the client See Configuring The ION HTTP Tunnel Broker on page 29 for details on connection types Syntax public final void setConnectionMethod int iType Arguments iType Set the Type argument to one of the three following values e HTTP_CON The client uses the ION HTTP Tunnel Broker exclusively e SOCK_CON The client uses a normal ION socket connection exclusively e BEST_CON The client first tries to use a SOCK_CON If this times out the client uses the HTTP_CON These values are defined as constants in the IONCallableClient class definition Example To set the connection type to HTTP only use the following statement setConnectionType IONCalla
171. ner interface defines the method that a class must implement to receive notification that an IDL command has completed The listener object must be registered with the addJONCommandDoneListener call Class Declaration public interface IONCommandDoneListener Methods IONCommandComplete Reports on the status of a completed command Implementing Classes e JONGraphicApplet e JONGrConnection IONJGrConnection Class IONCommandComplete Call the IONCommandComplete method when a command that was sent to the IDL server is complete Syntax public abstract void IONCommandComplete int iStatus int i DLStatus Arguments iStatus A value that indicates the status of the processing of the IDL command This value is one of the following constants that are part of this class TION _COMM_OK Command is OK e ION _COMM_SECURITY Command security error e TION _COMM_INVALID Command was invalid ION Java User s Guide IONCommandDoneListener Interface 138 Chapter 6 ION Java Class and Method Reference ilIDLStatus Indicates the success or failure of the execution of the IDL command A value of 0 indicates that the command was successful If the command was not successful il DLStaus contains the value of ERROR in the IDL session Exceptions None Example public void IONCommandComplete iStatus iIDLStatus IONCommandDoneListener Interface ION Java User s Guide Chapter 6 ION Java Class and Method Reference 139
172. nt MouseMotionListener These provide a more robust and complete solution Class Declaration public interface IONMouseListener Methods e mouseMoved Called when the mouse moves e mousePressed Called when a mouse button down event occurs e mouseReleased Called when a mouse button up event occurs Implementing Classes IONGraphicsClient Class mouseMoved Call the mouseMoved method when a mouse cursor is moved in a drawable Note that the Mouse Listener must have been registered in the drawable prior to calling mouseMoved Syntax public abstract void mouseMoved IONDrawable drawable int X int Y long when int mask Arguments drawable The IONDrawable object that the event occurred in ION Java User s Guide lIONMouseListener Interface 238 Chapter 6 ION Java Class and Method Reference X The X location of the mouse Y The Y location of the mouse when The time when the event happened mask Current mouse button state Exceptions None mousePressed Call the mousePressed method when a mouse button is pressed in a drawable Note that the Mouse Listener must have been registered in the drawable prior to calling mousePressed Syntax public abstract void mousePressed IONDrawable drawable int X int Y long when int mask Arguments drawable The IONDrawable object in which the event occurred X The X location of the mouse Y The Y location of the mouse
173. nterface ION Java User s Guide Chapter 6 ION Java Class and Method Reference 241 lONOffScreen Class Objects of the IONOffScreen class represent an invisible drawing area on which graphic output can be placed Class Declaration public class IONOffScreen extends Object implements IONDrawable Methods e TIONOffScreen Constructs an object of the IONOffScreen class e createImage Creates an offscreen image e getImage Returns the image that is being drawn e getlIONGraphics Returns an ION graphics context for the device See also the description of the IONDrawable Interface lIONOffScreen The IONOffScreen method constructs an object of the IONOffScreen class Syntax public IONOffScreen int width int height Component comp Arguments width The width of the drawing area height The height of the drawing area ION Java User s Guide IONOffScreen Class 242 Chapter 6 ION Java Class and Method Reference comp A visible used to create images This needs to be a component that is already visible on the users screen in order for the OffScreen to be properly created Exceptions None Example IONOf Screen offscreen new IONOffScreen createlmage Use the createImage method to create an image of a given size Syntax public abstract Image createImage int width int height Arguments width The width of the requested image height The height of the requested image Exce
174. ntour method constructs an object of the IONJContour class IONContour ONJContour Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 145 Syntax Noe The following is the syntax for the IONContour method For the IONJContour method replace I ONContour with IONJContour public IONContour int iWidth int iHeight public IONContour int iWidth int iHeight int Z public IONContour int iWidth int iHeight float Z D public IONContour int iWidth int iHeight double Z public IONContour int iWidth int iHeight int Z public IONContour int iWidth int iHeight float Z public IONContour int iWidth int iHeight double Z public I ONContour int iWidth int iHeight String sName public IONContour int iWidth int iHeight int Z int X int Y public IONContour int iWidth int iHeight float Z float X float Y public IONContour int iWidth int iHeight double Z double X double Y public IONContour int iWidth int iHeight int Z int X int Y public IONContour int iWidth int iHeight float Z float X float Y public IONContour int iWidth int iHeight double Z double X double Y public I ONContour int iWidth int iHeight String sZName String sXName String sYName Arguments iWidth The width of the plot in pixels iHeight The height of the plot in pixels Z The Z values data to use in the contour ION Java Use
175. nual iondir iondir Note If no switches are specified ion_srvinst prints the status of the service The switches to the ion_srvinst command are described below install Set this switch to install the ION Daemon service into the system ION Java User s Guide Configuring ION Java for Windows 20 Chapter 1 Configuring ION Java remove Set this switch to remove the ION Daemon service from the system start Set this switch to specify the start type of the service If set to auto the ION Daemon service will be started by the Windows system at startup If set to manual the default the ION Daemon service must be started through the ION Java Properties dialog or the Control Panel Services dialog Note that this option is ignored if the install switch is not also specified iondir Use this switch to specify the ION installation directory for example RSI DIR IDL61 products ION61 not RSI DIR IDL61 products ION61 ion_java Setting this switch will override any Windows registry entries and environment variable settings Using Windows Services Manager to Start the ION Daemon Use the Services dialog to start stop or configure automatic or manual startup modes of the ION Java Daemon To open the Service dialog do one of the following e On Windows NT select Start Settings Control Panel Services e On Windows 2000 select Start gt Settings gt Control Panel gt Administrative Tools Services In the Serv
176. o another directory located in or near the directory containing your HTML files Considerations Specific to ION Applets ION Java User s Guide Chapter 5 Building ION Applets and Applications 101 For example suppose you have located your HTML pages in a directory named public_html You may wish to place the ION package the ION ZIP file and the ION JAR file in a subdirectory of public_html named java If you then include any ION applet class files you create in the java directory you could simply specify CODEBASE java in the lt APPLET gt tag used in your HTML page See CODEBASE on page 67 for further details Supporting Java Archive Files When a web browser encounters an HTML page that contains a Java applet the class files that make up the applet are downloaded from the web server into the browser The applet is executed only after all of the necessary class files have been downloaded Because a separate HTTP connection between the client and the server is established for each class file the download time for a large applet an applet with many class files can be substantial To increase the download performance of Java applets consider using a Java Archive file or JAR file detailed in Number 3 of the following section A JAR file can contain multiple class files thus avoiding the need for multiple connections A JAR file can also be compressed further speeding the download process Most modern bro
177. o dimensional array each element specifies the X coordinate of the corresponding point in the Z_VALUES array Y_ VALUES Set the value of this parameter equal to a valid IDL expression that evaluates to a vector or two dimensional array specifying the Y coordinates for the surface If Y_VALUES specifies a vector each element specifies the Y coordinate for a column in the Z_VALUES array e g Y 0 specifies the Y coordinate for Z 0 If Y_VALUES specifies a two dimensional array each element specifies the Y coordinate of the corresponding point in the Z_VALUES array Z VALUES Set the value of this parameter equal to a valid IDL expression that evaluates to a one or two dimensional array containing the values that make up the surface If the X_VALUES and Y_VALUES parameters are provided the contour is plotted as a function of the X Y locations specified by their contents Otherwise the surface is generated as a function of the two dimensional array index of each element of Z_VALUES IONSurfaceApplet ION Java User s Guide Chapter 4 Using ION s Pre Built Applets 85 surface_property_7 surface_property_n Here surface_property_ is the name of a surface property supported by the IONGrSurface class Properties for the IONSurfaceApplet reflect the capabilities implemented in keywords to the IDL SURFACE procedure The syntax above refers to the fact that you can supply more than one surface property to the applet via the lt
178. o the listener object The listener is added to the internal listener list Exceptions None connect The connect method establishes a connection between the client and the ION Server The client and the server make validity checks and the communication protocol is established If hostname and port information for both the ION Server and the ION HTTP Tunnel Broker are supplied the connection type is set automatically to BEST_CON See setConnectionMethod on page 130 for details on setting other connection types Syntax public void connect String sHostname public void connect String sHostname int iPort public void connect String sHostname int iPort String sHttpHost int iHttpPort ION Java User s Guide IONCallableClient Class 124 Chapter 6 ION Java Class and Method Reference Arguments sHostname The name of the host that the ION Server or HTTP broker is running on If the class is being created as part of a Java applet most web browsers require that the host name be the same host that is serving the applet If the connection type is either SOCK_CON or BEST_CON this argument specifies the host on which the ION Server is running If the connection type is HTTP_CON and the sHttpHost argument is not specified this argument specifies the host on which the HTTP Tunnel Broker is running iPort The port number to use when connecting to the ION Server If this number is not provided the
179. object 3 Draw the object to the buffer then read the contents of the buffer as an image 4 TV the image to the ION device The following example demonstrates this technique First create your IDL graphic objects contained in the proper object hierarchy model and view oView obj_new IDLgrView COLOR 255 255 255 oModel obj_new IDLgrModel oText obj_new IDLgrText Hello World COLOR 255 0 0 oModel gt Add oText oView gt Add oModel Then create an off screen buffer object to which to draw in IDL Match the dimensions of the ION drawable For example suppose your java file contains the following method public void buildGUI c_ionDrw new IONGrDrawable 400 400 setLayout new FlowLayout add c_ionDrw In the above code the I ONGrDrawable is defined with dimensions of 400 400 Therefore you would create the IDLgrBuffer object in IDL as follows oBuffer obj_new IDLgrBuffer DIMENSIONS 400 400 Next draw the object to your buffer object oBuffer gt Draw oView Then get the image object from the buffer olmage oBuf fer gt Read Now extract the data oImage gt Getproperty DATA image Object Graphics in ION ION Java User s Guide Chapter 5 Building ION Applets and Applications 93 Make sure to destroy the image object since it is no longer needed OBJ_DESTROY oImage Next convert the TrueColor image to 8 bit to reduce the bandwidth required to send it
180. od 133 removelIONMouseListener method 136 IONCanvas method 133 IONCommandComplete method 137 IONCommandDoneListener interface 56 137 IONCommandDoneListener interface class IONCommandComplete method 137 IONComplex class 56 139 double Value method 140 floatValue method 140 getDImaginary method 141 getImaginary method 141 intValue method 142 IONComplex method 139 longValue method 142 toString method 143 IONComplex method 139 IONContour class 57 144 draw method 146 getProperty method 147 IONContour method 144 setNoErase method 148 setProperty method 148 setX Value method 148 setY Value method 149 setZValue method 150 IONContour method 144 IONContourApplet 59 76 IONdaemon command line parameters 19 Index 300 IONDComplex class 56 151 doubleValue method 152 floatValue method 152 getDImaginary method 153 getImaginary method 153 intValue method 154 IONDComplex method 151 longValue method 154 toString method 155 IONDComplex method 151 IONDisconnection method 156 IONDisconnectListener interface class 156 IONDisconnection method 156 iondown utility 26 IONDrawable class 55 IONDrawable interface 158 createImage method 158 getGraphics method 159 getImage method 159 IONGraphicApplet 59 74 IONGraphicsClient readImage method 167 IONGraphicsClient class 55 161 addIONDrawable method 162 connec
181. og offers another way of specifying IDL commands which should or should not be executed gt ION Properties Ea Contral Locations Security Commands Broker About m Exclusion Commands BOx_CURSOR SHADE_SURF j Remove Inclusion Commands po Add E To add a command click Add and enter a of an IDL command to the list of individual commands to be excluded or allowed by the ION security mechanism To remove a command select a command from either list and click Remove Noe Security Command files can also be used to designate which IDL commands are or are not executed See Security Command Files on page 32 for details Configuring ION Java for Windows ION Java User s Guide Chapter 1 Configuring ION Java The Broker Tab 17 The Broker tab allows the configuration of the ION Tunnel Broker See Configuring The ION HTTP Tunnel Broker on page 29 for information about the Tunnel Broker gt ION Properties x Control Locations Security Commands Broker About Broker Log file Broker Port Number Maximum HTTP Connections Timeout minutes Browse Cancel Apply Within the Broker tab you can make the following configurations Attribute Description Enable HTTP Broker Select this option to enable or disable the ION Tunnel Broker Broker Port Number Enter the port number to which the ION Tunnel Brok
182. oint array or a string value Optional Arguments Arguments that are not required are included in the syntax definition enclosed in square brackets Italicized square brackets indicate an array while non italicized square brackets indicate that the enclosed arguments are optional For example the square brackets in this syntax definition indicate that the variable X is an array variable setX Value int X The square brackets in the following syntax definition indicate that the portNumber argument is optional connect String hostname int portNumber Case Sensitivity ION object class and method names are displayed in mixed case type Unlike IDL the Java language is case sensitive that is names of ION Java methods and classes must be entered with the same capitalization as shown in this reference section Italic Type Arguments to ION procedures and functions data or variables you must provide are displayed in italic type Courier Type Class declarations syntax and examples are shown in courier IDL Code IDL functions procedures and keywords are displayed in UPPER CASE type For example the calling sequence for an IDL procedure looks like this CONTOUR Z X Y Arguments The Arguments section describes each valid argument to the method Note that these arguments are positional parameters that must be supplied in the order indicated by the method s syntax How to Use this Chapter
183. om RSI DIR IDL61 products ION61 ion_java to the Web Server htdocs IONJava directory When you finish the main level htdocs 1IONJava directory of your Web server will include two subdirectories classes and examples and an index html file ION Java User s Guide Manually Configuring Your Web Server 28 Chapter 1 Configuring ION Java 5 Update your IDL search path to include the Web Server htdocs directory For more information see The ION Java Properties Dialog on page 11 Manually Configuring Your Web Server ION Java User s Guide Chapter 1 Configuring ION Java 29 Configuring The ION HTTP Tunnel Broker The ION HTTP Tunnel Broker is a program that allows ION client applets running in World Wide Web browsers located behind a network firewall to communicate with an ION Server on the other side of the firewall For more information about network firewalls in regards to the ION client server model see ION HTTP Tunnel Broker on page 39 Note ___S S SSsSSSSSSSSSSSSSS Due to errors in virtual machine implementations Java Applets may use SOCKS to open an HTTP connection As such the broker may fail with firewalls that do not support the SOCKS protocol Using the Tunnel Broker Using the ION Tunnel Broker is very simple On the server side you must ensure that the ION Tunnel Broker is running see Starting the ION Tunnel Broker Daemon on page 30 for details On the client side you have the option of
184. omplex number as a single precision floating point value Syntax public final float floatValue Arguments None IONComplex Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 141 Exceptions None Example float f complexvar floatValue getDimaginary The getDImaginary method returns the imaginary portion of the complex number as a double precision floating point value Syntax public final double getDImaginary Arguments None Exceptions None Example double d complexvar getDImaginary getimaginary The getImaginary method returns the imaginary portion of the complex number as a single precision floating point value Syntax public final float getImaginary Arguments None ION Java User s Guide IONComplex Class 142 Chapter 6 ION Java Class and Method Reference Exceptions None Example float i complexvar getImaginary intValue The intValue method returns the real portion of the complex number as an integer value Syntax public final int intValueQ Arguments None Exceptions None Example int i complexvar intValue longValue The longValue method returns the real portion of the complex number as a long integer value Syntax public final long longValueQ Arguments None IONComplex Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 143 Exceptions None Example long 1 comple
185. on speed of ION Java applets and applications ION Java User s Guide ION Java Performance Considerations 44 Chapter 2 Overview Package Multiple IDL Commands into a Single pro File It is always more efficient to package multiple IDL commands into a single pro file than to call individual commands With individual commands the communication layer must be transversed for each command With a a single package of commands the communication layer is transversed only once An example is included in the Advanced section of the ION Examples See Running the ION Java Examples on page 46 Convert TrueColor Images TrueColor 24 bit images are three times as large as indexed 8 bit images While ION Java is capable of displaying 24 bit TrueColor images you can speed up ION Java execution by converting 24 bit images to 8 bit images To do so use the IDL COLOR_QUAN function before displaying the image By decreasing the image size this significantly reduces the transfer time necessary to display a graphics primitive sent from the server to the client Related considerations include clients who may not have displays configured to display 24 bit images and browsers which automatically dither images An example is included in the Basic section of the ION examples See Running the ION Java Examples on page 46 Send Complex Plots as a Single Image ION Java sends graphics primitives to the client to be drawn by Java More
186. on the map MAP_ LAT LON Center of the map ION Java User s Guide IONMapApplet 80 Chapter 4 Using ION s Pre Built Applets MAP_ROTATION Rotation of the map MAP Keywords accepted by IONGrMap MAP_GRID_ Keywords accepted by IONGrMapGrids valid if MAP_GRID is set MAP_CONT Keywords accepted by IONGrContinents valid if MAP_CONT is set MAP_IMAGE_DATA An IDL statement that evaluates to a 2D dataset that is used as the image data MAP_IMAGE_ Keywords accepted by IONGrMapImage valid if MAP_IMAGE_DATA is set MAP_CONTOURn Keywords accepted by the I ONContourApplet n identifies the contour to which the keyword is applied The applet starts processing at MAP_CONTOUR1 and continues sequentially until no more contours are encountered MAP_DISP_ORDER Specifies the order that the data sets are displayed on the map Valid orders are as follows CTR contour CT continents GR grid lines e CTR_CT_GR GTR_GR_CT e CT_CTR_GR CT_GR_CTR e GR_CTR_CT GR_CT_CTR The following IDL MAP_SET properties are supported by IONMapApplet Refer to the IDL documentation on keywords available for use with the MAP_SET procedure for an explanation of each property Projection Types AITOFF ALBERS AZIMUTHAL CONIC CYLINDRICAL GNOMIC GOODESHOMOLOSINE HAMMER LAMBERT MERCATOR MILLER MOLLEWIDE ORTHOGRAPHIC ROBINSON SATELLITE SINUSOIDAL STEREOGRAPHIC TRANS VERSE_MERCATOR IONMapApplet ION Java User s Guide Chapter 4
187. on which the ION Server is located Your class files however must reside on the same host machine as the ION Server This is due to Java applet security mechanisms Testing ION Applications Locally When learning how to write ION applications and running the example applications included with ION Java you may find it easier to load the applications directly from the ION Server machine rather than placing the files on your Web server and loading them over a network This allows you to run the example applications right from one of the examples directories of your ION Java installation and makes the process of developing and testing your applications easier This also takes the Web server out of the loop thereby eliminating the Web server as a potential source of application errors If you run the example applet applications directly from the RSI DIR IDL61 products ION61 ion_java examples directory Windows or RSI DIR ion_6 1 ion_java examples directory UNIX you do not need to change the CODEBASE attribute for any of the lt APPLET gt tags Note Certain browsers may generate a Java security exception when attempting to start an applet contained in an HTML file opened by selecting Open from the File menu This exception prevents the applet from running To work around this exception browse to the basic html file using a URL that looks like http rather than file Publishing ION Applications on Your Web Server Once you have
188. onGraphic Graphic object to add Exceptions None Example addGraphic ionGraphic debugMode The debugMode method enables and disables the debug mode of the class When debug mode is enabled the command log output from the ION Server is displayed in a window when a Shift click shifted mouse button press event is detected on the drawing surface When debug mode is enabled the class will buffer the output information for all registered drawables sent by the ION Server to the client class Syntax public void debugMode boolean bEnable Arguments bEnable If true the debug mode is enabled otherwise the debug mode is disabled Example con debugMode true ION Java User s Guide IONGrDrawable ONJGrDrawable Class 190 Chapter 6 ION Java Class and Method Reference draw The draw method draws all the graphics objects associated with this drawable If there are no graphics objects associated nothing happens Syntax public void draw Arguments None Exceptions None executelDLCommand The executeIDLCommand method sends an IDL command to the ION Server for execution The call returns when the command has finished executing Any resultant graphics is displayed in the IONGraphic drawing area Syntax public int executeIDLCommand String s DLCommand Return Value The function returns 0 if the IDL command executed successfully or the value of the IDL system variable ERROR if the IDL comma
189. onts available are supplied by Java itself not the platform on which IDL is running Java s font system supplies several standard fonts These font names will map to different actual fonts on different platforms but will always be handled gracefully by Java If you specify a different font Java will substitute one of the standard fonts automatically Tip Avoid using device fonts for performance reasons See Tips for Increasing Execution Speed in ION Java on page 43 Note that hardware fonts cannot be rotated scaled or projected and that the 1 commands accepted for vector fonts for subscripts and superscripts may not work When generating three dimensional plots it is best to use the vector drawn characters because IDL can draw them in perspective with the rest of the plot The GET_FONTNAMES keyword described below can be used to retrieve a list of available fonts The FONT keyword should be set to a string with the following form DEVICE FONT font modifier modifier modifier ION Java User s Guide Direct Graphics in ION 90 Chapter 5 Building ION Applets and Applications where the asterisk acts as a delimiter between the font s name font and any modifiers The string is not case sensitive Modifiers are simply keywords that change aspects of the selected font Valid modifiers are e For font size Any number is interpreted as the point size of the font to use e For font weight
190. operation ION device 88 plot_property parameter 82 plotting 59 82 port number 13 23 30 PORT_NUMBER parameter 70 Pre Built ION Client Applets 41 R readImage method 167 registerProperty method 199 removeDrawable method 176 removeGraphic method 192 removelONCommandDoneListener method 128 removeIONDisconnectListener method 128 removeIONDrawable method 168 removelIONMouseListener method 136 removelIONOutputListener method 129 ION Java User s Guide 303 resetMultiQ method 192 S screen size retrieving 90 scripting languages 107 109 differences 113 search path IDL 14 security 32 exclude commands 22 exclude file 21 include commands 22 include file 22 ION server 39 lists 23 sendIDLCommand method IONCallableClient class 129 IONGrConnection class 177 IONGrDrawable class 193 server 38 SERVER_DISCONNECT parameter 70 SERVER_NAME parameter 70 Services Manager Windows ION daemon services manager 20 SET_CHARACTER_SIZE keyword ION de vice 90 SET_GRAPHICS_FUNCTION keyword ION device 91 SET_PLOT routine 88 setConnectionMethod method 130 setConnectionTimeout method 130 setDecomposed method 168 setDrawable method 177 setIDLVariable method 131 setImage method 216 setIONDrawable method 169 setMulti method 194 setNoErase method IONContour class 148 IONGrContour class 183 IONGrDrawable class 194 Index 304
191. or The first element specifies the new character width and thus the height of the characters because vector drawn fonts have a fixed aspect ratio The second element specifies the vertical distance between Direct Graphics in ION ION Java User s Guide Chapter 5 Building ION Applets and Applications 91 lines The default produces a character that is approximately 8 pixels wide with 12 pixels between lines SET_GRAPHICS_FUNCTION Most window systems allow applications to specify the graphics function This is a logical function which specifies how the source pixel values generated by a graphics operation are combined with the pixel values already present on the screen ION supports only the following two of the fifteen graphics functions supported by IDL Direct Graphics Logical Function Code Definition GXcopy 3 source GXxor 6 source XOR destination The default graphics function is GXcopy which causes new pixels to completely overwrite any previous pixels Not all functions are available on all window systems See IDL Graphics Devices in the IDL Reference Guide for more information about how IDL handles graphics devices ION Java User s Guide Direct Graphics in ION 92 Chapter 5 Building ION Applets and Applications Object Graphics in ION To render IDL Object Graphics in ION Java you use the following general technique 1 Create the IDL objects 2 Create an off screen buffer an DLgrBuffer
192. oubleValue The doubleValue method returns the real portion of the complex number as a double precision floating point value Syntax public final double doubleValue Arguments None Exceptions None Example double d dcomplexvar doubleValue floatValue The floatValue method returns the real portion of the complex number as a single precision floating point value Syntax public final float floatValue Arguments None IONDComplex Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 153 Exceptions None Example float f dcomplexvar floatValue getDimaginary The getDImaginary method returns the imaginary portion of the complex number as a double precision floating point value Syntax public final double getDImaginary Arguments None Exceptions None Example double d dcomplexvar getDImaginary getimaginary The getImaginary method returns the imaginary portion of the complex number as a single precision floating point value Syntax public final float getImaginary Arguments None ION Java User s Guide IONDComplex Class 154 Chapter 6 ION Java Class and Method Reference Exceptions None Example float i dcomplexvar getImaginary intValue The intValue method returns the real portion of the complex number as an integer value Syntax public final int intValueQ Arguments None Exceptions None Example int i
193. pe byte TYPE_INT Variable is of IDL type int TYPE_LONG Variable is of IDL type long TYPE_FLOAT Variable is of IDL type float TYPE_DOUBLE Variable is of IDL type double TYPE_STRING Variable is of IDL type string TYPE_COMPLEX Variable is of IDL type complex TYPE_DCOMPLEX Variable is of IDL type double complex lIONVariable Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 259 Methods e TIONVariable Q Constructs an object of the ION Variable class e arrayDimensions Returns an int array that contains the array s dimensions e getByte Returns the byte value of the variable e getByteArray Returns the byte array of the variable e getComplexArray Returns the array of IONComplex values e getDComplexArray Returns the array of IONDComplex values e getDImaginary Returns the imaginary value of a double complex variable e getDouble Returns the double value of the variable e getDimensionedByteArray Returns the byte array value of the variable as an array with the same dimensions as the variable e getDimensionedDoubleArray Returns the double array value of the variable as an array with the same dimensions as the variable e getDimensionedFloatArray Returns the float array value of the variable as an array with the same dimensions as the variable getDimensionedIntArray Returns the integer array value of the variable as an a
194. perty String sName Argument sName The name of the property to retrieve Properties Supported The following IDL MAP_GRID properties are supported by IONGrMapGrid get set Property Refer to the IDL documentation on keywords available for use with the MAP_GRID procedure for an explanation of each property BOX_AXES CHARSIZE CLIP_TEXT COLOR FILL_HORIZON GLINESTYLE GLINETHICK HORIZON INCREMENT LABEL LATALIGN LATDEL LATLAB LATNAMES LATS LONALIGN LONDEL LONLAB LONNAMES LONS NO_GRID ORIENTATION T3D ZVALUE Exceptions None IONGrMapGrid Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 213 setProperty The setProperty method sets the specified property to the specified value Syntax public final void setProperty string sName ION Variable vValue Arguments sName The name of the property to set vValue The value to which to set the property Properties Supported The IDL MAP_GRID properties supported by the IONGrMapGrid get set Property are the same as those supported by getProperty on page 212 Refer to the IDL documentation on keywords available for use with the MAP_GRID procedure for an explanation of each property Exceptions None ION Java User s Guide IONGrMapGrid Class 214 Chapter 6 ION Java Class and Method Reference IONGrMapImage Class IONGrMapImage is an IONGrGraphic that encapsulates the functionality of IDL s MAP_IMAGE procedure which p
195. ptions None Example Image im draw createImage 300 300 lIONOffScreen Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 243 getimage The getImage method returns the image of the current drawing area Syntax public abstract Image getImage Arguments None Exceptions None Example Image im draw getImage getlONGraphics The getlONGraphics method returns a Graphics object that you can use to get graphics information on ION s drawing buffer or draw directly to Unlike the getGraphics method getIONGraphics allows you to affect the actual IDL drawable area For example you would use the getlONGraphics method when manipulating the buffer using the COPY keyword to IDL s DEVICE procedure Syntax public abstract Graphics getIONGraphics Arguments None Exceptions None Example Graphics g draw getIONGraphics ION Java User s Guide IONOffScreen Class 244 Chapter 6 ION Java Class and Method Reference lONOutputListener Interface The I ONOutputListener interface defines the method that a class must implement to receive ION Server output text The object must register itself with the addION OutputListener call Class Declaration public interface IONOutputListener Methods JONOutputText Retrieves a line of text from the ION Server Implementing Classes IONGrConnection I ONJGrConnection Class IONMapApplet Example For a simple example using IONOutputList
196. ptions None Example Image im draw getImage getlONGraphics The getlONGraphics method returns a Graphics object that you can use to get graphics information on ION s drawing buffer or draw directly to Unlike the getGraphics method getIONGraphics allows you to affect the actual IDL drawable area For example you would use the getlONGraphics method when manipulating the buffer using the COPY keyword to IDL s DEVICE procedure Syntax public abstract Graphics getIONGraphics Arguments None Exceptions None Example Graphics g draw getIONGraphics ION Java User s Guide IONCanvas IONJCanvas Class 136 Chapter 6 ION Java Class and Method Reference getMousePos The getMousePos method returns the current location of the mouse cursor in the canvas Syntax public Point getMousePos Arguments None Exceptions None Example Point pt getMousePos removelONMouseListener The removelONMouseListener method removes a mouse listener from the object If the given mouse listener is not the current listener the function exits quietly Syntax public final void removelONMouseListener IONMouseListener listener Arguments listener The listener to remove Exceptions None Example remove lONMouseListener listener IONCanvas IONJCanvas Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 137 lONCommandDoneListener Interface The I ONCommandDoneListe
197. r s Guide IONContour ONJContour Class 146 Chapter 6 ION Java Class and Method Reference sName sZName The name of the IDL variable to use for the Z data values of the contour X An array holding the values for the X coordinates of the grid Y An array holding the values for the Y coordinates of the grid sXName The name of the IDL variable holding the values for the X coordinates of the grid sYName The name of the IDL variable holding the values for the Y coordinates of the grid Exceptions None draw The draw method produces and display a graphic in the drawing area that makes up this object Syntax public void draw Arguments None Exceptions None IlONContour IONJContour Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 147 getProperty The getProperty method retrieves the current value of a property Syntax public final ION Variable getProperty String sName Argument sName The name of the property Properties Supported The following IDL Contour properties are supported by IONContour get set Property Refer to the IDL documentation on keywords available for use with the CONTOUR procedure for an explanation of each property BACKGROUND CELL_FILL CHARSIZE CLIP CLOSED COLOR C_ANNOTATION C_CHARSIZE C_COLORS C_LABELS C_LINESTYLE C_ORIENTATION C_SPACING DATA DEVICE DOWNHILL FILL FOLLOW FONT IRREGULAR LEVELS MAX_VALUE MIN_VALUE NLEVELS
198. r all registered drawables sent by the ION Server to the client class Syntax public void debugMode boolean bEnable Arguments bEnable If true the debug mode is enabled otherwise the debug mode is disabled Exceptions None IONGrConnection ONJGrConnection Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 175 Example con debugMode true disconnect See disconnect on page 125 executelDLCommand The executeI DLCommand method sends an IDL command to the ION Server for execution Any graphical output resulting from the IDL command is displayed in the IONGrDrawable drawing area Control is not returned to the application until the command has been executed Syntax public int executeIDLCommand String s DLCommand Return Value The function returns 0 if the IDL command executed successfully or the value of the IDL system variable ERROR if the IDL command did not execute successfully Arguments sIDLCommand A string containing a valid IDL command Exceptions IOException IONIlegalCommandException I ONSecurityException Example tryf con executeIDLCommand PLOT FINDGEN 10 catch IOException e System err printin IO error te getMessage catch IONIllegalCommandException eIC System err printin Illegal Command error te getMessage catch IONSecurityException eSE System err printin Security error te getMessage j ION Ja
199. r s Guide Chapter 7 Troubleshooting 291 sure that the access permissions for the ION class files and any class files you create are such that the ION Daemon has read permission If your applet does not run and the Java Console shows something like the following Applet exception class myApplet not found where you know that the myApplet class file exists and is located in the designated place you may have a file permissions problem Troubleshooting Licensing Errors If you get a license manager error on Windows stating that the license file cannot be found your ION Java installation may not have been properly licensed Review the licensing instructions in the Installing and Licensing IDL manual and make sure you have properly licensed ION Note Since Web Servers do not read any system environment variables you cannot use the LM_LICENSE_FILE environment variable to point to where you have located your license file When licensing ION Java you must place your license file in the default location RSI DIR license license dat where RSI DIR is the name of the main installation directory you selected to install ION Java On UNIX if you have a network license that you wish your ION installation to use you can copy the network license file to the default location RST DIR license license dat on the machine on which you are running ION Note Licensing errors appear on the server machine not the client machine Setting the IDL Path
200. rConnection addDrawable The addDrawable method adds the specified ION graphic to the connection object In turn the graphic objects sets its reference back to the connection Once added the graphic can communicate with the ION Server and thus request graphics and information Noe When using an IONGrConnection class it is recommended that you add a drawable method using addDrawable Do not use the parent class IONGraphicsClient addIONDrawable since this method does not set the connection from the drawable method back to the connection Syntax public int addDrawableIONGrDrawable ionGraphic public int addDrawable IONJGrDrawable ionGraphic Return Value This method returns a reference to the added IONGrDrawable IONJGrDrawable object ION Java User s Guide IONGrConnection ONJGrConnection Class 174 Chapter 6 ION Java Class and Method Reference Arguments ionGraphic An object of the ONGrDrawable class to add to the connection object Exceptions None Example IONGrDrawable draw con addDrawable draw connect See connect on page 163 debugMode The debugMode method enables and disables the debug mode of the class When debug mode is enabled the command log output from the ION Server is displayed in a window when a Shift click shifted mouse button press event is detected on the drawing surface When debug mode is enabled the class will buffer the output information fo
201. re built applets and provides example code Note You can use the examples in the chapter directly in your own Web pages by specifying the appropriate host and port settings for your server and by specifying the CODEBASE attribute to reflect the location of the ION class files ION Java User s Guide 65 66 Chapter 4 Using ION s Pre Built Applets The lt APPLET gt Tag The HTML lt APPLET gt tag is used to include Java applets in your HTML code For more information on embedding applets into a web page consult an HTML manual The syntax of the lt APPLET gt tag is as follows lt APPLET ALIGN left right top middle bottom ALT alternate text ARCHIVE zip or jar file CODE class file CODEBASE path or URL HEIGHT height HSPACE pixels NAME name VSPACE pixels WIDTH Wwidth gt lt APPLET gt Attributes The lt APPLET gt tag takes the following attributes ALIGN ALIGN specifies either the position of the applet in relation to the left and right borders of the browser or the alignment of text in relation to the applet ALT LEFT The applet is aligned with the left border of the browser RIGHT The applet is aligned with the right border of the browser TOP Text to the left and right of the applet is aligned with the top edge of the applet MIDDLE Text to the left and right of the applet is aligned with the vertical midpoint of the applet BOTTOM
202. re the same as those covered in getProperty on page 147 Refer to the IDL documentation on keywords available for use with the CONTOUR procedure for an explanation of each property Exceptions None setXValue The setX Value method resets the X value of the contour IONContour ONJContour Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 149 Syntax public void setX Value int X public void setX Value float X public void setX Value double X public void setX Value String sName Arguments X The new X value of the contour sName The name of an IDL variable that contains the new X value of the contour Exceptions None setYValue The setY Value method resets the Y value of the contour Syntax public void setY Value int Y public void setY Value float Y public void setY Value double Y public void setY Value String sName Arguments Y The new Y value of the contour sName The name of the IDL variable that contains the new Y value of the contour ION Java User s Guide IONContour ONJContour Class 150 Chapter 6 ION Java Class and Method Reference Exceptions None setZValue The setZValue method resets the Z value of the contour Syntax public void setZValue int Z public void setZValue float Z J public void setZValue double Z public void setZValue int Z D public void setZValue float Z public void setZValue dou
203. rence 171 lIONGraphicConnection Interface The I ONGraphicConnection interface defines the common functionality in the IONGrConnection and IONJGrConnection classes Interface Declaration public interface IONGraphicConnection Implementing Classes e JONGrConnection IONJGrConnection Class Methods e addDrawable Adds an IONGrDrawable class to this connection e debugMode Enables Disables debug mode e executeIDLCommand Executes a given IDL command on the ION Server Control is not returned until the command has been executed e getIDLVariable Gets the value of an IDL variable on the ION Server e removeDrawable Removes an IONGrDrawable class from this connection sendIDLCommand Sends an IDL command to the ION Server Control is returned as soon as the command has been sent e setDrawable Sets the current drawable e setIDLVariable Sets the value of an IDL variable on the ION Server See TONGrConnection ONJGrConnection Class on page 172 for information on these methods ION Java User s Guide IONGraphicConnection Interface 172 Chapter 6 ION Java Class and Method Reference lONGrConnection ONJGrConnection Class The I ONGrConnection class represents a connection between the client and the ION Server It allows for the addition of multiple I ONGrGraphic classes and has the primary function of acting as a communication module between the IONGrGraphic classes and
204. rface Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 229 keywords available for use with the SURFACE procedure for an explanation of each property Exceptions None setXValue The setX Value method resets the X value of the surface Syntax public void setX Value int X public void setX Value float X public void setX Value double X public void setX Value String sName Arguments X The new X value of the surface sName The name of the IDL variable that contains the new X value of the surface Exceptions None setYValue The setY Value method resets the Y value of the surface Syntax public void setY Value int Y public void setY Value float Y public void setY Value double Y ION Java User s Guide IONGrSurface Class 230 Chapter 6 ION Java Class and Method Reference public void setY Value String sName Arguments Y The new Y value of the surface sName The name of the IDL variable that contains the new Y value of the surface Exceptions None setZValue The setZValue method resets the Z value of the surface Syntax public void setZValue int Z D public void setZValue float Z public void setZValue double Z public void setZValue String sName Arguments Z The new Z value of the surface sName The name of the IDL variable that contains the new Z value of the surface Exceptions None lIONGrSurface Class ION Java Us
205. rguments None Exceptions None Example int num getNumIndices readimage Use the readImage method to read the contents of the current drawable Syntax readImage readImage int x0 int y0 int width int height Arguments x0 The x start position of the rectangle to read yO The y start position of the rectangle to read width The width of the rectangle to read height The height of the rectangle to read Exceptions None ION Java User s Guide IONGraphicsClient Class 168 Chapter 6 ION Java Class and Method Reference Example Image im readImage Image im readImage x0 y0 width height removelONDrawable The removelONDrawable method removes an object that implements the IONDrawable interface from the internal list of IONDrawable objects Syntax public IONDrawable removelONDrawable IONDrawable drawable public IONDrawable removeIONDrawable int index Return Value This method returns a reference to the removed IONDrawable object Arguments drawable The drawable to remove index The index of the drawable to remove Exceptions None setDecomposed The setDecomposed method sets an individual connection to the ION Server to use decomposed color mode The decomposed color mode setting determines how ION will display graphics on a True color 24 bit or 32 bit color device If the argument is true the default a pixel value is treated as an RGB triplet If the argument is
206. rojects an image onto a map projection This is used in conjunction with an IONGrMap All IDL 5 4 MAP_IMAGE keywords are accepted Class Declaration public class IONGrMapImage extends IONGrGraphic Methods e IONGrMapImage Constructs an object of the IONGrMapImage class e draw Calls the MAP_IMAGE procedure to project an image onto the current map projection e getProperty Retrieves the specified property e setImage Sets the image that will be projected It can either be in the form of a two dimensional array or the name of the IDL variable e setProperty Sets the value of the specified property e setStart Defines the coordinates of the lower left corner of the image IONGrMapImage The IONGrMapImage method constructs an object of the IONGrMapImage class Syntax public IONGrMapImage public IONGrMapImage byte image public IONGrMapImage int image public IONGrMapImage float image public IONGrMapImage double image public IONGrMapImage String image IONGrMapImage Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 215 Arguments image A two dimensional array containing the image to be overlaid on the map or a variable containing an array Exceptions None draw The draw method calls the MAP_IMAGE procedure to project an image onto the current map projection Syntax public void draw ONGraphicConnectio
207. rot lt 180 The default is 0 If the center of the map is at the North pole North is in the direction lon 180 If the origin is at the South pole North is in the direction lon Exceptions None draw The draw method displays the map projection in the drawing area for this object Syntax public void draw Arguments None Exceptions None getProperty The getProperty method retrieves the value of the specified property Syntax public final ION Variable getProperty String sName ION Java User s Guide IONMap IONJMap Class 234 Chapter 6 ION Java Class and Method Reference Arguments sName The name of the property to retrieve Properties Supported The following IDL map properties are supported by IONMap get set Property Refer to the IDL documentation on keywords available for use with the MAP_SET procedure for an explanation of each property Projection Types AITOFF ALBERS AZIMUTHAL CONIC CYLINDRICAL GNOMIC GOODESHOMOLOSINE HAMMER LAMBERT MERCATOR MILLER_CYLINDRICAL MOLLEWIDE ORTHOGRAPHIC ROBINSON SATELLITE SINUSOIDAL STEREOGRAPHIC TRANS VERSE_MERCATOR Map Characteristics ADVANCE CHARSIZE CLIP COLOR CONTINENTS CON_COLOR HIRES E_CONTINENTS E_GRID E_HORIZON GLINESTYLE GRID HORIZON LABEL LATALIGN LATDEL LATLAB LONDEL LONLAB MLINESTYLE NAME NOBORDER NOERASE REVERSE TITLE USA XMARGIN YMARGIN Projection Parameters CENTRAL_AZIMUTH ELLIPSOID ISOTROPIC LIMIT
208. rray with the same dimensions as the variable e getDimensionedShortArray Returns the short array value of the variable as an array with the same dimensions as the variable e getDouble Returns the double value of the variable e getDoubleArray Returns the double array value of the variable e getFloat Returns the float value of the variable e getFloatArray Returns the float array of the variable e getImaginary Returns the imaginary value of a complex variable e getInt Returns the int value of the variable e getIntArray Returns the int array of the variable e getShort Returns the short value of the variable e getShortArray Returns the short array value of the variable ION Java User s Guide lIONVariable Class 260 IONVariable Class Chapter 6 ION Java Class and Method Reference getString Returns the string value of the variable getStringArray Returns the string array value of the variable isArray Returns true of the variable is an array toString Returns a string that represents the variable value type Returns the type of the variable ION Java User s Guide Chapter 6 ION Java Class and Method Reference 261 IONVariable The IONVariable method constructs an object of the specified IDL data type The variable can be either a scalar or an array Syntax Scalars public ION VariableQ public IONVariable byte
209. rty method 200 IONGrGraphic method 196 IONGrMap class 58 draw method 203 getProperty method 204 IONGrMapQ 202 setProperty method 206 ION Java User s Guide IONGrMapContinents class 58 draw method 209 getProperty method 209 IONGrMapContinents method 208 setProperty method 210 IONGrMapContinents method 208 IONGrMapGrid class 58 draw method 211 getProperty method 212 IONGrMapGrid method 211 setProperty method 213 IONGrMapGrid method 211 IONGrMapImage class 58 215 217 draw method 215 getProperty method 215 IONGrMapImage class 214 setImage method 216 setProperty method 217 setStart method 217 IONGrMapImage method 214 IONGrPlot class 58 219 draw method 220 getProperty method 221 IONGrPlot method 219 setNoErase method 222 setProperty method 222 setX Value method 223 setY Value method 223 IONGrPlot method 219 IONGrSurface class 59 225 draw method 226 getProperty method 227 IONGrSurface method 225 setNoErase method 228 setProperty method 228 setX Value method 229 setY Value method 229 setZValue method 230 IONGrSurface method 225 IONJContour class 144 251 IONJContour method 144 ION Java User s Guide 301 IONJContour method 144 IONJMap class 231 IONJPlot class 245 IONMap class 57 draw method 233 getProperty method 233 setProperty method 235 IONMouseListener interface c
210. ry the CODE CODEBASE and ARCHIVE attributes would be CODE com rsi ion IONPlotApplet class CODEBASE classes ARCHIVE i0n_61 jar because the IONPlotApplet class file is located in the com rsi ion subdirectory within the ION jar file Similarly if you were to place all of the Java class files necessary for your applet in the directory containing your HTML files you could omit the CODEBASE attribute and use something like the following CODE MyApplet class The CODE attribute is required for all ION applets CODEBASE The CODEBASE attribute is not strictly required but is often useful The Java class loader searches for the contents of the classes directory in current directory that is the directory from which the HTML page containing the lt APPLET gt tag was loaded If you locate the HTML page somewhere other than the LONJava classes ION Java User s Guide The lt APPLET gt Tag 68 Chapter 4 Using ION s Pre Built Applets directory you will need to set the CODEBASE attribute to the relative path from the page location to the classes directory or to a URL that specifies the location For example if your HTML page is located in a directory called vsi IDL61 products ION61 ion_java html you would set the CODEBASE attribute as follows CODEBASE classes Noe If the CODEBASE attribute is set equal to a URL then the host specified by the URL can be used for ION network connection
211. s but the host that is serving the HTML page cannot This allows you to set up the ION Server and all of the ION class files on a machine separate from your web server provided you include the SERVER_NAME parameter with the same hostname as in the CODEBASE URL If you use this method both the CODEBASE and SERVER_NAME attributes must refer to the same machine or Java security errors will result In addition the ION Server machine will still need to run a web server but it will only be used to get the class or archive files for the applets HEIGHT The height of the applet in pixels ION uses the HEIGHT attribute when creating the drawing area This attribute is required for all ION applets HSPACE The amount of white space to the left and right of the applet in pixels NAME A string containing a unique name for the applet The string should be enclosed in double quotes marks This attribute is required for all ION applets WIDTH The width of the applet in pixels ION uses the WIDTH attribute when creating the drawing area This attribute is required for all ION applets VSPACE The amount of white space on the top and bottom of the applet in pixels Example The following lt APPLET gt tag creates an applet of the IONGraphicApplet class with a drawing area 100 pixels by 100 pixels with the name MyApplet The HTML The lt APPLET gt Tag ION Java User s Guide Chapter 4 Using ION s Pre Built Applets
212. s exception check the type of the data and call the correct method for that type Syntax public final int getIntArray Return Value The method returns the int array value of the variable Arguments None Exceptions IONNotAnArrayException Example try int i myVariable getIntArray catch IONNotAnArrayException e System err println Variable is not an array ION Java User s Guide IONVariable Class 276 Chapter 6 ION Java Class and Method Reference getShort The getShort method returns the short value of the variable If the value is not of type short IDL type int the scalar value is converted to a short Syntax public final short getShort Return Value The method returns the short value of the variable Arguments None Exceptions IONIsAnArrayException NumberFormatException Example try short s myVariable getShort catch IONIsAnArrayException e System err println Variable is an array catch NumberFormatException e System err printin String Cannot be converted getShortArray The getShortArray method returns the short array value of the variable If the value is not of type short java lang ClassCastException exception will be thrown To avoid this exception check the type of the data and call the correct method for that type Syntax public final short getShortArray IONVariable Class ION Java User s Guide Chapter 6 ION Java Cla
213. s also included in an include file or list excomm Set this switch to a comma separated list of IDL commands procedure or function names to add to the exclusion list This switch works in the same way as the exfile switch it is provided as a convenience Specifying a list of routines to exclude will not alter the list of routines rejected as a result of the setting of the security switch incomm Set this switch to a comma separated list of IDL commands procedure or function names to add to the inclusion list This switch works in the same way as the infile switch it is provided as a convenience Specifying a list of routines to include will not alter the list of routines rejected as a result of the setting of the security switch Noe If a routine is excluded either via an exclude file a list of excluded routines or via the security switch it will be rejected even if that routine is also included in an include file or list http Set this switch to start the ION HTTP Tunnel Broker when starting the ION Daemon See Configuring The ION HTTP Tunnel Broker on page 29 for details on the ION Tunnel Broker httplog Set this switch to the name of the file in which you wish to save informational messages from the ION Tunnel Broker If no logfile is specified messages will be written to the standard out Configuring ION Java for UNIX ION Java User s Guide Chapter 1 Configuring ION Java 23
214. s not currently part of the system Arguments ionGraphic A graphic to remove from the drawable Exceptions None Example removeGraphic ionGraphic resetMulti The resetMulti Q method resets the P multi system variable to 0 one plot at a time using the entire drawing area Syntax public void resetMulti IONGrDrawable ONJGrDrawable Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 193 Arguments None Exceptions None sendiIDLCommand The sendIDLCommand method asynchronously sends an IDL command to the ION Server for execution The IDL command is posted to the server for execution and the function immediately returns Notification of the commands completion is performed via the IONCommandDoneListener interface Control is returned to the application as soon as the command has been sent Syntax public void sendIDLCommand String s DLCommand Arguments sIDLCommand The IDL Command that is to be executed on the ION Server The use of the spawn command and the line continuation character is prohibited for security reasons and because they can hang the server Exceptions IOException setConnection The setConnection method associates this ONGrDrawable object with an IONGraphicConnection Syntax public void setConnection IONGraphicConnection ionConnection ION Java User s Guide IONGrDrawable ONJGrDrawable Class 194 Chapter 6 ION Java Class and Metho
215. s the Java event loop must not block during IDL command execution If the main event thread blocked and the IDL server requested a mouse location the client and the server would be in a deadlock condition To prevent a deadlock condition this class provides the sendI DLCommand method which sends the command to the server for execution and returns not waiting for the command to complete The class is informed of the commands completion status through the IONCommandDoneListener interface Class Declaration public class IONCallableClient Methods e TIONCallableClient Constructs an object of the IONCallableClient class e addIlIONCommandDoneListener Adds a command done listener to the client object e addIONDisconnectListener Adds a disconnect listener to the client object e addIONOutputListener Adds an output listener to the client object e connect Connects to the server e disconnect Shuts down the ION Server and disconnects e executeIDLCommand Executes an IDL command on the ION Server Control is not retuned until the command has been executed e getClientVersion Returns the current version of ION e getConnectionType Returns the type of connection in use e getIDLVariable Gets the value of an IDL variable on the ION Server e removeIONCommandDoneListener Removes a command done listener from the client object IONCallableClient Class I
216. ser s Guide Chapter 4 Using ION s Pre Built Applets 71 CONNECTION_TYPE Set the value of this parameter to specify what type of connection ION should use The three possible values are e HTTP_CON Make only HTTP connections using the ION HTTP Tunnel Broker e SOCK_CON Make only socket connections using only the ION Daemon e BEST_CON Attempt to make a socket connection If a socket connection is not possible attempt to make an HTTP connection This is the default setting See Configuring The ION HTTP Tunnel Broker on page 29 for additional details about HTTP connections CONNECTION_TIMEOUT Set the value of this parameter to an integer number of seconds to wait before assuming that a socket connection has failed If the CONNECTION_TYPE parameter is set to BEST_CON ION will attempt to make an HTTP connection if the timeout time expires before a socket connection is made HTTP_HOSTNAME Set the value of this parameter equal to the hostname of the computer on which the ION HTTP Tunnel Broker is running HTTP_PORT Set the value of this parameter equal to the port number the ION HTTP Tunnel Broker is listening to Example The following connects the MyApplet applet to a server named Server1 using the default port number the default connection type and specifies that the applet should not disconnect from the server when all commands have been processed
217. should or should not execute DION Properties Eg Control Locations Security Commands Broker About Security Files Exclusion List JESRSNIONTIexcudetd 0000 Edit Browse Inclusion Poo Browse Active Security Groups V Device lV Widgets I File Control File Output V OS Access M Linking N Fielnput M Data Formats Cancel Apply Use the Location Tab to define the path to text files containing the following items Attribute Description Exclusion List Contains a list of the commands ION should not execute Click the Edit button on either field to edit the text file See Security Command Files on page 32 for details on how the ION Daemon handles inclusion and exclusion lists and how they can be created Inclusion List Contains a list of the commands ION is allowed to execute Click the Edit button on either field to edit the text file See Security Command Files on page 32 for details on how the ION Daemon handles inclusion and exclusion lists and how they can be created Active Security Select options to disable entire classes of IDL functionality Groups See the table Active Security Group Tokens on page 24 for a description of the security tokens associated with this field Table 1 3 ION Java Properties Security Tab ION Java User s Guide Configuring ION Java for Windows 16 Chapter 1 Configuring ION Java The Commands Tab The Commands tab dial
218. specifying one of three connection types via the CONNECTION_TYPE parameter in an ION applet e HTTP_CON Make only HTTP connections using the The ION HTTP Tunnel Broker These connections are typically slower than SOCK_CON e SOCK_CON Make only socket connections using only the ION Daemon e BEST_CON Attempt to make a socket connection If a socket connection is not possible attempt to make an HTTP connection This is the default setting Since BEST_CON is the default you do not need to add the CONNECTION_TYPE parameter at all if you want your ION Server to accept either socket or HTTP connections See Parameters Specified via lt PARAM gt Tags on page 70 for details on other parameters related to the ION Tunnel Broker ION Java User s Guide Configuring The ION HTTP Tunnel Broker 30 Chapter 1 Configuring ION Java Starting the ION Tunnel Broker Daemon The ION Tunnel Broker Daemon must be running for ION to be able to use HTTP connections There are three ways to start the ION Tunnel Broker 1 On Windows systems by using the ION Java Properties dialog See the section The Broker Tab on page 17 for more information 2 By specifying the http switch to the iond command With this method both the ION Daemon and the ION Tunnel Broker are started at the same time You can also specify the httpport and httplog switches to specify ION Tunnel Broker options See Configuring ION Java for UNIX on pag
219. splay data on a map projection All MAP_SET keywords are accepted except GOODESHOMOLOSINE ROBINSON MILLER_CYLINDRICAL NAME and REVERSE Class Declaration public class IONGrMap extends IONGrGraphic Methods e TIONGrMap Constructs a new map centered at lat lon with rotation rot e draw Calls the MAP_SET procedure to draw the map projection e getProperty Retrieves the specified property e setLat setLon Sets the lat lon on which to center the projection e setProperty Sets the value of the specified property e setRotation Sets the rotation of the map projection IONGrMap Constructs a new map centered at lat lon with rotation rot Syntax public IONGrMap public IONGrMap int lat public IONGrMap float lat public IONGrMap double lat public IONGrMap int lat int lon public IONGrMap float lat float lon public IONGrMap double lat double Jon IONGrMap Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 203 public IONGrMap int lat int lon int rot public IONGrMap float lat float lon float rot public IONGrMap double lat double lon double rot public IONGrMap String sLat public IONGrMap String sZat String sLon public IONGrMap String sZat String sLon String sRot Arguments lat The latitude of the point on the Earth s surface to be mapped to the center of the projection plane Latitude is measured in d
220. ss 140 IONDComplex class 152 ION Java User s Guide 297 FONT keyword ION device 89 fonts available 90 fonts specifying 89 G GET_CURRENT_FONT keyword ION de vice 90 GET_FONTNAMES keyword ION device 90 GET_GRAPHICS_FUNCTION keyword ION device 90 GET_SCREEN_SIZE keyword ION device 90 getByte method 263 getByteArray method 263 getClientVersion method 126 getComplexArray method 264 getConnection method 191 getConnectionType method 126 getCurrentIndex method 165 getDComplexArray method 265 getDImaginary method IONComplex class 141 IONDComplex class 153 IONVariable class 266 getDimensionedByteArray method IONVa riable class 266 getDouble method 270 getDoubleArray method 271 getDownButtons method 134 getFloat method 271 getFloatArray method 273 getGraphics method 135 159 243 getIDLVariable method 127 getImage method 135 159 243 getImaginary method IONComplex class 141 IONDComplex class 153 IONVariable class 273 getInt method 274 Index 298 getIntArray method 275 getlONDrawableIndices method 166 getMousePos method 136 getNumIndices method 166 getProperty method 215 IONContour class 147 IONGrContour class 181 IONGrGraphic class 197 IONGrPlot class 221 IONGrSurface class 227 IONMap class 233 IONPlot class 247 IONSurface class 253 getPropertyNames method 198 getPropertyString method 198 get
221. ss and Method Reference 277 Return Value The method returns the short array value of the variable Arguments None Exceptions IONNotAnArrayException Example try short s myVariable getShortArray catch IONNotAnArrayException e System err println Variable is not an array getString The getString method returns the string value of the variable If the value is not of type string the scalar value is converted to a string Syntax public final String getString Return Value The method returns the string value of the variable Arguments None Exceptions IONIsAnArrayException Example try String st myVariable getString ION Java User s Guide IONVariable Class 278 Chapter 6 ION Java Class and Method Reference catch IONISAnArrayException e System err println Variable is an array getStringArray The getStringArray method returns the string array value of the variable If the value is not of type string java lang ClassCastException exception will be thrown To avoid this exception check the type of the data and call the correct method for that type Syntax public final String getStringArray Return Value The method returns the string array value of the variable Arguments None Exceptions IONNotAnArrayException Example try String st myVariable getStringArray catch IONNotAnArrayException e System err printin Variable is not an array
222. t method 163 copyArea method 165 getCurrentIndex method 165 getIONDrawableIndices method 166 getNumIndices method 166 IONGraphicsClient method 162 removeIONDrawable method 168 setDecomposed method 168 setIONDrawable method 169 IONGraphicsClient method 162 IONGrConnection class 57 171 172 addDrawable method 173 debugMode method 174 executeIDLCommand method 175 IONGrConnection method 173 removeDrawable method 176 sendIDLCommand method 177 setDrawable method 177 Index IONGrConnection class 57 171 172 contin ued setY Value method 185 IONGrConnection method 173 IONGrContour class 58 179 draw method 181 getProperty method 181 IONGrContour method 179 setNoErase method 183 setProperty method 182 setX Value method 183 setZValue method 185 IONGrContour method 179 IONGrDrawable class 57 187 addGraphic method 188 debugMode method 189 draw method 190 executeIDLCommand method 190 getConnection method 191 IONGrDrawable method 188 isConnected method 191 removeGraphic method 192 resetMulti method 192 sendIDLCommand method 193 setMulti method 194 setNoErase method 194 IONGrDrawable method 188 IONGrGraphic class 58 196 getProperty method 197 getPropertyNames method 198 getPropertyString method 198 IONGrGraphic method 196 197 registerProperty method 199 setNoErase method 200 setPrope
223. t APPLET NAME AnotherApplet WIDTH 100 HEIGHT 100 CODE com rsi ion IONGraphicApplet class ARCHIVE ion_61 zip CODEBASE classes gt lt PARAM NAME ION_CONNECTION_NAME VALUE MyApplet gt lt Other applet cod gt lt APPLET gt Behavior Parameters Two behavior parameters determine how an applet responds to certain user actions The two behaviors currently supported by all ION applets allow the applets to display debug information and link to other HTML pages Use the following parameters to alter the behavior of pre built applets DEBUG_MODE If the value of this parameter is set to YES holding down the shift key and clicking the mouse in the applet drawing area displays a window containing the IDL commands and server responses associated with the applet s connection If more than Parameters Specified via lt PARAM gt Tags ION Java User s Guide Chapter 4 Using ION s Pre Built Applets 73 one applet is connected to the connection the information for all applets is displayed If the main connection has DEBUG_MODE set to NO or not specified but an applet connected to it has DEBUG_MODE turned on debug will be turned on for the entire connection The default value is NO LINK_URL Set the value of this parameter to a URL that will be loaded if the user clicks in the applet area The switch to the linked URL happens before any mouse events are passed to the server This option should not be used with
224. t ION Java application development Familiarity with Web Server Administration Even if you do not maintain the World Wide Web server at your site you should be aware of the configuration details You will need to know where files should be located for server access what file permissions are necessary and any other site specific details that apply to publishing HTML pages on the World Wide Web JAVA Programming Knowledge If you wish to build your own applications or applets you will need to be familiar with Java programming concepts You will also need to know how applets are embedded in HTML pages What is ION Java ION Java User s Guide Chapter 2 Overview 37 Understanding of IDL ION is designed to interact with IDL To use ION you will need to be familiar with IDL s basic command syntax and features ION Java User s Guide What is ION Java 38 Chapter 2 Overview ION Java Architecture The components that make up ION Java are illustrated in Figure 2 1 Applet Component Core Classes Classes Classes lt D ION Applet CLIENT FIREWALL pe a oe ION SERVER aoe INITIAL ie IDL Server Client Figure 2 1 ION Java Architecture ION Server The ION Server is a program that manages communication between an ION client application either a Java Applet running in a Web browser or a stand alone Java app
225. t of an IDL Direct Graphics driver This includes the creation deletion showing hiding and iconization of windows on the client IONDrawable This interface defines the methods that an object must implement to act as an ION drawable object An ION drawable is an object that can be drawn to by an IONGraphicsClient This interface is implemented as either an ONCanvas or IONOffScreen object ION Java User s Guide The ION Java Class Hierarchy 56 Chapter 3 Overview of the ION Java Classes IONCanvas ONJCanvas These classes represents a visible drawing area upon which graphics can be displayed They implement the ION Drawable interface lIONOffScreen This class represents an undisplayed drawing area on which graphic output can be placed This implements the ION Drawable interface lONCommandDoneListener This interface defines the methods a class must implement to register and to receive notification that an IDL command has completed l1ONMouseListener deprecated This interface defines the callback methods that a class must define to be notified of mouse events occurring on an object that implements the ONDrawable interface This interface is deprecated in ION 6 1 It is recommended that you use the more robust Java MouseListener and or the Java MouseMotionListener lONOutputListener This interface defines the methods that a class must implement to receive ION Server output text IONVariable This class is a client
226. te The following is the syntax for the IONPlot method For the IONJPlot method replace IONPlot with IONJPlot public IONPlot int iWidth int iHeight ION Java User s Guide IONPlot IONJPlot Class 246 Chapter 6 ION Java Class and Method Reference public IONPlot int iWidth int iHeight int X public IONPlot int iWidth int iHeight float X public IONPlot int iWidth int iHeight double X public IONPlot int iWidth int iHeight String sName public IONPlot int iWidth int iHeight int X int Y public IONPlot int iWidth int iHeight float X float Y public IONPlot int iWidth int iHeight double X double Y public IONPlot int iWidth int iHeight String sxName String sYName Arguments iWidth The width of the plot iHeight The height of the plot X The X values of the plot Y The Y values of the plot sXName The name of an IDL variable to use for the X values of this plot sYName The name of an IDL variable to use for the Y values of this plot Exceptions None IONPlot IONJPlot Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 247 draw The draw method produces and displays a graphic in the drawing area that makes up this object Syntax public void draw Arguments None Exceptions None getProperty The getProperty method retrieves the current value of the specified property Syntax public final ION Variable getProperty String sNa
227. teIDLCommand SHADE_SURF a AZ rotation ION Java User s Guide Considerations Specific to ION Applets 112 Chapter 5 Building ION Applets and Applications end sub lt SCRIPT gt lt HEAD gt lt BODY gt lt Create an IONGraphicAppl t applet named SURFAPP that generates some data and creates a shaded surface Note that the CODEBASE attribute is set to classes This is the proper path for the example as installed with the ION documentation files gt lt APPLET NAME SURFAPP CODE com rsi ion IONGraphicApplet class CODEBASE PA a classes WIDTH 200 HEIGHT 200 gt PA PA Pa 2 E DECOMPOSED_COL E DEBUG_MODE VALUE YES gt E SERVER_DISCONNECT VALUE NO gt OR VALUE NO gt lt lt lt lt PA z E IDL_COMMAND_0 UE a EXP SHI E IDL_COMMAND_1 E IDL_ COMMAND 2 lt LA prpprpep lt PARA lt PARA lt APPLET p z z S v FT DIST 30 15 15 7 2 gt VALUE LOADCT 5 gt VALUE SHADE_SURF a gt lt VBScript input controls must be contained in an HTML form gt lt FORM NAME command_form gt lt BR gt lt Create the pulldown menu of rotation values gt lt SELECT NAME rot_value SI lt OPTION VALUE 15 gt 15 lt OPTION VALUE
228. the ION Server Class Declaration public class IONGrConnection extends IONGraphicsClient implements IONGraphicConnection TONCommandDoneListener TONOutputListener public class IONJGrConnection extends IONGraphicsClient implements IONGraphicConnection TONCommandDoneListener TONOutputListener Methods e TIONGrConnection Constructs an object of the I ONGrConnection class e addDrawable Adds an IONGrDrawable class to this connection e connect Connects with an ION Server e debugMode Enables Disables debug mode e disconnect Disconnects with an ION Server e executeIDLCommand Executes a given IDL command on the ION Server Control is not returned until the command has been executed e getIDLVariable Gets the value of an IDL variable on the ION Server e removeDrawable Removes an IONGrDrawable class from this connection e sendIDLCommand Sends an IDL command to the ION Server Control is returned as soon as the command has been sent IONGrConnection ONJGrConnection Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 173 e setDrawable Sets the current drawable e setIDLVariable Sets the value of an IDL variable on the ION Server lIONGrConnection The IONGrConnection method constructs an object of the I ONGrConnection class Syntax public IONGrConnection Arguments None Example TONGrConnection con new IONG
229. the ION Server If you do not include the security switch when starting the ION Daemon the following default tokens are set fileio os linking device df If you include the security switch when starting the ION Daemon only the tokens you specify are set See the discussion of the infile exfile incomm and excomm switches for further information on specifying which IDL commands will be accepted by daemon ION Java User s Guide Configuring ION Java for UNIX 24 Chapter 1 Configuring ION Java The security switch accepts the following tokens In the lists below the asterisk is used to represent all IDL routines of a given type Token Description df Disables all Scientific Data Format routines CDF_ EOS_ HDF_ NCDF_ device Disables changing devices using the SET_PLOT routine filein Disables file input operations by disallowing use of the following routines GET_KBRD OPENR READ READF READU READ_ fileout fileio Disables file output operations by disallowing use of the following routines OPENW PRINTF WRITEU WRITE_ Disables file input and output operations by disallowing use of the following routines ASSOC CLOSE EOF FILEPATH FLUSH FSTAT GET_LUN IOCTL OPENU POINT_LUN linking Disables calls from IDL to external code by disallowing use of the following routines CALL_EXTERNAL LINKIMAGE none No security checking is provided os
230. the class path has the added benefit of simulating the same environment that your clients will experience when running your application from your browser This method does not rely on having a system environment variable Compiling java Files ION Java User s Guide Chapter 5 Building ION Applets and Applications 95 pointing to the ION classes directory something your clients are unlikely to have defined Setting the Class Path Environment Variable To define the CLASSPATH environment variable you would set it using the following shell command on UNIX setenv CLASSPATH usr local rsi ion_6 1 ion_java classes or modify the class path environment variable in the System Environment dialog on Windows The Java compiler will add the com rsi ion portion of the path when it looks for the package Once the CLASSPATH is set you can compile your code with a shell command like the following javac myIONApp java where my IONApp is the name of your applet or application Warning If you are running the client and the server on the same machine setting the system CLASSPATH environment variable can result in errors similar to the following appearing in your browser s Java console Netscape Java Console Applet exception error java lang ClassFormatError class already loaded IE Java Console Error getting package information com rsi ion To avoid such errors specify the class path when compiling as describe
231. thod called repaint repaint then would call our paint method now deleted from this file The paint method was responsible for connecting However in some cases our paint method would not be called and the applet would not get its data from the server We are now guaranteed that we will connect to the IONJ server because start will always be called when the applet starts public void start if c_bConnected 0 Not connected to ION do so connectToServer FF FF FF F F F HF KF OF Considerations Specific to ION Applets ION Java User s Guide Chapter 5 Building ION Applets and Applications 105 KKK KKK KK KKK KKK KKK KKK KEK KKK KKK KEK KKK KKK KKK KK KKK KKK KK stop Purpose x Override the applet s stop method This method i Is called when the page is not being viewed W a disconnect from the server when this is the case f public void stop if c_bConnected 1 c_ionCon removelONDisconnectListener this c_ionCon disconnect c_bConnected 0 KKK KK KKK KKK KKK KKK KKK KKK KKK KKK KKK KKK KKK KKK KK KKK KK connectToServer Purpose Connects to the ION server providing feedback to user z7 private void connectToServer Write Status message writeMessage Connecting to ION Java Server Connect to the server try c_ionCon connect this getCodeBase getHost catch UnknownHostException eUn
232. to the client result COLOR_QUAN image 1 r g b Load the color table TVLCT xr g b Lastly TV the image TV result The image is then displayed in the current ION Java drawable Noe For a similar but slightly more complex version of this example click the Object Graphics link on the page advanced htm1 The Java source code resides in objgraphics java in the IDL61 products ION61 ion_java examples src directory The IDL create_surface pro in the examples directory contains a draw_buffer procedure that illustrates the coding routine shown above Using Object References When we initially create an object we get back a reference to that object Since the IDL session is persistent in ION Java we can use object references later in event callbacks for the applet It is not necessary to create Java variables for persistence because the object continues to exist in the persistent IDL session For instance you could add a button to our Hello World applet to rotate the text In the event callback for the button you would call the rotate method on the model object whose reference you obtained initially Then you would use the buffer technique to redraw the view ION Java User s Guide Object Graphics in ION 94 Chapter 5 Building ION Applets and Applications Compiling java Files Keep the following points in mind when you compile the java file that contains your applet or application code Setting the Class Path
233. top button 3 Remove the ION Service by selecting the Remove button After removing the previous ION service uninstall your previous ION version On UNIX 1 At the shell prompt change to the previous ION installation directory RSI DIR ion ion_java bin where RSI DIR is the directory where you have installed your outdated ION version 2 Enter iondown to stop the ION daemon After removing the previous ION service uninstall your previous ION version by deleting the directory tree Check the CLASSPATH Variable If you have configured a system variable for CLASSPATH make sure it is not referencing your previous ION version See Setting the Class Path on page 94 for more information Check the ION Version From within an application you can see which version of ION your application is using by adding a call to the getClientVersion method of the IONCallableClient Class on page 120 Make sure the resulting string value indicating the current version of ION is ION 6 1 ION Java User s Guide Chapter 7 Troubleshooting 287 Checking Web Server Communication Make sure you are able to communicate with the Web Server For example using the Apache Web server you can enter a URL such as http localhost or http hostname where hostname is the hostname or Windows machine name of your computer If your Web server is properly configured you should receive a page stating that the Apache Web server has been success
234. tor to see if your site supports the SOCKS proxy If the SOCKS proxy is available input the correct information Troubleshooting Applets that Fail to Display When an applet fails to display first make sure the ION Service is started See Checking Web Server Communication on page 287 If you are on a slow connection modem you may need to wait for all of ION Java s class files to be downloaded to your browser These Java class files are required by ION Java for proper operation If neither of these issues seem to be the problem check the following sections for additional possibilities Enable Java in Your Browser Most web browsers include a setting that enables the use of Java applets in HTML pages Make sure your browser is configured to allow Java to load by completing the following steps for your browser Enable Java in Netscape Navigator 1 In the browser select Edit gt Preferences ION Java User s Guide Chapter 7 Troubleshooting 289 2 Click on Advanced and make sure the Enable Java check box is selected Enable Java in Internet Explorer 1 In the browser select Tools gt Internet Options 2 Select the Advanced tab 3 At the bottom of the scroll window make sure JIT compiler for virtual machine enabled is selected Restart the Browser If an ION applet fails to load as expected even though you are using the correct CODEBASE you might need to shut down and restart the browser
235. tup script before starting the ION Daemon For more information see Define ION Environment Variables and Aliases in the Installing and Licensing IDL 6 1 manual The following command line parameters are accepted by the ION Daemon exfile Set this switch to the name of a file that contains a list of IDL commands procedure or function names that the server should not accept Any command that attempts to execute one of the listed routines will be rejected The file should contain one routine name on each line Blank lines and lines that begin with the character are ignored Specifying an exclude file will not alter the list of routines rejected as a result of the setting of the security switch infile Set this switch to the name of a file that contains a list of IDL commands procedure or function names that the server should accept Any command that attempts to execute a routine that is not in the list will be rejected The file should contain one ION Java User s Guide Configuring ION Java for UNIX 22 Chapter 1 Configuring ION Java routine name on each line Blank lines and lines that begin with the character are ignored Specifying an include file will not alter the list of routines rejected as a result of the setting of the security switch Noe If a routine is excluded either via an exclude file a list of excluded routines or via the security switch it will be rejected even if that routine i
236. uates to a vector of Y data plot_property_7 plot_property_n Here plot_property_ is the name of a plot property supported by the IONGrPlot class Properties for the IONPlotApplet reflect the capabilities implemented in keywords to the IDL PLOT procedure The syntax above refers to the fact that you can supply more than one plot property to the applet via the lt PARAM gt tag In the example in the next section both TITLE and LINESTYLE are plot properties with values of Plot and 2 respectively The following IDL Plot properties are supported by IONPlotApplet Refer to the IDL documentation on keywords available for use with the PLOT procedure for an explanation of each property BACKGROUND CHARSIZE CLIP COLOR DATA DEVICE FONT LINESTYLE NOCLIP NODATA NOERASE NORMAL POSITION PSYM IONPlotApplet ION Java User s Guide Chapter 4 Using ION s Pre Built Applets 83 SUBTITLE SYMSIZE T3D TICKLEN TITLE MAX_VALUE MIN_VALUE NSUM POLAR XLOG YNOZERO YLOG ZLOG Example The following example creates an IONPlotApplet that connects to the same server used by the Connection applet defined in the IONGraphicApplet example The applet generates some data for the X value of the plot and sets the Title and Linestyle properties of the plot lt APPLET NAME PLOT CODE IONPlotApplet class WIDTH 200 HEIGHT 200 ARCHIVE ion_61 zip CODEBASE classes gt lt This applet us
237. upported The following IDL Surface properties are supported by IONSurface get set Property Refer to the IDL documentation on keywords available for use with the SURFACE procedure for an explanation of each property AX AZ BACKGROUND BOTTOM CHARSIZE CLIP COLOR DATA DEVICE FONT HORIZONTAL IMAGE LEGO LINESTYLE LOWER_ONLY MAX_VALUE MIN_VALUE NOCLIP NODATA NOERASE NORMAL PIXELS POSITION SAVE SHADES SKIRT SUBTITLE T3D TICKLEN TITLE UPPER_ONLY XLOG YLOG ZLOG XCHARSIZE Y CHARSIZE ZCHARSIZE XGRIDSTYLE YGRIDSTYLE ZGRIDSTYLE XMARGIN Y MARGIN ZMARGIN XMINOR YMINOR ZMINOR XRANGE YRANGE ZRANGE XSTYLE YSTYLE ZSTYLE XTICKFORMAT Y TICKFORMAT ZTICKFORMAT XTICKINTERVAL Y TICKINTERVAL ZTICKINTERVAL XTICKLAYOUT YTICKLAY OUT ZTICKLAYOUT XTICKLEN YTICKLEN ZTICKLEN XTICKNAME YTICKNAME ZTICKNAME XTICKS YTICKS ZTICKS XTICKUNITS YTICKUNITS ZTICKUNITS XTICKV YTICKV ZTICKV XTICK_GET YTICK_GET ZTICK_GET XTITLE YTITLE ZTITLE ZAXIS ZVALUE Exceptions None Example IONVariable value getProperty Property setNoErase The setNoErase method of the I ONSurface class overrides setNoErase in the IONGrDrawable class The setNoErase method of the IONJSurface class overrides lIONSurface ONJSurface Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 255 setNoErase in the IONJGrDrawable class See setNoErase on page 194 for the syntax of this method setProperty Th
238. ur Web server s java files directory if you completed the ION Java Web Server Configuration dialog For example using the Apache Web server on Windows the Web_Server directory might be similar to c Program Files Apache Group Apache htdocs ION s Java class files are provided in three formats 1 The raw Java class files are located in the com rsi ion subdirectory of the classes directory 2 A ZIP file named ion_61 zip This contains compressed versions of all the classes This file is installed in the classes directory and is also copied to your Web_Server IONJava classes directory 3 A Java archive JAR file named ion_61 jar This file contains uncompressed version of the ION class files This file is installed in the classes directory an is also copied to your Web_Server IONJava classes directory If you decide to create your own directory for the ION Java classes you will need to copy the classes directory files specified in the section Manually Configuring Your Web Server on page 27 to the new directory Copying the com directory and subdirectories to your new directory is optional For more on the ION Java class files see Supporting Java Archive Files on page 101 ION Java User s Guide Where to Place HTML and Class Files 52 Chapter 2 Overview Where to Place HTML and Class Files ION Java User s Guide Chapter 3 Overview of the ION Java Classes This chapter provides a high level overview of the
239. uring ION Java for Windows on page 11 All utilities and command line programs discussed in this chapter are located in the following platform directory e Windows RSI DIR IDL61 products ION61 ion_java bin e UNIX RSI DIR ion_6 1 ion_java bin where RSI DIR is the directory in which you installed ION Starting and Configuring the ION Daemon ION Java User s Guide Chapter 1 Configuring ION Java 11 Configuring ION Java for Windows ION Java for Windows includes two dialog based utilities that duplicate the functionality of the command line utilities discussed in Starting the ION Daemon on UNIX on page 21 The ION Java Properties utility presents a tabbed dialog that allows you to start configure and control ION Daemon settings For more information see the following section The ION Java Properties Dialog The ION Java Status utility allows you to check the status of the ION Daemon or the Tunnel Broker For more information see Checking Status with the ION Java Status Utility on page 18 The ION Java Properties Dialog To configure ION Java for Windows perform the following steps 1 Access the ION Java Properties utility from the Start menu by selecting Programs Research Systems ION 6 1 ION Java Properties This program wionprop exe is located in the bin directory of your ION Java installation Modify the desired settings on each of the tabs described in the following sections e See Th
240. uses the applet CONNECTION to connect to the server gt lt PARAM NAME ION_CONNECTION_NAME VALUE CONNECTION gt lt PARAM NAME LINK_URL VALUE Surfaceappletsrc html gt lt PARAM NAME Z_VALUES VALUE exp shift dist 30 15 15 fT 72 gt lt PARAM NAME TITLE VALUE Surface gt lt PARAM NAME LEGO VALUE 1 gt lt APPLET gt ION Java User s Guide lIONSurfaceApplet 86 lIONSurfaceApplet Chapter 4 Using ION s Pre Built Applets ION Java User s Guide Chapter 5 Building ION Applets and Applications This chapter discusses the process of building your own ION Java applets and standalone Java applications Details on the ION Java classes used to build ION applets and applications can be found in Chapter 3 Overview of the ION Java Classes and Chapter 6 ION Java Class and Method Reference The following topics are discussed Direct Graphics in ION Object Graphics in ION Compiling java Files Error Handling and ION Exceptions Debug Mode Converting Between IDL and Java Bytes Considerations Specific to ION Applets ION Java User s Guide 87 88 Chapter 5 Building ION Applets and Applications Direct Graphics in ION The ION Device IDL uses the concept of a current graphics device when creating and displaying IDL Direct Graphics When the ION Server requests graphics from IDL it automatically sets the curr
241. va Class Hierarchy ION Java User s Guide Chapter 3 Overview of the ION Java Classes 55 Note In Figure 3 1 classes that contain Component represent Contour Map Plot and Surface For example IONComponent represents the ONContour IONMap IONPlot and IONSurface classes ION Low Level Classes The ION low level classes are the most basic building blocks of ION applications The ION low level classes are the only classes required to build ION applications that contain IDL data and graphics output All other ION Java classes are built on top of these low level classes The ION low level classes provide a degree of control not available with the ION Graphics Component classes but require more sophisticated Java and IDL programming skills Each of the ION low level classes is described below IONCallableClient IONCallableClient provides mechanisms to handle communication with the server execution of IDL commands retrieving IDL command log output and the getting and setting of IDL variables on the ION Server ONCallableClient is the only class required to write a non graphical ION application lONGraphicsClient This class provides mechanisms to handle the processing of graphic primitive data sent from the ION Server Information sent by the server is read by mechanisms provided by the parent class IONCallableClient IONWindowingClient This class provides mechanisms to handle the processing of the windowing commands that are par
242. va User s Guide IONGrConnection ONJGrConnection Class 176 Chapter 6 ION Java Class and Method Reference getIDLVariable See getIDLVariable on page 127 removeDrawable The removeDrawable method removes a graphic from the connection object Once the graphic has been removed from the connection object the graphic can no longer communicate with the ION Server Syntax public IONDrawable removeDrawableIONGrDrawable ionGraphic public IONDrawable removeDrawableIONJGrDrawable ionGraphic public IONDrawable removeDrawable int iGraphic Return Value This method returns a reference to the removed IONGrDrawable object Arguments ionGraphic An object of the IONGrDrawable class that is being removed from the connection iGraphic A zero based integer index designating which IONGrDrawable object to remove from the connection the IDL window index Exceptions None Example TONGrDrawable draw con removeDrawable iongraphic IONGrDrawable draw con removeDrawable 1 IONGrConnection ONJGrConnection Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 177 sendiIDLCommand The sendIDLCommand method asynchronously sends an IDL command to the ION Server Control is returned to the application as soon as the command has been sent Syntax public void sendIDLCommand String s1DLCommand throws IO Exception Arguments sIDLCommand A string containing a valid IDL command Except
243. value of the specified property Syntax public IONVariable getProperty String Property Arguments Property The name of the property Return Value The function returns the current value of a property Properties Supported The following IDL Plot properties are supported by IONGrPlot get set Property Refer to the IDL documentation on keywords available for use with the PLOT procedure for an explanation of each property BACKGROUND CHARSIZE CLIP COLOR DATA DEVICE FONT ISOTROPIC LINESTYLE MAX_VALUE MIN_VALUE NOCLIP NODATA NOERASE NORMAL NSUM POLAR POSITION PSYM SUBTITLE SYMSIZE T3D TICKLEN TITLE XCHARSIZE YCHARSIZE ZCHARSIZE XGRIDSTYLE YGRIDSTYLE ZGRIDSTYLE XLOG XMARGIN Y MARGIN ZMARGIN XMINOR YMINOR ZMINOR XRANGE YRANGE ZRANGE XSTYLE YSTYLE ZSTYLE XTICKFORMAT Y TICKFORMAT ZTICKFORMAT XTICKINTERVAL Y TICKINTERVAL ZTICKINTERVAL XTICKLAYOUT YTICKLAY OUT ZTICKLAY OUT XTICKLEN YTICKLEN ZTICKLEN XTICKNAME YTICKNAME ZTICKNAME XTICKS YTICKS ZTICKS XTICKUNITS YTICKUNITS ZTICKUNITS XTICKV YTICKV ZTICKV XTICK_GET YTICK_GET ZTICK_GET XTITLE YTITLE ZTITLE YLOG YNOZERO ZVALUE ION Java User s Guide IONGrPlot Class 222 Chapter 6 ION Java Class and Method Reference Exceptions None Examples IONVariable value getProperty Property setNoErase The setNoErase method of the IONGrPlot class overrides setNoErase in the IONGrGraphic class See setNoErase on page 200 for the syntax of t
244. values of the surface X An array holding the values for the X coordinates of the grid Y An array holding the values for the Y coordinates of the grid sXName The name of the IDL variable holding the values for the X coordinates of the grid sYName The name of the IDL variable holding the values for the Y coordinates of the grid Exceptions None IONGrContour Class ION Java User s Guide Chapter 6 ION Java Class and Method Reference 181 draw Call the draw method to produce and display a graphic in the drawing area that makes up this object Syntax public void drawWONGrConnection grConn Arguments grConn IONGrConnection used to issue the drawing commands to the server Exceptions None getProperty The getProperty method retrieves the current value of a property Syntax public ION Variable getProperty String Property Arguments Property The name of the property Return Value The function returns the current value of a property Properties Supported The following IDL Contour properties are supported by IONGrContour get set Property Refer to the IDL documentation on keywords available for use with the CONTOUR procedure for an explanation of each property ION Java User s Guide IONGrContour Class 182 Chapter 6 ION Java Class and Method Reference BACKGROUND CELL_FILL CHARSIZE CLIP CLOSED COLOR C_ANNOTATION C_CHARSIZE C_COLORS C_LABELS C_LINESTYLE C_ORIENTATION C_SPACING DATA
245. w Y value of the surface Exceptions None setZValue The setZValue method resets the Z value of the surface Syntax public void setZValue int Z D public void setZValue float Z public void setZValue double Z public void setZValue String sName Arguments Z The new Z value of the surface sName The name of the IDL variable that contains the new Z value of the surface Exceptions None ION Java User s Guide lIONSurface ONJSurface Class 258 Chapter 6 ION Java Class and Method Reference lONVariable Class Objects of the ION Variable class provide a client side representation of an IDL variable ONVariable objects are used to read and write data between the IDL server and clients Noe IDL and Java both have a basic byte data type however IDL s byte is unsigned and Java s is signed Java does not support the concept of unsigned types When a byte in Java is cast to an integer the sign is preserved via sign extension This can cause problems when transferring byte data between IDL and Java For information on how to properly convert an IDL byte to a Java byte see Converting Between IDL and Java Bytes on page 98 Class Declaration public class IONVariable extends Object Constants The following constants are used to identify data types Type Description TYPE_UNDEFINED Variable is of IDL type undefined TYPE_BYTE Variable is of IDL ty
246. wser and enter the following URL http hostname IONJava index html where hostname is your qualified domain name or machine name This loads a page containing ION Java basic and advanced applet links as well as a link to Research System s ION web site 3 For a simple example select the Basic ION Java Applets link and choose Simple Plot Click View Source Code to see the code required for this applet The ION Java examples provide many samples of Web based Java applications The examples have been divided into three levels e Basic ION Java Applets illustrate simple ION Java concepts that are necessary to understand before building your own applets You can examine the source code of each basic example to better understand the implementation of simple concepts Three categories of basic ION Java examples include pre built applets component classes and low level classes e Advanced ION Java Applets illustrate advanced programming concepts in ION Java You can examine the source code and even use the applets as building blocks for your own applets Three categories of basic ION Java examples include pre built applets component classes and low level classes e ION Online Demos display interactive ION Java web applications A link is provided to Research System s ION site where you can view applications that exemplify the power of ION Java When you are ready to develop your own applications see the following s
247. wsers support the JAR format Browser Support of ION Class Library Versions To support the different methods used by different browsers to download Java class files ION provides three separate versions of the ION class library These are 1 The raw Java class files are contained in the com rsi ion directory structure within the classes directory of the ION distribution Each file is downloaded to the browser via a separate connection to the server Use raw Java class files with browsers that don t support the ARCHIVE attribute to the APPLET tag For example Version 3 of Microsoft s Internet Explorer does not support the ARCHIVE attribute Note To use this method you must copy the com directory and all its subdirectories to your Web server since the raw Java class files are not copied to your Web server during ION installation ION Java User s Guide Considerations Specific to ION Applets 102 Chapter 5 Building ION Applets and Applications 2 Ancompressed file named ion_61 zip contains all of the Java class files included in the ION package This ZIP file is located in the classes directory of the ION distribution and can be downloaded via a single connection to the server Use the ZIP file with browsers that support the ARCHIVE attribute and support compressed archive files For example version 4 of Netscape s Navigator supports the ARCHIVE attribute and compressed JAR files 3 An uncompressed Java Archive JAR file n
248. xvar longValue toString The toString method returns the real portion of the complex number as a string value Syntax public final String toString Arguments None Exceptions None Example String s complexvar toString ION Java User s Guide IONComplex Class 144 Chapter 6 ION Java Class and Method Reference lONContour ONJContour Class The IONContour class extends the IONGrDrawable class and contains an IONGrContour object to provide an easy way of drawing IDL contours It can be inserted into an AWT tree The IONJContour class extends the IONJGrDrawable class and contains an IONGrContour object It can be inserted into a Swing component tree Class Declaration public class IONContour extends IONGrDrawable public class IONJContour extends IONJGrDrawable Methods IONContour IONJContour Constructs an object of the IONContour IONJContour class draw Produces and displays the graphic on the drawing surface of this class getProperty Gets the value of a property setNoErase Specifies whether the object should be erased when another object is drawn setProperty Sets a property for the graphic setX Value Sets the X value of the contour setY Value Sets the Y value of the contour setZ Value Sets the Z data of the contour lONContour ONJContour The IONContour method constructs an object of the I ONContour class The IONJCo
249. yntax public int executeI DLCommand String sCommand Return Value The function returns 0 if the IDL command executed successfully or the value of the IDL system variable ERROR if the IDL command did not execute successfully Arguments sCommand The IDL Command that is to be executed on the IDL server The use of the IDL command to open a shell or command window and the line continuation character are prohibited for security reasons and because they can hang the server ION Java User s Guide IONCallableClient Class 126 Chapter 6 ION Java Class and Method Reference Exceptions IOException IONIIlegalCommandException I ONSecurityException getClientVersion The getClientVersion method returns a string representing the current version of ION for example ION 6 1 Syntax public final String getClientVersion Return Value The method returns a string containing the current version of ION Arguments None Exceptions None getConnectionType The getConnectionType method returns the type of connection in use See Configuring The ION HTTP Tunnel Broker on page 29 for details on connection types Syntax public final int getConnectionType Return Value The function returns one of the following values e HTTP_CON The client uses the ION HTTP Tunnel Broker exclusively e SOCK_CON The client uses a normal ION socket connection exclusively e BEST_CON The client makes the b

Download Pdf Manuals

image

Related Search

Related Contents

irati - Forjas Salvador  LanPhone 101 User manual  Blue Cat`s Remote Control User Manual  Manual de intru Manual de utilização e instalação Fogão  CT Analyzer Brochure    Samsung PCJ611RF User's Manual  全ページダウンロード(PDF 4.01MB)  Tote Vision LCD-1048HDM2 User's Manual  Télécharger et imprimer le manuel complet ()  

Copyright © All rights reserved.
Failed to retrieve file