GLG Toolkit, JavaScript Library  Version 4.1
 All Classes Namespaces Functions Variables Enumerations Enumerator
GlgObject Class Reference

Detailed Description

Superclass of all GLG objects. Provides the GLG API functionality (Standard, Intermediate and Extended) for all GLG objects.

PROGRAMMING NOTES

  • Global methods of the GlgObject class are marked with the static prefix and must be invoked on the GLG Toolkit handle obtaned via a "new GlgToolkit()" call at the application start-up. For example:
        var GLG = new GlgToolkit();
        GLG.LoadWidgetFromURL( "drawing.g", null, LoadCB, null );


  • Methods not marked with the static prefix are instance methods invoked on a GlgObject instance. For example:
        viewport.Update();

  • The GlgObject instances are wrappers around the internal representation of the GLG objects. Because of that, the equality operator (==) cannot be used to compare if two instances of the GlgObject refer to the same actual GLG object. The Equals instance method or the ObjectsEqual global (static) method must be used instead. For example:
        var same_object = object1.Equals( object2 );
        same_object = GLG.ObjectsEqual( object1, object2 );


  • The GlgObject instances received as parameters of a callback function, such as the Input or Trace callback, are valid only inside the callback and the assignment operator (=) cannot be used to store them in global variables to be used outside of the callback (the only exception are GlgObject instances received as parameters of the load callbacks). The global GetReference method must be used to store GlgObject in a global variable in a way that allows it to be used outside of the callback. For example:
        GlobalRef = GLG.GetReference( viewport );

  • To minimize garbage collection, the ReleaseToCache method may be used to collect temporary objects, such as GlgPoint or GlgCube, after they have been used. ReleaseToCache may also be invoked on temporary GlgObject instances, in which case it will release to the cache the object's wrapper instance, without affecting the internal GLG object the wrapper refers to. For example:
        var point = object.GetGResource( "Point1" );
        MyFunction( point );   
        GLG.ReleaseToCache( point );

Public Member Functions

void AbortGISRequest (String res_name)
 
GlgObject AddAnnotation (String res_name, GlgObject annotation, double position_x, double position_y, boolean add_box)
 
GlgObject AddAttachmentPoint (double dx, double dy, double dz)
 
void AddListener (GlgCallbackType type, function callback)
 
boolean AddObjectAt (Object obj, int index)
 
boolean AddObjectToBottom (Object obj)
 
boolean AddObjectToTop (Object obj)
 
GlgObject AddPlot (String res_name, GlgObject plot)
 
void AddPlotDataSample (double value, double time_stamp, boolean valid, float marker_visibility, boolean quick_mode)
 
GlgObject AddTimeLine (String res_name, GlgObject time_line, double time_stamp)
 
void ChangeObject (String res_name)
 
boolean ClearDataBuffer (String res_name)
 
GlgObject CloneObject (GlgCloneType clone_type)
 
boolean ConstrainObject (GlgObject to_attribute)
 
boolean ContainsObject (Object obj)
 
GlgObject CopyObject ()
 
GlgObject CreateAlarmList ()
 
GlgObject CreateChartSelection (GlgObject plot, double x, double y, double dx, double dy, boolean screen_coord, boolean include_invalid, boolean x_priority)
 
GlgObject CreateInversedMatrix ()
 
GlgObject CreatePointArray (GlgControlPointType type)
 
GlgObject CreateResourceList (boolean list_named_res, boolean list_def_attr, boolean list_aliases)
 
GlgObject CreateTagList (boolean unique_tag_sources)
 
String CreateTooltipString (double x, double y, double dx, double dy, String format)
 
boolean DeleteAnnotation (String res_name, GlgObject annotation, double position_x, double position_y)
 
boolean DeleteBottomObject ()
 
boolean DeleteObjectAt (int index)
 
boolean DeletePlot (String res_name, GlgObject plot)
 
boolean DeleteTags (GlgTagType tag_type_mask)
 
boolean DeleteThisObject (Object obj)
 
boolean DeleteTimeLine (String res_name, GlgObject time_line, double time_stamp)
 
boolean DeleteTopObject ()
 
boolean Equals (GlgObject object)
 
Object ExportStrings (String separator1, String separator2)
 
Object ExportTags (String separator1, String separator2)
 
boolean FindMatchingObjects (GlgObjectMatchType match_type, boolean find_parents, boolean find_first_match, boolean search_inside, boolean search_drawable_only, GlgObjectType object_type, String object_name, String resource_name, GlgObject object_id, function custom_match)
 
boolean FitObject (GlgCoordType coord_type, GlgCube box, boolean keep_ratio)
 
void Flush (int size)
 
GlgObject GetAction (GlgActionType action_type, GlgTriggerType trigger_type, int button, GlgArmedStateType armed_state, GlgDoubleClickStateType double_click_state, String action, String subaction, boolean enabled_only)
 
GlgObject GetAlarmObject (String alarm_label, boolean single_alarm)
 
GlgCube GetBox ()
 
GlgMinMax GetChartDataExtent (String res_name, boolean time, boolean visible_only)
 
GlgMinMax GetDataExtent (String res_name, boolean time)
 
GlgDataType GetDataType ()
 
GlgObject GetDrawingMatrix ()
 
double GetDResource (String resource_name)
 
double GetDTag (String tag_source)
 
Object GetElement (int index)
 
GlgGISRequestObserver GetGISRequestInfo (String res_name)
 
GlgPoint GetGResource (String resource_name)
 
GlgPoint GetGTag (String tag_source)
 
int GetIndex (Object obj)
 
GlgObject GetLegendSelection (double x, double y)
 
GlgMatrixData GetMatrixData (GlgMatrixData matrix_data)
 
GlgObject GetNamedObject (String name)
 
GlgObject GetNamedPlot (String res_name, String plot_name)
 
Object GetNativeComponent (String res_name, GlgComponentQueryType type)
 
int GetNumParents ()
 
String GetObjectName ()
 
GlgObjectType GetObjectType ()
 
GlgObject GetParent ()
 
GlgObject GetParentViewport (boolean heavy_weight)
 
Object GetResource (String resource_name)
 
GlgObject GetResourceObject (String resource_name)
 
int GetSize ()
 
String GetSResource (String resource_name)
 
String GetSTag (String tag_source)
 
int GetStringIndex (String search_string)
 
GlgObject GetTagObject (String search_string, boolean by_name, boolean unique_tags, boolean single_tag, GlgTagType tag_type_mask)
 
boolean GISConvert (String res_name, GlgCoordType coord_type, boolean coord_to_lat_lon, GlgPoint in_point, GlgPoint out_point)
 
boolean GISCreateSelection (String res_name, String layers, double x, double y, GlmLabelSelectionMode select_labels, function callback)
 
boolean GISGetElevation (String res_name, String layer_name, double lon, double lat, function callback)
 
boolean HasResourceObject (String resource_name)
 
boolean HasTag (String tag_name, GlgTagType tag_type_mask)
 
boolean HasTagName (String tag_name)
 
boolean HasTagSource (String tag_source)
 
int ImportStrings (String data, boolean verbose)
 
int ImportTags (String data, boolean verbose)
 
void InitialDraw ()
 
boolean InstallGISRequest (String res_name)
 
void Inverse ()
 
boolean IsAt (GlgPositionType position)
 
boolean IsDrawable ()
 
Object Iterate ()
 
Object IterateBack ()
 
boolean LayoutObjects (GlgObject sel_elem, GlgLayoutType type, double distance, boolean use_box, boolean process_subobjects)
 
boolean MoveObject (GlgCoordType coord_type, GlgPoint start_point, GlgPoint end_point)
 
boolean MoveObjectBy (GlgCoordType coord_type, double x, double y, double z)
 
boolean MoveObjectByPoint (GlgCoordType coord_type, GlgPoint point)
 
boolean PositionObject (GlgCoordType coord_type, GlgAnchoringType anchoring, double x, double y, double z)
 
boolean PositionObjectByPoint (GlgCoordType coord_type, GlgAnchoringType anchoring, GlgPoint position)
 
double PositionToValue (String res_name, double x, double y, boolean outside_x, boolean outside_y)
 
GlgObject QueryTags (GlgTagType tag_type_mask)
 
void ReleaseObject (GlgObject suspend_info)
 
boolean ReorderElement (int current_index, int new_index)
 
boolean RequestGISMap (String res_name, double extent_x, double extent_y, double center_x, double center_y, double angle, GlgProjectionType projection, String layers, GlgGISRequestFlags flags, GlgGISRequestObserver request_observer)
 
boolean RequestGISZoom (String res_name, char type, double value, GlgGISRequestObserver request_observer)
 
boolean Reset ()
 
void ResetHierarchy ()
 
boolean RotateObject (GlgCoordType coord_type, GlgPoint center, double x, double y, double z)
 
Uint8List SaveObject (String encoding)
 
boolean ScaleObject (GlgCoordType coord_type, GlgPoint center, double x, double y, double z)
 
boolean ScreenToWorld (boolean inside_vp, GlgPoint in_point, GlgPoint out_point)
 
Object SendMessageToObject (String res_name, String message, Object param1, Object param2, Object param3, Object param4)
 
boolean SetDResource (String resource_name, double value)
 
boolean SetDResourceIf (String resource_name, double value, boolean if_changed)
 
boolean SetDTag (String tag_source, double value, boolean if_changed)
 
boolean SetElement (int index, Object new_object)
 
void SetEnd ()
 
void SetFocus (String res_name)
 
boolean SetGResource (String resource_name, double g_value1, double g_value2, double g_value3)
 
boolean SetGResourceFromPoint (String resource_name, GlgPoint g_value)
 
boolean SetGResourceFromPointIf (String resource_name, GlgPoint g_value, boolean if_changed)
 
boolean SetGResourceIf (String resource_name, double g_value1, double g_value2, double g_value3, boolean if_changed)
 
boolean SetGTag (String tag_source, double g_value1, double g_value2, double g_value3, boolean if_changed)
 
boolean SetGTagObj (String tag_source, GlgPoint g_value, boolean if_changed)
 
boolean SetLabelFormatter (String res_name, GlgLabelFormatter formatter)
 
boolean SetLinkedAxis (String res_name, GlgObject axis_object, String axis_res_name)
 
void SetMatrixData (GlgMatrixData matrix_data)
 
void SetParentElement (String element_id)
 
boolean SetResource (String resource_name, Object value)
 
boolean SetResourceFromObject (String resource_name, GlgObject o_value)
 
boolean SetResourceFromObjectIf (String resource_name, GlgObject o_value, boolean if_changed)
 
boolean SetResourceObject (String resource_name, GlgObject value)
 
GlgGISRequestObserver SetScrollbarObserver (String res_name, GlgGISRequestObserver request_observer)
 
boolean SetSResource (String resource_name, String s_value)
 
boolean SetSResourceFromD (String resource_name, String format, double d_value)
 
boolean SetSResourceFromDIf (String resource_name, String format, double d_value, boolean if_changed)
 
boolean SetSResourceIf (String resource_name, String s_value, boolean if_changed)
 
boolean SetSTag (String tag_source, String s_value, boolean if_changed)
 
boolean SetSTagFromD (String tag_source, String format, double d_value, boolean if_changed)
 
void SetStart ()
 
void SetTemplate (GlgObject template)
 
void SetupHierarchy ()
 
boolean SetXform (GlgObject xform)
 
boolean SetZoom (String res_name, char type, double value)
 
boolean SetZoomMode (String res_name, GlgObject zoom_object, String zoom_object_name, GlgZoomMode zoom_mode)
 
GlgObject SuspendObject ()
 
boolean TransformObject (GlgObject xform, GlgCoordType coord_type, GlgObject parent)
 
void TransformPoint (GlgPoint in_point, GlgPoint out_point)
 
void TraverseObjects (function action)
 
boolean UnconstrainObject ()
 
boolean Update ()
 
boolean UpdateImmediately ()
 
void UpdateSize ()
 
boolean WorldToScreen (boolean inside_vp, GlgPoint in_point, GlgPoint out_point)
 

Static Public Member Functions

static void AddDataSample (GlgObject plot, GlgDataSample datasample)
 
static void AddGlobalListener (GlgCallbackType type, function callback)
 
static void Bell ()
 
static void BellExt (double volume, double frequency, double duration)
 
static String ConcatResNames (String resource_name1, String resource_name2)
 
static GlgObject ConvertViewportType (GlgObject obj)
 
static String CreateIndexedName (String template_name, int resource_index)
 
static GlgObject CreateObject (GlgObjectType type, Object param1, Object param2, Object param3, Object param4)
 
static GlgObject CreateSelection (GlgObject top_vp, GlgCube rectangle, GlgObject selected_vp)
 
static GlgObject CreateSelectionFromEvent (int x, int y, int delta, GlgObject top_vp, GlgObject selected_vp)
 
static GlgObject CreateSelectionMessage (GlgObject top_vp, GlgCube rectangle, GlgObject selected_vp, GlgSelectionEventType selection_type, int button)
 
static GlgObject CreateSelectionNames (GlgObject top_vp, GlgCube rectangle, GlgObject selected_vp)
 
static GlgObject CreateSelectionNamesFromEvent (int x, int y, int delta, GlgObject top_vp, GlgObject selected_vp)
 
static boolean EnableAttachmentPoints (boolean state)
 
static boolean EnableTimerXforms (boolean state)
 
static void Error (GlgErrorType error_type, String message, Object exception)
 
static String GetLibraryVersion ()
 
static boolean GetModifierState (GlgModifierType modifier)
 
static int GetPendingInstances ()
 
static int GetPendingTemplates ()
 
static GlgObject GetReference (GlgObject object)
 
static GlgObject GetSelectedPlot ()
 
static String GetStackTraceAsString ()
 
static boolean GetTouchMode ()
 
static void GlmConvert (GlgProjectionType projection, boolean stretch, GlgCoordType coord_type, boolean coord_to_lat_lon, GlgPoint center, GlgPoint extent, double angle, double min_x, double max_x, double min_y, double max_y, GlgPoint in_point, GlgPoint out_point)
 
static boolean IHCallCurrIH (GlgCallEvent call_event)
 
static boolean IHCallCurrIHWithModifToken (GlgCallEvent call_event, int token)
 
static boolean IHCallCurrIHWithToken (int token)
 
static void IHCallPrevIHWithModifToken (GlgCallEvent call_event, int token)
 
static void IHCallPrevIHWithToken (int token)
 
