Using the Java version of the GLG Toolkit

Introduction

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 Glg bean classes, as described below.

In addition to GlgObject , several Glg Bean classes are provided:

GlgBean

AWT-based Java bean and applet.

GlgJBean

Heavyweight Swing-based Java bean and applet (JApplet).

GlgJLWBean

Lightweight Swing-based Java bean for use with JDesktopPane and JInternalFrame.

All Glg Bean 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 277 of Appendix A: Global Configuration Resources 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 277 of Appendix A: Global Configuration Resources controls the use of anti-aliasing in Java 2 and Java 2D environment.

Using the Documentation

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 85). 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.

Jar Files

The Java version of the Toolkit uses the GLG Java Class Library from the GlgEval2.jar, Glg2.jar or GlgExt2.jar archive files. The GlgEval2.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 GlgDemo2.jar archive contains the GLG demos.

Interfaces

GlgInputListener

public interface GlgInputListener

The main listener interface for handling user interaction.

Methods
public void InputCallback( GlgObject object, GlgObject message_object )

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.

GlgSelectListener

public interface GlgSelectListener

Listener interface used to handle an object selection with the mouse, provides a simplified name-based interface for object selection handling.

Methods
public void SelectCallback( GlgObject object, Object[ ] name_array, int button )

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.

GlgTraceListener

public interface GlgTraceListener

Listener interface used to handle low-level AWT events.

Methods
public void TraceCallback( GlgObject object, GlgTraceData trace_info )

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.

GlgHListener

public interface GlgHListener

Interface for setting the initial values of the Glg bean.

Methods
public void HCallback( GlgObject viewport )

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.

GlgVListener

public interface GlgVListener

Interface for setting the initial values of the Glg bean.

Methods
public void VCallback( GlgObject viewport )

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.

GlgReadyListener

public interface GlgReadyListener

Interface for detecting the Ready event.

Methods
public void ReadyCallback( GlgObject viewport )

This callback is invoked after the bean's drawing is loaded, setup and displayed for the first time. It may be used to detect when the bean is ready and begin updating the drawing with data. The viewport parameter is the listener's viewport object.

GlgErrorHandler

public interface GlgErrorHandler

Error handling interface.

Methods
public void Error( String message )

Displays the error message. The string parameter is the error message.

GlgBean class

GlgJBean class

GlgJLWBean class

public class GlgBean extends Applet implements GlgInputListener, GlgSelectListener, GlgTraceListener, GlgErrorHandler

AWT-based Java bean and applet.

public class GlgJBean extends JApplet implements GlgInputListener, GlgSelectListener, GlgTraceListener, GlgErrorHandler

Heavyweight Swing-based Java bean and applet.

public class GlgJLWBean extends JPanel implements GlgInputListener, GlgSelectListener, GlgTraceListener, GlgErrorHandler

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.

Properties

DrawingURL

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 .

DrawingFile

The filename of the drawing to be loaded into the bean.

DrawingName

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.

DrawingResource

The name of the drawing file in a jar file.

SetupDataURL

The URL of the setup script in the Glg Script Format to use for initializing drawing's resources.

DataURL

The URL of the data script in the Glg Script Format to use for periodic updates of the drawing's resources.

UpdatePeriod

Double value that defines an update interval for reading DataURL , in seconds.

HResource0

HResource1

HResource2

HResource3

HResource4

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 173.

VResource0

VResource1

VResource2

VResource3

VResource4

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 173.

TraceHRef

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 .

HRefTarget

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.

JavaLog

Enables Java Console logging of bean events for debugging bean problems.

ResourceLog

Enables Java Console logging of resource settings from the SetupDataURL and DataURL to debug data scripts.

APILog

Enables Java Console logging of the bean's GLG API methods.

Constructors

public GlgBean()

public GlgJBean()

public GlgJLWBean()

Creates a GLG bean.

Methods

public void PrintToJavaConsole( String message )

Prints the message to stdout. Provided for convenience when used with Java Script in a web browser.

