GLG Toolkit, Java Class Library  Version 4.6
Standard API Methods

Detailed Description

Functions

void Bell ()
 Emits an audio beep. More...
 
String CreateIndexedName (String template_name, int resource_index)
 Creates a string with a name of an enumerated resource. More...
 
boolean ExportPostScript (String filename, double x, double y, double width, double height, boolean portrait, boolean stretch, boolean center)
 Generates a PostScript output of the current state of the bean drawing's graphics. More...
 
double GetDResource (String resource_name)
 Returns the current value of a D (double) resource of the bean's viewport. More...
 
double GetDTag (String tag_source)
 Returns the current value of a D (double) tag of the bean's viewport. More...
 
GlgPoint GetGResource (String resource_name)
 Returns the current value of a G (color or point) resource of the bean's viewport. More...
 
String GetSResource (String resource_name)
 Returns the current value of an S (string) resource of the bean's viewport. More...
 
String GetSTag (String tag_source)
 Returns the current value of an S (string) tag of the bean's viewport. More...
 
double GetXResource (String resource_name)
 Returns the X value of a G (geometrical or color) resource of the bean's viewport. More...
 
double GetYResource (String resource_name)
 Returns the Y value of a G (geometrical or color) resource of the bean's viewport. More...
 
double GetZResource (String resource_name)
 Returns the Z value of a G (geometrical or color) resource of the bean's viewport. More...
 
boolean HasResourceObject (String resource_name)
 Checks for the existence of a resource object in the bean's viewport. More...
 
boolean HasTagName (String tag_name)
 Checks if a data tag with a specified tag name exists in the bean's viewport. More...
 
boolean HasTagSource (String tag_source)
 Checks if a data tag with a specified tag source exists in the bean's viewport. More...
 
void InitialDraw (GlgObject glg_object)
 Draws a GLG viewport object for the first time after it has been created or loaded. More...
 
boolean IsDemo ()
 Checks the type of the GLG library. More...
 
GlgObject LoadObject (String filename, int medium_type)
 Loads an object from a file or URL using the default charset. More...
 
GlgObject LoadObject (String filename, int medium_type, String charset_name)
 Loads an object from a file or URL using the specified charset. More...
 
GlgObject LoadWidget (GlgObject glg_object)
 Finds a viewport named $Widget inside an object and returns it. More...
 
GlgObject LoadWidget (String filename, int medium_type)
 Loads a viewport named $Widget from a file or URL using default charset. More...
 
GlgObject LoadWidget (String filename, int medium_type, String charset_name)
 Loads a viewport named $Widget from a file or URL using the specified charset. More...
 
void Reset ()
 This method invokes the corresponding method of the bean's viewport. More...
 
void ResetHierarchy (GlgObject glg_object)
 Resets the object hierarchy of the object. More...
 
boolean SetDResource (String resource_name, double value)
 Sets a new value of a D (double) resource of the bean's viewport. More...
 
boolean SetDResource (String resource_name, double value, boolean if_changed)
 Sets a new value of a D (double) resource of the bean's viewport. More...
 
boolean SetDTag (String tag_source, double value, boolean if_changed)
 Sets a new value of a D (double) tag of the bean's viewport. More...
 
boolean SetGResource (String resource_name, double value1, double value2, double value3)
 Sets a new value of a G (geometrical or color) resource of the bean's viewport. More...
 
boolean SetGResource (String resource_name, double value1, double value2, double value3, boolean if_changed)
 Sets a new value of a G (geometrical or color) resource of the bean's viewport. More...
 
boolean SetGTag (String tag_source, GlgPoint gvalue, boolean if_changed)
 Sets a new value of a G (geometrical or color) tag of the bean's viewport. More...
 