static void IHChangeBParameter (GlgObject ih, String name, boolean value)
 
static void IHChangeDParameter (GlgObject ih, String name, double value)
 
static void IHChangeIParameter (GlgObject ih, String name, int value)
 
static void IHChangeNParameter (GlgObject ih, String name, Object value)
 
static void IHChangeOParameter (GlgObject ih, String name, GlgObject value)
 
static void IHChangeSParameter (GlgObject ih, String name, String value)
 
static boolean IHGetBParameter (GlgObject ih, String name)
 
static GlgObject IHGetCurrIH ()
 
static double IHGetDParameter (GlgObject ih, String name)
 
static GlgIHHandlerInterface IHGetHandlerInterface (GlgObject ih)
 
static int IHGetIParameter (GlgObject ih, String name)
 
static Object IHGetNParameter (GlgObject ih, String name)
 
static GlgObject IHGetOParameter (GlgObject ih, String name)
 
static boolean IHGetOptBParameter (GlgObject ih, String name, boolean default_value)
 
static double IHGetOptDParameter (GlgObject ih, String name, double default_value)
 
static int IHGetOptIParameter (GlgObject ih, String name, int default_value)
 
static Object IHGetOptNParameter (GlgObject ih, String name, Object default_value)
 
static GlgObject IHGetOptOParameter (GlgObject ih, String name, GlgObject default_value)
 
static String IHGetOptSParameter (GlgObject ih, String name, String default_value)
 
static GlgIHHandlerInterface IHGetPrevHandlerInterface ()
 
static GlgObject IHGetPrevIH ()
 
static String IHGetSParameter (GlgObject ih, String name)
 
static int IHGetToken (GlgCallEvent call_event)
 
static GlgCallEventType IHGetType (GlgCallEvent call_event)
 
static void IHInit ()
 
static GlgObject IHInstall (GlgIHHandlerInterface interface_handler)
 
static GlgObject IHInstallAsInterface (function entry_point)
 
static void IHPassToken (GlgIHHandlerInterface handler_interface, int token, boolean uninstall)
 
static void IHResetup (GlgObject ih)
 
static void IHSetBParameter (GlgObject ih, String name, boolean value)
 
static void IHSetDParameter (GlgObject ih, String name, double value)
 
static void IHSetIParameter (GlgObject ih, String name, int value)
 
static void IHSetNParameter (GlgObject ih, String name, Object value)
 
static void IHSetOParameter (GlgObject ih, String name, GlgObject value)
 
static void IHSetOParameterFromD (GlgObject ih, String name, double value)
 
static void IHSetOParameterFromG (GlgObject ih, String name, double value1, double value2, double value3)
 
static void IHSetOParameterFromGPoint (GlgObject ih, String name, GlgPoint point)
 
static void IHSetSParameter (GlgObject ih, String name, String value)
 
static void IHStart ()
 
static void IHTerminate ()
 
static void IHUninstall ()
 
static void IHUninstallWithEvent (GlgCallEvent call_event)
 
static void IHUninstallWithToken (int token)
 
static void Init ()
 
static boolean IsDemo ()
 
static void LoadAsset (String url, GlgHTTPRequestResponseType request_type, function callback, Object user_data)
 
static GlgObject LoadObject (Object data, String encoding, String path, GlgObject rebind_ref)
 
static void LoadObjectFromURL (String url, String encoding, function callback, Object user_data, function abort_func, GlgObject rebind_ref)
 
static GlgObject LoadWidget (Object data, String encoding, String path)
 
static GlgObject LoadWidgetFromObject (GlgObject glg_object)
 
static void LoadWidgetFromURL (String url, String encoding, function callback, Object user_data, function abort_func)
 
static boolean ObjectsEqual (GlgObject object1, GlgObject object2)
 
static String PrintfD (String format, double value)
 
static String PrintfI (String format, int value)
 
static String PrintfS (String format, String value)
 
static double Rand (double low, double high)
 
static ReleaseToCache (Object object)
 
static boolean RootToScreenCoord (GlgObject viewport, GlgPoint root_coord)
 
static GlgAlarmHandler SetAlarmHandler (GlgAlarmHandler alarm_handler)
 
static boolean SetAttachmentMoveMode (boolean state)
 
static void SetCanvasScale (double scale, double text_scale, double native_text_scale)
 
static void SetCustomLoadFunc (Function(String, String, int, Function(int, Object)) func)
 
static boolean SetEditMode (GlgObject viewport, String res_name, boolean edit_mode)
 
static GlgErrorHandler SetErrorHandler (GlgErrorHandler new_handler)
 
static void SetLocale (String locale)
 
static GlgTooltipFormatter SetTooltipFormatter (GlgTooltipFormatter formatter)
 
static void SetTouchMode ()
 
static void Terminate ()
 
static void ThrowExceptionOnError (boolean user_error, boolean internal_error, boolean detect_null_strings)
 
static void TranslatePointOrigin (GlgObject from_viewport, GlgObject to_viewport, GlgPoint point)
 
static boolean TraverseObjects (GlgObject object, boolean state, boolean is_widget, GlgObject top_parent, function action)
 

Static Public Attributes

static GlgObject IH_CURR = null
 
static GlgObject IH_GLOBAL = null
 
static GlgObject IH_NEW = null
 

Member Function Documentation

void AbortGISRequest ( String  res_name)

Intermediate API: Aborts the GIS request in progress, if any.

Parameters
res_nameIf is not null, specifies the resource path of child GIS object, otherwise this GIS object will be used.
GlgObject AddAnnotation ( String  res_name,
GlgObject  annotation,
double  position_x,
double  position_y,
boolean  add_box 
)

Adds an annotation to a chart.

Parameters
res_nameThe resource path of a child chart to add the annotation to, or null to add to this chart object.
annotationThe annotation object to add, or null to create a new annotation.
position_xThe annotation's X position.
position_yThe annotation's Y position.
add_boxIf set to true, a text box will be added to the annotation label if the new annnotation is created.
Returns
The added annotation object, or null on failure.
GlgObject AddAttachmentPoint ( double  dx,
double  dy,
double  dz 
)

Extended API: Adds an attachment point to a reference object at the specified offset from its anchor point. The offset is in world coordinates for resizable reference objects and in screen corrdinates for fixed size references.

Parameters
dxX offset
dyY offset
dzZ offset
Returns
Created attachment point.
static void AddDataSample ( GlgObject  plot,
GlgDataSample  datasample 
)
static

Deprecated, use AddDataSampleNode.

static void AddGlobalListener ( GlgCallbackType  type,
function  callback 
)
static

Adds a global listener for TemplateLoad events.

Parameters
typeCallback type: TEMPLATE_LOAD_CB
callbackA callback function with the type signature matching the type signature of the GlgTemplateLoadListener::TemplateLoadCallback method. This function will be invoked to handle TemplateLoad events generated by subwindows and subdrawings when their templates are loaded.
void AddListener ( GlgCallbackType  type,
function  callback 
)

Adds a listener for GLG events to a viewport or light viewport.

Light viewports support only input listeners, while viewport objects support all listener types.

Parameters
typeCallback type: SELECT_CB, INPUT_CB, TRACE_CB or TRACE2_CB. (defined in the GlgCallbackType enum).
callbackA callback function with the type signature matching the type signature of the methods of the corresponding listener objects:

This function will be invoked to handle events of the requested listener type.

boolean AddObjectAt ( Object  obj,
int  index 
)

Extended API: Adds object to the container at the specified position.

Parameters
objObject to add
indexPosition index
boolean AddObjectToBottom ( Object  obj)

Extended API: Adds object to the bottom of the container.

Parameters
objObject to add
boolean AddObjectToTop ( Object  obj)

Extended API: Adds object to the top of the container.

Parameters
objObject to add
GlgObject AddPlot ( String  res_name,
GlgObject  plot 
)

Adds a plot line to a chart.

Parameters
res_nameThe resource path of a child chart to add the plot to, or null to add to this chart object.
plotThe plot object. It null is specified, the method creates a plot with default parameters.
Returns
The added plot object.
void AddPlotDataSample ( double  value,
double  time_stamp,
boolean  valid,
float  marker_visibility,
boolean  quick_mode 
)

Intermediate API, ADVANCED: Adds a new datasample with the supplied values to this plot's data buffer. If the plot uses a cache, and the cache is not empty, the new datasample will be taken from the plot's cache.

Parameters
valueThe datasample value.
time_stampThe time stamp.
validThe valid flag.
marker_visibilityThe marker visibility in the range [0;1].
quick_modeEnables a quick mode that bypasses chart autoscroll and autoscale logic for faster chart prefilling, and also disables all validity checks for increased performance of charts with large number of data samples.
To scroll the chart to the last added sample when done adding samples, set the chart XAxis' EndValue to the time stamp of the last sample.

It is recommended that the initial development is done with quick_mode=false, switching to quick_mode=true when all potential errors have been dealt with.
GlgObject AddTimeLine ( String  res_name,
GlgObject  time_line,
double  time_stamp 
)

Adds a time line to a chart.

Parameters
res_nameThe resource path of a child chart to add the time line to, or null to add to this chart object.
time_lineThe time line object to add, or null to create a new time line.
time_stampThe time stamp to assign to the added time line.
Returns
The added time line object, or null on failure.
static void Bell ( )
static

Emits an audio beep. See BellExt for more control over the audio beep parameters.

static void BellExt ( double  volume,
double  frequency,
double  duration 
)
static

Emits a beeping sound with the specified parameters.

The Bell method uses this method with the following parameters:

    BellExt( 0.03, 520, 0.1 )

Parameters
volumeThe sound volume
frequencyThe sound frequency
durationThe sound duration
void ChangeObject ( String  res_name)

Forces a change event for an object.

boolean ClearDataBuffer ( String  res_name)

Clears data buffer of a chart or a plot object.

For a chart object, the method clears data buffers of all its plots. For a plot object, the method clears the buffer of the plot.

Parameters
res_nameThe resource path of a child chart or a child's plot to clear the buffer of, or null to clear this object.
Returns
false if the buffer did not contain any data samples, or true otherwise.
GlgObject CloneObject ( GlgCloneType  clone_type)

Extended API: Creates and returns a copy of an object according to the clone_type.

The WEAK_CLONE, STRONG_CLONE, FULL_CLONE or CONSTRAINED_CLONE clone types differ in the way they handle objects' Global flag settings.

The SHALLOW_CLONE fills the returned group with the object IDs of the elements of the original group without copying the elements.

Returns
Object copy
static String ConcatResNames ( String  resource_name1,
String  resource_name2 
)
static

Concatenates two resource names, inserting the "/" separator if necessary.

Parameters
resource_name1Resource path
resource_name2Resource name
Returns
Created name
boolean ConstrainObject ( GlgObject  to_attribute)

Intermediate API: Constrains the attribute object.

Parameters
to_attributeThe object to constrain to
boolean ContainsObject ( Object  obj)

Intermediate API: Checks if the object is contained in the container.

Parameters
objThe object to search for.
Returns
true if the object is contained in the container.
static GlgObject ConvertViewportType ( GlgObject  obj)
static

Extended API: Converts viewport to a light viewport, or a light viewport to a viewport.

Parameters
objObject to be converted: viewport or light viewport.
Returns
Converted object on success, or null on error.
GlgObject CopyObject ( )

Extended API: Creates a copy of an object using FULL_CLONE copy method.

Returns
Object copy
GlgObject CreateAlarmList ( )

Returns a list of all alarms defined in the object.

GlgObject CreateChartSelection ( GlgObject  plot,
double  x,
double  y,
double  dx,
double  dy,
boolean  screen_coord,
boolean  include_invalid,
boolean  x_priority 
)

Intermediate API, ADVANCED: Returns chart selection corresponding to the screen point.

Parameters
plotThe plot to create selection for, or null to query all plots of this chart.
xThe x/time coordinate.
yThe y coordinate.
dxThe x distance around the point. Datasamples with greater x distances from the point will not be considered.
dyThe y distance around the point. Datasamples with greater y distances from the point will not be considered. not be considered.
screen_coordIf set to true, the coordinates are supplied in screen pixels (with pixel0 center at 0.5). If set to false, x coordinates are suplied in the units of the chart's X axis (x or time value), and y coordinates are supplied in relative units with the [0,1] range corresponding to the min/max of each datagroup. Relative ranges are used to allow for uniform handling of multiple datagroups.
include_invalidIf set to true, invalid samples will be reported if their time stamp matches the x coordinate.
x_priorityIf set to true, a point with the smallest x deviation will be selected, otherwise a point with the smallest xy distance will be selected.
Returns
Selection object (a group containing properties of the selected datasample). Refer to the Chart Selection Message Object section of the GLG Programming Reference Manual for detailed description of the chart selection object.
static String CreateIndexedName ( String  template_name,
int  resource_index 
)
static

Creates an indexed name by inserting a number into the first % character of the name template.

Returns
Created name
GlgObject CreateInversedMatrix ( )

Intermediate API, ADVANCED: Creates and returns a matrix that is an inverse of this matrix.

Returns
Inversed matrix
static GlgObject CreateObject ( GlgObjectType  type,
Object  param1,
Object  param2,
Object  param3,
Object  param4 
)
static

Extended API: Creates a GlgObject of the requested type.

Parameters
typeGLG object type
param1An optional object creation parameter that depends on the object type.
param2An optional object creation parameter that depends on the object type.
param3An optional object creation parameter that depends on the object type.
param4An optional object creation parameter that depends on the object type.
Returns
The created GLG object.

Refer to the Using GlgCreateObject section of the C/C++ Extended API in the GLG Programming Reference Manual for description of parameter values.

GlgObject CreatePointArray ( GlgControlPointType  type)

Intermediate API, ADVANCED: Creates an array containing all of an object's control points.

Parameters
typeReserved for future use.
Returns
Array of the object's control points.
GlgObject CreateResourceList ( boolean  list_named_res,
boolean  list_def_attr,
boolean  list_aliases 
)

Intermediate API, ADVANCED: Queries object's resources.

Creates an array of all resource names of this object on one level of hierarchy.

Parameters
list_named_resInclude named resources if true
list_def_attrInclude default attributes if true
list_aliasesInclude aliases if true
Returns
An array of resources containing named resource objects, or dummy named objects for defauilt resources and aliases.
static GlgObject CreateSelection ( GlgObject  top_vp,
GlgCube  rectangle,
GlgObject  selected_vp 
)
static

Intermediate API, ADVANCED: Creates an array of objects selected by a rectangle.