public void SetDrawingName( String drawing_resource )

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.

public String GetDrawingName()

Returns the current value of the DrawingName property.

public void SetDrawingURL( String drawing_url )

Sets a new value of the DrawingURL property, loads the drawing from the URL and displays it in the bean.

public String GetDrawingURL()

Returns the current value of the DrawingURL property.

public void SetDrawingFile( String drawing_file )

Sets a new value of the DrawingFile property, loads the drawing from the file and displays it in the bean.

public String GetDrawingFile()

Returns the current value of the DrawingFile property.

public void SetDataURL( String data_url )

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.

public String GetDataURL()

Returns the current value of the DataURL property.

public void SetSetupDataURL( String setup_data_url )

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.

public String GetSetupDataURL()

Returns the current value of the SetupDataURL property.

public void SetUpdatePeriod( double update_period )

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.

public double GetUpdatePeriod()

Returns the current value of the UpdatePeriod property.

public void SetJavaLog( boolean active )

Activates logging debugging messages to stdout or the Java Console.

public boolean GetJavaLog()

Returns the current value of the JavaLog property.

public void SetResourceLog( boolean active )

Activates logging messages for setting resources from data scripts.

public boolean GetResourceLog()

Returns the current value of the ResourceLog property.

public void SetAPILog( boolean active )

Activates logging API calls, which is convenient for debugging Java Scripts in a web browser.

public boolean GetAPILog()

Returns the current value of the APILog property.

public void SetHResource0( String value )

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 String GetHResource0()

public String GetHResource1()

public String GetHResource2()

public String GetHResource3()

public String GetHResource4()

Return the current value of H properties.

public void SetVResource0( String value )

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.

public String GetVResource0()

public String GetVResource1()

public String GetVResource2()

public String GetVResource3()

public String GetVResource4()

Return the current value of V properties.

public void SetTraceHRef( boolean trace )

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.

public boolean GetTraceHRef()

Returns the current value of the TraceHRef property.

public void SetHRefTarget( String target )

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.

public String GetHTarget()

Returns the current value of the HRefTarget property.

public void SetIgnoreErrors( boolean ignore )

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.

public boolean GetIgnoreErrors()

Returns the current value of the IgnoreErrors property.

public boolean IsReady()

Returns the Ready status of the bean. The bean is ready when it finished loading the drawing and reading setup data and data URLs.

public Applet SetParentApplet( Applet parent_applet )

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.

public String GetFullPath( String filename )

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 GetDResource( String res_name )

public double GetDTag( String tag_name )

Returns the value of the D-type resource or tag of the bean's drawing.

public String GetSResource( String res_name )

public String GetSTag( String tag_name )

Returns the value of the S-type resource or tag of the bean's drawing.

public double GetXResource( String res_name )

public double GetYResource( String res_name )

public double GetZResource( String res_name )

public double GetXTag( String tag_name )

public double GetYTag( String tag_name )

public double GetZTag( String tag_name )

Return the X, Y or Z values of the G-type resource or tag of the bean's drawing.

public boolean HasResourceObject( String res_name )

public boolean HasTagObject( String tag_name )

Return true if a named resource or tag exists.

public boolean SetDResource( String res_name, double dvalue )

public boolean SetDResource( String res_name, double dvalue, boolean if_changed )

public boolean SetDTag( String tag_name, double dvalue, boolean if_changed )

Sets 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 )

public boolean SetSResource( String res_name, String svalue, boolean if_changed )

public boolean SetSTag( String tag_name, String svalue, boolean if_changed )

Sets 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 )

public boolean SetGResource( String res_name, double dvalue1, double dvalue2, double dvalue3, boolean if_changed )

public boolean SetGTag( String tag_name, double dvalue1, double dvalue2, double dvalue3, boolean if_changed )

Sets 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.

public boolean SetSResourceFromD( String res_name, String format, double dvalue )

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.

public boolean SetZoom( String res_name, int type, double value )

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.