boolean SetResourceFromObject (GlgObject glg_object, 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 SetSResource (String resource_name, String value)
 Sets a new value of an S (string) resource of the bean's viewport. More...
 
boolean SetSResource (String resource_name, String value, boolean if_changed)
 Sets a new value of an S (string) resource of the bean's viewport. More...
 
boolean SetSResourceFromD (GlgObject glg_object, 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 SetSTag (String tag_source, String value, boolean if_changed)
 Sets a new value of an S (string) tag of the bean's viewport. More...
 
void SetupHierarchy (GlgObject glg_object)
 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...
 
void Update ()
 Updates the bean's drawing with the latest resource values. More...
 

Function Documentation

◆ Bell()

void Bell ( )

Emits an audio beep.

◆ CreateIndexedName()

String CreateIndexedName ( String  template_name,
int  resource_index 
)

Creates a string with a name of an enumerated resource.

This method invokes the corresponding method of the GlgObject class. See CreateIndexedName for more information.

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.

◆ ExportPostScript()

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

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

This method invokes the corresponding method of the bean's viewport. See ExportPostScript for more information.

Parameters
filenameFilename
xThe X coordinate of the lower left corner of the postcript output.
yThe Y coordinate of the lower left corner of the postcript output.
widthThe width of the postcript output.
heightThe height of the postcript output.
portraitOrientation: true for portrait
stretchPreserving X/Y ratio: true to stretch, false to preserve.
centerIf true, the output is centered inside the defined area when stretch=false resulted in unused space on the sides of the output.
Returns
true if PostScript output was successfully written to the file, otherwise false.

◆ GetDResource()

double GetDResource ( String  resource_name)

Returns the current value of a D (double) resource of the bean's viewport.

Parameters
resource_nameResource path.
Returns
Resource value.

If a scalar resource with the given resource path does not exist, an error message is generated, and zero is returned.

◆ GetDTag()

double GetDTag ( String  tag_source)

Returns the current value of a D (double) tag of the bean's viewport.

Parameters
tag_sourceSpecifies the TagSource of the scalar tag to query.
Returns
Tag value.

If a scalar resource with the given TagSource does not exist, an error message is generated, and null is returned.

◆ GetGResource()

GlgPoint GetGResource ( String  resource_name)

Returns the current value of a G (color or point) resource of the bean's viewport.

Parameters
resource_nameResource path.
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.

◆ GetSResource()

String GetSResource ( String  resource_name)

Returns the current value of an S (string) resource of the bean's viewport.

Parameters
resource_nameResource path.
Returns
Resource value.

If a string resource with the given resource path does not exist, an error message is generated, and null is returned.

◆ GetSTag()

String GetSTag ( String  tag_source)

Returns the current value of an S (string) tag of the bean's viewport.

Parameters
tag_sourceSpecifies the TagSource of the string tag to query.
Returns
Tag value.

If a string tag with the given TagSource does not exist, an error message is generated, and zero is returned.

◆ GetXResource()

double GetXResource ( String  resource_name)

Returns the X value of a G (geometrical or color) resource of the bean's viewport.

Parameters
resource_nameResource path.
Returns
Resource's X value.

If a G resource with the given resource path does not exist, an error message is generated, and zero is returned.

◆ GetYResource()

double GetYResource ( String  resource_name)

Returns the Y value of a G (geometrical or color) resource of the bean's viewport.

Parameters
resource_nameResource path.
Returns
Resource's Y value.

If a G resource with the given resource path does not exist, an error message is generated, and zero is returned.

◆ GetZResource()

double GetZResource ( String  resource_name)

Returns the Z value of a G (geometrical or color) resource of the bean's viewport.

Parameters
resource_nameResource path.
Returns
Resource's Z value.

If a G resource with the given resource path does not exist, an error message is generated, and zero is returned.

◆ HasResourceObject()

boolean HasResourceObject ( String  resource_name)

Checks for the existence of a resource object in the bean's viewport.

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 a data tag with a specified tag name exists in the bean's viewport.

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

◆ HasTagSource()

boolean HasTagSource ( String  tag_source)

Checks if a data tag with a specified tag source exists in the bean's viewport.

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.

◆ InitialDraw()

void InitialDraw ( GlgObject  glg_object)

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

Parameters
glg_objectThe viewport object.

This method invokes the corresponding method of the GlgObject class and draws the viewport in a top-level window outside of the bean. It should not be used on the viewport of the bean. See InitialDraw for more information.

◆ IsDemo()

boolean IsDemo ( )

Checks the type of the GLG library.

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

◆ LoadObject() [1/2]

GlgObject LoadObject ( String  filename,
int  medium_type 
)

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

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

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() [2/2]

GlgObject LoadObject ( String  filename,
int  medium_type,
String  charset_name 
)

Loads an object from a file or 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 load fails.

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.

◆ LoadWidget() [1/3]

GlgObject LoadWidget ( GlgObject  glg_object)

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

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

◆ LoadWidget() [2/3]

GlgObject LoadWidget ( String  filename,
int  medium_type 
)

Loads a viewport named $Widget from a file or URL using 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 load fails.

◆ LoadWidget() [3/3]

GlgObject LoadWidget ( String  filename,
int  medium_type,
String  charset_name 
)

Loads a viewport named $Widget from a file or 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 load fails.

◆ Reset()

void Reset ( )

This method invokes the corresponding method of the bean's viewport.

See Reset for more information.

◆ ResetHierarchy()

void ResetHierarchy ( GlgObject  glg_object)

Resets the object hierarchy of the object.

Parameters
glg_objectThe object to be reset.

This method invokes the corresponding method of the GlgObject class. See ResetHierarchy for more information.

◆ SetDResource() [1/2]

boolean SetDResource ( String  resource_name,
double  value 
)

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

Parameters
resource_nameResource path.
valueResource value.
Returns
Success or failure status.

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

See Resource Access Optimization for more.

◆ SetDResource() [2/2]

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

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

Parameters
resource_nameResource path.
valueResource value.
if_changedIf true, the graphics will be redrawn only if the new resource value is different from the old one.
Returns
Success or failure status.

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

See Resource Access Optimization for more.

◆ SetDTag()

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

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

Parameters
tag_sourceSpecifies TagSource of the scalar tag to be set.
valueSpecifies a new value.
if_changedIf true, the graphics will be redrawn only if the new tag value is different from the old one.
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.

◆ SetGResource() [1/2]

boolean SetGResource ( String  resource_name,
double  value1,
double  value2,
double  value3 
)

Sets a new value of a G (geometrical or color) resource of the bean's viewport.

Parameters
resource_nameResource path.
value1The first value of the XYZ or RGB value triplet.
value2The second value of the XYZ or RGB value triplet.
value3The third value of the XYZ or RGB value triplet.
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 Optimization for more.

◆ SetGResource() [2/2]

boolean SetGResource ( String  resource_name,
double  value1,
double  value2,
double  value3,
boolean  if_changed 
)

Sets a new value of a G (geometrical or color) resource of the bean's viewport.

Parameters
resource_nameResource path.
value1The first value of the XYZ or RGB value triplet.
value2The second value of the XYZ or RGB value triplet.
value3The third value of the XYZ or RGB value triplet.
if_changedIf true, the graphics will be redrawn only if the new resource value is different from the old one.
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 Optimization for more.

◆ SetGTag()

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

Sets a new value of a G (geometrical or color) tag of the bean's viewport.

Parameters
tag_sourceSpecifies the TagSource of the geometrical or color tag to be set.
gvalueGlgPoint containing XYZ or RGB resource values.
if_changedIf true, the graphics will be redrawn only if the new tag value is different from the old one.
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.

◆ SetResourceFromObject()

boolean SetResourceFromObject ( GlgObject  glg_object,
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
glg_objectObject whose resource to set.
resource_nameResource path.
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 Optimization for more.

◆ SetSResource() [1/2]

boolean SetSResource ( String  resource_name,
String  value 
)

Sets a new value of an S (string) resource of the bean's viewport.

Parameters
resource_nameResource path.
valueResource value.
Returns
Success or failure status.

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

See Resource Access Optimization for more.

◆ SetSResource() [2/2]

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

Sets a new value of an S (string) resource of the bean's viewport.

Parameters
resource_nameResource path.
valueResource value.
if_changedIf true, the graphics will be redrawn only if the new resource value is different from the old one.
Returns
Success or failure status.

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

See Resource Access Optimization for more.

◆ SetSResourceFromD()

boolean SetSResourceFromD ( GlgObject  glg_object,
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
glg_objectObject whose resource to set.
resource_nameResource path.
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 Optimization for more.

◆ SetSTag()

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

Sets a new value of an S (string) tag of the bean's viewport.

Parameters
tag_sourceSpecifies TagSource of the string tag to be set.
valueSpecifies a new value.
if_changedIf true, the graphics will be redrawn only if the new tag value is different from the old one.
Returns
Success or failure status.

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.

◆ SetupHierarchy()

void SetupHierarchy ( GlgObject  glg_object)

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

Parameters
glg_objectThe object to be set up.

This method invokes the corresponding method of the GlgObject class. See SetupHierarchy for more information.

◆ SetZoom()

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

Provides a programmatic interface to integrated zooming and panning.

Parameters
resource_nameA resource path of a child viewport to zoom or pan, or null to zoom or pan the bean's top viewport.
typeA char value that specifies the type of the zoom or pan operation to perform. For example, 'i' may be used to zoom in. See SetZoom for information on available zoom types.
valueSpecifies a value for zoom and pan operations, see SetZoom for more information.
Returns
Success or failure status.

This method invokes the corresponding method of the bean's viewport. See SetZoom for more information.

◆ Update()

void Update ( )

Updates the bean's drawing with the latest resource values.

This method invokes the corresponding method of the bean's viewport. See Update for more information.