This is the same as CreateSelectionNames, but returns an array of selected objects on the bottom of the hierarchy instead of an array of object names.

Parameters
top_vpThe top viewport of the drawing
rectangleRectangle in screen coordinates of the selected_vp.
selected_vpThe selection viewport.
Returns
Array of objects selected by the rectangle.
static GlgObject CreateSelectionFromEvent ( int  x,
int  y,
int  delta,
GlgObject  top_vp,
GlgObject  selected_vp 
)
static

Intermediate API, ADVANCED: Creates object selection from a mouse event.

Parameters
xX coordinate of the event
yY coordinate of the event
deltaMouse sensitivity in pixels
top_vpThe top viewport of the drawing
selected_vpThe viewport of the mouse event.
Returns
Array of objects selected by the mouse event.
static GlgObject CreateSelectionMessage ( GlgObject  top_vp,
GlgCube  rectangle,
GlgObject  selected_vp,
GlgSelectionEventType  selection_type,
int  button 
)
static

ADVANCED: Alternative interface to custom events and commands. Finds the first object selected by the specified rectangle that contains a matching action attached and returns a custom event or command message for the found action. The message is the same as the one received in the Input callback on mouse click or mouse over event. The rectangle is used to select an object with an attached custom event or command action, instead of using the mouse event for selecting an object. The first selected custom event or command message is returned, or null if no objects with custom event or command actions were selected.

Parameters
top_vpThe top viewport of the drawing
rectangleRectangle in screen coordinates of the selected_vp.
selected_vpThe selection viewport in which rectangle coordinates are defined.
selection_typeCLICK_SELECTION, MOVE_SELECTION or TOOLTIP_SELECTION.
buttonselection button for click selection or 0.0
Returns
Custom event or command message object containing information about the selected object.
static GlgObject CreateSelectionNames ( GlgObject  top_vp,
GlgCube  rectangle,
GlgObject  selected_vp 
)
static

ADVANCED: Creates an array of objects selected by a rectangle.

Parameters
top_vpThe top viewport of the drawing
rectangleRectangle in screen coordinates of the selected_vp.
selected_vpThe selection viewport in which rectangle coordinates are defined.
Returns
Array of names of all objects selected by the rectangle.
static GlgObject CreateSelectionNamesFromEvent ( int  x,
int  y,
int  delta,
GlgObject  top_vp,
GlgObject  selected_vp 
)
static

ADVANCED: Creates object selection from a mouse event.

This method is useful for use with the Trace callback to implement custom selection logic based on the mouse events.

Parameters
xX coordinate relative to the selected_vp.
yY coordinate relative to the selected_vp.
deltaMouse sensitivity in pixels
top_vpThe top viewport of the drawing
selected_vpThe viewport of the mouse event.
Returns
Array of names of all objects selected by the mouse event.
GlgObject CreateTagList ( boolean  unique_tag_sources)

Returns a list of all tags of the DATA_TAG type defined in the object

Parameters
unique_tag_sourcesIf set to true, only the first encountered tag will be reported for tags with the same tag sources.
String CreateTooltipString ( double  x,
double  y,
double  dx,
double  dy,
String  format 
)

Intermediate API, ADVANCED: Returns tooltip string corresponding to the screen point.

Parameters
xThe x coordinate.
yThe y coordinate.
dxThe x distance around the point for chart tooltips. Datasamples with greater x distances from the point will not be considered.
dyThe y distance around the point for chart tooltips. Datasamples with greater y distances from the point will not be considered.
formatTooltip format. Pass null to use default tooltip, pass "<single_line>" to use default tooltip without line breaks.
Returns
Tooltip string containing information about the chart point or an axis position selected by the passed coordinates.
boolean DeleteAnnotation ( String  res_name,
GlgObject  annotation,
double  position_x,
double  position_y 
)

Deletes an annotation from a chart.

Parameters
res_nameThe resource path of a child chart to delete the annotation from, or null to delete from this chart object.
annotationThe annotation object to delete, or null to delete an annotation with the specified position_x and position_y parameters.
position_xThe x position of the annotation to delete when the annotation parameter is null.
Returns
true if a time line was deleted.
boolean DeleteBottomObject ( )

Extended API: Deletes last object from the container.

boolean DeleteObjectAt ( int  index)

Extended API: Deletes the object of the container at the specified position.

Parameters
indexIndex of the object to delete.
boolean DeletePlot ( String  res_name,
GlgObject  plot 
)

Deletes a plot line from a chart.

Parameters
res_nameThe resource path of a child chart to delete the plot from, or null to delete from this chart object.
plotThe plot object.
Returns
true on success.
boolean DeleteTags ( GlgTagType  tag_type_mask)

Intermediate API: Delete all tags of a requested tag type.

Parameters
tag_type_maskSpecifies the tag type(s) to search. Several tag types can be combined by ORing them together.
boolean DeleteThisObject ( Object  obj)

Extended API: Deletes the object from the container.

Parameters
objObject to delete.
Returns
true if the object was successfully deleted.
boolean DeleteTimeLine ( String  res_name,
GlgObject  time_line,
double  time_stamp 
)

Deletes a time line from a chart.

Parameters
res_nameThe resource path of a child chart to delete the time line from, or null to delete from this chart object.
time_lineThe time line object to delete, or null to delete a time line with the specified time stamp.
time_stampThe time stamp of the time line to delete when the time_line parameter is null.
Returns
true if a time line was deleted.
boolean DeleteTopObject ( )

Extended API: Deletes first object from the container.

static boolean EnableAttachmentPoints ( boolean  state)
static

Intermediate API: Enables use of attachment points for object layout.

If attachment points are disabled, layout methods do not consider attachment points in the control points layout mode. If attachment points are enabled, both control points and attachment points are used to determine an object's extent.

Parameters
stateThe new state of the attachment point use mode.
Returns
The previous state of the attachmenmt point use mode.
static boolean EnableTimerXforms ( boolean  state)
static

Enables or disables timer transformations.

Parameters
stateThe new enabled state.
Returns
Previous value of the enabled state.
boolean Equals ( GlgObject  object)

Performs equality comparison between the passed object and this object.

Parameters
objectGlgObject to compare this object with.
Returns
true if the passed object represents the same internal GLG object as this object.
static void Error ( GlgErrorType  error_type,
String  message,
Object  exception 
)
static

Invokes a currently installed error handler to generate an error message.

Parameters
error_typeSpecifies an error type: INTERNAL_ERROR, USER_ERROR, WARNING, INFO or LOGGING.
messageAn error message
exceptionAn optional exception that caused the error. If it is not null, it is used to print additional information by converting the exception to string.
Object ExportStrings ( String  separator1,
String  separator2 
)

Exports all strings defined in the (drawing) object.

Parameters
separator1If not null, the first character of the string defines the first separator character, otherwise the quote character is used as the first separator.
separator2If not null, the first character of the string defines the second separator character, otherwise the quote character is used as the second separator.
Returns
An object containing a count and data properties on success, or null on error. The count property (integer) contains the number of exported strings, and the data property (string) contains the list of exported strings.
Object ExportTags ( String  separator1,
String  separator2 
)

Exports all tags defined in the (drawing) object.

Parameters
separator1If not null, the first character of the string defines the first separator character, otherwise the quote character is used as the first separator.
separator2If not null, the first character of the string defines the second separator character, otherwise the quote character is used as the second separator.
Returns
An object containing a count and data properties on success, or null on error. The count property (integer) contains the number of exported tags, and the data property (string) contains the list of exported tags.
boolean FindMatchingObjects ( GlgObjectMatchType  match_type,
boolean  find_parents,
boolean  find_first_match,
boolean  search_inside,
boolean  search_drawable_only,
GlgObjectType  object_type,
String  object_name,
String  resource_name,
GlgObject  object_id,
function  custom_match 
)

Intermediate API: Finds object's parents or children that match the specified search criteria.

Parameters
match_typeA bitwise mask of constants in the GlgObjectMatchType enum to specify the object matching criteria: OBJECT_TYPE_MATCH, OBJECT_NAME_MATCH, RESOURCE_MATCH, OBJECT_ID_MATCH or CUSTOM_MATCH. All of the criteria in the mask must be true in order for an object to match.
find_parentsTrue to search parents, false to search children of the object.
find_first_matchIf true, stop the search after the first match and return the matching object. If false, returns all matching objects.
search_insideIf false, don't search the object's children or parents if the object itself matches.
search_drawable_onlySearch only drawable objects (searching children only). Refer to the description of the IsDrawable method for more information.
object_typeObject type for the object type search.
object_nameObject name for the object name search.
resource_nameResource name for the resource search.
object_idObject ID for the object id search.
custom_matchA function that will be invoked for each object to provide custom matching logic. The function should return true if the match was detected, and should have the following type signature:

    boolean custom_match( GlgObject object );

where:
  • object is the object to act upon.
Returns
An object containing found_object and found_multiple properties if one or more matches were found, or null if there were no matches. For a single match, found_object will contain the matching object and the found_multiple property will be set false. If several matches were found, found_object will contain a group of matching objects, and found_multiple will be set to true.
boolean FitObject ( GlgCoordType  coord_type,
GlgCube  box,
boolean  keep_ratio 
)

Intermediate API: Fits an object to the specified box.

Parameters
coord_typeThe coordinate system in which the box is defined. May have the following values:

SCREEN_COORD to fit in screen pixels

PARENT_COORD to fit in the world coordinates of the object's parent

OBJECT_COORD to fit in the world coordinates of the object.

boxNew object bounding box.
keep_ratioIf set to true, the same scale factor is used for X, Y and Z scaling.
Returns
false if errors were encountered during the fitting process.
void Flush ( int  size)

Extended API: Sets container size to the requested size. If the new size is less than the container size, extra elements are removed. If the new size is larger, it adds elements by making a copy of the last element.

The container may be a group, a viewport, a polygon (as a container of points), a spline or a connector. The function can only be invoked if the container is not set up. If the container is set up (drawn), the function must be surrounded by the SuspendObject and ReleaseObject calls.

Parameters
sizeNew size.
GlgObject GetAction ( GlgActionType  action_type,
GlgTriggerType  trigger_type,
int  button,
GlgArmedStateType  armed_state,
GlgDoubleClickStateType  double_click_state,
String  action,
String  subaction,
boolean  enabled_only 
)

Intermediate API: Returns the first found action with the matching parameters attached to the object.

Parameters
action_typeSpecifies an action type. If zero, actions of any type will be considered.
trigger_typeSpecifies a trigger type. If zero, actions with any trigger type will be considered.
buttonSpecifies a mouse button. If zero, actions that are activated by any mouse button will be considered.
armed_stateSpecifies settings of an action's ProcessArmed attribute, may be ANY_ARMED_STATE, ARMED_ONLY_STATE or UNARMED_ONLY_STATE.
double_click_stateSpecifies settings of an action's DoubleClick attribute, may be DOUBLE_CLICK_NONE, DOUBLE_CLICK_ONLY, SINGLE_CLICK_ONLY or SINGLE_AND_DOUBLE_CLICK.
actionSpecifies input action string for action objects with INPUT trigger. If null, action objects with any input action string will be considered.
subactionSpecifies input subaction string for action objects with INPUT trigger. If null, action objects with any input subaction string will be considered.
enabled_onlyIf set to true, only actions enabled by the settings of their Enabled attribute will be considered.
Returns
Matching action object.
GlgObject GetAlarmObject ( String  alarm_label,
boolean  single_alarm 
)

Intermediate API: Finds alarms based on their alarm label attribute.

Parameters
alarm_labelAlarm label, may contain '*' and '?' wildcards.
single_alarmIf set to true, the method returns the first found alarm object with the specified alarm label.
Returns
An alarm object if single_tag=true or an array of alarms otherwise.
GlgCube GetBox ( )

Intermediate API, ADVANCED: Returns object's 3D bounding box in screen coordinates.

The box can be used for collision detection. The coordinates of the box are valid only after the object has been drawn.

Returns
Bounding box
GlgMinMax GetChartDataExtent ( String  res_name,
boolean  time,
boolean  visible_only 
)

Returns the extent of data accumulated in the chart in one direction.

Parameters
res_nameThe resource path of a child chart or a child's plot to query, or null to query this object.
timetrue to query the minimum and maximum timestamps (or X values the X/Y scatter plot), false to query the minimum and maximum Y values.
visible_onlyControls the extent of the query when querying minimum and maximum of Y values. If set to true, the minimum and maximum Y values of the visible data samples will be returned. If set to false, the minimum and maximum of all data samples will be returned.
Returns
GlgMinMax object or null if the chart plot's contain no data.
GlgMinMax GetDataExtent ( String  res_name,
boolean  time 
)

Deprecated, use GetChartDataExtent.

GlgDataType GetDataType ( )

Returns a data type of a data or attribute object.

GlgObject GetDrawingMatrix ( )

Intermediate API, ADVANCED: Returns the matrix object of the transformation used to draw the object on the screen.

Returns
Drawing matrix
double GetDResource ( String  resource_name)

Returns value of a D (double) resource.

Parameters
resource_nameResource name
Returns
Resource value
double GetDTag ( String  tag_source)

Returns value of a D (double) tag.

Parameters
tag_sourceTag source
Returns
Tag value
Object GetElement ( int  index)

Returns container's element at the specified position.

Parameters
indexPosition Index
Returns
Container's element or null on failure.
GlgGISRequestObserver GetGISRequestInfo ( String  res_name)

Intermediate API: Obtains information about a GIS object's current GIS request being processed.

Parameters
res_nameIf is not null, specifies the resource path of child GIS object, otherwise this GIS object will be used.
Returns
The request observer of a GIS request in progress, or null if the GIS object has no pending GIS requests.
GlgPoint GetGResource ( String  resource_name)

Returns value of a G (geometrical or color) resource.

Parameters
resource_nameResource name
Returns
Resource value
GlgPoint GetGTag ( String  tag_source)

Returns value of a G (geometrical or color) tag.

Parameters
tag_sourceTag source
Returns
Tag value
int GetIndex ( Object  obj)

Intermediate API: Returns the index of the first occurrence of the object in the container.

Parameters
objThe object to search for.
Returns
Object's index or -1 if the object wasn't found in the container.
GlgObject GetLegendSelection ( double  x,
double  y 
)

Intermediate API, ADVANCED: Returns a plot object corresponding to the legend item at the specified screen point.