public void Update()

Updates the bean's drawing to display the latest resource settings.

public void Reset()

Resets the object hierarchy of the bean's drawing.

public void Bell()

Emits an audio beep.

public boolean Print( String filename, double x, double y, double width, double height, boolean portrait, boolean stretch )

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.

public String CreateIndexedName( String template_name, int resource_index )

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.

public boolean IsDemo()

Returns true if an evaluation version of the GlgBean is used.

public boolean SetInputUpdate( boolean update )

Enables or disables an automatic update performed at the end of the bean's InputCallback . Returns the previous enabled status.

public void AddListener( int callback_type, Object listener)

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.

public void HCallback( GlgObject vp )

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.

public void VCallback( GlgObject vp )

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.

synchronized public void ReadyCallback( GlgObject vp )

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.

public void UpdateCallback()

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.

public void InputCallback( GlgObject vp, GlgObject message_object )

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.

public void SelectCallback( GlgObject vp, Object[] name_array, int button )

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.

public void TraceCallback( GlgObject top_viewport, GlgTraceData trace_info )
public void Trace2Callback( GlgObject top_viewport, GlgTraceData trace_info )

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.

Extended API methods

public GlgObject GetDrawingObject()

Returns the viewport object of the bean's drawing;

public boolean SetDrawingObject( GlgObject viewport )

Sets a new viewport object as a drawing for the bean and displays the new drawing.

public GlgObject LoadWidget( String filename, int media_type )

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.

public GlgObject LoadWidget( GlgObject object )

Finds a viewport named "$Widget" inside the object and returns it. Returns null if the "$Widget" viewport can't be found.

public void InitialDraw( GlgObject object )

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.

public void SetupHierarchy( GlgObject object )

Sets up the viewport's object hierarchy.

public void ResetHierarchy( GlgObject object )

Resets the viewport's object hierarchy.

public GlgObject CopyObject( GlgObject object )

Creates and returns a copy of the object.

public GlgObject CloneObject( GlgObject object, int clone_type )

Creates and returns an full or constrained copy of an object according the clone_type (WEAK_CLONE, STRONG_CLONE, FULL_CLONE or CONSTRAINED_CLONE).

public static GlgObject LoadObject( String filename, int media_type )

Loads an object from a file or URL, and returns it. The media_type parameter defines the loading type (URL or FILE). Returns null if the object can't be loaded.

public boolean SaveObject( GlgObject object, String filename )

Saves the object into a file with the given filename . Returns true if the object was successfully saved.

public boolean AddObjectToTop( GlgObject container, Object object )

Adds the object to the beginning of the container . Returns true if the object was successfully added.

public boolean AddObjectToBottom( GlgObject container, Object object )

Adds the object to the end of container . Returns true if the object was successfully added.

public boolean AddObjectAt( GlgObject container, int index )

Adds the object to the container at the index position . Returns false if index is invalid.

public boolean AddObject( GlgObject container, Object object,
int access_type, int position_modifier )

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.

public boolean DeleteTopObject( GlgObject container )

Deletes the first object of this container. Returns true if the object was successfully deleted.

public boolean DeleteBottomObject( GlgObject container )

Deletes the first object of this container. Returns true if the object was successfully deleted.

public boolean DeleteObjectAt( GlgObject container, int index )

Deletes the object of the container at the index position . Returns false if index is invalid.

public boolean DeleteObject( GlgObject container, Object object )

Deletes an object from container . Returns true if the object was successfully deleted.

public boolean ContainsObject( GlgObject container, Object object )

Returns true if the object is contained in container .

public Object GetElement( GlgObject container, int index )

Returns the element of the container indicated by the index .

public int GetIndex( Object object )

Returns the index of the first occurrence of the object in the container or -1 if the object wasn't found in the container.

public int GetStringIndex( String string )

Returns an index of the first occurrence of the string in the container or -1 if the string wasn't found in the container.

public GlgObject GetNamedObject( GlgObject container, String name )

