GLG Toolkit, Java Class Library  Version 4.5
1. Standard API Methods

Detailed Description

This group lists GLG Standard API methods of the GlgObject class.

These methods are used to:

Specialized Chart methods, as well as a variety of utility methods, are also provided.

Functions

GlgObject AddAnnotation (String resource_name, GlgObject annotation, double position_x, double position_y, boolean add_box)
 Adds an annotation to the chart object. More...
 
void AddListener (GlgCallbackType type, Object listener)
 Adds a GLG event listener to a viewport. More...
 
GlgObject AddPlot (String resource_name, GlgObject plot)
 Adds a plot line to the chart object. More...
 
GlgObject AddTimeLine (String resource_name, GlgObject time_line, double time_stamp)
 Adds a vertical time line to the chart object. More...
 
static void Bell ()
 Emits an audio beep. More...
 
void ChangeObject (String resource_path)
 Sends a change message the object without actually changing the object's properties. More...
 
boolean ClearDataBuffer (String resource_name)
 Clears accumulated data samples of a real-time chart or one of its plots. More...
 
static String ConcatResNames (String resource_name1, String resource_name2)
 Creates a composite resource path from two components. More...
 
boolean ConfigureWindow (int x, int y, int width, int height, GlgConfigureMask mask, GlgObject parent)
 Sets the size and/or position of a viewport's window. More...
 
GlgObject CreateAlarmList ()
 Creates and returns a list of alarms defined in the object. More...
 
BufferedImage CreateImage (String resource_name)
 Creates and returns an image of the current state of the viewport's graphics. More...
 
BufferedImage CreateImageCustom (String resource_name, Rectangle image_area, int gap)
 Creates an image of the specified rectangular region of the viewport's graphics. More...
 
static String CreateIndexedName (String template_name, int resource_index)
 Creates a string with a name of an enumerated resource. More...
 
static GlgObject CreateSelectionMessage (GlgObject top_vp, GlgCube rectangle, GlgObject selected_vp, GlgSelectionEventType selection_type, int button)
 Searches for an Action object that would be activated by the user interaction event. More...
 
static GlgObject CreateSelectionNames (GlgObject top_vp, GlgCube rectangle, GlgObject selected_vp)
 Returns a list of names of objects intersecting a given rectangle. More...
 
static GlgObject CreateSelectionNames (MouseEvent mouse_event, int delta, GlgObject top_vp, GlgObject selected_vp)
 Returns a list of names of objects located under the mouse. More...
 
GlgObject CreateTagList (boolean unique_tag_sources)
 Creates and returns a list of data tags defined in the object. More...
 
boolean DeleteAnnotation (String resource_name, GlgObject annotation, double position_x, double position_y)
 Deletes an annotation from the chart. More...
 
boolean DeletePlot (String resource_name, GlgObject plot)
 Deletes a plot line from the chart. More...
 
boolean DeleteTimeLine (String resource_name, GlgObject time_line, double time_stamp)
 Deletes a time line from the chart. More...
 
void DialogInitialDraw (GlgObject parent)
 Displays a GLG drawing of the viewport as a floating dialog for the first time after it has been created or loaded. More...
 
void DialogSetupHierarchy (GlgObject parent)
 Provides an explicit request to set up the object hierarchy of a drawing displayed in a dialog window. More...
 
static boolean EnableTimerXforms (boolean state)
 ADVANCED: Enables or disables all timer transformations defined inside GLG drawings. More...
 
static void Error (GlgErrorType error_type, String message, Exception exception)
 Display an error message using the GLG error handler. More...
 
boolean ExportPostScript (String file, double x, double y, double width, double height, boolean portrait, boolean stretch, boolean center)
 Generates a PostScript output of the current state of the viewport's graphics. More...
 
int ExportStrings (String filename, GlgMediumType medium_type, char separator1, char separator2, String charset_name)
 Writes all text strings defined in the viewport's drawing into a string translation file. More...
 
int ExportTags (String filename, GlgMediumType medium_type, char separator1, char separator2, String charset_name)
 Writes tag names and tag sources of all data tags defined in the viewport's drawing to a tag remapping file. More...
 
GlgMinMax GetChartDataExtent (String resource_name, boolean x_extent, boolean visible_only)
 Queries the minimum and maximum extent of the data accumulated in the chart or in one of its plots in the specified X or Y direction. More...
 
GlgDataType GetDataType ()
 Returns The data object's data type. More...
 
Double GetDResource (String resource_name)
 Returns the current value of the object's D (double) resource. More...
 
GlgDouble GetDResourceObj (String resource_name)
 Returns the current value of the object's D (double) resource. More...
 
Double GetDTag (String tag_source)
 Returns the current value of the object's D (double) tag. More...
 
GlgDouble GetDTagObj (String tag_source)
 Returns the current value of the object's D (double) tag. More...
 
GlgPoint GetGResource (String resource_name)
 Returns the current value of the object's G (geometrical or color) resource. More...
 
GlgPoint GetGTag (String tag_source)
 Returns the current value of the object's G (geometrical or color) tag. More...
 
static boolean GetModifierState (GlgModifierType modifier)
 Returns the current state of a modifier. More...
 
GlgObject GetNamedPlot (String resource_name, String plot_name)
 Given a name of the chart's plot, returns the plot's object ID. More...
 
Object GetNativeComponent (String resource_name, GlgComponentQueryType type)
 ADVANCED: Returns a native component used to render the viewport. More...
 
String GetObjectName ()
 Returns the object's name. More...
 
GlgObjectType GetObjectType ()
 Returns the object's type. More...
 
String GetSResource (String resource_name)
 Returns the current value of the object's S (string) resource. More...
 
static String GetStackTraceAsString ()
 Returns current stack trace as a string. More...
 
static String GetStackTraceAsString (Exception e)
 Returns the stack trace of the specified exception as a string. More...
 
String GetSTag (String tag_source)
 Returns the current value of the object's S (string) tag. More...
 
char[] GetWidgetPassword (String resource_name)
 Returns password entered into the password text widget. More...
 
boolean GISConvert (String resource_name, GlgCoordType coord_type, boolean coord_to_lat_lon, GlgPoint in_point, GlgPoint out_point)
 Performs coordinate conversion from the GIS coordinates of the GIS Object to the GLG coordinates of the drawing and visa versa. More...
 
GlgObject GISCreateSelection (String resource_name, String layers, double x, double y, GlmLabelSelectionMode select_labels)
 Returns a message object containing information about GIS features located at a specified position on the map. More...
 
GlgDouble GISGetElevation (String resource_name, String layer_name, double lon, double lat)
 Returns an elevation of a lat/lon point on a map. More...
 
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)
 A low level method that performs coordinate conversion from the GIS coordinates of a map to the GLG coordinates of the drawing and visa versa without the help of a GLG GIS Object. More...
 
static boolean HasJava2D ()
 Queries device graphical capabilities. More...
 
boolean HasResourceObject (String resource_name)
 Checks if the object's named resource exists. More...
 
boolean HasTagName (String tag_name)
 Checks if the object's data tag with a specified tag name exists. More...
 
boolean HasTagSource (String tag_source)
 Checks if the object's data tag with a specified tag source exists. More...
 
int ImportStrings (String filename, GlgMediumType medium_type, boolean verbose, String charset_name)
 Replaces text strings in the viewport's drawing with the strings loaded from a string translation file. More...
 
int ImportTags (String filename, GlgMediumType medium_type, boolean verbose, String charset_name)
 Replaces the TagName and TagSource attributes of data tags in the viewport's drawing with information loaded from a tag remapping file. More...
 
static void Init ()
 Initializes GLG Toolkit. More...
 
void InitialDraw ()
 Draws a GLG viewport object for the first time after it has been created or loaded. More...
 
static boolean IsDemo ()
 Queries the type of the GLG library. More...
 
static GlgObject LoadObject (Object medium, GlgMediumType medium_type)
 Loads an object from a stream using a default charset. More...
 
static GlgObject LoadObject (Object medium, GlgMediumType medium_type, String charset_name)
 Loads an object from a stream using the specified charset. More...
 
static GlgObject LoadObject (String filename, GlgMediumType medium_type)
 Loads an object from a GLG drawing file or a URL using a default charset. More...
 
static GlgObject LoadObject (String filename, GlgMediumType medium_type, String charset_name)
 Loads an object from a file or a URL using the specified charset. More...
 
static GlgObject LoadWidget (GlgObject glg_object)
 Finds a viewport named $Widget inside an object and returns it. More...
 
static GlgObject LoadWidget (String filename, GlgMediumType medium_type)
 Loads a viewport named $Widget from a file or a URL using a default charset. More...
 
static GlgObject LoadWidget (String filename, GlgMediumType medium_type, String charset_name)
 Loads a viewport named $Widget from a file or a URL using the specified charset. More...
 
boolean NativePrint (Graphics graphics)
 Generates printing output of the current state of the viewport's graphics. More...
 
static String Printf (String format, double value)
 C-style printf method for formatting double values. More...
 
static String Printf (String format, int value)
 C-style printf method for formatting integer values. More...
 
static String Printf (String format, String value)
 C-style printf method for formatting strings. More...
 
static double Rand (double low, double high)
 Returns a random number in the specified range. More...
 
boolean Reset ()
 Reinitializes the viewport's drawing by resetting its drawing hierarchy, then setting it up again and rendering the drawing. More...
 
void ResetHierarchy ()
 Resets the object hierarchy of the object. More...
 
static boolean SaveImage (RenderedImage image, String image_file, String image_format)
 Saves an image to a file in a requested format. More...
 
Object SendMessage (String resource_name, String message, Object param1, Object param2, Object param3, Object param4)
 Sends a message to the object to request some action to be performed. More...
 
static GlgAlarmHandler SetAlarmHandler (GlgAlarmHandler alarm_handler)
 Installs a global alarm handler that will be invoked to process alarms. More...
 
static void SetBrowserObject (GlgObject browser, GlgObject glg_object)
 Sets the object for browsing with the GLG Resource, Tag and Alarm browser widgets. More...
 
boolean SetBrowserSelection (String resource_name, String selection, String filter)
 Sets a new value of a browser's Selection and Filter text boxes of the Resource, Tag, Alarm and Data browser widgets after the browser object has already been set up. More...
 
boolean SetChartFilter (String resource_name, GlgChartFilter filter, Object client_data)
 Attaches a custom data filter to the chart's plot. More...
 
boolean SetCursorType (String resource_name, GlgCursorType cursor_type)
 Sets cursor for the viewport's drawing or one of its child viewports. More...
 
boolean SetDResource (String resource_name, double value)
 Sets a new value of the object's D (double) resource. More...
 
boolean SetDResource (String resource_name, Double value)
 Sets a new value of the object's D (double) resource. More...
 
boolean SetDResource (String resource_name, double value, boolean if_changed)
 Sets a new value of the object's D (double) resource. More...
 
boolean SetDResource (String resource_name, Double value, boolean if_changed)
 Sets a new value of the object's D (double) resource. More...
 
boolean SetDResource (String resource_name, GlgDouble value)
 Sets a new value of the object's D (double) resource. More...
 
boolean SetDResource (String resource_name, GlgDouble value, boolean if_changed)
 Sets a new value of the object's D (double) resource. More...
 
boolean SetDTag (String tag_source, double value, boolean if_changed)
 Sets a new value of the object's D (double) tag. More...
 
boolean SetDTag (String tag_source, Double value, boolean if_changed)
 Sets a new value of the object's D (double) tag. More...
 
boolean SetDTag (String tag_source, GlgDouble value, boolean if_changed)
 Sets a new value of the object's D (double) tag. More...
 
static boolean SetEditMode (GlgObject viewport, String resource_name, boolean edit_mode)
 Sets the viewport's edit mode to disable input objects in the viewport while the drawing is being edited. More...
 
static GlgErrorHandler SetErrorHandler (GlgErrorHandler new_handler)
 Replaces the GLG Toolkit error handler and returns the previous error handler. More...
 
void SetFocus (String resource_name)
 Sets the keyboard focus to the object's viewport. More...
 
boolean SetGResource (String resource_name, double x_value, double y_value, double z_value)
 Sets new values of the object's G (geometrical or color) resource. More...
 
boolean SetGResource (String resource_name, double x_value, double y_value, double z_value, boolean if_changed)
 Sets new values of the object's G (geometrical or color) resource. More...
 
boolean SetGResource (String resource_name, GlgPoint g_value)
 Sets new values of the object's G (geometrical or color) resource. More...
 
boolean SetGResource (String resource_name, GlgPoint g_value, boolean if_changed)
 Sets new values of the object's G (geometrical or color) resource. More...
 
boolean SetGTag (String tag_source, double x_value, double y_value, double z_value, boolean if_changed)
 Sets new values of the object's G (geometrical or color) tag. More...
 
boolean SetGTag (String tag_source, GlgPoint value, boolean if_changed)
 Sets new values of the object's G (geometrical or color) tag. More...
 