Parameters
xThe x coordinate.
yThe y coordinate.
Returns
The plot corresponding to the selected legend item of this legend object.
static String GetLibraryVersion ( )
static

Queries GLG JavaScript library version.

Returns
The string in the N.N format that represents the major and minor version of the GLG JavaScript library.
GlgMatrixData GetMatrixData ( GlgMatrixData  matrix_data)

Intermediate API, ADVANCED: Returns values of the matrix's coefficients

Parameters
matrix_dataGlgMatrixData object to be filled with returned matrix data. If null is passed, a new GlgMatrixData object will be created.
Returns
GlgMatrixData object filled with the matrix data.
static boolean GetModifierState ( GlgModifierType  modifier)
static

Returns the current state of a modifier.

Parameters
modifierSpecifies the modifier to query.
Returns
The current modifier state.
GlgObject GetNamedObject ( String  name)

Intermediate API: Returns container's element with the specified name

Parameters
nameThe element's name
Returns
Container's element or null if named element wasn't found.
GlgObject GetNamedPlot ( String  res_name,
String  plot_name 
)

Finds a chart's plot by name.

Parameters
res_nameThe resource path of a child chart to query, or null to query this chart object.
plot_nameThe plot name.
Returns
The plot object.
Object GetNativeComponent ( String  res_name,
GlgComponentQueryType  type 
)

Returns the native component of the viewport.

Parameters
res_nameThe resource name of the child object, or null to use this object.
typeSpecifies the type of the component to return.
Returns
The native component object.
int GetNumParents ( )

Intermediate API, ADVANCED: Returns the number of object's parents.

Used to determine the type of the return value of the GetParent method.

Returns
number object's parents
String GetObjectName ( )

Returns an object's name.

GlgObjectType GetObjectType ( )

Returns an object's type.

GlgObject GetParent ( )

Intermediate API, ADVANCED: Returns object parent(s).

The type of the return value may be determined by using GetNumParents method.

Returns
objects' parent if the object has one parent. If object has more than one parent, returns an array of parents.
GlgObject GetParentViewport ( boolean  heavy_weight)

Intermediate API: Returns object's parent viewport.

This method provides a convenient way to get the viewport or the light viewport the object is drawn in.

Parameters
heavy_weightThe type of a viewport to return. If set to true, the closest heavy-weight parent viewport will be returned; otherwise the closest parent viewport will be returned, either heavy or light-weight.
Returns
The object's parent viewport of the specified type.
static int GetPendingInstances ( )
static

Returns a number of subdrawing and subwindow objects that are waiting for their templates being loaded.

static int GetPendingTemplates ( )
static

Returns a number of subdrawing and subwindow templates that are in the process of being loaded.

static GlgObject GetReference ( GlgObject  object)
static

Creates a GlgObject that may be used outside of a callback method.

Parameters
objectGlgObject to reference
Returns
GlgObject that equals to the object parameter and may be used outside of a callback method.

Any object obtained inside a callback without a call to a GLG method that returns an object is not valid outside of a callback. The GetReference method should be used to assign such an object to a variable used outside the callback, as shown in the below example:

var StoredGlgObject = null;

function TraceCallback( viewport, trace_info )
{
   // Incorrect: can't assign object received in a callback to a global variable.
   StoredGlgObject = viewport;

   // Incorrect: can't assign object received in a callback to a global variable.
   StoredGlgObject = trace_info.viewport;

   // Correct: using GetReference to assign to a global variable.
   StoredGlgObject = GLG.GetReference( trace_info.viewport );

   // Correct: assigning an object obtained via a GLG call.
   StoredGlgObject = trace_info.viewport.GetResourceObject( "FillColor" );
}

Object GetResource ( String  resource_name)

Intermediate API: Finds and returns a resource of an arbitrary type.

Parameters
resource_nameResource name
Returns
Resource object.
GlgObject GetResourceObject ( String  resource_name)

Intermediate API: Finds and returns a named resource or an attribute of the object.

Parameters
resource_nameResource name
Returns
Resource or attribute object.
static GlgObject GetSelectedPlot ( )
static

Returns a plot corresponding to the last selected legend item, or null if no item was selected.

When the legend is selected by the mouse move or mouse click event, it determines the legend item the mouse points at, and stores the item's plot object.

int GetSize ( )

Returns container's size.

String GetSResource ( String  resource_name)

Returns value of an S (string) resource.

Parameters
resource_nameResource name
Returns
Resource value
static String GetStackTraceAsString ( )
static

Returns the current stack trace as a String.

String GetSTag ( String  tag_source)

Returns value of an S (string) tag. All tags with the specified tag_source will be set to the supplied value.

Parameters
tag_sourceTag source
Returns
Tag value
int GetStringIndex ( String  search_string)

Intermediate API: Returns the index of the first occurrence of the string in a string container.

Parameters
search_stringThe string to search for.
Returns
Object's index or -1 if the object wasn't found in the container.
GlgObject GetTagObject ( String  search_string,
boolean  by_name,
boolean  unique_tags,
boolean  single_tag,
GlgTagType  tag_type_mask 
)

Intermediate API: Finds tags based on their TagName or TagSource attributes.

Parameters
search_stringTag name or source, may contain '*' and '?' wildcards.
by_nameSearch type: search for tag name if true, tag source if false.
unique_tagsIf set to true, only one tag instance will be returned for each tag name.
single_tagIf set to true, the method returns the first found tag object with the specified name.
tag_type_maskSpecifies the types of tags to return, is formed by ORing the tag type constants.
Returns
A tag object if single_tag=true or an array of tags otherwise.
static boolean GetTouchMode ( )
static

Queries the state of the touch mode.

Returns
true if the touch mode is currently enabled.
boolean GISConvert ( String  res_name,
GlgCoordType  coord_type,
boolean  coord_to_lat_lon,
GlgPoint  in_point,
GlgPoint  out_point 
)

Performs coordinate conversion between the GIS to GLG coordinate systems using the current settings of the GIS object.

Parameters
res_nameThe resource path of a child GIS object to query, or null to query this GIS object.
coord_typeCoordinate system to use, SCREEN_COORD or OBJECT_COORD. For OBJECT_COORD, the world coordinate system of the GIS object is used.
coord_to_lat_lonConversion type: x/y to lon/lat if true, lon/lat to x/y if false.
in_pointInput values (x/y in the selected coordinate system or lon/lat).
out_pointConverted output values (x/y in the selected coordinate system or lon/lat).
Returns
true if coordinate conversion succeeded with no errors.
boolean GISCreateSelection ( String  res_name,
String  layers,
double  x,
double  y,
GlmLabelSelectionMode  select_labels,
function  callback 
)

Queries information about GIS features located at the specified map position.

Parameters
res_nameThe resource path of a child GIS object to query or null to query this GIS object.
layersList of vector layers to query
xThe X coordinate (in screen pixels) in the GIS object's parent viewport
yThe Y coordinate (in screen pixels) in the GIS object's parent viewport
select_labelsControls text label selection. May have the following values:
  • GIS_LBL_SEL_NONE disables label selection
  • GIS_LBL_SEL_IN_TILE enables selection
  • GIS_LBL_SEL_MAX_PRECISION enables selection with maximum precision
callbackA function to be invoked with the received selection data, with the following type signature:

    void callback( GlgObject gis_object, double selection_message )

where:
  • gis_object is the GIS object being queried
  • selection_message is a message object containing returned selection data. It which could be null if there was no selection detected for the requested lat/lon. Refer to the GlmGetSelection section of the GLG Map Server Reference Manual for information on the structure of the returned message object.
Returns
true if selection request was successfully posted, in which case the callback function will be invoked when the data are received.
boolean GISGetElevation ( String  res_name,
String  layer_name,
double  lon,
double  lat,
function  callback 
)

Queries map server elevation data.

Parameters
res_nameThe resource path of a child GIS object to query or null to query this GIS object.
layer_nameName of the elevation layer to query
latThe Lat coordinate of the point
lonThe Lon coordinate of the point
callbackA function to be invoked with the received elevation data, with the following type signature:

    void callback( GlgObject gis_object, double elevation )

where:
  • gis_object is the GIS object being queried
  • elevation is the returned elevation value, which could be null if there is no elevation data for the requested lat/lon location.
Returns
true if elevation request was successfully posted, in which case the callback function will be invoked when the data are received.
static void GlmConvert ( GlgProjectionType  projection,
boolean  stretch,
GlgCoordType  coord_type,
boolean  coord_to_lat_lon,
GlgPoint  center,
GlgPoint  extent,
double  angle,
double  min_x,
double  max_x,
double  min_y,
double  max_y,
GlgPoint  in_point,
GlgPoint  out_point 
)
static

Low-level interface to the map server; performs GIS coordinate conversion.

Parameters
projectionRECTANGULAR or ORTHOGRAPHIS
stretchIf false, the map extent is adjusted to preserve X/Y ratio (for SCREEN_COORD coordinate type only).
coord_typeCoordinate system to use.
coord_to_lat_lonConversion type: x/y to lon/lat if true, lon/lat to x/y if false.
centerCenter of the map in lat/lon.
extentExtent of the map in lat/lon (rectangular projection) or in meters for orthogonal progection.
angleAngle of the map rotation.
min_xThe extent of the GIS object in the selected coordinate system.
min_yThe extent of the GIS object in the selected coordinate system.
max_xThe extent of the GIS object in the selected coordinate system.
max_yThe extent of the GIS object in the selected coordinate system.
in_pointInput values (x/y in the selected coordinate system or lon/lat).
out_pointConverted output values (x/y in the selected coordinate system or lon/lat).
boolean HasResourceObject ( String  resource_name)

Checks for the existence of the resource object.

Parameters
resource_nameResource name
Returns
true on success
boolean HasTag ( String  tag_name,
GlgTagType  tag_type_mask 
)

Intermediate API: Checks for an existence of a tag object with the specified tag name and tag type.

Parameters
tag_nameTag name
tag_type_maskSpecifies the types of tags to search, is formed by ORing the tag type constants.
Returns
true on success
boolean HasTagName ( String  tag_name)

Checks for an existence of a data tag object with the given tag name.

Parameters
tag_nameTag name
Returns
true on success
boolean HasTagSource ( String  tag_source)

Checks for an existence of a data tag object with the given tag source.

Parameters
tag_sourceTag source
Returns
true on success
static boolean IHCallCurrIH ( GlgCallEvent  call_event)
static

Intermediate API: Passes the event to the current handler.

Parameters
call_eventThe event to pass.
Returns
true if the handler was uninstalled as a result of processing the event, false otherwise.
static boolean IHCallCurrIHWithModifToken ( GlgCallEvent  call_event,
int  token 
)
static

Intermediate API: Same as IHCallCurrIHWithToken, but it reuses the existing event by setting its token instead of creating a new call event to pass the token to the handler.

Parameters
call_eventThe event to use.
tokenThe token to pass.
Returns
true if the handler was uninstalled as a result of processing the token, false otherwise.
static boolean IHCallCurrIHWithToken ( int  token)
static

Intermediate API: Passes the token to the current handler.

The method creates a call event object used to pass the token to the handler, and destroys the event object when done.

Parameters
tokenThe token to pass.
Returns
true if the handler was uninstalled as a result of processing the token, false otherwise.
static void IHCallPrevIHWithModifToken ( GlgCallEvent  call_event,
int  token 
)
static

Intermediate API: Same as IHCallPrevIHWithToken, but reuses the event object for efficiency, the same way as IHCallCurrIHWithModifToken.

Parameters
call_eventThe event to use.
tokenThe token to pass.
static void IHCallPrevIHWithToken ( int  token)
static

Intermediate API: Passes the token to the parent handler of the currently active handler. The parent handler is the handler preceding the current handler on the stack.

Note: when the parent handler is invoked, the current handler is not the parent handler, but the handler that invoked it. Therefore, the parent handler cannot uninstall itself by simply calling IHUninstall.

Parameters
tokenThe token to pass.
static void IHChangeBParameter ( GlgObject  ih,
String  name,
boolean  value 
)
static

Intermediate API: Same as IHSetBParameter, except that the named parameter must exist. If the parameter does not exist, a GLG error is generated.

static void IHChangeDParameter ( GlgObject  ih,
String  name,
double  value 
)
static

Intermediate API: Same as IHSetDParameter, except that the named parameter must exist. If the parameter does not exist, a GLG error is generated.

static void IHChangeIParameter ( GlgObject  ih,
String  name,
int  value 
)
static

Intermediate API: Same as IHSetIParameter, except that the named parameter must exist. If the parameter does not exist, a GLG error is generated.

static void IHChangeNParameter ( GlgObject  ih,
String  name,
Object  value 
)
static

Intermediate API: Same as IHSetNParameter, except that the named parameter must exist. If the parameter does not exist, a GLG error is generated.

static void IHChangeOParameter ( GlgObject  ih,
String  name,
GlgObject  value 
)
static

Intermediate API: Same as IHSetOParameter, except that the named parameter must exist. If the parameter does not exist, a GLG error is generated.

static void IHChangeSParameter ( GlgObject  ih,
String  name,
String  value 
)
static

Intermediate API: Same as IHSetSParameter, except that the named parameter must exist. If the parameter does not exist, a GLG error is generated.

static boolean IHGetBParameter ( GlgObject  ih,
String  name 
)
static

Intermediate API: Returns a boolean value stored in a named parameter.

A GLG error is generated if a requested named parameter does not exist, or if its value cannot be converted to the requested type.

Parameters
ihThe handler to query the parameter of. IH_CURR can be used to specify the currently active handler, and IH_GLOBAL can be used to query global parameters.
nameParameter name.
static GlgObject IHGetCurrIH ( )
static

Intermediate API: Returns the ID of the currently active interaction handler.

Returns
ID of the current interaction handler.
static double IHGetDParameter ( GlgObject  ih,
String  name 
)
static

Intermediate API: Returns a double value stored in a named parameter.

A GLG error is generated if a requested named parameter does not exist, or if its value cannot be converted to the requested type.

Parameters
ihThe handler to query the parameter of. IH_CURR can be used to specify the currently active handler, and IH_GLOBAL can be used to query global parameters.
nameParameter name.
static GlgIHHandlerInterface IHGetHandlerInterface ( GlgObject  ih)
static

Intermediate API: Returns the instance of the handler interface used to implement the handler.

Parameters
ihThe handler to query. IH_CURR can be used as the ih parameter to access the curent handler.
Returns
The handler's interface instance.
static int IHGetIParameter ( GlgObject  ih,
String  name 
)
static