Returns the named element of the container defined by the name parameter.

public boolean ReorderElement( GlgObject container, int old_index, int new_index )

Moves the container's element from the old_index to the new_index position. The function returns false if indexes are out of range.

public void SetStart( GlgObject container )

Initializes the container for traversing. This function should be called before invoking the container's Iterate method.

public Object Iterate( GlgObject container )

Returns the next element of container .

public int GetSize( GlgObject container )

Returns the size of container .

public boolean SetXform( GlgObject object, GlgObject xform )

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.

public GlgObject GetResourceObject( GlgObject object, String res_name )

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.

public boolean SetResourceObject( String resource_name, GlgObject value )

Sets the new value of the object's attribute specified by the resource_name . It is used for attaching Custom Property objects and aliases .

public Object GetResource( GlgObject object, String res_name )

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 .

public boolean ConstrainObject( GlgObject from_object, GlgObject to_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.

public boolean UnconstrainObject( GlgObject object )

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.

public GlgObject SuspendObject( GlgObject object )

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.

public void ReleaseObject( GlgObject object, GlgObject suspend_info )

Releases the object after suspending for editing. The suspend_info parameter is a returned value of a previous call to SuspendObject.

public int GetNumParents( GlgObject object )

Returns the number of parents of the object. Used to determine a type of the return value of the GetParent method.

public GlgObject GetParent( GlgObject object )

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.

public void Inverse( GlgObject container )

Reverses the order of objects in the container .

public double GetDResource( GlgObject object, String res_name )

Returns the value of an object's D-type resource specified by res_name .

public String GetSResource( GlgObject object, String res_name )

Returns the value of an object's S-type resource specified by res_name .

public double GetXResource( GlgObject object, String res_name )

public double GetYResource( GlgObject object, String res_name )

public double GetZResource( GlgObject object, String res_name )

Returns the X, Y or Z values of an object's G-type resource specified by res_name .

public boolean SetDResource( GlgObject object, String res_name, double dvalue )

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.

public boolean SetSResource( GlgObject object, String res_name, String svalue )

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.

public boolean SetGResource( GlgObject object, String res_name,
double dvalue1, double dvalue2, double dvalue3 )

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.

public void Update( GlgObject viewport )

Updates the viewport to display the latest resource settings.

public boolean Print( GlgObject object, String filename, double x, double y, double width,
double height, boolean portrait, boolean stretch )

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.

public boolean SetResourceFromObject( GlgObject object, String res_name, GlgObject o_value )

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.

public boolean SetSResourceFromD( GlgObject object, String res_name, String format,
double dvalue )

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.

public boolean IsDemo()

Returns true if an evaluation version of the GlgBean 's Extended API is in use.

GlgObject class

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.

Variables

The GlgObject contains the following public data variables:

Version constants

public static final int MAJOR_VERSION;

public static final int MINOR_VERSION;

Compatibility type constants

public static final int PRE_2_9;

public static final int LATEST_RELEASE;

Loading type constants

public static final int FILE;

public static final int URL;

Polygon fill type masks

public static final int EDGE;

public static final int FILL;

public static final int FILL_EDGE;

Polygon open type constants

public static final int CLOSED;

public static final int OPEN;

Arc fill type constants

public static final int CHORD;

public static final int SECTOR;

Arc angle type constants

public static final int START_AND_ANGLE;

public static final int START_AND_END;

Marker type masks

public static final int CROSS;

public static final int BOX;

public static final int FILLED_BOX;

public static final int CIRCLE;

public static final int FILLED_CIRCLE;

public static final int DIAMOND;

public static final int FILLED_DIAMOND;

public static final int DOT;

public static final int CROSS_BOX;

public static final int CROSS_CIRCLE;

Text subtype constants

public static final int FIXED_TEXT;

public static final int AUTOSCALED_TEXT;

public static final int SCROLLED_TEXT;

public static final int SPACED_TEXT;

Text and connector direction constants

public static final int HORIZONTAL;

public static final int VERTICAL;

public static final int VERTICAL_ROTATED_RIGHT;

public static final int VERTICAL_ROTATED_LEFT;

Text horizontal anchoring masks

public static final int HCENTER;

public static final int HLEFT;

public static final int HRIGHT;

Text vertical anchoring masks

public static final int VCENTER;

public static final int VTOP;

public static final int VBOTTOM;

Image subtype constants

public static final int FIXED_IMAGE;

public static final int SCALED_IMAGE;

Reference object subtype constants

public static final int CONTAINER_REF;

public static final int REFERENCE_REF;

Reference storage type constants

public static final int USE_TEMPLATE;

public static final int USE_FILE;

public static final int USE_PALETTE;

ZSort constants

public static final int INHERIT;

public static final int YES;

public static final int NO;

public static final int BY_PARENT;

public static final int SPECIAL;

Scroll type constants

public static final int WRAPPED;

public static final int SCROLLED;

Spline type constants

public static final int B_SPLINE;

public static final int C_SPLINE;

GIS projection constants

public static final int RECTANGULAR;

public static final int ORTHOGRAPHIC;

GIS constants

public static final int EQUATOR_RADIUS;

public static final int POLAR_RADIUS;

Viewport lighting type constants

public static final int NO_LIGHT;

public static final int FLAT_LIGHT;

Viewport widget type constants

public static final int DRAWING_AREA_WIDGET;

public static final int PUSH_BUTTON_WIDGET;

public static final int DRAWN_BUTTON_WIDGET;

public static final int TOGGLE_BUTTON_WIDGET;

public static final int MAIN_WINDOW_WIDGET;

public static final int BULLETIN_WIDGET;

public static final int FORM_WIDGET;

public static final int ROW_COLUMN_WIDGET;

public static final int LEFT_ARROW_WIDGET;

public static final int RIGHT_ARROW_WIDGET;

public static final int UP_ARROW_WIDGET;

public static final int DOWN_ARROW_WIDGET;

public static final int HORIZONTAL_SCALE_WIDGET;

public static final int VERTICAL_SCALE_WIDGET;

public static final int HORIZONTAL_SCROLL_WIDGET;

public static final int VERTICAL_SCROLL_WIDGET;

public static final int MENU_BAR_WIDGET;

public static final int MS_FRAME_WIDGET;

public static final int TEXT_WIDGET;

public static final int LABEL_WIDGET;

public static final int OPTION_MENU_WIDGET;

public static final int PULL_DOWN_MENU_WIDGET;

public static final int VERTICAL_SEPARATOR_WIDGET;

public static final int HORIZONTAL_SEPARATOR_WIDGET;

public static final int LIST_WIDGET;

public static final int MULTI_LIST_WIDGET;

public static final int EXT_LIST_WIDGET;

public static final int DIALOG_AREA_WIDGET;

public static final int MAX_WIDGET_TYPE;

Viewport shell type constants

public static final int NO_TOP_SHELL;

public static final int DIALOG_SHELL;

public static final int APPLICATION_SHELL;

Viewport bevel type constants

public static final int SHADOW_OUT;

public static final int SHADOW_IN;

Object type constants

public static final int REFERENCE;

public static final int DATA;

public static final int ATTRIBUTE;

public static final int MATRIX;

public static final int FUNCTION;

public static final int XFORM;

public static final int VECTOR;

public static final int POLYGON;

public static final int ARRAY;

public static final int LIST;

public static final int SCREEN;

public static final int DISPLAY;

public static final int VIEWPORT;

public static final int MARKER;

public static final int TEXT;

public static final int FONTTABLE;

public static final int ARC;

public static final int PARALLELOGRAM;

public static final int SQUARE_SERIES;

public static final int SERIES;

public static final int COLORTABLE;

public static final int HISTORY;

public static final int POLYLINE;

public static final int POLYSURFACE;

public static final int FRAME;

public static final int FONT;

public static final int IMAGE;

public static final int CONNECTOR;

public static final int GIS;

public static final int MAX_OBJECT_TYPE;

Default container type.

public static final int GROUP = ARRAY;

Data type constants

public static final int S;

public static final int D;

public static final int G;

public static final int O;

Array element type constants

public static final int GLG_OBJECT;

public static final int STRING;

public static final int INT_VALUE;

public static final int JAVA_OBJECT;

Copy type constants

public static final int WEAK_CLONE;

public static final int STRONG_CLONE;

public static final int FULL_CLONE;

public static final int CONSTRAINED_CLONE;

Frame type constants

public static final int FRAME_1D;

public static final int FRAME_2D;

public static final int FRAME_3D;

Transformation type constants

public static final int TRANSLATE_XF;

public static final int MATRIX_XF;

public static final int PATH_XF;

public static final int TRANSLATE_X_XF;

public static final int TRANSLATE_Y_XF;

public static final int TRANSLATE_Z_XF;

public static final int TRANSLATE_XYZ_XF;

public static final int SCALE_X_XF;

public static final int SCALE_Y_XF;

public static final int SCALE_Z_XF;

public static final int SCALE_XYZ_XF;

public static final int ROTATE_X_XF;

public static final int ROTATE_Y_XF;

public static final int ROTATE_Z_XF;

public static final int CONCATENATE_XF;

public static final int LINEAR_XF;

public static final int D_FORMAT_XF;

public static final int S_FORMAT_XF;

public static final int DIVIDE_XF;

public static final int TRANSFER_XF;

public static final int RANGE_XF;

public static final int SCALE_TRANSLATE_XF;

public static final int SCALE_TRANSLATE_XYZ_XF;

public static final int COMBO_XF;

public static final int SHEAR_X_XF;

public static final int SHEAR_Y_XF;

public static final int SHEAR_Z_XF;

public static final int MAX_XFORM_TYPE;

Transformation role constants

public static final int UNDEFINED_XR;

public static final int POINT_XR;

public static final int COLOR_XR;

public static final int GEOM_XR;

public static final int GDATA_XR;

public static final int DDATA_XR;

public static final int SDATA_XR;

Container position constants

public static final int BOTTOM;

public static final int TOP;

public static final int CURRENT;

Container adjustment constants

public static final int BEFORE;

public static final int AFTER;

Global type constants

public static final int LOCAL;

public static final int SEMI_GLOBAL;

public static final int GLOBAL;

public static final int UNCONSTRAINED;

public static final int BOUND;

Callback type constants

public static final int INPUT_CB;

public static final int SELECT_CB;

public static final int TRACE_CB;

public static final int TRACE2_CB;

public static final int H_CB;

public static final int V_CB;

public static final int READY_CB;

ArrowType constants

public static final int NO_ARROW;

public static final int START_ARROW;

public static final int END_ARROW;

public static final int START_END_ARROW;

public static final int MIDDLE_ARROW;

public static final int MIDDLE_INVERSED_ARROW;

public static final int START_FILL_ARROW;

public static final int END_FILL_ARROW;

public static final int START_END_FILL_ARROW;

public static final int MIDDLE_FILL_ARROW;

public static final int MIDDLE_INVERSED_FILL_ARROW;

Arrow mask constants

public static final int ARROW_POSITION_MASK = 0x0f;

public static final int ARROW_TYPE_MASK = 0xf0;

Arrow position constants

public static final int START_APOS;

public static final int END_APOS;

public static final int START_END_APOS;

public static final int MIDDLE_APOS;

public static final int MIDDLE_INVERSED_APOS;

Arrow fill type constant

public static final int LINE_ATYPE;

public static final int FILL_ATYPE;

public static final int FILL_EDGE_ATYPE;

Methods

The GlgObject class provides the following public methods.

public void SetupHierarchy()

Sets up the viewport's object hierarchy.

public void ResetHierarchy()

Resets the viewport's object hierarchy.

public void InitialDraw()

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.

public boolean SetZoom( String res_name, int type, double value )

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.

public boolean SetGISZoom( String res_name, GlgObject gis_object, String gis_name )

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.

public static GlgObject LoadObject( String filename, int media_type )

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.

public static GlgObject LoadWidget( String filename, int media_type )

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.

public static GlgObject LoadWidget( GlgObject object )

Finds a viewport named "$Widget" inside the object and returns it. Returns null if the "$Widget" viewport can't be found.

public boolean Update()

Updates the viewport to display the latest resource settings.

public boolean Reset()

Resets the viewport.

Object SendMessage( String res_name, char * message, Object param1,
Object param2, Object param3, Object param4 )

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 103 of the GLG User's Guide and Builder Reference Manual for a list of messages supported by each type of the available input handlers.

int ExportStrings( GlgObject object, String filename, char separator1, char separator2,
String encoding )

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 101 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.

int ImportStrings( GlgObject object, String filename, String encoding )

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 101 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.

int ExportTags( GlgObject object, String filename, char separator1, char separator2,
String encoding )

Writes all tag names 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 101 of the GLG User's Guide and Builder Reference Manual for information about the file format. The method returns the number of exported tag names or -1 in case of an error.

int ImportTags( GlgObject object, String filename, String encoding )

Replaces tag names in the drawing defined by the object parameter with the tag names 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 101 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 tag names or -1 in case of an error.

public boolean Print( String file, double x, double y, double width, double height, boolean portrait, boolean stretch )

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.

public boolean NativePrint( Graphics graphics )

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.

public Image CreateImage( String res_name )

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.

public Image CreateImageCustom( String res_name, Rectangle image_area, int gap )

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.

public static String CreateIndexedName( String template_name, int resource_index )

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.

public static String ConcatResNames( String resource_name1, String resource_name2 )

Creates a "/"- separated resource name by appending the second resource name to the first one, and inserting the "/" separator is necessary.

public Double GetDResource( String resource_name )

public Double GetDTag( String tag_name )

Returns the value of a scalar resource or tag.

public GlgPoint GetGResource( String resource_name )

public GlgPoint GetGTag( String tag_name )

Returns the value of a G-type resource or tag.

public String GetSResource( String resource_name )

public String GetSTag( String tag_name )

Returns the value of a string resource or tag.

public boolean SetDResource( String resource_name, double d_value )

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_name, double d_value, boolean if_changed )