boolean SetLabelFormatter (String resource_name, GlgLabelFormatter formatter)
 Attaches a custom label formatter to the chart axis or the stand-alone axis object. More...
 
boolean SetLinkedAxis (String resource_name, GlgObject axis_object, String axis_resource_name)
 Associates the chart's plot, level line or annotation object with an Y axis for automatic rescaling. More...
 
boolean SetResourceFromObject (String resource_name, GlgObject value)
 Sets a new value of the object's resource to the value of contained in the provided data object of the same data type. More...
 
boolean SetResourceFromObject (String resource_name, GlgObject value, boolean if_changed)
 Sets the value of the object's data object to the value of another data object of the same data type. More...
 
boolean SetSResource (String resource_name, String value)
 Replaces the string of the object's S (string) resource. More...
 
boolean SetSResource (String resource_name, String value, boolean if_changed)
 Replaces the string of the object's S (string) resource. More...
 
boolean SetSResourceFromD (String resource_name, String format, double value)
 Sets the value of the object's S (string) resource from a double value, converting the value into a string using a C-style printf format string. More...
 
boolean SetSResourceFromD (String resource_name, String format, Double value)
 Sets the value of the object's S (string) resource from a double value, converting the value into a string using a C-style printf format string. More...
 
boolean SetSResourceFromD (String resource_name, String format, double value, boolean if_changed)
 Sets the value of the object's S (string) resource from a double value, converting the value into a string using a C-style printf format string. More...
 
boolean SetSResourceFromD (String resource_name, String format, Double value, boolean if_changed)
 Sets the value of the object's S (string) resource from a double value, converting the value into a string using a C-style printf format string. More...
 
boolean SetSTag (String tag_source, String value, boolean if_changed)
 Replaces the string of the object's S (string) tag. More...
 
boolean SetSTagFromD (String tag_source, String format, double value, boolean if_changed)
 Sets the value of the object's S (string) tag from a double value, converting the value into a string using a C-style printf format string. More...
 
boolean SetSTagFromDObj (String tag_source, String format, Double value, boolean if_changed)
 Sets the value of the object's S (string) tag from a double value, converting the value into a string using a C-style printf format string. More...
 
static GlgTooltipFormatter SetTooltipFormatter (GlgTooltipFormatter formatter)
 Supplies a custom tooltip formatter. More...
 
void SetupHierarchy ()
 Provides an explicit request to set up the object hierarchy of the object without rendering it. More...
 
boolean SetZoom (String resource_name, char type, double value)
 Provides a programmatic interface to integrated zooming and panning. More...
 
boolean SetZoomMode (String resource_name, GlgObject zoom_object, String zoom_object_resource_name, GlgZoomMode zoom_mode)
 Sets or resets the viewport's zoom mode by supplying a GIS or Chart object to be zoomed. More...
 
static boolean Sleep (long millisec)
 Sleeps for the specified number of milliseconds. More...
 
static boolean Sync ()
 Flushes graphical output. More...
 
static void Terminate ()
 Destroys GLG Toolkit's internal objects. More...
 
static void ThrowExceptionOnError (boolean user_error, boolean internal_error)
 Controls displaying a stack trace on errors. More...
 
boolean Update ()
 Updates the drawing of a viewport or a light viewport with the latest resource values. More...
 
boolean UpdateChartState (String resource_name, int state)
 Triggers updating the chart's state after prefilling it with data using the quick mode of AddDataSampleNode. More...
 
boolean UpdateChartTimeAxis (String resource_name, double time_stamp, boolean initialize)
 Scrolls the chart forward to show all data samples up to the provided time stamp or index. More...
 
boolean UpdateImmediately ()
 Advanced: Updates the drawing of a viewport or a light viewport with the latest resource values, immediately. More...
 

Function Documentation

◆ AddAnnotation()

GlgObject AddAnnotation ( String  resource_name,
GlgObject  annotation,
double  position_x,
double  position_y,
boolean  add_box 
)

Adds an annotation to the chart object.

Parameters
resource_nameA resource path of a child chart, or null to add to the chart the method is invoked on. The resource path is relative to the invoking object.
annotationA Text object that will be used as an annotation. null may be used to create a new annotation.
position_xAn annotation's position relative to the X axis.
position_yAn annotation's position relative to the Y axis.
add_boxIf true, a text box will be added to the annotation's text object.
Returns
The added annotation on success, or null on failure.

The chart's NumAnnotations attribute should be set to -1 in order to use this method.

◆ AddListener()

void AddListener ( GlgCallbackType  type,
Object  listener 
)

Adds a GLG event listener to a viewport.

An Input listener can also be added to the light viewport.

Parameters
typeSpecifies the type of a listener to be added:
listenerSpecifies a listener that will be used to process GLG events.

This method adds the specified listener to a viewport. A listener's entry point will be called by the GLG Toolkit upon some action:

  • Input listener is invoked when an input widget, such as a slider or a toggle, receives some user input. It is also invoked when an object in the viewport is selected.
  • Select listener is invoked when a user selects an object in the widget's drawing area.
  • Trace listener is invoked for every native windowing system event received by the viewport or its child viewports and may be used to handle these events.
  • Hierarchy listener may be used to initialize loaded subdrawings.

See GlgInputListener, GlgSelectListener, GlgTraceListener and GlgHierarchyListener for the description of the available listener types and their entry points.

Only one listener of each listener type may be added to an individual viewport. Any subsequent invocations of AddListener with the same listener type will overwrite the previous value of the viewport's listener. To remove a listener, call AddListener with null as a value of the listener parameter.

Note: Listeners must be added before the drawing's hierarchy is set up.

Several listeners of the same type may be added to different viewports on different levels of the drawing hierarchy. However, only the first encountered listener on the lowest level of the hierarchy will be called. For example, if an input listener is attached to a viewport and its child viewport, only the child viewport's listener will be invoked when input event occurs in the child viewport.

If an event occurs in a child viewport that doesn't have a listener attached, the listener of the first encountered parent viewport that has the listener attached will be invoked.

The viewport's ProcessMouse attribute controls processing of the mouse selection events and tooltips inside the viewport and its child viewports.

The GlgJBean also provides methods for adding listeners to the drawings used by each GlgJBean instance.

See the Listener Events section of the Handling User Input and Other Events chapter of the GLG Programming Reference Manual for more information.

◆ AddPlot()

GlgObject AddPlot ( String  resource_name,
GlgObject  plot 
)

Adds a plot line to the chart object.

Parameters
resource_nameA resource path of a child chart, or null to add to the chart the method is invoked on. The resource path is relative to the invoking object.
plotA plot object. null may be used to create a new plot.
Returns
The added plot on success, or null on failure.

◆ AddTimeLine()

GlgObject AddTimeLine ( String  resource_name,
GlgObject  time_line,
double  time_stamp 
)

Adds a vertical time line to the chart object.

Parameters
resource_nameA resource path of a child chart, or null to add to the chart the method is invoked on. The resource path is relative to the invoking object.
time_lineA Level Line object to be used as a time line. null may be used to create a new time line.
time_stampThe timestamp to position the time line at. This value will be assigned to the time line's Level attribute.
Returns
The added time line on success, or null on failure.

The chart's NumTimeLines attribute should be set to -1 in order to use this method.

◆ Bell()

static void Bell ( )
static

Emits an audio beep.

◆ ChangeObject()

void ChangeObject ( String  resource_path)

Sends a change message the object without actually changing the object's properties.

Parameters
resource_pathIf null, the message is sent to the object the method is invoked on. Otherwise, the message is sent to the object's child specified by the resource path. The resource path is relative to the invoking object.

This method may be used to send a change message to an object's attribute. Sending the message to an object attribute is equivalent to setting the attribute to the same value as its current value using one of the SetDResource, SetSResource or SetDResource methods.