Intermediate API: Returns an integer value stored in a named parameter.

A GLG error is generated if a requested named parameter does not exist, or if its value cannot be converted to the requested type.

Parameters
ihThe handler to query the parameter of. IH_CURR can be used to specify the currently active handler, and IH_GLOBAL can be used to query global parameters.
nameParameter name.
static Object IHGetNParameter ( GlgObject  ih,
String  name 
)
static

Intermediate API: Returns a native object stored in a named parameter.

A GLG error is generated if a requested named parameter does not exist, or if its value cannot be converted to the requested type.

Parameters
ihThe handler to query the parameter of. IH_CURR can be used to specify the currently active handler, and IH_GLOBAL can be used to query global parameters.
nameParameter name.
static GlgObject IHGetOParameter ( GlgObject  ih,
String  name 
)
static

Intermediate API: Returns a GLG object stored in a named parameter.

A GLG error is generated if a requested named parameter does not exist, or if its value cannot be converted to the requested type.

Parameters
ihThe handler to query the parameter of. IH_CURR can be used to specify the currently active handler, and IH_GLOBAL can be used to query global parameters.
nameParameter name.
static boolean IHGetOptBParameter ( GlgObject  ih,
String  name,
boolean  default_value 
)
static

Intermediate API: Same as IHGetBParameter, except that the parameter is optional.

If a parameter with the requested name does not exist, a default value provided by the default_value argument is returned.

Parameters
ihThe handler to query the parameter of. IH_CURR can be used to specify the currently active handler, and IH_GLOBAL can be used to query global parameters.
nameParameter name.
default_valueThe default value.
static double IHGetOptDParameter ( GlgObject  ih,
String  name,
double  default_value 
)
static

Intermediate API: Same as IHGetDParameter, except that the parameter is optional.

If a parameter with the requested name does not exist, a default value provided by the default_value argument is returned.

Parameters
ihThe handler to query the parameter of. IH_CURR can be used to specify the currently active handler, and IH_GLOBAL can be used to query global parameters.
nameParameter name.
default_valueThe default value.
static int IHGetOptIParameter ( GlgObject  ih,
String  name,
int  default_value 
)
static

Intermediate API: Same as IHGetIParameter, except that the parameter is optional.

If a parameter with the requested name does not exist, a default value provided by the default_value argument is returned.

Parameters
ihThe handler to query the parameter of. IH_CURR can be used to specify the currently active handler, and IH_GLOBAL can be used to query global parameters.
nameParameter name.
default_valueThe default value.
static Object IHGetOptNParameter ( GlgObject  ih,
String  name,
Object  default_value 
)
static

Intermediate API: Same as IHGetNParameter, except that the parameter is optional.

If a parameter with the requested name does not exist, a default value provided by the default_value argument is returned.

Parameters
ihThe handler to query the parameter of. IH_CURR can be used to specify the currently active handler, and IH_GLOBAL can be used to query global parameters.
nameParameter name.
default_valueThe default value.
static GlgObject IHGetOptOParameter ( GlgObject  ih,
String  name,
GlgObject  default_value 
)
static

Intermediate API: Same as IHGetOParameter, except that the parameter is optional.

If a parameter with the requested name does not exist, a default value provided by the default_value argument is returned.

Parameters
ihThe handler to query the parameter of. IH_CURR can be used to specify the currently active handler, and IH_GLOBAL can be used to query global parameters.
nameParameter name.
default_valueThe default value.
static String IHGetOptSParameter ( GlgObject  ih,
String  name,
String  default_value 
)
static

Intermediate API: Same as IHGetSParameter, except that the parameter is optional.

If a parameter with the requested name does not exist, a default value provided by the default_value argument is returned.

Parameters
ihThe handler to query the parameter of. IH_CURR can be used to specify the currently active handler, and IH_GLOBAL can be used to query global parameters.
nameParameter name.
default_valueThe default value.
static GlgIHHandlerInterface IHGetPrevHandlerInterface ( )
static

Intermediate API: Returns the handler interface used to implement the parent handler of the currently active handler. The parent handler is the handler preceding the current handler on the stack.

Returns
The parent handler's interface instance.
static GlgObject IHGetPrevIH ( )
static

Intermediate API: Returns the ID of the parent handler of the currently active interface handler. The parent handler is the handler preceding the current handler on the stack of the installed handlers.

Returns
ID of the parent interaction handler.
static String IHGetSParameter ( GlgObject  ih,
String  name 
)
static

Intermediate API: Returns a string value stored in a named parameter.

A GLG error is generated if a requested named parameter does not exist, or if its value cannot be converted to the requested type.

Parameters
ihThe handler to query the parameter of. IH_CURR can be used to specify the currently active handler, and IH_GLOBAL can be used to query global parameters.
nameParameter name.
static int IHGetToken ( GlgCallEvent  call_event)
static

Intermediate API: Returns a token associated with the MESSAGE_EVENT event.

Tokens are application-defined integer values used to uniquely identify each user interaction event.

Parameters
call_eventThe event to query.
Returns
Token associated with the event.
static GlgCallEventType IHGetType ( GlgCallEvent  call_event)
static

Intermediate API: Returns event's type.

Parameters
call_eventThe event to query.
Returns
Event type, one of HI_SETUP_EVENT, HI_RESETUP_EVENT, HI_CLEANUP_EVENT or MESSAGE_EVENT
static void IHInit ( )
static

Intermediate API: Initializes installable handler utilities. Must be invoked after Init, but before installable handler methods.

static GlgObject IHInstall ( GlgIHHandlerInterface  interface_handler)
static

Intermediate API: Creates a handler with the specified handler interface and installs the handler, adding it to a stack of handlers.

The stack of handlers is used to keep track of nested handlers; the last handler pushed onto the stack becomes the active handler, referred to as the current handler.

Parameters
interface_handlerA user-defined interface handler.
Returns
ID of the created handler.
static GlgObject IHInstallAsInterface ( function  entry_point)
static

Intermediate API: Provides a simplified interface to the IHInstall method. The method creates a GlgIHHandlerInterface object with a supplied function as a entry point, and installs a handler that uses this handler interface object.

Parameters
entry_pointA function that implements the user interaction handler. The function's type signature must match the type signature of the GlgIHHandlerInterface::EntryPoint method.
Returns
ID of the created handler.
static void IHPassToken ( GlgIHHandlerInterface  handler_interface,
int  token,
boolean  uninstall 
)
static

Intermediate API: Installs the specified handler and invokes its entry point with the specified token.

This method is used to implement pass-though handlers for processing global accelerators, stateless options, as well as managing floating stay-open dialogs, such as the Edit Properties dialog shown on the GlgDiagram demo.

Parameters
handler_interfaceThe handler to pass the token to.
tokenThe token to pass.
uninstallIf true, the handler is uninstalled after processing the token, unless the handler has already uninstalled itself. If the handler installs other handlers while processing the token, the last installed handler (the current handler) will be uninstalled instead of the handler the token is passed to.
static void IHResetup ( GlgObject  ih)
static

Intermediate API: Invokes the handlers entry point with the HI_RESETUP_EVENT event. This can be used to reinitialize the handler by sharing some of the HI_SETUP_EVENT code.

Parameters
ihThe handler to pass the event to.
static void IHSetBParameter ( GlgObject  ih,
String  name,
boolean  value 
)
static

Intermediate API: Creates a named boolean parameter.

Parameters
ihThe handler to add the parameter to. IH_CURR can be used to specify the currently active handler, IH_NEW to specify the just installed handler, and IH_GLOBAL to add global parameters.
nameParameter name. If a parameter with this name already exists, it will be replaced, which can change the type of the parameter associated with this name.
valueParameter value.
static void IHSetDParameter ( GlgObject  ih,
String  name,
double  value 
)
static

Intermediate API: Creates a named double parameter.

Parameters
ihThe handler to add the parameter to. IH_CURR can be used to specify the currently active handler, IH_NEW to specify the just installed handler, and IH_GLOBAL to add global parameters.
nameParameter name. If a parameter with this name already exists, it will be replaced, which can change the type of the parameter associated with this name.
valueParameter value.
static void IHSetIParameter ( GlgObject  ih,
String  name,
int  value 
)
static

Intermediate API: Creates a named integer parameter.

Parameters
ihThe handler to add the parameter to. IH_CURR can be used to specify the currently active handler, IH_NEW to specify the just installed handler, and IH_GLOBAL to add global parameters.
nameParameter name. If a parameter with this name already exists, it will be replaced, which can change the type of the parameter associated with this name.
valueParameter value.
static void IHSetNParameter ( GlgObject  ih,
String  name,
Object  value 
)
static

Intermediate API: Creates a named parameter that stores a native object.

Parameters
ihThe handler to add the parameter to. IH_CURR can be used to specify the currently active handler, IH_NEW to specify the just installed handler, and IH_GLOBAL to add global parameters.
nameParameter name. If a parameter with this name already exists, it will be replaced, which can change the type of the parameter associated with this name.
valueParameter value.
static void IHSetOParameter ( GlgObject  ih,
String  name,
GlgObject  value 
)
static

Intermediate API: Creates a named parameter that stores GlgObject.

Parameters
ihThe handler to add the parameter to. IH_CURR can be used to specify the currently active handler, IH_NEW to specify the just installed handler, and IH_GLOBAL to add global parameters.
nameParameter name. If a parameter with this name already exists, it will be replaced, which can change the type of the parameter associated with this name.
valueParameter value.
static void IHSetOParameterFromD ( GlgObject  ih,
String  name,
double  value 
)
static

Intermediate API: Creates a GlgDataValue object parameter containing a double value.

Parameters
ihThe handler to add the parameter to. IH_CURR can be used to specify the currently active handler, IH_NEW to specify the just installed handler, and IH_GLOBAL to add global parameters.
nameParameter name. If a parameter with this name already exists, it will be replaced, which can change the type of the parameter associated with this name.
valueParameter value.
static void IHSetOParameterFromG ( GlgObject  ih,
String  name,
double  value1,
double  value2,
double  value3 
)
static

Intermediate API: Creates a GlgDataValue object parameter containing geometrical (XYZ) or color (RGB) data.

Parameters
ihThe handler to add the the parameter to. IH_CURR can be used to specify the currently active handler, IH_NEW to specify the just installed handler, and IH_GLOBAL to add global parameters.
nameParameter name. If a parameter with this name already exists, it will be replaced, which can change the type of the parameter associated with this name.
value1X value.
value2Y value.
value3Z value.
static void IHSetOParameterFromGPoint ( GlgObject  ih,
String  name,
GlgPoint  point 
)
static

Intermediate API: Creates a GlgDataValue object parameter containing geometrical (XYZ) or color (RGB) data.

Parameters
ihThe handler to add the parameter to. IH_CURR can be used to specify the currently active handler, IH_NEW to specify the just installed handler, and IH_GLOBAL to add global parameters.
nameParameter name. If a parameter with this name already exists, it will be replaced, which can change the type of the parameter associated with this name.
pointParameter value.
static void IHSetSParameter ( GlgObject  ih,
String  name,
String  value 
)
static

Intermediate API: Creates a named string parameter.

Parameters
ihThe handler to add the parameter to. IH_CURR can be used to specify the currently active handler, IH_NEW to specify the just installed handler, and IH_GLOBAL to add global parameters.
nameParameter name. If a parameter with this name already exists, it will be replaced, which can change the type of the parameter associated with this name.
valueParameter value.
static void IHStart ( )
static

Intermediate API: Invokes the handler's entry point with the HI_SETUP_EVENT event, which allows the handler to perform any desired initialization, such as displaying a dialog associated with the handler, if any.

Refer to the GLG Installable Interface Handlers section of the C/C++ Extended API in the GLG Programming Reference Manual for a detailed description of general topics of the handler's usage in an editor-style application, including examples of passing parameters to a handler.

The Java, C# and JavaScript versions of the GlgDiagram demo provide source code examples of using the handlers.

static void IHTerminate ( )
static

Intermediate API: Terminates installable handler utilities. All currently installed handlers must be uninstalled before invoking this method.

static void IHUninstall ( )
static

Intermediate API: Uninstalls the current handler (the last handler on the stack).

The handlers entry point is invoked with the GLG_CLEANUP_EVENT event prior to uninstalling to let the handler perform any required cleanup. After the handler is uninstalled, a previous handler in the stack (if any) becomes the active current handler. Uninstalling a handler deletes its stored data and invalidates its ID; the ID should not be used after the handler has been uninstalled.

static void IHUninstallWithEvent ( GlgCallEvent  call_event)
static

Intermediate API: Uninstalls the handler using IHUninstall and passes the event to the previous handler (which becomes current after IHUninstall is invoked).

Parameters
call_eventThe event to be passed.
static void IHUninstallWithToken ( int  token)
static

Intermediate API: Uninstalls the handler using IHUninstall and invokes the previous handler (which becomes current after IHUninstall is invoked) with the specified token.

Parameters
tokenThe token to pass.
int ImportStrings ( String  data,
boolean  verbose 
)

Converts matching strings of the (drawing) object using the provided list of strings.

Parameters
dataThe string containing a list of strings to be converted.
verboseIf set to true, generates a warning on the console for each string in the drawing that was not converted.
Returns
Number of converted strings or -1 if error.
int ImportTags ( String  data,
boolean  verbose 
)

Converts matching tags of the (drawing) object using the provided list of tags.

Parameters
dataThe string containing a list of tags to be converted.
verboseIf set to true, generates a warning on the console for each tag in the drawing that was not converted.
Returns
Number of converted tags or -1 if error.
static void Init ( )
static

Initializes GLG Toolkit.

void InitialDraw ( )

Draws a viewport object for the first time.

boolean InstallGISRequest ( String  res_name)

Intermediate API: Installs the GIS object's GIS request. This method may be invoked only from inside of a request observer's RequestUpdate method invoked with the GIS_REQUEST_READY status.

Parameters
res_nameIf is not null, specifies the resource path of child GIS object, otherwise this GIS object will be used.
Returns
true on success, false on failure.
void Inverse ( )

Intermediate API: Reverses the order of objects in a container.

boolean IsAt ( GlgPositionType  position)

Intermediate API: May be used to query if traversing reached the start or the end of a container.

Parameters
positionThe query type. May have the following values:

FIRST returns true if reversed traversing reaches the first container element.

LAST returns true if traversing reaches the last container element.
static boolean IsDemo ( )
static

Returns true if a Community Edition version of the library is used.

