GLG Toolkit, Java Class Library  Version 4.6
Intermediate API Methods

Detailed Description

Functions

boolean ConstrainObject (GlgObject from_attribute, GlgObject to_attribute)
 Constrains an attribute or a point of the object to an attribute or a point of another object. More...
 
boolean ContainsObject (GlgObject container, Object object)
 Checks if object belongs to the container. More...
 
Object GetElement (GlgObject container, int index)
 Returns element at the specified position in the container. More...
 
int GetIndex (GlgObject container, Object object)
 Returns index of the first occurrence of an object in the container. More...
 
GlgObject GetNamedObject (GlgObject container, String name)
 Finds an object with the specified name inside the container of GLG objects and returns it. More...
 
int GetNumParents (GlgObject glg_object)
 ADVANCED: Returns number of the object's parents. More...
 
GlgObject GetParent (GlgObject glg_object)
 ADVANCED: Returns an object's parent object, if one exists., or an array of all parents for constrained data objects. More...
 
Object GetResource (GlgObject glg_object, String resource_name)
 Deprecated, use GetNativeComponent:
Returns an ID of a native resource. More...
 
GlgObject GetResourceObject (GlgObject glg_object, String resource_name)
 Finds and returns a named resource or an attribute of the object. More...
 
int GetSize (GlgObject container)
 Returns size of the container object. More...
 
void Inverse (GlgObject container)
 Inverses the order of elements inside the container object. More...
 
Object Iterate (GlgObject container)
 Traverses the container object's elements in the forward direction. More...
 
Object IterateBack (GlgObject container)
 Traverses the container object's elements in the backward direction. More...
 
void ReleaseObject (GlgObject glg_object, GlgObject suspend_info)
 Releases the object that was suspended for editing. More...
 
boolean ReorderElement (GlgObject container, int old_index, int new_index)
 Changes an element's position inside the container. More...
 
boolean SaveObject (GlgObject glg_object, String filename)
 Saves the object to a file using a default charset. More...
 
boolean SaveObject (GlgObject glg_object, String filename, String charset_name)
 Saves an object into a file using the specified charset. More...
 
void SetEnd (GlgObject container)
 Initializes the container object for the backward traversing. More...
 
void SetStart (GlgObject container)
 Initializes the container object for the forward traversing. More...
 
GlgObject SuspendObject (GlgObject glg_object)
 Suspends the object for editing after it has been drawn. More...
 
boolean UnconstrainObject (GlgObject glg_object)
 Unconstrains an object's attribute or an object's point. More...
 

Function Documentation

◆ ConstrainObject()

boolean ConstrainObject ( GlgObject  from_attribute,
GlgObject  to_attribute 
)

Constrains an attribute or a point of the object to an attribute or a point of another object.

Parameters
from_attributeThe attribute or point object to be constrained.
to_attributeThe attribute or the point to constrain to.
Returns
Success or failure status.

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

◆ ContainsObject()

boolean ContainsObject ( GlgObject  container,
Object  object 
)

Checks if object belongs to the container.

Parameters
containerA container object.
objectThe object to search for.
Returns
true if the object is found in the container, false otherwise.

This method invokes the corresponding method of the GlgObject class.

◆ GetElement()

Object GetElement ( GlgObject  container,
int  index 
)

Returns element at the specified position in the container.

Parameters
containerA container object.
indexThe element's position inside the container.
Returns
The element at the specified position.

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

◆ GetIndex()

int GetIndex ( GlgObject  container,
Object  object 
)

Returns index of the first occurrence of an object in the container.

Parameters
containerA container object.
objectThe object to search for.
Returns
Index of the object, or -1 if the object was not found in the container.

This method invokes the corresponding method of the GlgObject class.

◆ GetNamedObject()

GlgObject GetNamedObject ( GlgObject  container,
String  name 
)

Finds an object with the specified name inside the container of GLG objects and returns it.

Parameters
containerA container object.
nameThe object's name.
Returns
The retrieved object, of null if the named object was not found.

This method invokes the corresponding method of the GlgObject class.

◆ GetNumParents()

int GetNumParents ( GlgObject  glg_object)

ADVANCED: Returns number of the object's parents.

This method is used to determine the type of the return value of the GetParent method and must be called after the hierarchy is created.

For constrained objects, the method returns a number greater than 1.

Parameters
glg_objectAn object to query.
Returns
The number of the object's parents.

This method invokes the corresponding method of the GlgObject class.

◆ GetParent()

GlgObject GetParent ( GlgObject  glg_object)