For example, sending the message to the Factor attribute of a volatile series object forces the series to recreate its instances without actually changing the value of the Factor. If the change message is sent to the ImageFile attribute of an image object, the image will reload the image file (the image's EnableCache attribute should be set to NO to disable cache for images that need to be reloaded).

Sending a change message to a drawable object forces the object to redraw itself. If the message is sent to an object like a polygon or a text object, the area of the object's bounding box gets invalidated and redrawn. If an object is a viewport, it redraws its content.

◆ ClearDataBuffer()

boolean ClearDataBuffer ( String  resource_name)

Clears accumulated data samples of a real-time chart or one of its plots.

Parameters
resource_nameA resource path of a child chart or a child plot, or null to clear the chart or the plot the method is invoked on. The resource path is relative to the invoking object.
Returns
  • true if any data samples were cleared
  • false on error or if no samples were cleared.

For a Chart object, ClearDataBuffer discards data samples in all plots of the chart. For a Plot object, it discards only the data samples of that plot.

◆ ConcatResNames()

static String ConcatResNames ( String  resource_name1,
String  resource_name2 
)
static

Creates a composite resource path from two components.

This method is provided to mimic C/C++ API in cases when the C/C++ GLG code is converted to Java.

Parameters
resource_name1Specifies the first resource path component.
resource_name2Specifies the second resource path component.
Returns
Created resource path.

This method creates and returns a resource path formed by concatenating the two components with the / character between them. The method checks if a trailing / separator is already present in the first string, and adds it only if the separator is not present.

Either argument may be null, in which case the returned string will precisely equal the input value of the other argument.

Examples

The following code:

String resource_path = GlgObject.ConcatResNames( "DataGroup", "DataSample2" );
System.out.println( "resource_path: " + resource_path );

produces the following output:

resource_path = DataGroup/DataSample2

Multiple calls to ConcatResNames may be used to create composite paths from more than two components:

String temp_name = GlgObject.ConcatResNames( "DataGroup", "DataSample2" );
String resource_path = GlgObject.ConcatResNames( temp_name, "Value" );
System.out.println( "resource_path: " + resource_path );

producing the following output:

resource_path: DataGroup/DataSample2/Value

◆ ConfigureWindow()

boolean ConfigureWindow ( int  x,
int  y,
int  width,
int  height,
GlgConfigureMask  mask,
GlgObject  parent 
)

Sets the size and/or position of a viewport's window.

The method is new in the GLG release 4.5. The method should be invoked only for the viewport objects, not the light viewports.

Parameters
xSpecifies X coordinate of the window origin.
ySpecifies Y coordinate of the window origin.
widthSpecifies window width.
heightSpecifies window height.
mask

Specifies flags that can be combined with bitwise OR to control the action to perform, set size, set position or both:

  • POSITION_MASK requests to set window position using x and y parameters and ignore the position defined by the viewport's control points. For top-level viewports, the x and y parameters specify position in screen coordinates relative to the origin of the screen. For child viewports and embedded dialog viewports, position parameters specify position relative to the origin of their parent viewport's window.
  • SIZE_MASK requests to set window size using width and height parameters and ignore the width and height defined by the viewport's control points.
  • POSITION_AND_SIZE_MASK requests to set both the size and position, is equivalent to:
    static final int POSITION_MASK
    Set position mask.
    Definition: GlgObject.java:8052
    static final int SIZE_MASK
    Set size mask.
    Definition: GlgObject.java:8054
  • RESET_POSITION_MASK resets the position request to restore the position defined by the viewport's control points.
  • RESET_SIZE_MASK resets the size request to restore the width and height defined by the viewport's control points.

The set and reset flags are exclusive and can't be used together for the same size or position attribute.

parentSpecifies an optional parent viewport for dialog viewports displayed via the DialogSetupHierarchy or DialogInitialDraw methods, or null otherwise.
Returns
Success or failure status.

Once the viewport's size or position is set using ConfigureWindow, the viewport's control points are no longer used for controlling the viewport's size and/or position. If only the viewport's position is set and not its size, the size will be still controlled by the viewport's control points, and vice versa if only the size is set and not the position. The mask parameter of the method contains options to restore the use of the control points for determining the viewport's size or position after it was set with ConfigureWindow.

◆ CreateAlarmList()

GlgObject CreateAlarmList ( )

Creates and returns a list of alarms defined in the object.

Returns
A group containing all alarm objects, or null if no alarm objects were found.

Each element of the returned group is a data object that has an alarm attached. The GetElement and GetSize methods of the Intermediate API may be used within the Standard API to handle the returned group object.

If the object is not a viewport, the returned alarm list will include only alarms contained inside the object. For a viewport, the alarm list will contain all alarms defined in the viewport's drawing.

Example

The following code prints information about all alarms defined in the drawing:

GlgObject alarm_list = viewport.CreateAlarmList();
if( alarm_list != null )
{
int size = alarm_list.GetSize();
for( int i=0; i<size; ++i )
{
// The data object the alarm is attached to.
GlgObject data_object = alarm_list.GetElement( i );
// AlarmLabel may be unnamed, extract it as the XformAttr1 resource of the alarm object.
String alarm_label = data_object.GetSResource( "Alarm/XformAttr1" );
System.out.println( "AlarmLabel: " + alarm_label );
}
}

◆ CreateImage()

BufferedImage CreateImage ( String  resource_name)

Creates and returns an image of the current state of the viewport's graphics.

For a light viewport, the output will be generated for its parent viewport. The drawing's hierarchy must be set up in order to generate an image.

Parameters
resource_nameThe resource path of a child viewport whose image to generate, or null to generate the image of the viewport the method is invoked on. The resource path is relative to the invoking object.
Returns
Created image.

◆ CreateImageCustom()

BufferedImage CreateImageCustom ( String  resource_name,
Rectangle  image_area,
int  gap 
)

Creates an image of the specified rectangular region of the viewport's graphics.

For a light viewport, the output will be generated for its parent viewport. The drawing's hierarchy must be set up in order to generate an image.

Parameters
resource_nameThe resource path of a child viewport whose image to generate, or null to generate the image of the viewport the method is invoked on. The resource path is relative to the invoking object.
image_areaThe area used to generating an image of. The area is defined in screen pixels relative to the origin of the viewport's window, which has screen coordinates of (0,0).
gapSpecifies the padding space between the extent of the drawing and the border of the generated image in case when width and height of the image_area are set to zero, see below.

The extent of the image area may be obtained by querying the bounding box of either the whole drawing or of the area of the drawing for which the image needs to be generated using GetBox.

If width and height of the image_area are set to 0, the image of the whole drawing is generated using the drawing's bounding rectangle as the image generation area, without clipping to just the visible area. If the viewport is zoomed in, this area may be significantly bigger than the visible area of the viewport, and the image size may be quite large. The viewport's zoom factor defines the scaling factor for objects in the drawing when the image is saved.

Returns
Created image.

◆ CreateIndexedName()

static String CreateIndexedName ( String  template_name,
int  resource_index 
)
static

Creates a string with a name of an enumerated resource.

This method is provided to mimic C/C++ API in cases when the C/C++ GLG code is converted to Java.

Parameters
template_nameA character string containing the template name to be expanded. This name uses the % character to define the expansion position.
resource_indexSpecifies the number to use for expanding the % character in the template name.
Returns
Created resource name.

This method creates and returns a resource name by replacing the first (leftmost) occurrence of the % expansion character within the template name with the number corresponding to the resource_index parameter. If the template name does not contain the expansion character, the number is added to the end of the name.

Examples

The following code:

for( int i=0; i<3; ++i )
{
String name = GlgObject.CreateIndexedName( "XLabelGroup/XLabel%/String", i );
System.out.println( "Name :" + name );
}

produces the following output:

Name: XLabelGroup/XLabel0/String
Name: XLabelGroup/XLabel1/String
Name: XLabelGroup/XLabel2/String

CreateIndexedName may be used repeatedly if a template name has more than one expansion character. For example, the following code:

String name1 = GlgObject.CreateIndexedName( "Chart%/Plots/Plot#%/Value", 4 );
String name2 = GlgObject.CreateIndexedName( name1, 3 );
System.out.println( "Name:" + name2 );

produces the following output:

Name: Chart4/Plots/Plot#3/Value

◆ CreateSelectionMessage()

static GlgObject CreateSelectionMessage ( GlgObject  top_vp,
GlgCube  rectangle,
GlgObject  selected_vp,
GlgSelectionEventType  selection_type,
int  button 
)
static

Searches for an Action object that would be activated by the user interaction event.

This method provides a low-level API for searching all objects inside the given rectangle for an action with the specified selection trigger type attached to an object and returning a selection message for the first found action attached to the object.

The method may be used inside the GlgTraceListener's TraceCallback method to determine whether a mouse event was meant to trigger an action attached to a graphical object in a drawing.

Parameters
top_vpThe top viewport or light viewport of the selection query (must be an ancestor of selected_vp or the same as selected_vp). It may be either a viewport or a light viewport.
rectangleThe bounding rectangle in screen coordinates of the selected_vp viewport. All graphical shapes whose rendering intersects this rectangle, including shapes in the top_vp viewport, are included in the selection list.
selected_vpThe viewport relatively to which the bounding rectangle is defined. When used with the mouse events, this is the viewport in which the mouse event occurred. If a light viewport is supplied, its parent viewport will be used.
selection_typeSpecifies the selection type:
buttonThe mouse button (1, 2 or 3) for the CLICK_SELECTION selection type.
Returns
A message equivalent to the message received in the input callback when the event specified by the selection_type occurs in the specified rectangular area, or null if no matching actions were found.

◆ CreateSelectionNames() [1/2]

static GlgObject CreateSelectionNames ( GlgObject  top_vp,
GlgCube  rectangle,
GlgObject  selected_vp 
)
static

Returns a list of names of objects intersecting a given rectangle.

This method provides a low-level API to determine whether a mouse event was meant to select graphical objects in a drawing and may be used inside the GlgTraceListener's TraceCallback method to implement custom handling of mouse events.

See also CreateSelectionNames that creates selection names from an event.

Action objects attached to objects in the drawing provide a higher level interface for custom object selection processing.

A more powerful CreateSelection method of the Intermediate API returns object IDs of the selected objects and may be used to handle unnamed objects.

Parameters
top_vpThe top viewport or light viewport of the selection query (must be an ancestor of selected_vp or the same as selected_vp). It may be either a viewport or a light viewport.
rectangleThe bounding rectangle in screen coordinates of the selected_vp viewport. All graphical shapes whose rendering intersects this rectangle, including shapes in the top_vp viewport, are included in the selection list.
selected_vpThe viewport relatively to which the bounding rectangle is defined. When used with the mouse events, this is the viewport in which the mouse event occurred. If a light viewport is supplied, its parent viewport will be used.
Returns
An array of strings containing selected object names, or null if no named objects were selected.

The method returns an array of strings containing names of all objects that overlap with the given rectangle completely or partially. Both the selected objects at the bottom of the hierarchy and all their named parents will be included.

Objects in the array are listed in the reversed order compared to their drawing order, so that the objects that are at the bottom of the drawing list and are drawn on top of other objects will be listed first in the array.

Each returned name string is a complete resource path name (relative to top_vp) which can be used get the object ID of the object:

GlgObject selected_object = top_vp.GetResourceObject( path_name );

◆ CreateSelectionNames() [2/2]

static GlgObject CreateSelectionNames ( MouseEvent  mouse_event,
int  delta,
GlgObject  top_vp,
GlgObject  selected_vp 
)
static

Returns a list of names of objects located under the mouse.

This method provides a low-level API to determine whether a mouse event was meant to select graphical objects in a drawing and may be used inside the GlgTraceListener's TraceCallback method to implement custom handling of mouse events.

See also CreateSelectionNames that creates selection names for the specified area.

Action objects attached to objects in the drawing provide a higher level interface for custom object selection processing.

A more powerful CreateSelection method of the Intermediate API returns object IDs of the selected objects and may be used to handle unnamed objects.

Parameters
mouse_eventMouse event.
deltaSpecifies the radius of the area around the cursor position that will be used to select objects. All graphical shapes whose rendering intersects this area, including shapes in the top_vp viewport, are included in the selection list.
top_vpThe top viewport or light viewport of the selection query (must be an ancestor of selected_vp or the same as selected_vp). It may be either a viewport or a light viewport.
selected_vpThe viewport in which the mouse event occurred. If a light viewport is supplied, its parent viewport will be used.
Returns
An array of strings containing selected object names, or null if no named objects were selected.

Follow this link for information on using the returned array.

◆ CreateTagList()

GlgObject CreateTagList ( boolean  unique_tag_sources)

Creates and returns a list of data tags defined in the object.

Parameters
unique_tag_sources
  • If true, only the first encountered tag of the highest priority will be added to the list for tags with the same tag source. Input tags are prioritized over output tags, and enabled tags over disabled tags.
  • If false, all instances with the same tag source will be included.
Returns
A group containing all data tag objects, or null if no tags were found.

Each element of the returned group is an attribute object that has a data tag attached. The GetElement and GetSize methods of the Intermediate API may be used within the Standard API to handle the returned group object.

If the object is not a viewport, the returned tag list will include only the tags contained inside the object. For a viewport, the tag list will contain all tags defined in the viewport's drawing.

Example

The following code prints information about all tags defined in the drawing:

// Query list of tags defined in the drawing.
GlgObject tag_list = viewport.CreateTagList( false );
if( tag_list != null )
{
int size = tag_list.GetSize();
for( int i=0; i<size; ++i )
{
// Query TagName and TagSource of each tag.
GlgObject tag_object = GlgGetElement( tag_list, i );
String tag_name = tag_object.GetSResource( "TagName" );
String tag_source = tag_object.GetSResource( "TagSource" );
System.out.println( "TagName: " + tag_name + " TagSource: " + tag_source );
}
}

Tag Access Performance Optimization

Since tags returned by CreateTagList are actually data objects the tags are attached to, their object IDs may be stored and then used repeatedly to optimized tag access performance when tags are used to supply data for a drawing with large number of tags.

Instead of setting new tag values with SetDTag:

viewport.SetDTag( tag_source, new_value, true );

the stored object IDs may be used with the the SetDResource method using null as the resource_name parameter to set a new value of each data object directly without an overhead of searching the drawing for each tag by its TagSource:

tag_object.SetDResourceIf( null, new_value, true );

The AddDataSampleNode method of the Intermediate API can also be used instead of setting values of chart entry points to prefill a chart with a large number of data samples.

The GetTagObject and QueryTags methods of the Intermediate API provide extended functionality for querying both data and export tags.

◆ DeleteAnnotation()

boolean DeleteAnnotation ( String  resource_name,
GlgObject  annotation,
double  position_x,
double  position_y 
)

Deletes an annotation from the chart.

Parameters
resource_nameA resource path of a child chart, or null to delete from the chart the method is invoked on. The resource path is relative to the invoking object.
annotationThe annotation object to delete. If null, the annotation with the timestamp specified by the position_x and position_y parameters will be deleted.
position_xThe X position of the annotation to be deleted when the annotation parameter is null. The parameter is ignored if annotation is not null.
position_yThe Y position of the annotation to be deleted when the annotation parameter is null. The parameter is ignored if annotation is not null.
Returns
true if the annotation was successfully deleted.

The chart's NumAnnotations attribute should be set to -1 in order to use this method.

◆ DeletePlot()

boolean DeletePlot ( String  resource_name,
GlgObject  plot 
)

Deletes a plot line from the chart.

Parameters
resource_nameA resource path of a child chart, or null to delete from the chart the method is invoked on. The resource path is relative to the invoking object.
plotThe plot object to delete.
Returns
true if the plot was successfully deleted.

◆ DeleteTimeLine()

boolean DeleteTimeLine ( String  resource_name,
GlgObject  time_line,
double  time_stamp 
)

Deletes a time line from the chart.

Parameters
resource_nameA resource path of a child chart, or null to delete from the chart the method is invoked on. The resource path is relative to the invoking object.
time_lineThe time line object to delete. If null, the time line with the timestamp specified by time_stamp will be deleted.
time_stampThe timestamp of the time line to be deleted when the time_line parameter is null. The parameter is ignored if time_line is not null.
Returns
true if the plot was successfully deleted.

The chart's NumTimeLines attribute should be set to -1 in order to use this method.

◆ DialogInitialDraw()

void DialogInitialDraw ( GlgObject  parent)

Displays a GLG drawing of the viewport as a floating dialog for the first time after it has been created or loaded.

The method should be invoked only for the viewport objects and not the light viewports.

Parameters
parentSpecifies the viewport of the main drawing the dialog will be a child of.

This method is similar to InitialDraw, with the only difference that the drawing will be displayed as a child dialog of the main drawing specified by the parent parameter.

ConfigureWindow may be used to set the dialog's size and position.

◆ DialogSetupHierarchy()

void DialogSetupHierarchy ( GlgObject  parent)

Provides an explicit request to set up the object hierarchy of a drawing displayed in a dialog window.

The method is invoked on a viewport containing the dialog's drawing.

Parameters
parentSpecifies the viewport of the main drawing the dialog will be a child of.

This method similar to SetupHierarchy, with the only difference that the drawing will be set up as a child dialog of the main drawing specified by the parent parameter.

This method needs to be invoked only on the initial draw of the dialog. After the dialog has been set up, a generic SetupHierarchy method may be used for all objects, including the dialog.

◆ EnableTimerXforms()

static boolean EnableTimerXforms ( boolean  state)
static

ADVANCED: Enables or disables all timer transformations defined inside GLG drawings.

This method may be used to temporarily disable time transformation in some advanced usage scenarios, such as reparenting GlgJBean components.

Parameters
stateThe new enabled state.
Returns
Previous value of the enabled state.

◆ Error()

static void Error ( GlgErrorType  error_type,
String  message,
Exception  exception 
)
static

Display an error message using the GLG error handler.

Invokes a currently installed error handler to generate an error message. See GlgErrorType for details on how different message types are handled by the default error handler.

Parameters
error_type

Specifies an error type, may be one of the following:

messageThe message to be displayed.
exceptionAn optional exception that caused the error. If it is not null, it is used to extract additional information and an exact stack trace.

◆ ExportPostScript()

boolean ExportPostScript ( String  file,
double  x,
double  y,
double  width,
double  height,
boolean  portrait,
boolean  stretch,
boolean  center 
)

Generates a PostScript output of the current state of the viewport's graphics.

If the object is a light viewport, the output will be generated for its parent viewport.

Parameters
fileSpecifies a filename in which to save the generated PostScript output.
xDefines the X coordinate of the upper left corner of the rectangle on the page containing the PostScript output. All coordinates are specified in the world coordinate system, which maps a rectangle defined by the points (0;0) and (2000;2000) to a page.
yDefines the Y coordinate of the upper left corner of the rectangle.
widthDefines the width of the rectangle.
heightDefines the height of the rectangle.
portraitSpecifies the orientation of the PostScript output on the page. If true, a portrait orientation is used, otherwise a landscape orientation is used.
stretchSpecifies whether or not PostScript output should be stretched when mapping it to the specified rectangle:
  • If true, the PostScript output will be stretched to fit the rectangle exactly. This may distort printed objects.
  • If false, the ratio of height to width of the widget will be preserved in the PostScript output. This may leave some parts of the specified rectangle blank.
centerSpecifies whether or not PostScript output should be centered inside the specified output rectangle when stretch=false results in unused space on the sides of the rectangle. If true, the output will be centered inside the output area, otherwise it will be anchored in the upper left corner of the rectangle.
Returns
true if PostScript output was successfully written to the file, otherwise false.

The drawing's hierarchy must be set up in order to generate PostScript output. Use Update before calling ExportPostScript to make sure the drawing is up to date.

◆ ExportStrings()

int ExportStrings ( String  filename,
GlgMediumType  medium_type,
char  separator1,
char  separator2,
String  charset_name 
)

Writes all text strings defined in the viewport's drawing into a string translation file.

If the method is invoked on an arbitrary non-viewport object, it writes all text strings defined in the object.

Parameters
filenameSpecifies the filename of the string translation file.
medium_typeOutput type, must be FILE.
separator1A char value that specifies the first separator character to be used in the generated output (for example, '#').
separator2A char value that specifies the second separator character to be used in the generated output (for example, '#').
charset_nameName of a charset to use for encoding exported strings. If null, a default charset is used.
Returns
The number of exported strings or -1 in case of an error.

This method exports all strings defined in the drawing to an ASCII string translation file that can be edited using a text editor.

The method exports strings of the S (string) resource objects, such as the String attribute of a text object. It does not export strings that are not values of S resource objects, such as object names, tag names and tag sources, which ensures that the program logic is not affected when the translated file is used by ImportStrings to modify text strings in the drawing.

The string translation file contains a line for each exported string. Each string entry contains the name of a string resource which helps identify how the string is used, and two copies of the string: the current value and the new value. Each item in the string entry is separated by two separator characters. The name of the string resource and the first copy of the string are used to identify the string and should not be changed.

When the file is translated, the second copy of the string (the new value) may be replaced with a new string representing the text in the local language and local character set. Multiple copies of the file can be created, one for each supported language.

The ImportStrings method can be used at run time to display a localized drawing. An application can load different versions of the translated file to display localized drawings for different language environments.

This method provides a programming interface for exporting strings from a drawing. The File, Export Strings option of the GLG editors can be used to export strings from the loaded drawing, in which case two double quotation characters are used as the default separators. This can be changed by defining the GLG_STRING_SEPARATOR environment variable to supply a two character string to be used as a separator.

Refer to the Localization Support section of the GLG User's Guide and Builder Reference Manual for more information about the string translation file format.

◆ ExportTags()

int ExportTags ( String  filename,
GlgMediumType  medium_type,
char  separator1,
char  separator2,
String  charset_name 
)

Writes tag names and tag sources of all data tags defined in the viewport's drawing to a tag remapping file.

If the method is invoked on an arbitrary non-viewport object, it writes all data tags defined in the object.

Parameters
filenameSpecifies the filename of the tag remapping file.
medium_typeOutput type, must be FILE.
separator1A char value that specifies the first separator character to be used in the generated output (for example, '#').
separator2A char value that specifies the second separator character to be used in the generated output (for example, '#').
charset_nameName of a charset to use for encoding exported strings. If null, a default charset is used.
Returns
The number of exported tags or -1 in case of an error.

This method exports all data tags defined in the drawing to an ASCII tag file that can be edited using a text editor.

Each tag entry contains two copies of the tag's TagName and TagSource attributes separated by two separator characters. The first copy of the TagName and TagSource attributes contains the current values. It is used to identify the tag and should not be changed.

The second copy of the attributes contains new values that may be changed to modify the tag. The new value of the TagSource attribute supplies the data source variable associated with the tag. Tag names can also be localized by translating new values of the TagName attributes to different languages.

The file can be edited to modify new values, and then imported into the drawing using ImportTags.

This makes it possible to use the drawing as a template, and modify it on the fly to use a different set of tags. This technique may be used to create a single drawing, and then use it at run time to display different sections of a plant or different rooms of a data center. Alternatively, tag remapping may also be done programmatically as shown in the GLG demos.

This method provides a programming interface for exporting tag from a drawing. The File, Export Tags option of the GLG editors can be used to export tags from the loaded drawing, in which case two double quotation characters are used as the default separators. This can be changed by defining the GLG_STRING_SEPARATOR environment variable to supply a two character string to be used as a separator.

Refer to the Tag Export and Import Features for Run-Time Tag Mapping section of the GLG User's Guide and Builder Reference Manual for more information about the tag file format.

◆ GetChartDataExtent()

GlgMinMax GetChartDataExtent ( String  resource_name,
boolean  x_extent,
boolean  visible_only 
)

Queries the minimum and maximum extent of the data accumulated in the chart or in one of its plots in the specified X or Y direction.

Parameters
resource_nameA resource path to access the child chart or the child plot. Use null to use the chart or the plot the method is invoked on. The resource path is relative to the invoking object.
x_extentIf true, the method returns the X extent, otherwise it returns the Y extent.
visible_onlyIf true, the method considers only visible data samples when calculating data extent, otherwise all samples are considered.
Returns
The returned data extent or null on error.

For a chart object, the method returns the data extent of all plots in the chart is returned. For a plot, the data extent of that plot is returned.

The object hierarchy must be set up for this method to succeed.

◆ GetDataType()

GlgDataType GetDataType ( )

Returns The data object's data type.

Returns
The object's data type.

◆ GetDResource()

Double GetDResource ( String  resource_name)

Returns the current value of the object's D (double) resource.

Parameters
resource_nameSpecifies the resource path of the object's scalar resource to query.
Returns
Resource value or null if the resource was not found.

If a scalar resource with the given resource path exists, this method returns its value, otherwise it generates an error message and returns null.

◆ GetDResourceObj()

GlgDouble GetDResourceObj ( String  resource_name)

Returns the current value of the object's D (double) resource.

This is a more efficient version of GetDResource, it uses a cached GlgDouble object to return the value. If the returned object is not null, it can be returned to the internal cache via the object's ReleaseToCache method.

Parameters
resource_nameSpecifies the resource path of the object's scalar resource to query.
Returns
Resource value or null if the resource was not found.

If a scalar resource with the given resource path exists, this method returns its value, otherwise it generates an error message and returns null.

For efficiency, if the returned object is not null, it can be returned to the internal cache via the object's ReleaseToCache method.

◆ GetDTag()

Double GetDTag ( String  tag_source)

Returns the current value of the object's D (double) tag.

Parameters
tag_sourceSpecifies the TagSource of the scalar tag to query.
Returns
Tag value or null if the tag was not found.

If a scalar tag with the given TagSource exists, this method returns its value, otherwise it generates an error message and returns null.

◆ GetDTagObj()

GlgDouble GetDTagObj ( String  tag_source)

Returns the current value of the object's D (double) tag.

This is a more efficient version of GetDTag, it uses a cached GlgDouble object to return the value. If the returned object is not null, it can be returned to the internal cache via the object's ReleaseToCache method.

Parameters
tag_sourceSpecifies the TagSource of the scalar tag to query.
Returns
Tag value or null if the tag was not found.

If a scalar tag with the given TagSource exists, this method returns its value, otherwise it generates an error message and returns null.

For efficiency, if the returned object is not null, it can be returned to the internal cache via the object's ReleaseToCache method.

◆ GetGResource()

GlgPoint GetGResource ( String  resource_name)

Returns the current value of the object's G (geometrical or color) resource.

Parameters
resource_nameSpecifies the resource path of the G resource to query.
Returns
A GlgPoint containing XYZ or RGB resource values.

If a G resource with the given resource path exists, this method returns its values in a GlgPoint object, otherwise it generates an error message and returns null.

For efficiency, if the returned object is not null, it can be returned to the internal cache via the object's ReleaseToCache method.

◆ GetGTag()

GlgPoint GetGTag ( String  tag_source)

Returns the current value of the object's G (geometrical or color) tag.

Parameters
tag_sourceSpecifies the TagSource of the G tag to query. All object's tags with the specified TagSource will be set to the supplied values.
Returns
A GlgPoint containing XYZ or RGB resource values.

If a G tag with the given TagSource exists, this method returns its values in a GlgPoint object, otherwise it generates an error message and returns null.

For efficiency, if the returned object is not null, it can be returned to the internal cache via the object's ReleaseToCache method.

◆ GetModifierState()

static boolean GetModifierState ( GlgModifierType  modifier)
static

Returns the current state of a modifier.

Parameters
modifierSpecifies the modifier to query, may be one of the following constants:
Returns
The current modifier state.

◆ GetNamedPlot()

GlgObject GetNamedPlot ( String  resource_name,
String  plot_name 
)

Given a name of the chart's plot, returns the plot's object ID.

Parameters
resource_nameA resource path of a child chart to query, or null to query the chart the method is invoked on. The resource path is relative to the invoking object.
plot_nameThe plot name.
Returns
The found plot, or null if a plot with the specified name was not found.

◆ GetNativeComponent()

Object GetNativeComponent ( String  resource_name,
GlgComponentQueryType  type 
)

ADVANCED: Returns a native component used to render the viewport.

The method provides an access to native components used to render the viewport, making it possible to set their native properties.

Parameters
resource_nameA resource path of a child viewport, or null to query the viewport the method is invoked on. The resource path is relative to the invoking object.
typeThe type of a component to retrieve:
  • WIDGET_QUERY returns the native component used to render the viewport.
  • SHELL_QUERY returns the top-level JFrame used to host the GLG drawing.
  • CHILD_WIDGET_QUERY returns native components of the list and text edit viewports. For these viewport types WIDGET_QUERY returns the scroll pane used for scrolling, and CHILD_WIDGET_QUERY returns the list and text components themselves.
Returns
The retrieved native component.

◆ GetObjectName()

String GetObjectName ( )

Returns the object's name.

Returns
The object's name or null if the object is unnamed.

◆ GetObjectType()

GlgObjectType GetObjectType ( )

Returns the object's type.

Returns
The object's type.

◆ GetSResource()

String GetSResource ( String  resource_name)

Returns the current value of the object's S (string) resource.

Parameters
resource_nameSpecifies the resource path of the string resource to query.
Returns
Resource value or null if the resource was not found.

If a string resource with the given resource path exists, this method returns its value, otherwise it generates an error message and returns null.

◆ GetStackTraceAsString() [1/2]

static String GetStackTraceAsString ( )
static

Returns current stack trace as a string.

Returns
Stack trace string.

◆ GetStackTraceAsString() [2/2]

static String GetStackTraceAsString ( Exception  e)
static

Returns the stack trace of the specified exception as a string.

Parameters
eAn exception to generate the stack trace of.
Returns
Stack trace string.

◆ GetSTag()

String GetSTag ( String  tag_source)

Returns the current value of the object's S (string) tag.

Parameters
tag_sourceSpecifies the TagSource of the string tag to query.
Returns
Resource value or null if the resource was not found.

If a string tag with the given TagSource exists, this method returns its value, otherwise it generates an error message and returns null.

◆ GetWidgetPassword()

char [] GetWidgetPassword ( String  resource_name)

Returns password entered into the password text widget.

Parameters
resource_nameA resource path to access the password widget's viewport from the parent, or null if the method is invoked on the password widget's viewport.
Returns
Password string.

◆ GISConvert()

boolean GISConvert ( String  resource_name,
GlgCoordType  coord_type,
boolean  coord_to_lat_lon,
GlgPoint  in_point,
GlgPoint  out_point 
)

Performs coordinate conversion from the GIS coordinates of the GIS Object to the GLG coordinates of the drawing and visa versa.

Parameters
resource_nameThe resource path of a child GIS object whose coordinate system to use for conversion, or null to use the GIS object the method is invoked on. The resource path is relative to the invoking object.
coord_typeThe type of the GLG coordinate system to convert to or from:
coord_to_lat_lon
  • true to convert from GLG coordinates to GIS longitude and latitude
  • false to convert the GIS longitude and latitude to GLG coordinates.
in_pointGlgPoint containing input values (x/y in the selected coordinate system or lon/lat).
out_pointGlgPoint that will receive converted output values (x/y in the selected coordinate system or lon/lat).
Returns
Success or failure status.

When converting from X/Y to lat/lon coordinates in the ORTHOGRAPHIC projection, the Z coordinate is set to a negative value for points on the invisible part of the globe or outside the globe area, and to zero for points on the edge of the globe. Coordinates of the returned point may be outside of the visible portion of the map for all projections.

This method performs coordinate conversion using the current settings of the GIS object, which must be set up and rendered.

The GlmConvert method may be used to perform coordinate conversion between GIS and GLG coordinates without the use of the GIS object, which could be done before the drawing is rendered, without a drawing at all, or without a GIS object being present.

◆ GISCreateSelection()

GlgObject GISCreateSelection ( String  resource_name,
String  layers,
double  x,
double  y,
GlmLabelSelectionMode  select_labels 
)

Returns a message object containing information about GIS features located at a specified position on the map.

This method provides a high-level interface to the map server's GlmGetSelection function and may be used to query GIS selection at the point selected by the mouse click.

Parameters
resource_nameThe resource path of a child GIS object to query or null to query the GIS object the method is invoked on.
layersA list of layers to query.
x,yCoordinates of a point in the screen coordinates of a viewport that contains the GIS object.
select_labelsSpecifies the label selection mode, can have the following values:
  • GIS_LBL_SEL_NONE - GIS features' labels are not considered for the GIS selection.
  • GIS_LBL_SEL_IN_TILE_PRECISION - enables labels to be considered for the GIS selection. For a faster selection, this option does not check labels that belong to GIS features in a different tile but extend to the current tile.
  • GIS_LBL_SEL_MAX_PRECISION - enables labels to be considered for the GIS selection and performs selection with the maximum label precision.

    The layer's settings have precedence over the select_labels parameter. The labels will be considered for selection only for the layers that do not override it by setting their LABEL SELECTION MODE=NONE in the layer's LIF file. If LABEL SELECTION MODE=INTILE, the labels will always be considered using the IN_TILE precision.
Returns

A message object containing information about the selected GIS features.

Refer to the GlmGetSelection section of the GLG Map Server Reference Manual for information on the structure of the returned message object.

◆ GISGetElevation()

GlgDouble GISGetElevation ( String  resource_name,
String  layer_name,
double  lon,
double  lat 
)

Returns an elevation of a lat/lon point on a map.

This method may be used to query elevation at the point selected by the mouse click.

The returned value is in the units (such as meters or feet) defined by the elevation data file.

Parameters
resource_nameThe resource path of a child GIS object to query or null to query the GIS object the method is invoked on.
layer_nameThe name of the layer with elevation data to query.
lon,latThe lon/lat coordinates of a point on the map.
Returns
  • Elevation value if elevation data for the requested lat/lon location exist
  • null if the point is outside of the map in the ORTHOGRAPHIC projection, or if there is no elevation data for the specified location.

◆ GlmConvert()

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

A low level method that performs coordinate conversion from the GIS coordinates of a map to the GLG coordinates of the drawing and visa versa without the help of a GLG GIS Object.

Since the method does not rely on a GIS Object being displayed and set up, it may be used before the drawing is rendered, without a drawing at all, or without a GIS object being present.

When converting from X/Y to lat/lon coordinates in the ORTHOGRAPHIC projection, the Z coordinate is set to a negative value for points on the invisible part of the globe or outside the globe area, and to zero for points on the edge of the globe. Coordinates of the returned point may be outside of the visible portion of the map for all projections.

Parameters
projectionA GIS map projection: RECTANGULAR_PROJECTION or ORTHOGRAPHIC_PROJECTION.
stretchSpecifies if the map preserves the X/Y ratio (false) or not (true).
coord_typeThe type of the GLG coordinate system to convert to or from:
coord_to_lat_lon
  • true to convert from GLG coordinates to GIS longitude and latitude
  • false to convert from GIS longitude and latitude to GLG coordinates.
centerGlgPoint containing lat/lon coordinates of the map center. The Z coordinate must be set to 0.
extentGlgPoint containing X and Y extent of the map in the selected projection: in degrees for the RECTANGULAR projection or in meters for ORTHOGRAPHIC. The Z extent must be set to 0. Refer to the GIS Object section on of the GLG User's Guide and Builder Reference Manual for more details.
angleA map rotation angle in degrees.
min_x,max_x,min_y,max_yA map extent in the selected coordinate system. To get X/Y coordinates relative to the map image origin, use min_x=0, min_y=0, max_x=image_width, max_y=image_height.
in_pointGlgPoint containing coordinate values to be converted (x/y in the selected coordinate system or lon/lat).
out_pointGlgPoint that will receive converted coordinate values (x/y in the selected coordinate system or lon/lat).

◆ HasJava2D()

static boolean HasJava2D ( )
static

Queries device graphical capabilities.

Returns
true if Java2D is supported by the JVM.

◆ HasResourceObject()

boolean HasResourceObject ( String  resource_name)

Checks if the object's named resource exists.

Parameters
resource_nameThe resource path of the resource object to query.
Returns
true if a resource object with the given resource path exists, otherwise returns false without generating an error message.

◆ HasTagName()

boolean HasTagName ( String  tag_name)

Checks if the object's data tag with a specified tag name exists.

Parameters
tag_nameSpecifies the TagName to query.
Returns
true if a tag with the given TagName exists, otherwise returns false without generating an error message.

◆ HasTagSource()

boolean HasTagSource ( String  tag_source)

Checks if the object's data tag with a specified tag source exists.

Parameters
tag_sourceSpecifies the tag source to query.
Returns
true if a tag with the given tag source exists, otherwise returns false without generating an error message.

◆ ImportStrings()

int ImportStrings ( String  filename,
GlgMediumType  medium_type,
boolean  verbose,
String  charset_name 
)

Replaces text strings in the viewport's drawing with the strings loaded from a string translation file.

If the method is invoked on an arbitrary non-viewport object, it replaces text strings defined in the object.

Parameters
filenameSpecifies the file or the URL to load the string translation file from.
medium_typeFILE or URL constant.
verboseIf true, generates an error for each string that was not changed to a new value because it was missing a matching entry in the string translation file.
charset_nameName of a charset to use for decoding imported strings. If null, a default charset is used.
Returns
The number of imported strings or -1 in case of an error.

This method can be used at run time to display a localized drawing. An application can load different versions of the translated file to display localized drawings for different language environments. See ExportStrings for more information.

This method provides a run time interface for importing translated strings into a drawing to display it in a different language environment. The File, Import Strings option of the GLG editors can be used to import strings into the currently loaded drawing for testing.

◆ ImportTags()

int ImportTags ( String  filename,
GlgMediumType  medium_type,
boolean  verbose,
String  charset_name 
)

Replaces the TagName and TagSource attributes of data tags in the viewport's drawing with information loaded from a tag remapping file.

If the method is invoked on an arbitrary non-viewport object, it processes the data tags defined in the object.

Parameters
filenameSpecifies the file or the URL to load the tag remapping file from.
medium_typeFILE or URL constant.
verboseIf true, generates an error for each tag that was not modified because it was missing a matching entry in the tag remapping file.
charset_nameName of a charset to use for decoding imported tag names. If null, a default charset is used.
Returns
The number of imported tags or -1 in case of an error.

This method can be used at run time to modify the data tags used by the drawing. It load the specified tag remapping file and uses it to modify the drawing's data tags. See ExportStrings for more information.

This method provides a run time interface for importing modified tags into a drawing. The File, Import Tags option of the GLG editors can be used to import tags into the currently loaded drawing for testing.

◆ Init()

static void Init ( )
static

Initializes GLG Toolkit.

This method is automatically invoked if the GLG library is deployed using GlgJBean. However, it's always a good idea to explicitly call this method at the beginning of the application code.

◆ InitialDraw()

void InitialDraw ( )

Draws a GLG viewport object for the first time after it has been created or loaded.

The method displays a viewport's drawing and is part of the GLG Generic API.

The method creates a top level window and renders the viewport's drawing in it.

This method does not need to be explicitly called for the top level viewport of the GlgJBean, since the bean automatically invokes this method when it is displayed.

InitialDraw is equivalent to the following sequence:

viewport.SetupHierarchy();
viewport.Update();

◆ IsDemo()

static boolean IsDemo ( )
static

Queries the type of the GLG library.

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

◆ LoadObject() [1/4]

static GlgObject LoadObject ( Object  medium,
GlgMediumType  medium_type 
)
static

Loads an object from a stream using a default charset.

Parameters
mediumThe source to load the object from (Stream).
medium_typeSource type, must be STREAM.
Returns
Loaded object or null if loading fails.

◆ LoadObject() [2/4]

static GlgObject LoadObject ( Object  medium,
GlgMediumType  medium_type,
String  charset_name 
)
static

Loads an object from a stream using the specified charset.

Parameters
mediumThe source to load the object from (Stream).
medium_typeSource type, must be STREAM.
charset_nameName of a charset for string decoding.
Returns
Loaded object or null if loading fails.

◆ LoadObject() [3/4]

static GlgObject LoadObject ( String  filename,
GlgMediumType  medium_type 
)
static

Loads an object from a GLG drawing file or a URL using a default charset.

Parameters
filenameSpecifies the name of the file or a URL to load the object from.
medium_typeFILE or URL constant.
Returns
The loaded object or null if loading failed.

This method loads an object from the specified file or URL and returns the object. If the file or the URL is not accessible or is not in the GLG save format, an error message is generated and null is returned.

◆ LoadObject() [4/4]

static GlgObject LoadObject ( String  filename,
GlgMediumType  medium_type,
String  charset_name 
)
static

Loads an object from a file or a URL using the specified charset.

Parameters
filenameSpecifies the name of the file or the URL to load the object from.
medium_typeFILE or URL constant.
charset_nameName of a charset for string decoding.
Returns
Loaded object or null if loading fails.

◆ LoadWidget() [1/3]

static GlgObject LoadWidget ( GlgObject  glg_object)
static

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

Parameters
glg_objectAn object containing the $Widget viewport.
Returns
The found $Widget viewport or null if the search fails.

◆ LoadWidget() [2/3]

static GlgObject LoadWidget ( String  filename,
GlgMediumType  medium_type 
)
static

Loads a viewport named $Widget from a file or a URL using a default charset.

Parameters
filenameSpecifies the name of the file or the URL to load the widget from.
medium_typeFILE or URL constant.
Returns
Loaded viewport or null if loading fails.

This method loads a drawing from a file or a URL and searches the drawing for a viewport object named $Widget. If the viewport is found, it references and returns it, otherwise it produces an error message and returns null.

◆ LoadWidget() [3/3]

static GlgObject LoadWidget ( String  filename,
GlgMediumType  medium_type,
String  charset_name 
)
static

Loads a viewport named $Widget from a file or a URL using the specified charset.

Parameters
filenameSpecifies the name of the file or the URL to load the widget from.
medium_typeFILE or URL constant.
charset_nameName of a charset for string decoding.
Returns
Loaded viewport or null if loading fails.

This method loads a drawing from a file or a URL and searches the drawing for a viewport object named $Widget. If the viewport is found, it references and returns it, otherwise it produces an error message and returns null.

◆ NativePrint()

boolean NativePrint ( Graphics  graphics)

Generates printing output of the current state of the viewport's graphics.

If the object is a light viewport, the output will be generated for its parent viewport.

Parameters
graphicsPrint graphics context.
Returns
true on success.

◆ Printf() [1/3]

static String Printf ( String  format,
double  value 
)
static

C-style printf method for formatting double values.

Parameters
formatC-style format string.
valueDouble value to be formatted.
Returns
Formatted string.

◆ Printf() [2/3]

static String Printf ( String  format,
int  value 
)
static

C-style printf method for formatting integer values.

Parameters
formatC-style format string.
valueInteger value to be formatted.
Returns
Formatted string.

◆ Printf() [3/3]

static String Printf ( String  format,
String  value 
)
static

C-style printf method for formatting strings.

Parameters
formatC-style format string.
valueString value to be formatted.
Returns
Formatted string.

◆ Rand()

static double Rand ( double  low,
double  high 
)
static

Returns a random number in the specified range.

Parameters
lowThe low limit.
highThe high limit.
Returns
Generated random number.

◆ Reset()

boolean Reset ( )

Reinitializes the viewport's drawing by resetting its drawing hierarchy, then setting it up again and rendering the drawing.

Calling Reset restores all volatile resource changes to the values the resources had when the widget was first drawn. It also discards currently displayed chart data, unless the chart Persistent attribute is set to true.

The method should be invoked only for the top-level viewports, not the child viewports or the light viewports.

Returns
true if the drawing has been successfully reinitialized, otherwise false.

◆ ResetHierarchy()

void ResetHierarchy ( )

Resets the object hierarchy of the object.

Resets the object hierarchy of a top-level viewport. If a viewport containing a drawing was displayed using the InitialDraw or DialogInitialDraw, this method erases the drawing.

This method should not be called for the top-level viewports used in the GlgJBean.

Warning: Do not confuse this method with the Reset method, which is used to redraw a displayed drawing and to regenerate the object hierarchy.

◆ SaveImage()

static boolean SaveImage ( RenderedImage  image,
String  image_file,
String  image_format 
)
static

Saves an image to a file in a requested format.

CreateImage can be used to generates an image of the current state of a viewport's graphics

Parameters
imageImage to save.
image_fileFilename to save the image to.
image_formatImage format to use.
Returns
true on success.

◆ SendMessage()

Object SendMessage ( String  resource_name,
String  message,
Object  param1,
Object  param2,
Object  param3,
Object  param4 
)

Sends a message to the object to request some action to be performed.

In most cases, the object it is a viewport with a GLG input handler attached, such as a button or a slider.

Parameters
resource_name

Specifies the resource path of a child object to send the message to, or null to send the message to the object the method is invoked on. The resource path is relative to the invoking object.

For example, to send the message to a viewport's handler, use the viewport as the object parameter and "Handler" as the resource_name parameter.

messageA string that defines the message type.
param1Message type dependent.
param2Message type dependent.
param3Message type dependent.
param4Message type dependent.
Returns
The query result of messages that execute some query, is ignored otherwise.

This method is used to send a message to an input object with a request to execute some action. For example, a program can send an "Activate" message to a push button widget to simulate a user click, which will activate any click processing Action objects attached to the button. "Set" and "Reset" messages may be sent to a toggle button widget to change its value, which will also process any Action objects attached to the toggle.

The method also serves as an escape mechanism for actions that can not be easily accomplished by setting or querying a single resource, such us adding items to a list widget or querying a state of a multiple-selection list.

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

Integer parameters should be passed as GlgInteger objects.

Integer return values are also returned as Integer objects.

◆ SetAlarmHandler()

static GlgAlarmHandler SetAlarmHandler ( GlgAlarmHandler  alarm_handler)
static

Installs a global alarm handler that will be invoked to process alarms.

Alarms are generated by the Alarm objects attached to objects in the drawing and activated when the controlled values go outside the ranges specified in the Alarm objects.

Parameters
alarm_handlerAn alarm handler that will be invoked to process alarm messages generated by the application's drawings.
Returns
The previously installed alarm handler, or null.

See GlgAlarmHandler for more information.

◆ SetBrowserObject()

static void SetBrowserObject ( GlgObject  browser,
GlgObject  glg_object 
)
static

Sets the object for browsing with the GLG Resource, Tag and Alarm browser widgets.

Parameters
browserA viewport of the Resource, Tag or Alarm browser widget.
glg_objectAn object to browse.

The browser widget will display the object's resources, tags or alarms depending on the type of the browser widget.

◆ SetBrowserSelection()

boolean SetBrowserSelection ( String  resource_name,
String  selection,
String  filter 
)

Sets a new value of a browser's Selection and Filter text boxes of the Resource, Tag, Alarm and Data browser widgets after the browser object has already been set up.

The method is invoked on the browser widget's viewport, or its parent.

Parameters
resource_nameA resource path to access the browser widget's viewport from the parent, or null if the method is invoked on the browser widget's viewport.
selectionA new selection string.
filterA new filter string.
Returns
Success or failure status.

Setting a new selection will display a new list of matching entries. Before the browser's drawing hierarchy has been set up, the Selection and Filter fields of the browser widget may be set via the corresponding resources. To change Selection or Filter after hierarchy setup, this method should be used.

◆ SetChartFilter()

boolean SetChartFilter ( String  resource_name,
GlgChartFilter  filter,
Object  client_data 
)

Attaches a custom data filter to the chart's plot.

A data filter is invoked by a chart to aggregate the plot's data. See GlgChartFilter for more information.

Parameters
resource_nameA resource path of a child chart's plot, or null to attach the filter to the plot the method is invoked on. The resource path is relative to the invoking object.
filterA custom data filter.
client_dataData to be passed to the custom filter when it is invoked.
Returns
true if a custom filter was successfully attached.

◆ SetCursorType()

boolean SetCursorType ( String  resource_name,
GlgCursorType  cursor_type 
)

Sets cursor for the viewport's drawing or one of its child viewports.

Parameters
resource_nameA resource path of a child viewport, or null to set cursor for the viewport the method is invoked on. The resource path is relative to the invoking object.
cursor_typeOne of the system cursor types to be used:
Returns
Success or failure status.

The specified cursor will be used when the mouse moves inside the viewport the cursor is assigned to. The drawing's hierarchy must be set up in order to set cursor type.

◆ SetDResource() [1/6]

boolean SetDResource ( String  resource_name,
double  value 
)

Sets a new value of the object's D (double) resource.

Parameters
resource_nameSpecifies the name of the object's scalar resource to be set.
valueSpecifies a new value.
Returns
Success or failure status.

If a scalar resource with the given resource path exists, this method sets it to a new value and returns true, otherwise it generates an error message and returns false.

See Resource Access Performance Optimization for more.

◆ SetDResource() [2/6]

boolean SetDResource ( String  resource_name,
Double  value 
)

Sets a new value of the object's D (double) resource.

Parameters
resource_nameSpecifies the name of the object's scalar resource to be set.
valueSpecifies a new value.
Returns
Success or failure status.

If a scalar resource with the given resource path exists, this method sets it to a new value and returns true, otherwise it generates an error message and returns false.

See Resource Access Performance Optimization for more.

◆ SetDResource() [3/6]

boolean SetDResource ( String  resource_name,
double  value,
boolean  if_changed 
)

Sets a new value of the object's D (double) resource.

Parameters
resource_nameSpecifies the name of the object's scalar resource to be set.
valueSpecifies a new value.
if_changedIf set to false, the graphical updates will be performed even if the new value is the same as the old one (equivalent to SetDResource). Setting if_changed=true optimizes performance of applications that set resource values regardless whether the values have changed. The parameter is ignored when updating chart entry points to allow plotting straight lines when the plotted value does not change over time.
Returns
Success or failure status.

If a scalar resource with the given resource path exists, this method sets it to a new value and returns true, otherwise it generates an error message and returns false.

See Resource Access Performance Optimization for more.

◆ SetDResource() [4/6]

boolean SetDResource ( String  resource_name,
Double  value,
boolean  if_changed 
)

Sets a new value of the object's D (double) resource.

Parameters
resource_nameSpecifies the name of the object's scalar resource to be set.
valueSpecifies a new value.
if_changedIf set to false, the graphical updates will be performed even if the new value is the same as the old one (equivalent to SetDResource). Setting if_changed=true optimizes performance of applications that set resource values regardless whether the values have changed. The parameter is ignored when updating chart entry points to allow plotting straight lines when the plotted value does not change over time.
Returns
Success or failure status.

If a scalar resource with the given resource path exists, this method sets it to a new value and returns true, otherwise it generates an error message and returns false.

See Resource Access Performance Optimization for more.

◆ SetDResource() [5/6]

boolean SetDResource ( String  resource_name,
GlgDouble  value 
)

Sets a new value of the object's D (double) resource.

Parameters
resource_nameSpecifies the name of the object's scalar resource to be set.
valueSpecifies a new value.
Returns
Success or failure status.

If a scalar resource with the given resource path exists, this method sets it to a new value and returns true, otherwise it generates an error message and returns false.

See Resource Access Performance Optimization for more.

◆ SetDResource() [6/6]

boolean SetDResource ( String  resource_name,
GlgDouble  value,
boolean  if_changed 
)

Sets a new value of the object's D (double) resource.

Parameters
resource_nameSpecifies the name of the object's scalar resource to be set.
valueSpecifies a new value.
if_changedIf set to false, the graphical updates will be performed even if the new value is the same as the old one (equivalent to SetDResource). Setting if_changed=true optimizes performance of applications that set resource values regardless whether the values have changed. The parameter is ignored when updating chart entry points to allow plotting straight lines when the plotted value does not change over time.
Returns
Success or failure status.

If a scalar resource with the given resource path exists, this method sets it to a new value and returns true, otherwise it generates an error message and returns false.

See Resource Access Performance Optimization for more.

◆ SetDTag() [1/3]

boolean SetDTag ( String  tag_source,
double  value,
boolean  if_changed 
)

Sets a new value of the object's D (double) tag.

Parameters
tag_sourceSpecifies TagSource of the scalar tag to be set. All object's tags with the specified TagSource will be set to the supplied value.
valueSpecifies a new value.
if_changedIf set to false, the graphical updates will be performed even if the new value is the same as the old one. Setting if_changed=true optimizes performance of applications that set tag values regardless whether the values have changed. The parameter is ignored when updating chart entry points to allow plotting straight lines when the plotted value does not change over time.
Returns
Success or failure status.

If scalar tags with the given TagSource exist, this method sets their new values and returns true, otherwise it generates an error message and returns false.

See Tag Access Performance Optimization for more.

◆ SetDTag() [2/3]

boolean SetDTag ( String  tag_source,
Double  value,
boolean  if_changed 
)

Sets a new value of the object's D (double) tag.

Parameters
tag_sourceSpecifies TagSource of the scalar tag to be set. All object's tags with the specified TagSource will be set to the supplied value.
valueSpecifies a new value.
if_changedIf set to false, the graphical updates will be performed even if the new value is the same as the old one. Setting if_changed=true optimizes performance of applications that set tag values regardless whether the values have changed. The parameter is ignored when updating chart entry points to allow plotting straight lines when the plotted value does not change over time.
Returns
Success or failure status.

If scalar tags with the given TagSource exist, this method sets their new values and returns true, otherwise it generates an error message and returns false.

See Tag Access Performance Optimization for more.

◆ SetDTag() [3/3]

boolean SetDTag ( String  tag_source,
GlgDouble  value,
boolean  if_changed 
)

Sets a new value of the object's D (double) tag.

Parameters
tag_sourceSpecifies TagSource of the scalar tag to be set. All object's tags with the specified TagSource will be set to the supplied value.
valueSpecifies a new value.
if_changedIf set to false, the graphical updates will be performed even if the new value is the same as the old one. Setting if_changed=true optimizes performance of applications that set tag values regardless whether the values have changed. The parameter is ignored when updating chart entry points to allow plotting straight lines when the plotted value does not change over time.
Returns
Success or failure status.

If scalar tags with the given TagSource exist, this method sets their new values and returns true, otherwise it generates an error message and returns false.

See Tag Access Performance Optimization for more.

◆ SetEditMode()

static boolean SetEditMode ( GlgObject  viewport,
String  resource_name,
boolean  edit_mode 
)
static

Sets the viewport's edit mode to disable input objects in the viewport while the drawing is being edited.

Parameters
viewportA viewport object (either a Viewport or a Light Viewport) to set the editing mode of, or its parent.
resource_nameA resource path to access the viewport from the parent supplied by the viewport parameter, or null to set the editing mode of the viewport specified by the viewport parameter.
edit_mode
  • true to set the editing mode
  • false to cancel the editing mode.
Returns
Success or failure status.

If the viewport's edit mode is turned on, input objects in the viewport will not react to the mouse and keyboard events. The rest of the input objects outside of the viewport will still be active. The edit mode is inherited by all child viewports.

The edit mode is usually set for viewports that serve as a drawing area; the edit mode ensures that the input objects do not react to mouse clicks when they are dragged with the mouse to a new position. This is similar to the behavior of the Graphics Builder's Drawing Area.

The edit mode is global and may be set only for one viewport used as a drawing area. Setting the edit mode of a new viewport resets the edit mode of the previous viewport. A viewport's edit mode is inherited by all its child viewports.

◆ SetErrorHandler()

static GlgErrorHandler SetErrorHandler ( GlgErrorHandler  new_handler)
static

Replaces the GLG Toolkit error handler and returns the previous error handler.

Parameters
new_handlerSpecifies a new error handler, supplied by the user, to be called on an error condition. This does not include internal errors of the GLG Toolkit, if any are detected: they are still reported using the default handler.
Returns
The previous error handler.

The GLG default error handler emits an audio beep and logs the error in the Java console.

See GlgErrorType for details on how different message types are handled by the default error handler.

◆ SetFocus()

void SetFocus ( String  resource_name)

Sets the keyboard focus to the object's viewport.

If the target object is a viewport, the focus is set to this viewport, otherwise the focus is set to the target object's parent viewport.

Parameters
resource_nameA resource path of a target child object, or null to use the object the method is invoked on. The resource path is relative to the invoking object.

◆ SetGResource() [1/4]

boolean SetGResource ( String  resource_name,
double  x_value,
double  y_value,
double  z_value 
)

Sets new values of the object's G (geometrical or color) resource.

Parameters
resource_nameSpecifies the resource path of the geometrical or color resource to be set.
x_valueSpecifies the new X value.
y_valueSpecifies the new Y value.
z_valueSpecifies the new Z value.
Returns
Success or failure status.

If a G resource with the given resource path exists, this method sets its new values and returns true, otherwise it generates an error message and returns false.

See Resource Access Performance Optimization for more.

◆ SetGResource() [2/4]

boolean SetGResource ( String  resource_name,
double  x_value,
double  y_value,
double  z_value,
boolean  if_changed 
)

Sets new values of the object's G (geometrical or color) resource.

Parameters
resource_nameSpecifies the resource path of the geometrical or color resource to be set.
x_valueSpecifies the new X value.
y_valueSpecifies the new Y value.
z_valueSpecifies the new Z value.
if_changedIf set to false, the graphical updates will be performed even if the new value is the same as the old one (equivalent to SetDResource). Setting if_changed=true optimizes performance of applications that set resource values regardless whether the values have changed.
Returns
Success or failure status.

If a G resource with the given resource path exists, this method sets its new values and returns true, otherwise it generates an error message and returns false.

See Resource Access Performance Optimization for more.

◆ SetGResource() [3/4]

boolean SetGResource ( String  resource_name,
GlgPoint  g_value 
)

Sets new values of the object's G (geometrical or color) resource.

Parameters
resource_nameSpecifies the resource path of the geometrical or color resource to be set.
g_valueA GlgPoint containing XYZ or RGB resource values.
Returns
Success or failure status.

If a G resource with the given resource path exists, this method sets its new values and returns true, otherwise it generates an error message and returns false.

See Resource Access Performance Optimization for more.

◆ SetGResource() [4/4]

boolean SetGResource ( String  resource_name,
GlgPoint  g_value,
boolean  if_changed 
)

Sets new values of the object's G (geometrical or color) resource.

Parameters
resource_nameSpecifies the resource path of the geometrical or color resource to be set.
g_valueA GlgPoint containing XYZ or RGB resource values.
if_changedIf set to false, the graphical updates will be performed even if the new value is the same as the old one (equivalent to SetDResource). Setting if_changed=true optimizes performance of applications that set resource values regardless whether the values have changed.
Returns
Success or failure status.

If a G resource with the given resource path exists, this method sets its new values and returns true, otherwise it generates an error message and returns false.

See Resource Access Performance Optimization for more.

◆ SetGTag() [1/2]

boolean SetGTag ( String  tag_source,
double  x_value,
double  y_value,
double  z_value,
boolean  if_changed 
)

Sets new values of the object's G (geometrical or color) tag.

Parameters
tag_sourceSpecifies the TagSource of the geometrical or color tag to be set. All object's tags with the specified TagSource will be set to the supplied values.
x_valueSpecifies the new X value.
y_valueSpecifies the new Y value.
z_valueSpecifies the new Z value.
if_changedIf set to false, the graphical updates will be performed even if the new value is the same as the old one. Setting if_changed=true optimizes performance of applications that set tag values regardless whether the values have changed.
Returns
Success or failure status.

If G tags with the given TagSource exist, this method sets their new value and returns true, otherwise it generates an error message and returns false.

See Tag Access Performance Optimization for more.

◆ SetGTag() [2/2]

boolean SetGTag ( String  tag_source,
GlgPoint  value,
boolean  if_changed 
)

Sets new values of the object's G (geometrical or color) tag.

Parameters
tag_sourceSpecifies the TagSource of the geometrical or color tag to be set. All object's tags with the specified TagSource will be set to the supplied values.
valueA GlgPoint containing XYZ or RGB resource values.
if_changedIf set to false, the graphical updates will be performed even if the new value is the same as the old one. Setting if_changed=true optimizes performance of applications that set tag values regardless whether the values have changed.
Returns
Success or failure status.

If G tags with the given TagSource exist, this method sets their new value and returns true, otherwise it generates an error message and returns false.

See Tag Access Performance Optimization for more.

◆ SetLabelFormatter()

boolean SetLabelFormatter ( String  resource_name,
GlgLabelFormatter  formatter 
)

Attaches a custom label formatter to the chart axis or the stand-alone axis object.

See GlgLabelFormatter for more information.

Parameters
resource_nameA resource path of a child axis, or null to attach the formatter to the axis the method is invoked on. The resource path is relative to the invoking object.
formatterA custom label formatter.
Returns
true if the formatter was successfully attached.

◆ SetLinkedAxis()

boolean SetLinkedAxis ( String  resource_name,
GlgObject  axis_object,
String  axis_resource_name 
)

Associates the chart's plot, level line or annotation object with an Y axis for automatic rescaling.

Parameters
resource_nameA resource path for accessing the child plot, the level line or the annotation inside the object the method is invoked on. The resource path is relative to the invoking object. Use null to use the plot, level line or annotation object the method is invoked on.
axis_objectThe axis to link with, or the axis' parent.
axis_resource_nameA resource path for accessing the axis inside axis_object, or inside the object the method is invoked on if axis_object is null. Use null when the axis_object parameter specifies an axis.
Returns
Success or failure status.

◆ SetResourceFromObject() [1/2]

boolean SetResourceFromObject ( String  resource_name,
GlgObject  value 
)

Sets a new value of the object's resource to the value of contained in the provided data object of the same data type.

Parameters
resource_nameSpecifies the name of the D, S or G resource to be set.
valueAn object of the matching data type containing the new value.
Returns
Success or failure status.

If a resource of a matching type at the given resource path exists, the method sets the value of the resource to a value defined by the value object and returns true, otherwise it generates an error message and returns false.

The object type and data type of the resource specified by the resource path should match the corresponding types of the value object.

See Resource Access Performance Optimization for more.

◆ SetResourceFromObject() [2/2]

boolean SetResourceFromObject ( String  resource_name,
GlgObject  value,
boolean  if_changed 
)

Sets the value of the object's data object to the value of another data object of the same data type.

Parameters
resource_nameSpecifies the name of the resource to be set.
valueSpecifies the object containing the new value.
if_changedIf set to false, the graphical updates will be performed even if the new value is the same as the old one (equivalent to SetDResource). Setting if_changed=true optimizes performance of applications that set resource values regardless whether the values have changed.
Returns
Success or failure status.

If a resource of a matching type at the given resource path exists, the method sets the value of the resource to a value defined by the value object and returns true, otherwise it generates an error message and returns false.

The object type and data type of the resource specified by the resource path should match the corresponding types of the value object.

The object type (and data type for the data object) of the resource specified by the resource path should match the type of the value object.

See Resource Access Performance Optimization for more.

◆ SetSResource() [1/2]

boolean SetSResource ( String  resource_name,
String  value 
)

Replaces the string of the object's S (string) resource.

Parameters
resource_nameSpecifies the resource path of the string resource to be set.
valueSpecifies a new string.
Returns
Success or failure status.

If a string resource with the given resource path exists, this method sets its the new value and returns true, otherwise it generates an error message and returns false.

See Resource Access Performance Optimization for more.

◆ SetSResource() [2/2]

boolean SetSResource ( String  resource_name,
String  value,
boolean  if_changed 
)

Replaces the string of the object's S (string) resource.

Parameters
resource_nameSpecifies the resource path of the string resource to be set.
valueSpecifies a new string.
if_changedIf set to false, the graphical updates will be performed even if the new value is the same as the old one (equivalent to SetDResource). Setting if_changed=true optimizes performance of applications that set resource values regardless whether the values have changed.
Returns
Success or failure status.

If a string resource with the given resource path exists, this method sets its the new value and returns true, otherwise it generates an error message and returns false.

See Resource Access Performance Optimization for more.

◆ SetSResourceFromD() [1/4]

boolean SetSResourceFromD ( String  resource_name,
String  format,
double  value 
)

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

Parameters
resource_nameSpecifies the resource path of the string resource to be set.
formatSpecifies the C-style printf format to use (for example, "%.2f").
valueSpecifies the numerical value to be converted to a string according to the specified format.
Returns
Success or failure status.

If a string resource with the given resource path exists, this method sets it to a new string containing the value parameter formatter using the format argument and returns true, otherwise it generates an error message and returns false.

See Resource Access Performance Optimization for more.

◆ SetSResourceFromD() [2/4]

boolean SetSResourceFromD ( String  resource_name,
String  format,
Double  value 
)

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

Parameters
resource_nameSpecifies the resource path of the string resource to be set.
formatSpecifies the C-style printf format to use (for example, "%.2f").
valueSpecifies the numerical value to be converted to a string according to the specified format.
Returns
Success or failure status.

If a string resource with the given resource path exists, this method sets it to a new string containing the value parameter formatter using the format argument and returns true, otherwise it generates an error message and returns false.

See Resource Access Performance Optimization for more.

◆ SetSResourceFromD() [3/4]

boolean SetSResourceFromD ( String  resource_name,
String  format,
double  value,
boolean  if_changed 
)

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

Parameters
resource_nameSpecifies the resource path of the string resource to be set.
formatSpecifies the C-style printf format to use (for example, "%.2f").
valueSpecifies the numerical value to be converted to a string according to the specified format.
if_changedIf set to false, the graphical updates will be performed even if the new value is the same as the old one (equivalent to SetDResource). Setting if_changed=true optimizes performance of applications that set resource values regardless whether the values have changed.
Returns
Success or failure status.

If a string resource with the given resource path exists, this method sets it to a new string containing the value parameter formatter using the format argument and returns true, otherwise it generates an error message and returns false.

See Resource Access Performance Optimization for more.

◆ SetSResourceFromD() [4/4]

boolean SetSResourceFromD ( String  resource_name,
String  format,
Double  value,
boolean  if_changed 
)

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

Parameters
resource_nameSpecifies the resource path of the string resource to be set.
formatSpecifies the C-style printf format to use (for example, "%.2f").
valueSpecifies the numerical value to be converted to a string according to the specified format.
if_changedIf set to false, the graphical updates will be performed even if the new value is the same as the old one (equivalent to SetDResource). Setting if_changed=true optimizes performance of applications that set resource values regardless whether the values have changed.
Returns
Success or failure status.

If a string resource with the given resource path exists, this method sets it to a new string containing the value parameter formatter using the format argument and returns true, otherwise it generates an error message and returns false.

See Resource Access Performance Optimization for more.

◆ SetSTag()

boolean SetSTag ( String  tag_source,
String  value,
boolean  if_changed 
)

Replaces the string of the object's S (string) tag.

Parameters
tag_sourceSpecifies TagSource of the string tag to be set. All object's tags with the specified TagSource will be set to the supplied value.
valueSpecifies a new string.
if_changedIf set to false, the graphical updates will be performed even if the new value is the same as the old one. Setting if_changed=true optimizes performance of applications that set tag values regardless whether the values have changed.
Returns
Tag value or null if the tag was not found.

If string tags with the given TagSource exist, this method sets their new values and returns true, otherwise it generates an error message and returns false.

See Tag Access Performance Optimization for more.

◆ SetSTagFromD()

boolean SetSTagFromD ( String  tag_source,
String  format,
double  value,
boolean  if_changed 
)

Sets the value of the object's S (string) tag from a double value, converting the value into a string using a C-style printf format string.

Parameters
tag_sourceSpecifies TagSource of the string tag to be set. All object's tags with the specified TagSource will be set to the supplied value.
formatSpecifies the C-style printf format to use (for example, "%.2f").
valueSpecifies the numerical value to be converted to a string according to the specified format.
if_changedIf set to false, the graphical updates will be performed even if the new value is the same as the old one. Setting if_changed=true optimizes performance of applications that set resource values regardless whether the values have changed.
Returns
Success or failure status.

If a tag resource with the given resource path exists, this method sets it to a new string containing the value parameter formatter using the format argument and returns true, otherwise it generates an error message and returns false.

See Tag Access Performance Optimization for more.

◆ SetSTagFromDObj()

boolean SetSTagFromDObj ( String  tag_source,
String  format,
Double  value,
boolean  if_changed 
)

Sets the value of the object's S (string) tag from a double value, converting the value into a string using a C-style printf format string.

Parameters
tag_sourceSpecifies TagSource of the string tag to be set. All object's tags with the specified TagSource will be set to the supplied value.
formatSpecifies the C-style printf format to use (for example, "%.2f").
valueSpecifies the numerical value to be converted to a string according to the specified format.
if_changedIf set to false, the graphical updates will be performed even if the new value is the same as the old one. Setting if_changed=true optimizes performance of applications that set resource values regardless whether the values have changed.
Returns
Success or failure status.

If a tag resource with the given resource path exists, this method sets it to a new string containing the value parameter formatter using the format argument and returns true, otherwise it generates an error message and returns false.

See Tag Access Performance Optimization for more.

◆ SetTooltipFormatter()

static GlgTooltipFormatter SetTooltipFormatter ( GlgTooltipFormatter  formatter)
static

Supplies a custom tooltip formatter.

A custom tooltip formatter may be used to supply custom context-sensitive tooltip strings by querying an object's properties and displaying them in the tooltip.

See GlgTooltipFormatter for more.

Parameters
formatterSpecifies a custom tooltip formatter.
Returns
The previously set formatter, if any, or null otherwise.

◆ SetupHierarchy()

void SetupHierarchy ( )

Provides an explicit request to set up the object hierarchy of the object without rendering it.

When invoked on a drawing which has been loaded but not yet displayed, the method sets up the drawing's object hierarchy to prepare the drawing for rendering. The drawing should contain either a top-level viewport object, or a group containing several top-level viewports.

After the initial draw (when the object hierarchy has already been set up), the method can be used to set up any type of object after its resources were changed. Unlike fref Update, SetupHierarchy sets up the object without repainting it.

◆ SetZoom()

boolean SetZoom ( String  resource_name,
char  type,
double  value 
)

Provides a programmatic interface to integrated zooming and panning.

This method is invoked on a viewport or a light viewport to perform a zooming or panning operation.

Parameters
resource_nameA resource path of a child viewport to zoom or pan, or null to zoom or pan the viewport the method is invoked on. The resource path is relative to the invoking object.
typeA char value that specifies the type of the zoom or pan operation to perform. For example, 'i' may be used to zoom in.

The value of this parameter matches the corresponding zooming and panning accelerators:
  • i - zooms in relatively to the center of the drawing by the factor specified by the value parameter (the value of 2 is used as a default if value=0). In the Chart Zoom Mode, it zooms in only in the X/Time direction.

  • I - same as 'i' but zooms in relatively to the current mouse position.> In the Chart Zoom Mode, it zooms out only in the Y direction.

  • o - zooms out relatively to the center of the drawing by the factor specified by the value parameter (the value of 2 is used as a default if value=0). In the Chart Zoom Mode, it zooms out only in the X/Time direction.

  • O - same as o but zooms out relatively to the current mouse position. In the Chart Zoom Mode, it zooms out only in the Y direction.

  • t - starts generic ZoomTo mode (left-click and drag the mouse to finish, value is ignored). In the Chart Zoom Mode, if the first point of the ZoomTo box is located within the X or Y axis area, zooming will be performed only in the direction of the selected axis. For example, if the user defines the ZoomTo box in the X axis area, the chart will be zoomed only in the X direction.

  • _ - starts ZoomToX mode, which zooms only in the X direction and preserves the Y scale (left-click and drag the mouse to finish, value is ignored). It is especially useful in the Chart Zoom Mode to zoom the chart along the time axis.

  • | - starts ZoomToY mode, which zooms only in the Y direction preserves the X scale (left-click and drag the mouse to finish, value is ignored). It is especially useful in the Chart Zoom Mode to zoom the chart along the value axis.

  • @ - starts ZoomToXY mode (left-click and drag the mouse to finish, value is ignored).

  • T - starts custom ZoomTo mode (left-click and drag the mouse to ZoomTo, value is ignored). A custom zoom mode lets the user define the ZoomTo area without performing the zoom operation. An application can use the selected ZoomTo rectangle as the input to implement custom zooming or object selection logic. An application can handle Zoom events in input callback to perform a custom zoom operation. Refer to the Appendix B: Message Object Resources section of the GLG Programming Reference Manual for details of the Zoom event.

  • e - aborts ZoomTo mode, value is ignored.

  • s - starts generic dragging mode (left-click and drag the drawing with the mouse to pan or scroll). In the Chart Zoom Mode, if the user clicks and drags the mouse within the X or Y axis area, scrolling will be performed in the direction matching the direction of the selected axis.

  • ^ - starts vertical dragging mode (left-click and drag the drawing with the mouse to pan or scroll in the vertical direction). It is especially useful in the Chart Zoom Mode.

  • > - starts horizontal dragging mode (left-click and drag the drawing with the mouse to pan or scroll in the horizontal direction). It is especially useful in the Chart Zoom Mode.

  • & - starts XY dragging mode (left-click and drag the drawing with the mouse to pan or scroll).

  • f - fits the drawing to the visible area of the viewport, value is ignored (Drawing Zoom Mode only). The X/Y ratio is maintained depending on the setting of the viewport's Stretch attribute.

  • F - fits the area of the drawing defined by an object named GlgFitArea to the visible area of the viewport, value is ignored (Drawing Zoom Mode only). The X/Y ratio is maintained depending on the setting of the viewport's Stretch attribute.

  • n - resets zoom, value is ignored.
    In the GIS zoom mode with map in the ORTHOGRAPHIC projection, resets zooming but keeps the GIS center unchanged. In the RECTANGULAR projection, resets zooming and panning but keeps the rotation angle unchanged. In the Chart Zoom Mode, resets the Y range to fit all chart plots in the visible area of the chart in Y direction.

  • N - resets zoom, value is ignored.
    In the Chart Zoom Mode, resets the Y range and changes the chart's X span to show all accumulated data samples in the visible area of the chart.

  • u - pans up by the fraction of the widow height specified by the value parameter (the value of 0.5 is used as a default if value=0). In the Chart Zoom Mode, scroll the chart up by a fraction of the chart's data area height.

  • d - pans down by the fraction of the widow height specified by the value parameter (the value of 0.5 is used as a default if value=0). In the Chart Zoom Mode, scroll the chart down by a fraction of the chart's data area height.

  • l - pans left by the fraction of the widow width specified by the value parameter (the value of 0.5 is used as a default if value=0). In the Chart Zoom Mode, scroll the chart left by a fraction of the chart's data area width.

  • r - pans right by the fraction of the widow width specified by the value parameter (the value of 0.5 is used as a default if value=0). In the Chart Zoom Mode, scroll the chart right by a fraction of the chart's data area width.

  • x - pans horizontally by the distance in screen coordinates specified by the value parameter, the sign of the value defines the pan direction.

  • y - pans vertically by the distance in screen coordinates specified by the value parameter, the sign of the value defines the pan direction.

  • X - pans horizontally by the distance in world coordinates specified by the value parameter, the sign of the value defines the pan direction. In the GIS Zoom Mode, pans by the latitude degrees. In the Chart Zoom Mode, scrolls by the units of the X axis.

  • Y - pans vertically by the distance in world coordinates specified by the value parameter, the sign of the value defines the pan direction. In the GIS Zoom Mode, pans by the longitude degrees. In the Chart Zoom Mode, scrolls by the units of the first Y axis.

  • U - anchors on the upper edge, value is ignored (Drawing Zoom Mode only).

  • D - anchors on the lower edge, value is ignored (Drawing Zoom Mode only).

  • R - anchors on the right edge, value is ignored (Drawing Zoom Mode only).

  • L - anchors on the lower edge, value is ignored (Drawing Zoom Mode only).

  • A - rotates the drawing clockwise around X axis by the angle specified by the value parameter (Drawing Zoom Mode only).

  • a - rotates the drawing counterclockwise around X axis by the angle specified by the value parameter (Drawing Zoom Mode only).

  • B - rotates the drawing clockwise around Y axis by the angle specified by the value parameter (Drawing Zoom Mode only).

  • b - rotates the drawing counterclockwise around Y axis by the angle specified by the value parameter (Drawing Zoom Mode only).

  • C - rotates the drawing clockwise around Z axis by the angle specified by the value parameter (Drawing Zoom Mode or GIS Zoom Mode with the RECTANGULAR projection only).

  • c - rotates the drawing counterclockwise around Z axis by the angle specified by the value parameter (Drawing Zoom Mode or GIS Zoom Mode with the RECTANGULAR projection only).

valueSpecifies a value for zoom and pan operations as described above.
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.

This method performs a specified zoom or pan operation regardless of the setting of the viewport's Pan and ZoomEnabled attributes.

Zooming and panning keyboard accelerators may also be used by settings a viewport's ZoomEnabled attribute to true (the user may have to click on the viewport first to set the keyboard focus). This is especially useful for interactive testing of integrated zooming and panning in the GLG Graphics Builder.

The viewport's Pan attribute can be used to activate integrated scrollbars for scrolling the drawing, as well as scrolling charts and GIS maps.

In the Drawing Zoom Mode, if the method attempts to set a very large zoom factor which would result in the overflow of the integer coordinate values used by the native windowing system, the zoom operation is not performed and the method returns false.

The left mouse button is the default button for performing the ZoomTo operation, as well as for panning and scrolling the drawing by dragging it with the mouse. These defaults can be changed by setting the GlgZoomToButton and GlgPanDragButton global configuration resources. If the default is changed, the left-click used in the description of the affected operations changes to the click with the mouse button assigned to the respective ZoomTo or Pan operation.

◆ SetZoomMode()

boolean SetZoomMode ( String  resource_name,
GlgObject  zoom_object,
String  zoom_object_resource_name,
GlgZoomMode  zoom_mode 
)

Sets or resets the viewport's zoom mode by supplying a GIS or Chart object to be zoomed.

In the Drawing Zoom Mode (default), the drawing displayed in the viewport is zoomed and panned. If the GIS Zoom Mode is set, any zooming and panning operation performed by SetZoom will zoom and pan the map displayed in the viewport's GIS Object, instead of being applied to the viewport's drawing. In the Chart Zoom Mode, the content of the chart is zoomed and panned.

Parameters
resource_nameA resource path of a child viewport whose zoom mode to set, or null to set the Zoom Mode of the viewport the method is invoked on. The resource path is relative to the invoking object.
zoom_objectGIS or Chart object to be zoomed in the GIS and Chart zooming modes (or null for the Drawing zoom mode):
  • If not null, specifies the GIS or Chart object (or its parent if zoom_object_resource_name is not null).
  • If null, zoom_object_resource_name is used to to specify the GIS or Chart object in the GIS and Chart zooming modes as describe below.
zoom_object_resource_nameResource name of the GIS or Chart object.
  • If null, the GIS or Chart object supplied by the zoom_object parameter is selected as the GIS or Chart object to be zoomed.
  • If not null, specifies the resource path of the GIS or Chart object to be zoomed. The resource path is relative to the zoom_object parameter, or to the object the method is invoked on and the resource_name parameter if the zoom_object parameter is null.
zoom_modeThe zoom mode to set:
Returns
Success or failure status.

◆ Sleep()

static boolean Sleep ( long  millisec)
static

Sleeps for the specified number of milliseconds.

Parameters
millisecRequested sleep time.
Returns
Success or failure status.

◆ Sync()

static boolean Sync ( )
static

Flushes graphical output.

Returns
Success or failure status.

◆ Terminate()

static void Terminate ( )
static

Destroys GLG Toolkit's internal objects.

◆ ThrowExceptionOnError()

static void ThrowExceptionOnError ( boolean  user_error,
boolean  internal_error 
)
static

Controls displaying a stack trace on errors.

Parameters
user_errorSet to true to display a stack trace on application errors, such as "Can't find resource".
internal_errorSet to true to display a stack trace on internal GLG errors.

◆ Update()

boolean Update ( )

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

Returns
true if the drawing has been successfully updated, otherwise false.

If the object is a light viewport, an update of its parent viewport will be performed. All resource changes are held until the Update method is called or until the viewport's window receives an expose event. (That is, it must be redrawn because another window that was obscuring a part of the viewport's window has been moved. This causes the viewport to redraw itself, using its new data.)