boolean IsDrawable ( )

Intermediate API: Returns true if the object is drawable.

Drawable objects can be placed directly in a drawing area, have control points and a bounding box, have the visisibilty attribute and can contain custom properties, actions and aliases. For a chart object, the chart itself is drawable, but its plots are not.

Object Iterate ( )

Intermediate API: Returns the next element of a container.

Object IterateBack ( )

Intermediate API: Returns the previous element of a container.

boolean LayoutObjects ( GlgObject  sel_elem,
GlgLayoutType  type,
double  distance,
boolean  use_box,
boolean  process_subobjects 
)

Intermediate API: Performs layout action on an object or a group of objects.

Parameters
sel_elemAnchor element, may be set to null if not used.
typeType of the layout action. May have the following values:

ALIGN_LEFT - align the left edge of elements within the group with the left edge of the achor element

ALIGN_RIGHT - align the right edge of elements within the group with the right edge of the achor element

ALIGN_HCENTER - align the center of elements within the group with the center of the achor element horizontally

ALIGN_TOP - align the top edge of elements within the group with the top edge of the achor element

ALIGN_BOTTOM - align the bottom edge of elements within the group with the bottom edge of the achor element

ALIGN_VCENTER - align the center of elements within the group with the center of the achor element vertically

SET_EQUAL_VSIZE - set the height of elements within the group to the height of the anchor

SET_EQUAL_HSIZE - set the width of elements within the group to the width of the anchor

SET_EQUAL_SIZE - set the width and height of elements within the group to the width and height of the anchor

SET_EQUAL_VDISTANCE - equally distributes the group's elements in vertical direction as measured by the distance between their centers

SET_EQUAL_HDISTANCE - equally distributes the group's elements in horizontal direction as measured by the distance between their centers

SET_EQUAL_VSPACE - equally distibutes space gaps between group's elements in vertical direction

SET_EQUAL_HSPACE - equally distibutes space gaps between group's elements in horizontal direction

SET_VSIZE - If anchor is null, sets the object's height; if anchor in not null, sets the height of all elements within the group. The height is defined by the value of the distance parameter.

SET_HSIZE - If anchor is null, sets the object's width; if anchor in not null, sets the width of all elements within the group. The width is defined by the value of the distance parameter.

SET_VDISTANCE - set vertical distance between centers of the group's elements to a value defined by the distance parameter

SET_HDISTANCE - set horizontal distance between centers of the group's elements to a value defined by the distance parameter

SET_VSPACE - sets space gaps between group's elements in vertical direction to a value defined by the distance parameter

SET_HSPACE - sets space gaps between group's elements in horizontal direction to a value defined by the distance parameter

distanceThe distance in screen coordinates for positioning objects, depending on the layout action.
use_boxUse object's control points if false, otherwise use object's bounding box.
process_subobjectsIf true, apply SET_VSIZE and SET_HSIZE actions to the subobjects of the group, otherwise apply the actions to the group itself.
Returns
false if errors were encountered during the layout action.
static void LoadAsset ( String  url,
GlgHTTPRequestResponseType  request_type,
function  callback,
Object  user_data 
)
static

Loads an asset from a URL. The asset data are loaded asynchronously and a callback is invoked when the data are ready.

Parameters
urlAsset URL.
request_typeA type of the asset to load: one of the values of the GlgHTTPRequestResponseType enum, such as GLG_DRAWING, TEXT, BLOB, UINT8_ARRAY, etc.
callbackA callback to be invoked when the asset data has been loaded, with the following type signature:

    void callback( Object loaded_data, Object user_data, String load_path )

where:
  • loaded_data is the loaded asset data in the requested format
  • user_data is the user_data parameter passed to the LoadAsset method
  • load_path is the full URL path used to load the asset.
user_dataAn object that will be passed to the callback.
static GlgObject LoadObject ( Object  data,
String  encoding,
String  path,
GlgObject  rebind_ref 
)
static

Loads an object from raw data using the specified encoding. The raw data may be obtained using the LoadAsset method with the GLG_DRAWING request type.

Parameters
dataThe raw data to load the object from (Uint8Array).
encodingDefines encoding to be used for string decoding, "ascii", "latin1" or "utf8". Pass null to use the default Latin1 encoding. The encoding is used to decode all input strings that do not have the UTF8 flag set.
pathThe drawing path for loading image and subdrawings relatively to (if any present in the drawing).
rebind_refThe reference object to use for rebinding is the loaded object will be used as a template, or null otherwise.
Returns
Loaded object or null if load fails.
static void LoadObjectFromURL ( String  url,
String  encoding,
function  callback,
Object  user_data,
function  abort_func,
GlgObject  rebind_ref 
)
static

Loads an object from a URL using the specified encoding.

Parameters
urlDefines a URL of the drawing.
encodingDefines encoding to be used for string decoding, "ascii", "latin1" or "utf8". Pass null to use the default Latin1 encoding. The encoding is used to decode all input strings that do not have the UTF8 flag set.
callbackA callback to be invoked when the GLG object has been loaded, with the following type signature:

    void callback( GlgObject loaded_object, Object user_data, String load_path )

where:
  • loaded_object is the loaded GLG object
  • user_data is the user_data parameter passed to the parent method
  • load_path is the full URL path used to load the object.
user_dataUser data to be passed to the callback.
abort_funcAn optional function used to check if the load request was cancelled while it was being processed, with the following type signature:

    boolean abort_callback( Object user_data )

where:
  • user_data is the user_data parameter passed to the parent method The function will be invoked when the browser finishes loading the object's raw data. If the function returns true, the load process will be aborted. If it returns false, the loading process will proceed to create GLG objects from the loaded raw data. Pass null to disable abort callback.
rebind_refThe reference object to use for rebinding if the loaded object will be used as a template, or null otherwise.
static GlgObject LoadWidget ( Object  data,
String  encoding,
String  path 
)
static

Loads a viewport named "$Widget" from raw data using the specified encoding.

Parameters
dataThe raw data to load the widget from (Uint8Array).
encodingDefines encoding to be used for string decoding, "ascii", "latin1" or "utf8". Pass null to use the default Latin1 encoding. The encoding is used to decode all input strings that do not have the UTF8 flag set.
pathThe drawing path for loading image and subdrawings relatively to (if any present in the drawing).
Returns
Loaded viewport or null if load fails.
static GlgObject LoadWidgetFromObject ( GlgObject  glg_object)
static

Finds a viewport named "$Widget" inside an object and returns it.

Parameters
glg_objectAn object containing the $Widget viewport
Returns
Viewport or null if search fails.
static void LoadWidgetFromURL ( String  url,
String  encoding,
function  callback,
Object  user_data,
function  abort_func 
)
static

Loads a viewport named "$Widget" from a URL using the specified encoding.

Parameters
urlDefines a URL of the drawing.
encodingDefines encoding to be used for string decoding, "ascii", "latin1" or "utf8". Pass null to use the default Latin1 encoding. The encoding is used to decode all input strings that do not have the UTF8 flag set.
callbackA callback to be invoked when the widget has been loaded, with the following type signature:

    void callback( GlgObject viewport, Object user_data, String load_path )

where:
  • viewport is the loaded widget viewport
  • user_data is the user_data parameter passed to the parent method
  • load_path is the full URL path used to load the widget.
user_dataUser data to be passed to the callback.
abort_funcAn optional function used to check if the load request was cancelled while it was being processed, with the following type signature:

    boolean abort_callback( Object user_data )

where:
  • user_data is the user_data parameter passed to the parent method The function will be invoked when the browser finishes loading the widget's raw data. If the function returns true, the load process will be aborted. If it returns false, loading process will proceed to create GLG objects from the loaded raw data. Pass null to disable abort callback.
boolean MoveObject ( GlgCoordType  coord_type,
GlgPoint  start_point,
GlgPoint  end_point 
)

Intermediate API: Moves an object by specified vector.

Parameters
coord_typeThe coordinate system in which the move vector is defined. May have the following values:

SCREEN_COORD to move in screen pixels

PARENT_COORD to move in the world coordinates of the object's parent

OBJECT_COORD to move in the world coordinates of the object.

start_pointStart point of the move vector.
end_pointEnd point of the move vector.
boolean MoveObjectBy ( GlgCoordType  coord_type,
double  x,
double  y,
double  z 
)

Intermediate API: Moves an object by specified distance in x, y and z directions.

Parameters
coord_typeThe coordinate system in which x, y and z distance is defined. May have the following values:

SCREEN_COORD to move in screen pixels

PARENT_COORD to move in the world coordinates of the object's parent

OBJECT_COORD to move in the world coordinates of the object.

xThe X move distance.
yThe Y move distance.
zThe Z move distance.
boolean MoveObjectByPoint ( GlgCoordType  coord_type,
GlgPoint  point 
)

Intermediate API: Moves an object by specified distance in x, y and z directions.

Parameters
coord_typeThe coordinate system in which x, y and z distance is defined. May have the following values:

SCREEN_COORD to move in screen pixels

PARENT_COORD to move in the world coordinates of the object's parent

OBJECT_COORD to move in the world coordinates of the object.

pointPoint containing X, Y and Z distance values.
static boolean ObjectsEqual ( GlgObject  object1,
GlgObject  object2 
)
static

Performs equality comparison between two GLG objects.

Parameters
object1The first object to check, may be null.
object2The second object to check, may be null.
Returns
true if both objects represents the same internal GLG object or are both null.
boolean PositionObject ( GlgCoordType  coord_type,
GlgAnchoringType  anchoring,
double  x,
double  y,
double  z 
)

Intermediate API: Move object to the specified position.

Parameters
coord_typeThe coordinate system in which position is defined. May have the following values:

SCREEN_COORD to use screen pixels

PARENT_COORD to use the world coordinates of the object's parent

OBJECT_COORD to use the world coordinates of the object.

anchoringSpecifies which part of the object's bounding box will be position at the specified coordinates. It is a bitwise OR of horizontal and vertical anchor types: HLEFT, HCENTER and HRIGHT for horizontal types, and VTOP, VCENTER and VBOTTOM for vertical types.
xThe X coordinates of the new position.
yThe Y coordinates of the new position.
zThe Z coordinates of the new position.
boolean PositionObjectByPoint ( GlgCoordType  coord_type,
GlgAnchoringType  anchoring,
GlgPoint  position 
)

Intermediate API: Moves an object to the specified position.

Parameters
coord_typeThe coordinate system in which position is defined. May have the following values:

SCREEN_COORD to move in screen pixels

PARENT_COORD to move in the world coordinates of the object's parent

OBJECT_COORD to move in the world coordinates of the object.

anchoringSpecifies which part of the object's bounding box will be position at the specified coordinates. It is a bitwise OR of horizontal and vertical anchor types: HLEFT, HCENTER and HRIGHT for horizontal types, and VTOP, VCENTER and VBOTTOM for vertical types.
positionNew position
double PositionToValue ( String  res_name,
double  x,
double  y,
boolean  outside_x,
boolean  outside_y 
)

Intermediate API, ADVANCED: Translates point's screen coordinates to the corresponding value according to the object type: axis, plot or chart. For a chart, returns the value of its X axis. For a plot, returns the Y value relative to the plot's range.

Parameters
res_nameThe resource path of a child object to query, or null to query this object.
xThe x screen coordinate (with pixel0 center at 0.5).
yThe y screen coordinate (with pixel0 center at 0.5).
outside_xIf set to true, the method returns null for points outside the object's x extent.
outside_yIf set to true, the method returns null for points outside the object's y extent.
Returns
Converted value.
static String PrintfD ( String  format,
double  value 
)
static

Utilty function: C-style printf.

static String PrintfI ( String  format,
int  value 
)
static

Utilty function: C-style printf.

static String PrintfS ( String  format,
String  value 
)
static

Utilty function: C-style printf.

GlgObject QueryTags ( GlgTagType  tag_type_mask)

Intermediate API: Returns a list of all tags of the requested tag type defined in the object.

Parameters
tag_type_maskSpecifies the tag type to search
static double Rand ( double  low,
double  high 
)
static

Returns a random number in the specified range.

void ReleaseObject ( GlgObject  suspend_info)

Intermediate API: Releases the object after suspending for editing.

Parameters
suspend_infoReturned value of a previous call to SuspendObject.
static ReleaseToCache ( Object  object)
static

ADVANCED: Releases an object to a cache for reuse, minimizing garbage collection.

Parameters
objectAn object to be released to the cache, must be an instance of GlgObject, GlgPoint, GlgCube, GlgMinMax or GlgMatrixData objects.

The method can be used with any GlgObject, GlgPoint, GlgCube, GlgMinMax or GlgMatrixData objects that were obtained by a call to any GLG method. It cannot be used with objects obtained inside callbacks by using an assigment operator without a call to a GLG method (with the exception of load callbacks).

The method can yield performance improvements for applications with loops that invoke a large number of GLG methods returning GLG objects.

Since all GLG objects are wrappers around the internal representation of the GLG objects, releasing an instance of a wrapper to a cache does not affect the internal GLG object the wrapper represents. Note: releasing a GlgCube releases its GlgPoint objects.

The following example demonstrates correct uses of the method:

// Traverse all objects in a viewport.
var size = viewport.GetSize();
for( var i=0; i<size; ++i )
{
   var object = viewport.GetElement( i ); // GLG Object

   // Apply some action to the object.
   ...

   GLG.ReleaseToCache( object );
}

// Traverse all points of a polygon.
var size = polygon.GetSize();
for( var i=0; i<size; ++i )
{
   // Get polygon point values as GlgPoint.
   var point = polygon.GetElement( i ).GetGResource( null );

   // Examine point's x, y and z values as needed.
   ...

   GLG.ReleaseToCache( point );
}

The example below shows both valid and invalid uses of the method:

function TraceCallback( viewport, trace_info )
{
   // Incorrect: can't release an object received in a callback.
   var trace_viewport = trace_info.viewport );    GLG.ReleaseToCache( trace_viewport );

   // Correct: releasing an object obtained by calling a GLG method.
   var fill_color = trace_info.viewport.GetResourceObject( "FillColor" );
   GLG.ReleaseToCache( fill_color );

   var line_width = trace_info.viewport.GetResourceObject( "LineWidth" );
   GLG.ReleaseToCache( line_width );
   // Incorrect: the object is used after being released.
   line_width.SetDResource( null, 3 );
}

boolean ReorderElement ( int  current_index,
int  new_index 
)

Intermediate API: Moves the container's element from the current_index to the new_index position.