public boolean SetDTag( String tag_name, Double d_value, boolean if_changed )

Sets 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, double g_value1, double g_value2,
double g_value3 )

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_name, double g_value1, double g_value2, double g_value3, boolean if_changed )

public boolean SetGTag( String tag_name, GlgPoint g_value, boolean if_changed )

Sets 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 )

public boolean SetSResource( String resource_name, String s_value, boolean if_changed )

public boolean SetSTag( String tag_name, String s_value, boolean if_changed )

Sets the value of a string resource or tag. Returns true if the value of the resource or tag was successfully changed.

public boolean SetSResourceFromD( String resource_name, String format, double d_value )
public boolean SetSResourceFromD( String resource_name, String format, Double d_value )
public boolean SetSResourceFromD( String resource_name, String format, double d_value,
boolean if_changed )
public boolean SetSResourceFromD( String resource_name, String format, Double d_value,
boolean if_changed )
public boolean SetSTagFromD( String tag_name, String format, double d_value, boolean if_changed )
public boolean SetSTagFromD( String tag_name, String format, Double d_value, boolean if_changed )

Sets 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.

public boolean SetResourceFromObject( String resource_name, GlgObject o_value )

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.

public GlgObject CreateTagList( boolean unique_tags )

Returns a list of all object's tags.

public boolean HasResourceObject( String resource_name )

public boolean HasTagObject( String tag_name )

Returns true if a named resource or tag exists.

public boolean GISConvert( String res_name, int coord_type, boolean coord_to_lat_lon,
GlgPoint in_point, GlgPoint out_point )

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, coordinat