ADVANCED: Returns an object's parent object, if one exists., or an array of all parents for constrained data objects.

Parameters
glg_objectAn object to query.
Returns
  • The parent object if the object has a single parent.
  • A group containing all object's parents if the object has multiple parents.
  • null if the object has no parents or in case of an error.

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

◆ GetResource()

Object GetResource ( GlgObject  glg_object,
String  resource_name 
)

Deprecated, use GetNativeComponent:
Returns an ID of a native resource.

Parameters
glg_objectThe object to be queried.
resource_nameSpecifies the resource path of a native resource.
Returns
Native resource object.

This method was used in previous releases to get IDs of native objects used to render the viewport's drawing.

The method is deprecated, use GetNativeComponent.

◆ GetResourceObject()

GlgObject GetResourceObject ( GlgObject  glg_object,
String  resource_name 
)

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

Parameters
glg_objectThe parent object whose resources are queried.
resource_nameA resource path to access the resource object inside the object the method is invoked on. It may use object names or default attribute names.
Returns
The retrieved object, or null if the resource was not found.

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

◆ GetSize()

int GetSize ( GlgObject  container)

Returns size of the container object.

For a viewport or group object, the size is the number of objects in the viewport or group. For a polygon, the size is the number of vertices.

Parameters
containerA container object.
Returns
The size of the container.

While the method provides the Intermediate API functionality, it is also available in the Standard API when used with a group object returned by CreateTagList.

This method invokes the corresponding method of the GlgObject class.

◆ Inverse()

void Inverse ( GlgObject  container)

Inverses the order of elements inside the container object.

Parameters
containerA container object.

This method invokes the corresponding method of the GlgObject class.

◆ Iterate()

Object Iterate ( GlgObject  container)

Traverses the container object's elements in the forward direction.

Parameters
containerA container object.
Returns
The next element of the container.

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

◆ IterateBack()

Object IterateBack ( GlgObject  container)

Traverses the container object's elements in the backward direction.

Parameters
containerA container object.
Returns
The previous element of the container.

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

◆ ReleaseObject()

void ReleaseObject ( GlgObject  glg_object,
GlgObject  suspend_info 
)

Releases the object that was suspended for editing.

Parameters
glg_objectThe suspended object to be released.
suspend_infoSuspension information returned by the previous call to SuspendObject.

This method releases previously suspended object and is intended to be used only in conjunction with the SuspendObject method.

This method invokes the corresponding method of the GlgObject class.

◆ ReorderElement()

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

Changes an element's position inside the container.

Parameters
containerA container object.
old_indexThe index of an element to be reordered.
new_indexA new element position.
Returns
Success or failure status.

This method moves the element at the old_index to the new_index position inside the container. It generates an error message and returns false if indexes are out of range.

This method invokes the corresponding method of the GlgObject class.

◆ SaveObject() [1/2]

boolean SaveObject ( GlgObject  glg_object,
String  filename 
)

Saves the object to a file using a default charset.

Parameters
filenameThe file to save the object to.
glg_objectThe object to save.
Returns
false if the file is not accessible for writing, true if the object was successfully saved.

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

◆ SaveObject() [2/2]

boolean SaveObject ( GlgObject  glg_object,
String  filename,
String  charset_name 
)

Saves an object into a file using the specified charset.

Parameters
filenameThe file to save the object to.
glg_objectThe object to save.
charset_nameName of a charset for string encoding.
Returns
false if the file is not accessible for writing, true if the object was successfully saved.

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

◆ SetEnd()

void SetEnd ( GlgObject  container)

Initializes the container object for the backward traversing.

The method sets the current position pointer past the last element of the container, preparing the container object for the backward traversing with IterateBack.

Parameters
containerA container object.

This method invokes the corresponding method of the GlgObject class.

◆ SetStart()

void SetStart ( GlgObject  container)

Initializes the container object for the forward traversing.

The method sets the current position pointer before the first element of the container, preparing the container object for the forward traversing with Iterate.

Parameters
containerA container object.

This method invokes the corresponding method of the GlgObject class.

◆ SuspendObject()

GlgObject SuspendObject ( GlgObject  glg_object)

Suspends the object for editing after it has been drawn.

Parameters
glg_objectAn object to be suspended.
Returns
An object which keeps suspension information. This information should be passed to the ReleaseObject method when the object is released.

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

◆ UnconstrainObject()

boolean UnconstrainObject ( GlgObject  glg_object)

Unconstrains an object's attribute or an object's point.

Parameters
glg_objectThe attribute or point object to be unconstrained.
Returns
Success or failure status.

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