Parameters
current_indexIndex of the object to be reordered.
new_indexIndex of the new object position.
Returns
false if indexes are out of range.
boolean RequestGISMap ( String  res_name,
double  extent_x,
double  extent_y,
double  center_x,
double  center_y,
double  angle,
GlgProjectionType  projection,
String  layers,
GlgGISRequestFlags  flags,
GlgGISRequestObserver  request_observer 
)

Intermediate API: Requests an asynchronous GIS map update. When the new map image is either ready or aborted, the request observer's RequestUpdate method will be invoked with the status information. The observer can install a successfully prepared request via the InstallGISRequest method, or do nothing to cancel the request. Refer to the description of GlgGISRequestObserver for more information.

Parameters
res_nameIf is not null, specifies the resource path of child GIS object, otherwise this GIS object will be used.
extent_xSpecifies the new GIS x extent.
extent_ySpecifies the new GIS y extent.
center_xSpecifies the new GIS x center.
center_ySpecifies the new GIS y center.
angleSpecifies the new GIS angle.
projectionSpecifies the new GIS projection.
layersSpecifies the new GIS layer string.
flagsControls which GIS object's parameters will be updated and may have any OR combination of the following flags (defined in the GlgObject class for Java or GlgGISRequestStatus enum for C#): GIS_REQUEST_EXTENT, GIS_REQUEST_CENTER, GIS_REQUEST_ANGLE, GIS_REQUEST_PROJECTION or GIS_REQUEST_LAYERS.
request_observerSpecifies an observer whose RequestUpdate method will be invoked with status updates. Refer to the description of GlgGISRequestObserver for more information.
Returns
true on success, false on failure.
boolean RequestGISZoom ( String  res_name,
char  type,
double  value,
GlgGISRequestObserver  request_observer 
)

Intermediate API: Requests asynchronous GIS zoom in a way compatible with the SetZoom method. When the new zoomed map image is either ready or aborted, the request observer's RequestUpdate method will be invoked with the status information. The observer can install a successfully prepared request via the InstallGISRequest method, or do nothing to cancel the request. Refer to the description of GlgGISRequestObserver for more information.

Parameters
res_nameIf is not null, specifies the resource path of a child viewport to be zoomed, otherwise this viewport will be used.
typeSpecifies the zoom operation to perform. See the SetZoom method for a list of possible values.
valueSpecifies the amount to zoom or pan by. See the SetZoom method for more information.
request_observerSpecifies an observer whose RequestUpdate method will be invoked with status updates. Refer to the description of GlgGISRequestObserver for more information.
Returns
true on success, false on failure.
boolean Reset ( )

Resets the object hierarchy of a top-level viewport and then sets it up again.

void ResetHierarchy ( )

Resets object hierarchy.

static boolean RootToScreenCoord ( GlgObject  viewport,
GlgPoint  root_coord 
)
static

Intermediate API: Converts screen coordinates relative to the root window to the screen coordinates of the specified viewport.

Parameters
viewportViewport object
root_coordRoot coordinates
Returns
true on success.
boolean RotateObject ( GlgCoordType  coord_type,
GlgPoint  center,
double  x,
double  y,
double  z 
)

Intermediate API: Rotates an object around the X, Y or Z axis.

Parameters
coord_typeThe coordinate system in which the center point is defined. May have the following values:

SCREEN_COORD to use screen pixels

PARENT_COORD to use the world coordinates of the object's parent

OBJECT_COORD to use the world coordinates of the object.

centerCenter of rotation. The center of the object's bounding box is used if null is passed.
xThe X rotation angle.
yThe Y rotation angle.
zThe Z rotation angle.
Uint8List SaveObject ( String  encoding)

Intermediate API: Serializes an object into a byte array using the specified encoding.

Parameters
encodingDefines encoding to be used for string encoding, "ascii", "latin1" or "utf8". Pass null to use the default Latin1 encoding.
Returns
Byte array that represents the serialized object or null on failure.
boolean ScaleObject ( GlgCoordType  coord_type,
GlgPoint  center,
double  x,
double  y,
double  z 
)

Intermediate API: Scale object in X, Y and Z dimensions

Parameters
coord_typeThe coordinate system in which the center point is defined. May have the following values:

SCREEN_COORD to use screen pixels

PARENT_COORD to use the world coordinates of the object's parent

OBJECT_COORD to use the world coordinates of the object.

centerCenter of scaling. The center of the object's bounding box is used if null is passed.
xThe X scale factor.
yThe Y scale factor.
zThe Z scale factor.
boolean ScreenToWorld ( boolean  inside_vp,
GlgPoint  in_point,
GlgPoint  out_point 
)

Intermediate API: Converts a point from screen to world coordinates.

Parameters
inside_vpFor viewports, may be set to true to use the coordinate system used to draw objects inside the viewport, or false to use viewport's parent coordinate system. The parameter is ignored for non-viewport objects.
in_pointPoint in screen coordinates.
out_pointCalculated world coordinates.
Object SendMessageToObject ( String  res_name,
String  message,
Object  param1,
Object  param2,
Object  param3,
Object  param4 
)

Sends a message to object.

Parameters
res_nameThe resource path of a child object to send the message to, or null to send the the message to this object.
messageMessage type.
param1Message-specific parameter
param2Message-specific parameter
param3Message-specific parameter
param4Message-specific parameter
Returns
Return value of the message.

Refer to the Input Objects chapter of the GLG User’s Guide and Builder Reference Manual for the description of the function’s parameters and returned value for each of the GLG input handlers.

static GlgAlarmHandler SetAlarmHandler ( GlgAlarmHandler  alarm_handler)
static

Installs a global alarm handler.

Parameters
alarm_handlerNew alarm hadler
Returns
Previous alarm handler
static boolean SetAttachmentMoveMode ( boolean  state)
static

Extended API: Sets attachment points move mode.

If the move mode is set, transforming the attachment point changes its position relatively to the anchor point of the reference object. If the mode is unset, transforming the attachment point move the reference object.

Parameters
stateThe new state of the move mode.
Returns
The previous state of the move mode.
static void SetCanvasScale ( double  scale,
double  text_scale,
double  native_text_scale 
)
static

Specifies coordinate scaling to be used to render the GLG drawing in HTML canvas on mobile devices.

Parameters
scaleSpecifies canvas coordinate scale. The screen coordinates used to draw graphics in the canvas will be bigger than the Cascading Style Sheet (CSS) pixel coordinates by the scale value. This is used for HTML pages with responsive design rendered on mobile devices with devicePixelRatio different from 1.

If the scale is set to 1 (default) for such devices, each GLG screen coordinate will correspond to several physical pixels. As a result, thin lines with LineWidth=1 will be rendered several physical pixels thick, appearing not very thin. The drawing will also be rendered in a small size (in the GLG screen coordinates) equal to the size of the GLG area in CSS pixels.

Setting the scale to a value bigger than 1 increases canvas resolution by the specified scale. For example, specifying a scale equal to devicePixelRatio on mobile devices causes each GLG screen coordinate to correspond to one physical pixel, resulting in very crisp rendering of thin lines. The drawing will also be rendered in a size in the GLG screen coordinates which is bigger (by the specified scale) than the size of the GLG area in CSS pixels.

For example, if the width of the GLG area in CSS pixels is 300 and the value of devicePixelRatio=3 is passed as the scale parameter, the drawing will be rendered with width=900 in the GLG screen coordinates. The scale lower than devicePixelRatio can also be used to control the crispness of the rendering. For exampe, scale=2 can be used even if devicePixelRatio=3.

If scale is set to a value different from 1, all values in the CSS pixel coordinates must be converted to the GLG screen coordinates by multiplying them by the scale before passing them to any GLG methods as GLG screen coordinates. For example, mouse_x and mouse_y coordinates of the mouse in the Trace callback are in CSS pixels, and must be multiplied by the scale before using them as GLG screen coordinates. The WidthHint, HeightHint, XHint and YHint parameters of the top-level viewports should also be set using the GLG screen coordinates.

text_scaleSpecifies a text scaling factor (default 1). When the canvas resolution is increased by setting scale > 1, it scales all text objects down by the same scale, because canvas text is rendered in screen coordinates. (The only exception are text objects with a TextScaling attribute that scales them on resize, since they are automatically scaled up when the drawing size in GLG screen coordinates is increased due to scale > 1).

As a result, the appearance the text is proportional to other graphical objects in the drawing, which are also appearing scaled down by the same scale factor. However, the text may be too small to be readable.

The text_scale parameter may be used to increase text size to make it more readable. Keep in mind that increasing text size makes it unproportional compared to other objects in the drawing, which may cause alignment propblems if the drawing does not allow enough space for the increased text size.

native_text_scaleSpecifies a scaling factor (default 1) for native text, such as text inside the buttons, checkboxes and other native HTML objects. Text in native HTML objects used in the drawing is not scaled and may appear unproportional to the size of the text objects drawn in the GLG drawing canvas. This parameter may be set to a value < 1 to adjust the text size of native objects to match the size of the text objects in the GLG drawing.

The method should be invoked at the beginning of the program code before the first GLG drawing is setup or drawn. Refer to the code of the GLG JavaScript Demos for examples of the method's usage.

static void SetCustomLoadFunc ( Function(String, String, int, Function(int, Object))  func)
static

Sets a custom load function.

The custom load function will be invoked to load data using a custom loading method instead of just loading from a URL. For example, an application may use axios.get method.

Parameters
funcCustom load funcion.

The function will be invoked every time GLG needs to load data, such as drawings, subdraings, images or map images. When the data has been loaded, the function must call the provided done_cb callback with the request status and request data parameters.

The custom load function is invoked with the following parameters:

Parameters
urlURL to be loaded.
request_type_stringRequest type to be used for loading data.
glg_request_typeGLG request type (GlgHTTPRequestResponseType enum)
done_callbackCallback to be invoked when the data has been loaded.

The load function may return false to let GLG load the data, or return true to indicate that the function will load the data and will invoke the done_callback when data is ready.

The done_callback must be invoked with the following parameters when the data is ready :

Parameters
statusReturned status of XMLHttpRequest, 200 on success or a different value to indicate an error.
dataLoaded data, or null in case of a load error.
boolean SetDResource ( String  resource_name,
double  value 
)

Sets value of a D (double) resource.

Parameters
resource_nameResource name
valueResource value
boolean SetDResourceIf ( String  resource_name,
double  value,
boolean  if_changed 
)

Sets value of a D (double) resource.

Parameters
resource_nameResource name
valueResource value
if_changedIf set to true, the graphics will be redrawn only if the new tag value is different from the old one.
boolean SetDTag ( String  tag_source,
double  value,
boolean  if_changed 
)

Sets value of a D (double) tag. All tags with the specified tag_source will be set to the supplied value.

Parameters
tag_sourceTag source
valueTag value
if_changedIf set to true, the graphics will be redrawn only if the new tag value is different from the old one.
static boolean SetEditMode ( GlgObject  viewport,
String  res_name,
boolean  edit_mode 
)
static

Sets the edit mode to disable GLG input objects in the drawing area for editing.

Parameters
viewportThe drawing area viewport, or the top viewport containing the drawing area if the res_name is not null.
res_nameIf not null, specifies the resource path of the drawing area inside the top viewport.
edit_modeEdit mode: true or false.
Returns
true on success. The edit mode is inherited by all child viewports and is global: setting it for a new viewport resets it for the previous viewport.
boolean SetElement ( int  index,
Object  new_object 
)

Extended API: Sets an element of a container to a new value. Generates an error message and returns false if the element with the index does not exist.

Parameters
indexIndex of the element
new_objectNew value
void SetEnd ( )

Intermediate API: Initializes container for traversing in the reversed direction.

This method should be invoked before invoking the container's IterateBack method.

static GlgErrorHandler SetErrorHandler ( GlgErrorHandler  new_handler)
static

Installs a custom error handler.

Parameters
new_handlerNew error hadler
Returns
Previous error handler
void SetFocus ( String  res_name)

Sets focus to the object's viewport.

Parameters
res_nameThe resource name of the child object, or null to use this object.
boolean SetGResource ( String  resource_name,
double  g_value1,
double  g_value2,
double  g_value3 
)

Sets value of a G (geometrical or color) resource.

Parameters
resource_nameResource name
g_value1the first value of the XYZ or RGB value triplet.
g_value2the second value of the XYZ or RGB value triplet.
g_value3the third value of the XYZ or RGB value triplet.
boolean SetGResourceFromPoint ( String  resource_name,
GlgPoint  g_value 
)

Sets value of a G (geometrical or color) resource.

Parameters
resource_nameResource name
g_valueXYZ or RGB resource values
boolean SetGResourceFromPointIf ( String  resource_name,
GlgPoint  g_value,
boolean  if_changed 
)

Sets value of a G (geometrical or color) resource.

Parameters
resource_nameResource name
g_valueXYZ or RGB resource values
if_changedIf set to true, the graphics will be redrawn only if the new tag value is different from the old one.
boolean SetGResourceIf ( String  resource_name,
double  g_value1,
double  g_value2,
double  g_value3,
boolean  if_changed 
)

Sets value of a G (geometrical or color) resource.

Parameters
resource_nameResource name
g_value1the first value of the XYZ or RGB value triplet.
g_value2the second value of the XYZ or RGB value triplet.
g_value3the third value of the XYZ or RGB value triplet.
if_changedIf set to true, the graphics will be redrawn only if the new tag value is different from the old one.
boolean SetGTag ( String  tag_source,
double  g_value1,
double  g_value2,
double  g_value3,
boolean  if_changed 
)

Sets value of a G (geometrical or color) tag. All tags with the specified tag_source will be set to the supplied values.

Parameters
tag_sourceTag source
g_value1the first value of the XYZ or RGB value triplet.
g_value2the second value of the XYZ or RGB value triplet.
g_value3the third value of the XYZ or RGB value triplet.
if_changedIf set to true, the graphics will be redrawn only if the new tag value is different from the old one.
boolean SetGTagObj ( String  tag_source,
GlgPoint  g_value,
boolean  if_changed 
)

Sets value of a G (geometrical or color) tag. All tags with the specified tag_source will be set to the supplied values.

Parameters
tag_sourceTag source
g_valueXYZ or RGB tag values
if_changedIf set to true, the graphics will be redrawn only if the new tag value is different from the old one.
boolean SetLabelFormatter ( String  res_name,
GlgLabelFormatter  formatter 
)

