The Java version of the GLG Toolkit provides a 100% pure Java class library that loads and displays GLG drawings in Java applications. The Java version of the GLG library supports all the GLG Toolkit features available to C and C++ applications, and provides the GLG Standard and Extended APIs for Java applications.
It also provides the GLG Bean, a Java bean component that seemlessly integrates the GLG Toolkit into a Java environment, embedding Java-based GLG components into Java application frameworks and Java IDEs. The bean may also be used as an applet, integrating GLG components as Java applets into a browser and HTML environment.
The Java version of the Toolkit uses GLG drawings saved with the GLG Graphics Builder. The drawings must be saved in ASCII format, either compressed or uncompressed. The same drawing may be used by both the Java and C/C++ versions of the Toolkit. The drawing can also be generated on the fly using the Extended API.
GlgObject is the main class of the Java version of the GLG Toolkit. The GlgObject class contains all the functionality available to GLG objects. Since all objects implement the Get and SetResource functions central to the GLG architecture, it's only natural that the GlgObject superclass is heavily used, making it a Superclass in a more general sense. Using one main superclass also makes it easier to deal with GLG objects by limiting the number of classes and methods one has to learn.
The GLG Toolkit also contains Java classes for different GLG objects: polygons, arcs, etc. However, only the constructors of these classes are used. Once the object is created, all further object manipulation is done by using the GlgObject methods.
The GLG Toolkit also provides classes such as GlgPoint , GlgCube and some other utility classes, mainly used to exchange information between different object methods.
There are three GLG listeners: GlgInputListener , GlgSelectListener and GlgTraceListener used to handle user interaction and object selection. These listeners are supported by both the GlgObject and GlgBean classes, as described below.
In addition to GlgObject , several GlgBean classes are provided:
AWT-based Java bean and applet.
Heavyweight Swing-based Java bean and applet (JApplet).
Lightweight Swing-based Java bean for use with JDesktopPane and JInternalFrame.
All GlgBean classes have the same Glg-inherited interface and differ only in the methods inherited from respective AWT or Swing superclasses. The AWT and Swing-based GLG beans should not be intermixed in one application. The light-weight version of the GLG bean (GlgJLWBean) uses Swing's light-weight model which imposes a performance penalty related to the absence of a native window and a necessity to handle clipping in software. Although it is OK to use the light-weight component for small to medium drawings, a heavy-weight component is recommended for large graphically-intensive drawings.
The type of the top level bean may be different from the type of the components used to render GLG viewport objects displayed inside the GlgBean and GlgJBean. By default, the GlgBean uses AWT components, while the GlgJBean and GlgJLWBean use Swing-based components.
The GlgSwingUsage global configuration resource described on page 285 of Appendices may be used to change the default type of components used to render GLG viewport objects inside the bean. See the GlgSwingUsage resource description for details. The resource is global, affects all GLG viewports and must be set at the application start-up. If the resource is not used, the type of components is determined by the type the GLG Bean (AWT or Swing) used by an application.
The GLG Bean is a Java bean encapsulation of a GLG viewport object that loads, displays and animates a GLG drawing. The bean provides several properties that facilitate loading the drawing and using the bean as an applet in a browser environment.
The GLG Bean exposes methods similar to those of GlgObject . While the GlgObject methods have to be invoked for individual objects, the bean provides a central place for invoking methods on any object or resource. Since the methods exposed by the GLG Bean are the same as the methods of the GlgObject class, there are two ways of using GLG and GLG Bean in a Java application:
The GLG Bean may be used to integrate a GLG drawing into a Java application by creating a GLG Bean and using its SetDrawing methods to load a drawing. After loading the drawing, the viewport object (a GlgObject ) of the loaded drawing may be extracted by calling GLG Bean 's GetDrawingObject method, after which all further processing may be done using the GlgObject class methods of the viewport or individual objects inside the viewport.
The GLG Bean may only be used with the methods exposed by the GLG Bean itself. This is especially convenient when the GLG Bean is used as an applet inside a web browser that supports Java Script and the object's methods are invoked by the script.
In addition to the input, select and trace listeners, the bean provides a few additional listeners, GlgHListener, GlgVListener and GlgReadyListener, which simplify setting the initial resources and program initialization. The bean implements all listener interfaces and acts as a default listener. This makes it more convenient to create custom beans by subclassing the Glg bean and overriding some or all of its listener interfaces.
The Toolkit also provides a GlgErrorHandler interface for custom error handling.
The GlgAntiAliasing global configuration resource described on page 285 of Appendices controls the use of anti-aliasing.
A separate GLG class library for the JSP environment is provided in the GlgServer.jar file. This class library provides the same API but supports headless operation as well as a multi-threaded access by the servlet threads. When used in a servlet, the GlgObject classes should be used instead of the GLG Bean. The examples_jsp directory contains elaborate examples of the GLG servlets with the source code.
This chapter describes language-specific details of using the Java version of the Toolkit. Refer to Using the C/C++ version of the Toolkit for a detailed description of semantics of the Standard and Extended API methods, as well as details of handling user input (described in Handling Input Events on page 87). The semantics of all API methods is the same in all versions of the Toolkit, and the C/C++ section provides examples and details of using them.
Refer to the GLG Programming Tutorial for Java for detailed examples and a walk-through tutorial.
An on-line documentation for the Toolkit's Java class library in the JavaDoc format is also provided. The JavaDoc documentation is intended as a quick reference for the GLG Java classes and their methods, but not as a definitive guide to using the Toolkit in Java. Refer to Using the Java version of the GLG Toolkit for more details. Refer to Using the C/C++ version of the Toolkits for examples of using the GLG methods for specific tasks.
The Java version of the Toolkit uses the GLG Java Class Library from the GlgCE.jar, Glg2.jar or GlgExt2.jar files. The GlgCE.jar file supplies a free evaluation version, the Glg2.jar supplies a purchased version with the GLG Standard API, and the GlgExt2.jar file supplies the purchased version with the GLG Extended API.
All three libraries use Java2D renderer and support anti-aliasing, gradient shading, transparency and alpha blending, as well as Swing and light-weight components.
The GlgDemo.jar archive contains the class files of the GLG demos.
For the JSP Servlet use, the GlgServerCE.jar file supplies a free evaluation version and the GlgServer.jar supplies the purchased version of both the GLG Standard and Extended APIs.
This callback method is invoked every time a user interacts with input objects in the drawing or selects objects in the drawing with the mouse. More information about the type of the input activity may be extracted from the message object passed by the message_object parameter. The object parameter is the listener's viewport object. Refer to Input Callback of Handling Input Events for more details.
Listener interface used to handle an object selection with the mouse, provides a simplified name-based interface for object selection handling.
This callback is invoked every time user uses the mouse to select one or more objects in the drawing. The name_array parameter is a null-terminated array of names of selected objects. The button parameter is the mouse button used for selection (1, 2 or 3). The object parameter is the listener's viewport object. Refer to Selection Callback of Handling Input Events for more details.
This callback is invoked for every event occurring in any of the drawing's viewports and may be used to implement custom selection or hot-spots logic and to handle Java events. The object parameter is the listener's viewport object. Refer to Trace Callbacks of Handling Input Events for more details.
This callback is invoked after the bean's drawing is loaded, but before the drawing hierarchy is set up. It may be used to set the initial resources of the bean's drawing, such as the number of samples in a GLG graph object. The viewport parameter is the listener's viewport object.
This callback is invoked after the bean's drawing is loaded and set up, but before it is displayed for the first time. It may be used to set the initial resources of the bean's drawing. For example, it may be used to supply data for the initial appearance of a GLG graph object. The viewport parameter is the listener's viewport object.
Lightweight Swing-based Java bean for use with JDesktopPane and JInternalFrame.
GLG Beans are Java bean components that integrate GLG objects into the Java environment. The GLG Bean is a Java Bean encapsulation of a GLG viewport object that loads, displays and animates a GLG drawing. All GLG Bean classes have the same Glg-inherited interface and differ only in the methods inherited from their respective AWT or Swing superclasses. The AWT and Swing-based GLG beans should not be intermixed in one application.
The GLG Bean provides methods similar to those of GlgObject . Methods of the GLG Bean and the bean's viewport GlgObject may be used interchangeably.
The GLG Bean implements all GLG listener interfaces and automatically adds listeners for all GLG events. The bean's listener interface methods may be overwritten by the bean's subclass.
The GLG Bean provides functionality for following HTML links when used in the browser and HTML environment. If an object contains an S resource named "$href" , the value of the resource is interpreted as a URL which defines an HTML link. If the user selects an object in the drawing which has an HTML link, the link's URL will be automatically loaded. Custom Properties may be used to attach the "$href" property to objects in the Builder. The HRefTarget property of the bean may be used to define an html target name to open the link in a different browser window.
If the TraceHRef property of the bean in set to true , the bean also traces the link's hot spot and changes the cursor shape when cursor moves over an object that represents a link.
The URL of the drawing to be loaded into the bean. If a relative filename, such as drawing.g , is used, it will be interpreted relatively to the applet's DocumentBase .
A relative drawing name. This can be used to transparently specify the drawing location for both the applet and stand-alone Java application. For an applet, it is relative to it's DocumentBase . For a stand-alone application, it is relative to the current directory.
The URL of the setup script in the Glg Script Format to use for initializing drawing's resources.
The URL of the data script in the Glg Script Format to use for periodic updates of the drawing's resources.
String properties used to initialize drawing's resources before hierarchy setup. For information about the format of the strings see Dynamic Resource String Syntax on page 175.
String properties used to initialize drawing's resources after hierarchy setup. For information about the format of the strings see Dynamic Resource String Syntax on page 175.
If set to true , the bean will trace the hot spots for http links which are defined in the drawing. To make a graphical object a hot spot, it needs to have a custom property of an S type named " $href ". The value of the custom property defines link's URL. When the mouse moves over an object with a link, the cursor will change and, if the bean is used inside the browser, the links' URLs will be displayed in the browser's status area. The default value of the property is false .
Specifies a name of the browser frame to use when opening http links defined in the drawing. The default value is null , causing link's URL to replace the bean.
Prints the message to stdout. Provided for convenience when used with Java Script in a web browser.
Sets a new value of the DrawingName property, loads the drawing and displays it in the bean. If the bean is used as an applet or part of another applet (bean's SetParentApplet method was used), the DrawingName is interpreted as a URL relative to the applet's document base directory. Otherwise, the DrawingName is interpreted as a file relative to the current directory.
Sets a new value of the DrawingURL property, loads the drawing from the URL and displays it in the bean.
Sets a new value of the DrawingFile property, loads the drawing from the file and displays it in the bean.
Sets a new viewport object as a drawing for the bean and displays the new drawing.
Sets a new value of the DataURL property, reads and executes the new DataURL script. If the UpdatePeriod property is greater then 0, the DataURL will be read periodically with the period defined by the UpdatePeriod. The data script will be read once each time the drawing is reloaded using the SetDrawing methods, and then periodically if the UpdatePeriod property is set.
Sets a new value of the SetupDataURL property. The SetupDataURL script is read and executed once after a new drawing is loaded into a bean and every time the drawing is reloaded by using the SetDrawing methods.
Sets a new value of the UpdatePeriod property and starts or stops periodic reading of DataURL if necessary. The DataURL is read periodically if the UpdatePeriod is greater then 0.
Activates logging debugging messages to stdout or the Java Console.
Activates logging messages for setting resources from data scripts.
Activates logging API calls, which is convenient for debugging Java Scripts in a web browser.
public void SetHResource1( String value )
public void SetHResource2( String value )
public void SetHResource3( String value )
public void SetHResource4( String value )
Set the value of the H properties. These properties are used to set resources of the bean's drawing before the drawing's object hierarchy is created.
The syntax of these properties is described in Dynamic Resource String Syntax of Using the ActiveX Control. Refer to H and V Resources of Details of using GLG Standard API for C and C++ for more details on H and V resources.
public void SetVResource1( String value )
public void SetVResource2( String value )
public void SetVResource3( String value )
public void SetVResource4( String value )
Set the value of the V properties. These properties are used to set resources of the bean's drawing after the drawing's object hierarchy is created.
The syntax of these properties is described in Dynamic Resource String Syntax of Using the ActiveX Control. Refer to H and V Resources of Details of using GLG Standard API for C and C++ for more details on H and V resources.
Sets the value of the TraceHRef property. If the property is set to true , the bean traces the mouse movements and changes the cursor shape when cursor moves over objects in the drawing which have HTML links. If an object contains an S resource named "$href" , the value of the resource is interpreted as a URL which defines an HTML link.
Sets the value of the TraceHRef property which defines the target name for showing html links. If set to null, clicking on the hot spot defined by the "$href" property with the left mouse button opens the link in the same browser window, or in a separate window with the "_blank" target name if other mouse buttons are used. If HRefTarget property is not null, the link is always opened in a separate window with the target name defined by the HRefTarget property.
Sets the value of the IgnoreErrors properties. If set to true , suppresses GLG error messages.
This is useful in the bean box test program, which tries to set the value of a string property on every starting change before the entry is finished, which results in errors for the string properties that define URLs.
Returns the Ready status of the bean. The bean is ready when it finished loading the drawing and reading setup data and data URLs.
Sets the parent applet used to determine the document base when the bean is used as part of another applet.Use null for the parent_applet parameter to unset the parent applet.
Returns the full path name. If the bean is used as an applet or a part of another applet (the SetParentApplet method was used), the method prepends the applet's document path to the filename. Otherwise, the filename parameter is returned unchanged.
public double GetDTag( String tag_source )
Return the value of the D-type resource or tag of the bean's drawing.
public String GetSTag( String tag_source )
Return the value of the S-type resource or tag of the bean's drawing.
public double GetYTag( String tag_source )
public double GetZTag( String tag_source )
Return the X, Y or Z values of the G-type resource or tag of the bean's drawing.
Returns true if the bean's drawing contains a resource with the specified name.
public boolean HasTagName( String tag_name )
public boolean HasTagSource( String tag_source )
Return true if the bean's drawing contains a tag with a specified tag name or tag source.
public boolean SetDResource( String res_name, double dvalue, boolean if_changed )
public boolean SetDTag( String tag_source, double dvalue, boolean if_changed )
Set the value of the D-type resource or tag of the bean's drawing. Returns true if the value of the resource or tag was successfully changed.
public boolean SetSResource( String res_name, String svalue, boolean if_changed )
public boolean SetSTag( String tag_source, String svalue, boolean if_changed )
Set the value of the S-type resource or tag of the bean's drawing. Returns true if the value of the resource or tag was successfully changed.
public boolean SetGResource( String res_name, double dvalue1, double dvalue2, double dvalue3, boolean if_changed )
public boolean SetGTag( String tag_source, double dvalue1, double dvalue2, double dvalue3, boolean if_changed )
Set the values of the G-type resource or tag of the bean's drawing (x, y and z values of a point or R, G and B values or a color). Returns true if the value of the resource or tag was successfully changed.
Sets the value of the S-type resource of the bean's drawing to a string obtained by converting the supplied double value ( dvalue ) according to the given format. The format parameter is a C-like format string. Returns true if the value of the resource was successfully changed.
Performs a zoom or pan operation specified by the type parameter. If the res_name parameter is null, the bean's viewport is zoomed. Otherwise, the zoom operation will be performed on its child viewport specified by the res_name parameter. The value parameter defines a zoom factor or pan distance. Refer to GlgSetZoom on page 71 for a complete list of all zoom and pan types.
If the method attempts to set a very large zoom factor which would result in the overflow of the integer coordinate values used by the native windowing system, the zoom operation is not performed and the method returns false.
Loads a viewport named "$Widget" from a file or URL, and returns the viewport object. The media type parameter defines the loading type (URL or FILE). Returns null if the drawing can't be loaded or if it the "$Widget" viewport can't be found.
Finds a viewport named "$Widget" inside the object and returns the viewport. Returns null if the "$Widget" viewport can't be found.
Loads an object from a file or URL, and returns the loaded object. The media_type parameter defines the loading type (URL or FILE). Returns null if the object can't be loaded.
Draws a viewport object for the first time. If the viewport object does not have a parent, it will appear as a separate top level window. Sets up the hierarchy if it hasn't been set up yet.
Prints the bean's drawing and saves it in a PostScript file. Returns true if the drawing was successfully printed. The inherited print() method is used for native Java printing.
Creates and returns a resource name string by inserting a number ( resource_index ) to the template string ( template_name ). The number is inserted at the position indicated by the "%" character, or at the end of the template name if it does not contain the "%" character.
Enables or disables an automatic update performed at the end of the bean's InputCallback . Returns the previous enabled status.
Adds a GLG event listener to the bean. The callback_type parameter may have one of the following values: SELECT_CB, INPUT_CB, TRACE_CB, TRACE2_CB, H_CB, V_CB or READY_CB. The type of the listener provided by the second parameter must match the type parameter and may have one of the following values: GlgSelectListener, GlgInputListener, GlgTraceListener, GlgHListener, GlgVListener or GlgReadyListener, respectively. Only one listener of each type may be added. If no listener was added for some event types, the bean is used as a default listener. Use with null as the listener parameter to remove the listener specified by the callback_type parameter.
The default HCallback invoked after the bean's drawing is loaded, but before its object hierarchy is set up. The bean's AddListener method may be used to change the default callback. The vp parameter is the top level viewport of the bean's drawing.
The default VCallback invoked after the bean's drawing is loaded and set up, but before it is displayed for the first time. The bean's AddListener method may be used to change the default callback. The vp parameter is the top level viewport of the bean's drawing.
The default ReadyCallback invoked after the bean has finished loading the drawing and reading its data. The bean's AddListener method may be used to change the default callback. The vp parameter is the top level viewport of the bean's drawing.
This callback is invoked after the bean finished reading data on periodic updates. The ReadyCallback is invoked the first time, and the UpdateCallback is invoked on any subsequent data updates.
The default InputCallback invoked every time the user interacts with input objects in the drawing. More information about the type of the input activity may be extracted from the message_object parameter. Refer to Input Callback of Handling Input Events for more details. The bean's AddListener method may be used to change the default callback. The vp parameter is the top level viewport of the bean's drawing.
The default SelectCallback invoked every time the user selects one or more objects in the drawing with the mouse. The name_array parameter is a null-terminated array of names of selected objects. The button parameter is the mouse button used for selection (1, 2 or 3). Refer to Selection Callback Handling Input Events for more details. The bean's AddListener method may be used to change the default callback. The vp parameter is the top level viewport of the bean's drawing.
The TraceCallback and Trace2Callbacks are invoked for every event occurring in any of the drawing's viewports. They may be used as an escape mechanism to handle low-level Java events. The TraceCallback is invoked before dispatching the event for processing, while the Trace2Callback is invoked after the event has been processed. The vp parameter is the top level viewport of the bean's drawing. These callbacks are disabled by default and must be explicitly enabled by invoking the bean's AddListener method.
Creates and returns an full or constrained copy of an object according the clone_type (WEAK_CLONE, STRONG_CLONE, FULL_CLONE or CONSTRAINED_CLONE).
Saves the object into a file with the given filename . Returns true if the object was successfully saved.
Adds the object to the beginning of the container . Returns true if the object was successfully added.
Adds the object to the end of container . Returns true if the object was successfully added.
Adds the object to the container at the index position . Returns false if index is invalid.
Adds an object to the container at the position indicated by the access_type (BOTTOM, TOP or CURRENT). If the access type is CURRENT, the object is added before or after the element indicated by the container's current position, as indicated by the position_modifier parameter (BEFORE or AFTER). Sets the container's current position to point to the added object. Returns true if the object was successfully added.
Deletes the first object of this container. Returns true if the object was successfully deleted.
Deletes the first object of this container. Returns true if the object was successfully deleted.
Deletes the object of the container at the index position . Returns false if index is invalid.
Deletes an object from container . Returns true if the object was successfully deleted.
Returns the element of the container indicated by the index .
Returns the index of the first occurrence of the object in the container or -1 if the object wasn't found in the container.
Returns an index of the first occurrence of the string in the container or -1 if the string wasn't found in the container.
Returns the named element of the container defined by the name parameter.
Moves the container's element from the old_index to the new_index position. The function returns false if indexes are out of range.
Initializes the container for traversing. This function should be called before invoking the container's Iterate method.
Sets the object's transformation to a constrained copy of the xform parameter. If the object has already been drawn, it has to be suspended with the SuspendObject method before setting its transformation. If the xform parameter is null, the function removes any object transformations. The CopyObject and CloneObject methods may be used in conjunction with the SetXform to add unconstrained copies of the same transformation to several objects.
Finds and returns a named resource or an attribute of the object. The resource or attribute must be of the GlgObject type, and is specified with the res_name parameter.
Sets the new value of the object's attribute specified by the resource_name . It is used for attaching Custom Property objects and aliases .
Finds and returns a named resource or an attribute of the object. The resource or attribute may be of the Object type or any subclass of the Object .
Constrains an attribute object ( from_object ) to the object defined by the to_object attribute parameter. The attribute object being constrained must be obtained by using either a default attribute name at the end of the resource path name, or using the container access functions. If the object has already been drawn, a SuspendObject method should be invoked on either the attribute object or its parent before constraining.
Unconstrains the input attribute object. The input object is obtained by using either a default attribute name at the end of the resource path name, or using container access functions. If the object has already been drawn, a SuspendObject method should be invoked on either the attribute object or its parent before constraining.
Suspends the object for editing. This function must be called before adding a transformation or constraining attributes of the object whose object hierarchy has been setup (the object has been drawn). The method returns a GlgObject , which can be used as the suspend_info parameter to a subsequent call to the ReleaseObject method.
Releases the object after suspending for editing. The suspend_info parameter is a returned value of a previous call to SuspendObject.
Returns the number of parents of the object. Used to determine a type of the return value of the GetParent method.
Returns the objects' parent if the object has one parent. If object has more than one parent, returns an array of parents. The type of the return value may be determined by using GetNumParents method.
Returns the value of an object's D-type resource specified by res_name .
Returns the value of an object's S-type resource specified by res_name .
public double GetYResource( GlgObject object, String res_name )
public double GetZResource( GlgObject object, String res_name )
Return the X, Y or Z values of an object's G-type resource specified by res_name .
Sets the value of the D-type resource (specified by res_name ) of object to dvalue . Returns true if the value of the resource was successfully changed.
Sets the value of the S-type resource (specified by res_name ) of the object. Returns true if the value of the resource was successfully changed.
Sets the new values of the G-type resource (specified by res_name ) of the object. Returns true if the value of the resource was successfully changed.
Updates the viewport to display the latest resource settings.
Prints a drawing of the viewport to a PostScript file. The x, y, width and height parameters define the page layout of the print output in the GLG coordinate system (use x=-1000, y=-1000, width=2000, height = 2000 to use the whole page). The portrait parameter defines the portrait or landscape orientation. If the stretch parameter is false, the aspect ratio of the drawing is preserved. The function returns true if the drawing was successfully printed.
Sets the value of the data or matrix resource (specified by res_name ) to the value of the o_value object. The resource types should match, otherwise false is returned . Returns true if the value of the resource was successfully changed.
Sets the value of the input object's S-type resource (specified by res_name ) to a string obtained by converting the supplied double value ( dvalue ) according to the format. The format parameter is a C-like format string. Returns true if the value of the resource was successfully changed.
abstract public class GlgObject
GlgObject is the main class of the Java implementation of the GLG Toolkit. It provides functionality available to all GLG objects. The instances of this class are never created directly. Instead, GLG objects are either loaded from a GLG drawing created using the GLG Graphics Builder, or, for advanced users, created using one of the constructors for the GLG graphical objects (See the GLG objects classes later in this chapter) and then accessed using the GlgObject superclass.
Refer to the JavaDoc version of the documentation for a list of all variables of the GlgObject class.
The GlgObject class provides the following public methods.
Draws a viewport object for the first time. If the viewport object does not have a parent, it will appear as a separate top level window. Sets up the hierarchy if it wasn't set up yet.
Performs a zoom or pan operation specified by the type parameter. If the res_name parameter is null, the viewport itself is zoomed. Otherwise, the zoom operation will be performed on its child viewport specified by the res_name parameter. The value parameter defines the zoom factor or pan distance. Refer to GlgSetZoom on page 71 for a complete list of all zoom and pan types.
If the method attempts to set a very large zoom factor which would result in the overflow of the integer coordinate values used by the native windowing system, the zoom operation is not performed and the method returns false.
Sets or resets a viewport's GIS Zoom Mode. If the GIS zoom mode is set, any zooming and panning operations invoked by the SetZoom method will zoom and pan the map displayed in the viewport's GIS Object instead of being applied to the viewport's drawing. If the res_name parameter is null, the GIS zoom mode of the viewport itself will be set. Otherwise, the GIS zoom mode will be set for its child viewport specified by the res_name parameter. If the gis_name parameter is not null, it specifies the resource path of the GIS Object relative to the gis_object parameter, or relative to the viewport if the gis_object parameter is null. The method may be invoked with gis_object=null and gis_name=null to reset the GIS zoom mode.
Loads an object from a file or URL (given by filename ) and returns it. The media_type parameter defines the loading type (URL or FILE). Returns null if the object can't be loaded.
Loads a viewport named "$Widget" from a file or URL, and returns it. The media_type parameter defines the loading type (URL or FILE). Returns null if the drawing can't be loaded or if it the "$Widget" viewport can't be found.
Finds a viewport named "$Widget" inside the object and returns it. Returns null if the "$Widget" viewport can't be found.
Sends a message specified by the message parameter. If the res_name parameter is null, the message is sent to the object itself. Otherwise, the message is sent to the object's child specified by the res_name parameter. The param<n> arguments define additional parameters of the message depending on the message type. The Integer object must be used to pass integer values to the message. Integer values returned by the query messages are returned as Integer objects.
Refer to Input Objects on page 105 of the GLG User's Guide and Builder Reference Manual for a list of messages supported by each type of the available input handlers.
Writes all text strings defined in the drawing specified by the object parameter into a string translation file using requested separator characters and encoding. Refer to Localization Support on page 103 of the GLG User's Guide and Builder Reference Manual for information about the string translation file format. The method returns the number of exported strings or -1 in case of an error.
Replaces text strings in the drawing defined by the object parameter with the strings loaded from a string translation file with the specified encoding. Refer to Localization Support on page 103 of the GLG User's Guide and Builder Reference Manual for information about the string translation file format.The method returns the number of imported strings or -1 in case of an error.
Writes tag names and tag sources of all tags defined in the drawing specified by the object parameter into a file using requested separator characters and encoding. The method uses the same file format as the ExportStrings method. Refer to Localization Support on page 103 of the GLG User's Guide and Builder Reference Manual for information about the file format. The method returns the number of exported tags or -1 in case of an error.
Replaces tag names and tag sources of tags in the drawing defined by the object parameter with information loaded from a tag translation file using the specified encoding. The method uses the same file format as the ImportStrings method. Refer to Localization Support on page 103 of the GLG User's Guide and Builder Reference Manual for information about the tag translation file format.The method returns the number of imported tags or -1 in case of an error.
Prints the viewport object's drawing and saves it in a PostScript file. The x, y, width and height parameters define the page layout of the print output in the GLG coordinate system (use x=-1000, y=-1000, width=2000, height = 2000 to use the whole page). The portrait parameter defines the portrait or landscape orientation. If the stretch parameter is false, the aspect ratio of the drawing is preserved. The function returns true if the drawing was successfully printed.
Prints the viewport object's drawing into a provided graphics object. The origin of graphics is assumed to be (0,0) and clipping to be set the viewport's window width and height. Returns true if the drawing was successfully printed.
Generates an image of the visible area of the viewport's drawing and returns it in a form of the Java Image object. The res_name parameter specifies the resource name of a child viewport whose image to generate, or null to generate the image of the viewport itself. The function returns null if image creation fails.
Generates an image of the area of the drawing defined by the image_area (in the screen pixels), and returns it in a form of the Java Image object. If image_area is null, the image of the whole drawing is generated, which may be bigger than the visible area of the viewport if the drawing is zoomed in. The gap parameter specifies the padding space between the extent of the drawing and the edge of the image when the image_area is null. The viewport's zoom factor defines the scaling factor for objects in the drawing when the image is saved. The res_name parameter specifies the resource name of a child viewport whose image to generate, or null to generate the image of the viewport itself. The function returns null if image creation fails.
Creates and returns a resource name string by inserting the given number ( resource_index ) to the template_name string. The index is inserted at the position indicated by the "%" character, or at the end of the template name if it does not contain the "%" character.
Creates a "/"- separated resource name by appending the second resource name to the first one, and inserting the "/" separator is necessary.
public boolean SetDResource( String resource_name, Double d_value )
public boolean SetDResource( String resource_name, double d_value, boolean if_changed )
public boolean SetDResource( String resource_name, Double d_value, boolean if_changed )
public boolean SetDTag( String tag_source, double d_value, boolean if_changed )
public boolean SetDTag( String tag_source, Double d_value, boolean if_changed )
Set the value of scalar resource or tag. Returns true if the value of the resource or tag was successfully changed.
public boolean SetGResource( String resource_name, GlgPoint g_value )
public boolean SetGResource( String resource_name, double g_value1, double g_value2,
double g_value3, boolean if_changed )
public boolean SetGResource( String resource_name, GlgPoint g_value, boolean if_changed )
public boolean SetGTag( String tag_source, double g_value1, double g_value2, double g_value3, boolean if_changed )
public boolean SetGTag( String tag_source, GlgPoint g_value, boolean if_changed )
Set the value of a G-type resource or tag. Returns true if the value of the resource or tag was successfully changed.
public boolean SetSResource( String resource_name, String s_value, boolean if_changed )
public boolean SetSTag( String tag_source, String s_value, boolean if_changed )
Set the value of a string resource or tag. Returns true if the value of the resource or tag was successfully changed.
Set the value of a string resource or tag to a string obtained by converting the supplied double value according to the specified format. The format parameter is a C-like format string. Returns true if the value of the resource or tag was successfully changed.
Sets the new value of the resource object defined by the resource name to the value of the o_value object. The resource types should match. Returns true if the value of the resource was successfully changed.
Returns true if a named resource exists.
public boolean HasTagName( String tag_name )
public boolean HasTagSource( String tag_source )
Return true if a tag with a specified tag name or tag source exists.
Converts coordinates between the GIS coordinate system of the GIS Object and GLG coordinate system of the drawing. If the res_name parameter is NULL, the coordinate system of this object is used for conversion. If the res_name parameter is not NULL, it specifies the resource name of the GIS Object inside of this object whose coordinate system will be used for conversion. The coord_type parameter specifies the type of the GLG coordinate system type to convert to or from: SCREEN_COORD for screen coordinates or OBJECT_COORD for world coordinates. If the coord_to_lat_lon parameter is true, coordinates are converted from GLG to GIS coordinate system. If it is false, the coordinates are converted from GIS to GLG coordinate system. When converting from GLG to GIS coordinates, the Z coordinate is set to a negative GLG_GIS_OUTSIDE_VALUE value for points on the invisible part of the globe.
Low-level function similar to GISConvert, but without the use of the GIS Object. The projection, stretch, center, extent and angle parameters provide information about the GIS Object's attributes, and min_x, max_x, min_y and max_y parameters provide information about the extent of the GIS Object in the drawing using a coordinate system (screen or object) matching the coord_type parameter. Refer to the GlmConvert function description in the GLG Map Server Reference Manual for details.
Return an elevation of a lat/lon point on a map. If the res_name parameter is NULL, the coordinate system of this object is used for conversion. If the res_name parameter is not NULL, it specifies the resource name of the GIS Object inside of this object whose coordinate system will be used for conversion. The layer_name parameter specifies the name of the layer with elevation data to query.
The method returns null if the point is outside of the map in the ORTHOGRAPHIC projection or if there is no elevation data for the specified location. Otherwise, the method returns the elevation value in the units (such as meters or feet) defined by the elevation data file.
Initializes the GLG Toolkit. If a GlgBean is not used, this method must be invoke before using any other GLG methods. If the GlgBean is used, it'll invoke this method automatically in its constructor.
May be used to free internal structures allocated by the Toolkit if the Toolkit will not be used any more by the program.
Synchronizes the Toolkit's graphical state by flushing any buffered graphics events.
Adds an input, selection or event listener depending on the type parameter (INPUT_CB, SELECT_CB, TRACE_CB or TRACE2_CB). The listener should implement the GlgInputListener , GlgSelectListener or GlgTraceListener interface, depending on the specified type. Only one listener of a particular type may be added to one viewport. The listeners must be added before setting the drawing hierarchy or displaying the drawing for the first time.
The GlgBean implements all GLG listener interfaces. If the GlgBean is used, the listener's callbacks are added automatically and may be overwritten by the bean's subclass.
public static void Unlock() (JSP Servlet only)
Locks and unlocks the object for synchronization of object access in the JSP Servlets. These methods may be used to lock an object to avoid an access to object's components while it is being manipulated. The locking may also be used to prevent a thread being killed in the middle of the object manipulation, which would result in an unpredictable object state.
The calls to the Lock and Unlock methods must be balanced. If a thread was locked with a several calls to the Lock method, an equal number of calls to the Unlock method must be used to unlock the thread.
In Swing applications, asynchronous access is not allowed and these functions should not be used.
Unconditionally unlocks the current tread regardless of the number of the Lock calls made to lock the thread. It may be used at the end of the JSP Servlet's doGet method to unlock the thread after an exception that interrupts the normal flow of control, or to ensure that the thread is unlocked even if there was an unbalanced number of the Lock nd Unlock calls due to a programming error.
Replaces a default GLG error handler with a custom one. If the new_handler parameter is null, the method restores the default error handler. The default error handler prints an error message to the stdout and generates a beep.
Returns the stack trace information as a string which may be used for logging.
Creates and returns a full or constrained copy of an object according to the clone_type (WEAK_CLONE, STRONG_CLONE, FULL_CLONE or CONSTRAINED_CLONE).
Saves the object into a file. Returns true if the object was successfully saved.
Adds the object to the beginning of this container. Returns true if the object was successfully added.
Adds the object to the end of this container. Returns true if the object was successfully added.
Adds the object to the container at the position specified by index . Returns true if the object was successfully added.
Adds the object to this container at the position indicated by the access type (BOTTOM, TOP or CURRENT). If access_type is CURRENT, adds before or after the element indicated by the container's current position, as indicated by the position_modifier parameter (BEFORE or AFTER). Sets the container's current position to point to the added object. Returns true if the object was successfully added.
Deletes the first object of this container. Returns true if the object was successfully deleted.
Deletes the last object of this container. Returns true if the object was successfully deleted.
Deletes an object at the specified position in this container.
Deletes the given object from this container. Returns true if the object was successfully deleted.
Deletes an object from this container and adjusts the current position according to the pos_modifier (BEFORE or AFTER). The object is deleted from the position indicated by the access_type (BOTTOM, TOP or CURRENT). Returns true if the object was successfully deleted.
Returns the element of this container indicated by index or null if index is invalid.
Replaces the element of this container indicated by index . Returns false if index is invalid.
Returns the index of the first occurrence of the object in the container or -1 if the object wasn't found in the container.
Returns the index of the first occurrence of the string in the container or -1 if the string wasn't found in the container.
Returns the named element of this container defined by the name parameter.
Moves an element of this container from the position specified by old_index to the position defined by new_index . Returns false if indexes are out of range.
Initializes this container for traversing, should be called before invoking the container's Iterate method.
Sets this object's transformation to a constrained copy of the xform parameter. If the object has already been drawn, it has to be suspended with the SuspendObject method before setting its transformation. If the xform parameter is null, this function removes any object transformations. The CopyObject and CloneObject methods may be used in conjunction with the SetXform to add unconstrained copies of the same transformation to several objects.
ADVANCED: Sets the value of a generic resource of a type defined by the type parameter (D, S, G or O). The value parameter must be of the Double type for D resources, String type for S resources, GlgPoint for G resources and Object type for O (object) resources. If the if_changed_only parameter is true , the value change event will be generated only if value of the resource was different. The is_attribute parameter may be set to true to speed up setting default attributes of an object. Returns null if the resource can't be set.
Sets the new value of the object's attribute specified by the resource_name . It is used for attaching Custom Property objects and aliases .
Finds and returns a named resource or an attribute of this object. The resource or attribute must be of the GlgObject type.
Finds and returns a named resource or an attribute of this object. The resource or attribute must be of the Object type.
ADVANCED: Gets the value of a generic resource of a type defined by the type parameter. (D, S, G or O). The type of the returned value is Double for D resources, String for S resources, GlgPoint for G resources and Object for O (object) resources. Returns null if the resource can't be found.
Finds a single tag with a given tag name or tag source, or creates a list of tags matching the wildcard. The search_string specifies either the exact tag name or tag source to search for, or a search pattern which may contain the ? and * wildcards. The by_name parameter defines the search mode: by a tag name or tag source. In the single tag mode, the first tag matching the search criteria is returned. The unique_tags controls if only one tag is included in case there are multiple tags with the same tag name or tag source. The unique_tags flag is ignored in the single tag mode.
In a single tag mode, the function returns the first attribute that has a tag matching the search criteria. In the multiple tag mode, a list containing all attributes with matching tags will be returned.
Constrains this attribute object to the object defined by the to_attribute parameter. The attribute object being costrained must be obtained by using either a default attribute name at the end of the resource path name, or using the container access functions. If the object has already been drawn, a SuspendObject method should be invoked on either the attribute object or its parent before constraining.
Unconstrain this attribute object. The attribute object being unconstrained must be obtained by using either a default attribute name at the end of the resource path name, or using container access functions. If the object has already been drawn, a SuspendObject method should be invoked on either the attribute object or its parent before constraining.
ADVANCED: Unconstrain this attribute object using clone_type parameter (WEAK_CLONE, STRONG_CLONE, FULL_CLONE or CONSTRAINED_CLONE) to unconstrain the transformation attached to the object, if any. The attribute object being unconstrained must be obtained by using either a default attribute name at the end of the resource path name, or using container access functions. If the object has already been drawn, a SuspendObject method should be invoked on either the attribute object or its parent before constraining.
Suspends this object for editing. It must be called before adding a transformation or constraining attributes of the object whose object hierarchy has been setup (the object has been drawn). The method returns a GlgObject , which can be used as the suspend_info argument to the ReleaseObject method.
Releases this object after suspending for editing. The suspend_info parameter is a returned value of a previous call to SuspendObject.
ADVANCED: Returns the number of parents of this object. Used to determine the type of the return value of the GetParent method.
ADVANCED: Returns the objects' parent if this object has one parent. If object has more than one parent, returns an array of parents. The type of the return value may be determined with the GetNumParents method.
ADVANCED: Returns a 3D bounding box of the object that can be used for collision detection. The coordinates of the bounding box are valid only after the object has been drawn.
ADVANCED: Returns a matrix object of the transformation used to draw the object on the screen.
ADVANCED: Creates and returns an matrix inversed relative to this one.
ADVANCED: Transforms the in_point with this matrix and places the result into the out_point .
Moves an object by the specified vector in the specified coordinate system (SCREEN_COORD or WORLD_COORD). If start_point is null, (0,0,0) is used as the start point of the move vector.
Moves an object by the specified X, Y and Z distances in the specified coordinate system (SCREEN_COORD or WORLD_COORD).
Scales an object relative to the specified center in the specified coordinate system (SCREEN_COORD or WORLD_COORD) by the specified X, Y and Z scale factors.
Rotates an object around the specified center in the specified coordinate system (SCREEN_COORD or WORLD_COORD) by the specified X, Y and Z angles.
Positions an object at the specified location in the specified coordinate system (SCREEN_COORD or WORLD_COORD) using the specified anchoring. The value of anchoring is formed as a bitwise "or" of the horizontal anchoring constant (HLEFT, HCENTER or HRIGHT) with the vertical anchoring constants (VTOP, VCENTER or VBOTTOM). The object's bounding box is used to anchor an object's edges.
Fits the object to the specified area in the specified coordinate system (SCREEN_COORD or WORLD_COORD).
Performs a requested layout operation. Refer to The GLG Extended API on page 99 for more details.
ADVANCED: Transforms all control points of an object with the transformation, calculating new control points values.The coord_type specifies the coordinate system to interpret the transformation in. If SCREEN_COORD is used, the parameters of the transformation are considered to be in screen pixels. For example, this may be used to move the object by the number of screen pixels as defined by the mouse move. If OBJECT_COORD is used, the transformation parameters are interpreted as GLG world coordinates. The parent parameter specifies the object's parent in the OBJECT_COORD mode, null may be used in the SCREEN_COORD mode. The object's hierarchy must be set to use this method.
ADVANCED: Converts a point coordinates from the screen to the GLG world coordinate system. The inside_vp flag must be set to true for viewport objects to convert to the world coordinate system inside the viewport.
ADVANCED: Converts a point coordinates from the GLG world to the screen coordinate system. The inside_vp flag must be set to true for viewport objects to convert from the world coordinate system inside the viewport.
ADVANCED: Given the top viewport of the drawing, and a screen coordinates rectangle in a selected viewport, returns an array of names of all objects within the rectangle. This method may be used inside of the TraceListener to implement custom selection logic based on the mouse events.
ADVANCED: Given the top viewport of the drawing, a mouse event, a viewport in which the mouse event occurred and the selection distance ( delta ), returns an array of names of all objects selected by the mouse event. This method may be used inside of the TraceListener to implement custom selection logic based on the mouse events.
ADVANCED: This method is a programming API for the custom events. It may be used in the trace callback to retrieve a custom event which would be triggered by a specified mouse action in the rectangular area.
Given the top viewport of the drawing and a screen coordinates rectangle in a selected viewport, the method searches all objects inside the rectangle for the custom event of the specified type attached to an object. The method returns a selection message for the first matching custom event it finds. The selection message is a custom event message equivalent to the message received in the input callback. The selection_type parameter may specify one of the following predefined selection types: MOVE_SELECTION, CLICK_SELECTION or TOOLTIP_SELECTION.
ADVANCED: This is the same as the corresponding CreateSelectionNames, but returns an array of selected objects on the bottom of the hierarchy instead of an array of names.
ADVANCED: Same as the corresponding CreateSelectionNames, but returns an array of selected objects on the bottom of the hierarchy instead of an array of names.
ADVANCED: Creates an array of all resource names of this object on one level of hierarchy. If list_def_attr is true , the default attributes are included. The list_aliases parameter is reserved for the future use and must be false .
These classes are used for incidental tasks associated with the GlgBean and GlgObject classes.
GLG objects classes provide the actual implementation for specific drawing primitives used in the Toolkit. However, these classes are rarely used by the end user, since the GlgObject superclass delivers most of the GLG API. Unless you are dealing with some advanced uses of the Toolkit, you can skip this section of the manual. For details regarding a particular type of a GLG object, refer to GLG Objects.
The GLG objects classes are used only to create objects using their public constructors. After they are created, you use the GlgObject superclass methods for any further processing.
Most of the time the drawing and objects in it will be created interactively using the GLG Graphics Builder. These object classes are provided for the advanced users who may want to build the drawing programmatically for applications that generate objects in the drawing based on some kind of a configuration file or table.
When the constructors are used, the objects are initially created with default attributes (attribute values set to 0). The values may later be set using the GlgObject SetResource methods.
Most of the constructors may be called with null parameters to create an object instance with default attribute values. Where the non-null parameter are required, it will be explicitly mentioned.
All constants used by these classes are defined in the GlgObject superclass.
public class GlgDynArray extends GlgObject
A dynamic array. The array automatically increase its size when new elements are added.
The type parameter defines the type of objects that will be stored in the array and may be one of GLG_OBJECT, STRING, INT_VALUE or JAVA_OBJECT. The GLG_OBJECT default value is used if the value of 0 is passed.
The n_slots parameter defines the initial size of the array. A default value is used if the value 0 is passed.
The increment parameter specifies the initial increment to be used when the size of the array has to be increased. A default value is used if the value 0 is passed.
public class GlgFontTable extends GlgObject
Creates a font table. The num_types parameter specifies the number of font types in the table, and num_sizes specifies the number of font sizes. The font_array parameter may specify a GLG group object containing an array of strings to be used as font names. If the length of the array is less than the product of the first two parameters, default font names will be used for the remaining fonts. If null values are passed for the number of font types, sizes, or the font_array, the default values will be used.
public class GlgFrame extends GlgObject
Creates a frame object. The type parameter specifies a type of frame to create and must be FRAME_1D, FRAME_2D or FRAME_3D. The factor parameter must specify the number of intervals the frame uses to create frame points. The last parameter is reserved and a null value must be used.
public class GlgFunction extends GlgObject
A helper class for implementing GLG interaction handlers.
Creates an interaction handler that can be attached to a viewport object. The name parameter specifies a name of one of Glg's interaction handlers (GlgButton, GlgKnob, etc.). The second and third parameters are reserved and a null value must be used.
public class GlgHistory extends GlgObject
A history object that implements a scrolling behavior of the GLG graphs.
public class GlgImage extends GlgObject
An image object, integrates GIF images into a GLG drawing.
Creates a GLG image object. The image_type parameter defines the type of image: FIXED_IMAGE or SCALED_IMAGE. The filename defines the GIF file to use and may be a local file or a URL. The load_path parameter is reserved for future use and must be null.
public class GlgPolySurface extends GlgObject
Creates a polysurface object. The first two parameters are optional and null values may be used, the last parameter is reserved and a null value must be used. The marker parameter specifies a template marker object to use, and the polygon parameter specifies a template polygon.
public class GlgPolygon extends GlgObject
Creates a polygon object. The optional size parameter specifies the number of points in the polygon. If the values of 0 or 1 are used, a default polygon with two points is created. After the polygon is created, more points may be added or existing points may be deleted by using Add and Delete methods of the GlgObject superclass. The value of -1 may be used to create a polygon with no points. The second parameter is reserved and a null value must be used.
public class GlgPolyline extends GlgObject
Creates a polyline object. The first two parameters are optional and null values may be used, the last parameter is reserved and a null value must be used. The marker parameter specifies a template marker object to use, and the polygon parameter specifies a template polygon.
public class GlgResourceReference extends GlgObject
Creates an alias object. The from_name parameter specifies the new logical name for the resource hierarchy pointed to by the alias. The to_name specifies the resource path to the aliased resource. The third parameter is reserved and a null value must be used.
abstract class GlgScreen extends GlgObject
This class implements AWT-related properties of the viewport object. The class is never created directly. Instead, it is created by the viewport object.
public class GlgTag extends GlgObject
A tag object which is attached to object attributes to hold data connectivity information.
public class GlgText extends GlgObject
Creates a text object. An optional string parameter defines the string to display in the text object. If this parameter is null, an empty string is used as a default. The type parameter defines the type of the text object to create and may be FIXED_TEXT, AUTOSCALED_TEXT or SPACED_TEXT. If the value of 0 is passed, the AUTOSCALED_TEXT type is used as a default.
public class GlgXform extends GlgObject
Creates a transformation object used to animate objects.
The role parameter specifies the role transformation plays and may have the value of one of the transformation role constants defined in the GlgObject superclass. POINT_XR is the most common value of this parameter that is used to transform geometrical points in 3D space.
The type parameter specifies the type of the transformation to create and may have the value of one of the transformation type constants defined in the GlgObject superclass, for example: TRANSLATE_XF, SCALE_XYZ_XF, ROTATE_Z_XF, and so on.
After the transformation of a desired type is created, its parameters (such as the scale, rotation angle and others) may be set by using SetResource methods of the GlgObject superclass.
The last two parameters are reserved and null values must be used.
These classes implement an atomic data value holder. The data object may be used in user applications to hold D, S, or G data. One of the GLG containers may be used to hold a collection of data objects. The data may be assigned or queried using the GetResource and SetResource methods using null as a resource name. The type of the Get/Set method to use (D, S or G) is defined by the type of the data value.
abstract class GlgMatrix extends GlgObject
The GlgMatrix class implements a matrix object that is used for 3D transformations. The matrix holds the "value" of the transformation and is considered to be a data object. The matrix is never created directly by a user application. To create a matrix, a GlgXform transformation object of a required type is created with the required transformation parameters, and then either the xform object or its matrix is used.
The GLG Graph Layout package implements the spring embedder graph layout algorithm used for automatic layout of graphs containing nodes connected with edges. The spring embedder algorithm performs a series of iterations optimizing the graph layout and minimizing the number of node intersections. The GLG Graph Layout Demo shows an example of an application that creates and automatically lays out a graph containing connected nodes of a network. The demo's source code may be used as an example of using the Graph Layout module.
As seen in the demo, GLG Graph Layout may be used together with the GLG graphical engine, using GLG to display the graph and its nodes. In this case, the GLG Graphics Builder may be used to define a palette of graphical objects containing icons for the graph's nodes.
The Graph Layout may also be used to lay out non-GLG objects, for example, AWT or Swing components representing an application's objects. In this case, the application uses the Graph Layout's relative node position output (in the range from 0 to 1) to position an application's objects on the page.
The Graph Layout Component is provided with the GLG Extended API for Java.
Node type (0-based index used to associate the node with the node icon from the palette).
Custom GlgObject used to display the node. If the template is null, an icon from the palette is used.
The final "temperature" of the graph (in the range from 0 to 1) defining the end of the layout process, 0.2 by default. A higher value will result in the process finishing faster but with less precision. A lower value will cause the layout process to last longer, trying to produce a finer layout.
Sets the graph's icon palette. The palette drawing must contain node icons named Node0, Node1, Node2, etc. Each node must contain a G-type resource named Position, which is used by the graph layout to position the node. The palette must also contain an edge icon (a polygon named Edge), which is used to define the edges' attributes.
Resets the default palette to null and destroys any stored objects.
Loads icons from the palette and creates a GLG drawing to render the graph.
An optional viewport. If it is not null, it is used as a container for the graph's drawing, rendering the graph in the existing object hierarchy. If it is null, the graph will create a new viewport to render the graph.
Destroys the graph's drawing and all graphical objects used to render nodes and edges.
Performs one iteration of the spring embedder layout, returns true if the layout process has finished.
Updates the display to show the results of the spring layout. There is no need to update the display after every iteration: it may be updated every N iterations, or just once when the layout is finished.
The palette index, specifies what icon to use from the node palette if no custom icons are specified.
The palette index, specifies what icon to use from the edge palette if no custom graphics are specified (reserved for future use).
Returns the node position in GLG coordinates (in the range from -1000 to 1000).
Sets the node position in GLG coordinates (in the range from -1000 to 1000).
Finds the node object by its graphics and is used to handle mouse selection.
Finds the edge object by its graphics and is used to handle mouse selection.
Connectivity test, returns true if there is an edge connecting the two nodes.
Forces the graph to continue layout after it is finished by increasing the temperature of the graph by a small increment.
Returns true if the untangling algorithm is enabled. The untangling algorithm helps the graph layout to avoid local minima in the form of intersecting edges. Using this algorithm roughly doubles the time it takes to finish the layout.