Note: Some drawing resources affect the object hierarchy of the drawing. For example, the Factor attribute of a series object controls the number of template instances that will be created by the series. If a number of instances is increased by setting the series' Factor, the new instances will be created and their resources can be accessed only after the Update or SetupHierarchy method is invoked. If the series object is not persistent, any change (either increase or decrease) of its Factor attribute recreates its instances, and either the Update or SetupHierarchy method should be called before accessing resources of the series' instances.

◆ UpdateChartState()

boolean UpdateChartState ( String  resource_name,
int  state 
)

Triggers updating the chart's state after prefilling it with data using the quick mode of AddDataSampleNode.

Parameters
resource_nameA resource path of a child chart, or null to update the chart the method is invoked on. The resource path is relative to the invoking object.
state

Contains binary flags that specify the state to be updated:

Multiple flags can be combined with bitwise OR operator.

Returns
Success or failure status.

This method marks the selected chart states for updating. The actual update happens on the next invocation of the Update or SetupHierarchy methods.

◆ UpdateChartTimeAxis()

boolean UpdateChartTimeAxis ( String  resource_name,
double  time_stamp,
boolean  initialize 
)

Scrolls the chart forward to show all data samples up to the provided time stamp or index.

Parameters
resource_nameA resource path of a child chart, or null to scroll the chart the method is invoked on. The resource path is relative to the invoking object.
time_stampA timestamp (or an index for a chart with an index X axis).
initializeMay be set to true for initializing an empty sweep chart, positioning the sweep bar at the start of the plot instead of the plot end.
Returns
Success or failure status.

While a strip chart's X axis can be updated by simply setting its EndValue resource to the timestamp, a sweep chart needs to update the sweep bar and update the X axis only if needed.

UpdateChartTimeAxis should be used to properly update sweep charts after using the quick mode of the AddDataSampleNode method to supply a large number of data samples. The method handles both strip and sweep charts.

◆ UpdateImmediately()

boolean UpdateImmediately ( )

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

Updates the drawing without deferring the actual painting until the next paint event. It is rarely necessary to call this method, as it is less efficient 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,