Attaches a custom label formatter to an axis object.

Parameters
res_nameThe resource name of the object's child axis, or null to use this axis object.
formatterCustom label formatter.
Returns
true on success.
boolean SetLinkedAxis ( String  res_name,
GlgObject  axis_object,
String  axis_res_name 
)

Associates a chart's plot or a level line with an Y axis.

Parameters
res_nameThe resource path of a chart's plot, level, time line, annotation object, or null to associate the axis with this object.
axis_objectA chart's Y axis to associate with if axis_res_path is null, or an axis parent used in conjunction with the axis_res_path to specify the Y axis. If the parameter value is null, this object will be used as an axis parent.
axis_res_nameThe resource path of a chart's axis relatively to the axis_object, or null to use axis_object as the Y axis to link with.
Returns
true on success.
static void SetLocale ( String  locale)
static

Sets locale used to display dates and numbers.

Parameters
localeLocale name.
void SetMatrixData ( GlgMatrixData  matrix_data)

Intermediate API, ADVANCED: Sets matrix's coefficients to supplied values.

Parameters
matrix_dataGlgMatrixData object containing new matrix values.
void SetParentElement ( String  element_id)

Specifies a parent DIV element to use for the GLG drawing.

Parameters
element_idElement ID for the getElementById method, for example "glg_area".
boolean SetResource ( String  resource_name,
Object  value 
)

Intermediate API: Sets the new value of the object's attribute (of an Object type).

This method may be used for setting object's DataSlot attribute.

Parameters
resource_nameAttribute name
valueThe object to set or replace.
boolean SetResourceFromObject ( String  resource_name,
GlgObject  o_value 
)

Sets value of the data or matrix resource to the value of the data object.

Parameters
resource_nameResource name
o_valueA GLG data object providing a value (must match the resource's data type).
boolean SetResourceFromObjectIf ( String  resource_name,
GlgObject  o_value,
boolean  if_changed 
)

Sets value of the data or matrix resource to the value of the data object.

Parameters
resource_nameResource name
o_valueA GLG data object providing a value (must match the resource's data type)
if_changedIf set to true, the graphics will be redrawn only if the new tag value is different from the old one.
boolean SetResourceObject ( String  resource_name,
GlgObject  value 
)

Sets the new value of the object's attribute.

Without the Extended API, this method may be used to set global configuration resources. With the Extended API, it may also be used for attaching Custom Property objects, aliases, tags, alarms and history objects.

Parameters
resource_nameAttribute name
valueGlgObject to attach.
GlgGISRequestObserver SetScrollbarObserver ( String  res_name,
GlgGISRequestObserver  request_observer 
)

Intermediate API: Controls the the way integrated scrollbars work for the GIS object.

Parameters
res_nameIf is not null, specifies the resource path of child GIS object, otherwise this GIS object will be used.
request_observerSpecifies a request observer. If a non-null observer is specified, integrated scrollbars will use an asynchronous request to scroll the map. The observer's RequestUpdate method will be invoked with status updates. If null is specified, the new map will be loaded without the use of an asynchronous request.
Returns
Previous scrollbar request observer.
boolean SetSResource ( String  resource_name,
String  s_value 
)

Sets value of an S (string) resource.

Parameters
resource_nameResource name
s_valueResource value
boolean SetSResourceFromD ( String  resource_name,
String  format,
double  d_value 
)

Sets value of an S (string) resource from a double value, converting the value into a string using a C-style format.

Parameters
resource_nameResource name
formatC-style format (for example, "%.2f")
d_valueValue
boolean SetSResourceFromDIf ( String  resource_name,
String  format,
double  d_value,
boolean  if_changed 
)

Sets value of an S (string) resource from a double value, converting the value into a string using a C-style format.

Parameters
resource_nameResource name
formatC-style format (for example, "%.2f")
d_valueValue
if_changedIf set to true, the graphics will be redrawn only if the new tag value is different from the old one.
boolean SetSResourceIf ( String  resource_name,
String  s_value,
boolean  if_changed 
)

Sets value of an S (string) resource.

Parameters
resource_nameResource name
s_valueResource value
if_changedIf set to true, the graphics will be redrawn only if the new tag value is different from the old one.
boolean SetSTag ( String  tag_source,
String  s_value,
boolean  if_changed 
)

Sets value of an S (string) tag. All tags with the specified tag_source will be set to the supplied value.

Parameters
tag_sourceTag source
s_valueTag value
if_changedIf set to true, the graphics will be redrawn only if the new tag value is different from the old one.
boolean SetSTagFromD ( String  tag_source,
String  format,
double  d_value,
boolean  if_changed 
)

Sets value of an S (string) tag from a double value, converting the value into a string using a C-style format. All tags with the specified tag_source will be set to the converted string.

Parameters
tag_sourceTag source
formatC-style format (for example, "%.2f")
d_valueValue
if_changedIf set to true, the graphics will be redrawn only if the new tag value is different from the old one.
void SetStart ( )

Intermediate API: Initializes container for traversing.

This method should be invoked before invoking the container's Iterate method.

void SetTemplate ( GlgObject  template)

Intermediate API: Sets a custom template for a subdrawing or subwindow.

Parameters
templateThe object to set as a template of this object.
Returns
true on success.
static GlgTooltipFormatter SetTooltipFormatter ( GlgTooltipFormatter  formatter)
static

Sets a custom tooltip formatter.

Parameters
formatterCustom tooltip formatter.
Returns
Previous tooltip formatter.
static void SetTouchMode ( )
static

Enables handling of touch events,

The method may be invoked on the TOUCH_START event inside of the Trace callback to enable handing of the consequent TOUCH_MOVED, TOUCH_ENDED and TOUCH_CANCELLED events (defined in the GlgEventType enum).

If the touch mode is enabled, the default browser handling of touch events will be disabled, and the application will receive these events in the Trace callback to implement application-defined touch actions. For example, an application could use touch move events to drag objects or scroll the chart.

If the touch mode is not enabled, the browser will use touch events for scrolling or zooming the web page, and the application will not receive any touch events after the initial TOUCH_START event. The MOUSE_MOVED, MOUSE_PRESSED and MOUSE_RELEASED events will be received after the browser finished handing touch events.

The enabled state of touch mode is active only for the duration of one touch event sequence, and is reset when the touch ends or is cancelled.

GLG sliders and knob interaction handlers automatically activate the touch mode to handle dragging via the touch move events. The GlgSliderTouchDrag global configuration resource may be used to disable this feature if it interferes with the browser use of the touch events for scrolling and zooming the web page.

void SetupHierarchy ( )

Sets up object hierarchy.

boolean SetXform ( GlgObject  xform)

Extended API: Sets the object's transformation to a constrained copy of the xform parameter.

Parameters
xformTransformation to attach to the object.
boolean SetZoom ( String  res_name,
char  type,
double  value 
)

Programmatic interface for the integrated zoom and pan features.

Zooms or pans the viewport by the specified amount. If the res_name parameter is not null, the child viewport of the object with the name specified by the res_name parameter is zoomed or panned.

The type may be one of the following:

'u' - pan up (default amount is 1/2 of the window height).

'd' - pan down (default amount is 1/2 of the window height).

'l' - pan left (default amount is 1/2 of the window width).

'r' - pan right (default amount is 1/2 of the window width).

'i' - zoom in (default zoom scale is 2 ).

'o' - zoom out (default zoom scale is 1/2 ).

'U' - pan the drawing all the way up

'D' - pan the drawing all the way down

'L' - pan the drawing all the way to the left

'R' - pan the drawing all the way to the right

'x' - pan horizontally by the distance in screen coordinates

'y' - pan vertically by the distance in screen coordinates

'X' - pan horizontally by the distance in world coordinates

'Y' - pan vertically by the distance in world coordinates

'f' - fit the drawing to the window

'n' - reset any zoom and pan

't' - start ZoomTo mode

'e' - abort ZoomTo mode in progress (if any)

'g' - if the mouse points at the GIS object, set the GIS zoom mode for that object.

'G' - reset the GIS zoom mode.

The value specifies the amount to zoom or pan by (when the value of 0 is passed, the default value is used). For pan operations, the value is expressed in the fractions of the screen size (for example, using 2/3 as the value will pan by 2/3 of the screen width or height). For zoom operations, the value defines the zoom scale (for example, using 5 as the value will zoom in or out by the factor of 5). The value is ignored in Reset, Start ZoomTo or Abort ZoomTo modes.

Parameters
res_nameIf is not null, specifies the resource path of child viewport to be zoomed.
typeSpecifies the zoom operation to perform.
valueSpecifies .
Returns
false if the zoom factor or pan amount is too big and would result in the overflow of the integer values used for drawing primitives by the windowing system, otherwise true.
boolean SetZoomMode ( String  res_name,
GlgObject  zoom_object,
String  zoom_object_name,
GlgZoomMode  zoom_mode 
)

Sets the viewport's zoom mode and selects the GIS or CHART object to be zoomed.

Parameters
res_nameThe resource path of a child viewport to zoom, or null to zoom this viewport.
zoom_objectThe GIS or CHART object to be zoomed if zoom_object_name is null, or a parent of the GIS or CHART object if zoom_object_name is not null.
zoom_object_nameThe resource name of the GIS or CHART object to be zoomed relative to the parent specified by the zoom_object parameter.
zoom_modeThe Zoom mode: GRAPHICS_ZOOM_MODE, GIS_ZOOM_MODE or CHART_ZOOM_MODE.
Returns
true on success.
GlgObject SuspendObject ( )

Intermediate API: Suspends the object for editing.

This method must be called before adding a transformation or constraining attributes of the object whose object hierarchy has been setup (the object has been drawn).

Returns
Suspend information (GlgObject) to be used as a suspend_info parameter in a subsequent call to the ReleaseObject method.
static void Terminate ( )
static

Destroys GLG Toolkit's internal objects.

static void ThrowExceptionOnError ( boolean  user_error,
boolean  internal_error,
boolean  detect_null_strings 
)
static

Controls throwing an exception on an error to assist debugging.

Parameters
user_errorSet to true to throw exceptions on application errors, such as "Can't find resource".
internal_errorSet to true to throw exceptions on internal GLG errors.
detect_null_stringsSet to true to detect null strings being used as values of resources that are GLG data objects od S (String) type. Setting values of these attributes to null strings causes exceptions much later, when the objects are drawn. Setting this parameter to true makes it possible to detect such errors right at the line of code where the resource value is set.
boolean TransformObject ( GlgObject  xform,
GlgCoordType  coord_type,
GlgObject  parent 
)

Intermediate API, ADVANCED: Transforms an object's points with a transformation object.

The object's hierarchy must be set (drawn) to use this method.

Parameters
xformTransformation object
coord_typeThe coordinate system in which the transformation is defined. May have the following values:

SCREEN_COORD to transform in screen pixels

PARENT_COORD to transform in the world coordinates of the object's parent

OBJECT_COORD to transform in the world coordinates of the object.

parentObject's parent (returned by the GetParent method).
void TransformPoint ( GlgPoint  in_point,
GlgPoint  out_point 
)

Intermediate API, ADVANCED: Transforms a point with this matrix object.

Transforms the in_point with this matrix and places the result into the out_point.

Parameters
in_pointPoint to transform with the matrix
out_pointPoint to receive transformed values
static void TranslatePointOrigin ( GlgObject  from_viewport,
GlgObject  to_viewport,
GlgPoint  point 
)
static

Intermediate API, ADVANCED: Translates screen point's coordinates from one viewport to another.

Parameters
from_viewportThe viewport in which the screen coordinates of the point are defined.
to_viewportThe viewport to convert screen coordinates of the point to.
pointSupplies the screen coordinate values to be converted.
static boolean TraverseObjects ( GlgObject  object,
boolean  state,
boolean  is_widget,
GlgObject  top_parent,
function  action 
)
static

Intermediate API: Highlights all objects in the drawing that depend on the tag or resource object that is being traced. All parents of an object are searched and highlighted based on the supplied conditions. The parent search is performed until any of the supplied conditions (is_widget, top_parent or action) is satisfied. If no conditions are supplied, all immediate drawable parents will be highlighted.

Parameters
objectObject to be traced. The object must be setup.
stateIf set to true, the objects are highlighted with an outline when they are drawn. If set to false, the objects are unhighlighted. The attributes of the outline are defined by the GlgHighlightPolygon global configuration resource.
is_widgetIf set to true, the parents that have resource named IsWidget are highlighed.
top_parentIf non-null, the parents that are direct children of top_parent are highlighed.
actionAn optional function that will be invoked for every parent of the object. If the method returns true, the parent will be highlighed. The function must have the following type signature:

    boolean custom_match( GlgObject object );

where:
  • object is the parent object to act upon.
Returns
true if any objects were highlighted.
void TraverseObjects ( function  action)

Intermediate API: Traverses the object and all its subobjects and performs the specified action on each of them.

Parameters
actionA function that will be invoked for each traversed object to perform a custom action. If it returns true, the object's subobjects will not be traversed. The function must have the following type signature:

    boolean custom_match( GlgObject object );

where:
  • object is the object to act upon.
boolean UnconstrainObject ( )

Intermediate API: Unconstrains this attribute object.

boolean Update ( )

Updates the drawing of a viewport or a light viewport with the latest resource values.

Returns
true on success.
boolean UpdateImmediately ( )

ADVANCED: Updates the drawing of a viewport or a light viewport with the latest resource values, immediately.

Updates the drawing without defering the actual painting until the next paint event. It is rarely necessary to call this method, as it is less effcient than the Update method and does not guarantee a perfect redraw of children viewports. However, this method is useful if one needs to update the display while the current event is being dispatched.

Returns
true on success,
void UpdateSize ( )

Causes an immediate size update for top viewports embedded in the HTML glg_area.

boolean WorldToScreen ( boolean  inside_vp,
GlgPoint  in_point,
GlgPoint  out_point 
)

Intermediate API: Converts a point from world to screen coordinates.

Parameters
inside_vpFor viewports, may be set to true to use the coordinate system used to draw objects inside the viewport, or false to use viewport's parent coordinate system. The parameter is ignored for non-viewport objects.
in_pointPoint in world coordinates.
out_pointCalculated screen coordinates.

Member Data Documentation

GlgObject IH_CURR = null
static

ID of the current installable interface handler.

GlgObject IH_GLOBAL = null
static

ID of the global data cache of the installable interface handlers.

GlgObject IH_NEW = null
static

ID of the last installed installable interface handler.