GLG Toolkit, Java Class Library
Version 4.5
|
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... | |
GlgObject AddAnnotation | ( | String | resource_name, |
GlgObject | annotation, | ||
double | position_x, | ||
double | position_y, | ||
boolean | add_box | ||
) |
Adds an annotation to the chart object.
resource_name | A 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. |
annotation | A Text object that will be used as an annotation. null may be used to create a new annotation. |
position_x | An annotation's position relative to the X axis. |
position_y | An annotation's position relative to the Y axis. |
add_box | If true, a text box will be added to the annotation's text object. |
The chart's NumAnnotations attribute should be set to -1 in order to use this method.
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.
type | Specifies the type of a listener to be added: |
listener | Specifies 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:
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.
Adds a plot line to the chart object.
resource_name | A 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. |
plot | A plot object. null may be used to create a new plot. |
Adds a vertical time line to the chart object.
resource_name | A 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_line | A Level Line object to be used as a time line. null may be used to create a new time line. |
time_stamp | The timestamp to position the time line at. This value will be assigned to the time line's Level attribute. |
The chart's NumTimeLines attribute should be set to -1 in order to use this method.
|
static |
Emits an audio beep.
void ChangeObject | ( | String | resource_path | ) |
Sends a change message the object without actually changing the object's properties.
resource_path | If 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.
boolean ClearDataBuffer | ( | String | resource_name | ) |
Clears accumulated data samples of a real-time chart or one of its plots.
resource_name | A 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. |
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.
|
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.
resource_name1 | Specifies the first resource path component. |
resource_name2 | Specifies the second resource path component. |
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:
produces the following output:
Multiple calls to ConcatResNames may be used to create composite paths from more than two components:
producing the following output:
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.
x | Specifies X coordinate of the window origin. |
y | Specifies Y coordinate of the window origin. |
width | Specifies window width. |
height | Specifies window height. |
mask | Specifies flags that can be combined with bitwise OR to control the action to perform, set size, set position or both:
The set and reset flags are exclusive and can't be used together for the same size or position attribute. |
parent | Specifies an optional parent viewport for dialog viewports displayed via the DialogSetupHierarchy or DialogInitialDraw methods, or null otherwise. |
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.
GlgObject CreateAlarmList | ( | ) |
Creates and returns a list of alarms defined in the object.
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:
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.
resource_name | The 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. |
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.
resource_name | The 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_area | The 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). |
gap | Specifies 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.
|
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.
template_name | A character string containing the template name to be expanded. This name uses the % character to define the expansion position. |
resource_index | Specifies the number to use for expanding the % character in the template 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:
produces the following output:
CreateIndexedName may be used repeatedly if a template name has more than one expansion character. For example, the following code:
produces the following output:
|
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.
top_vp | The 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. |
rectangle | The 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_vp | The 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_type | Specifies the selection type:
|
button | The mouse button (1, 2 or 3) for the CLICK_SELECTION selection type. |
|
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.
top_vp | The 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. |
rectangle | The 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_vp | The 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. |
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:
|
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.
mouse_event | Mouse event. |
delta | Specifies 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_vp | The 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_vp | The viewport in which the mouse event occurred. If a light viewport is supplied, its parent viewport will be used. |
Follow this link for information on using the returned array.
GlgObject CreateTagList | ( | boolean | unique_tag_sources | ) |
Creates and returns a list of data tags defined in the object.
unique_tag_sources |
|
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:
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:
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:
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.
boolean DeleteAnnotation | ( | String | resource_name, |
GlgObject | annotation, | ||
double | position_x, | ||
double | position_y | ||
) |
Deletes an annotation from the chart.
resource_name | A 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. |
annotation | The annotation object to delete. If null, the annotation with the timestamp specified by the position_x and position_y parameters will be deleted. |
position_x | The X position of the annotation to be deleted when the annotation parameter is null. The parameter is ignored if annotation is not null. |
position_y | The Y position of the annotation to be deleted when the annotation parameter is null. The parameter is ignored if annotation is not null. |
The chart's NumAnnotations attribute should be set to -1 in order to use this method.
boolean DeletePlot | ( | String | resource_name, |
GlgObject | plot | ||
) |
Deletes a plot line from the chart.
resource_name | A 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. |
plot | The plot object to delete. |
boolean DeleteTimeLine | ( | String | resource_name, |
GlgObject | time_line, | ||
double | time_stamp | ||
) |
Deletes a time line from the chart.
resource_name | A 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_line | The time line object to delete. If null, the time line with the timestamp specified by time_stamp will be deleted. |
time_stamp | The 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. |
The chart's NumTimeLines attribute should be set to -1 in order to use this method.
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.
parent | Specifies 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.
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.
parent | Specifies 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.
|
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.
state | The new enabled state. |
|
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.
error_type | Specifies an error type, may be one of the following: |
message | The message to be displayed. |
exception | An optional exception that caused the error. If it is not null, it is used to extract additional information and an exact stack trace. |
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.
file | Specifies a filename in which to save the generated PostScript output. |
x | Defines 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. |
y | Defines the Y coordinate of the upper left corner of the rectangle. |
width | Defines the width of the rectangle. |
height | Defines the height of the rectangle. |
portrait | Specifies the orientation of the PostScript output on the page. If true, a portrait orientation is used, otherwise a landscape orientation is used. |
stretch | Specifies whether or not PostScript output should be stretched when mapping it to the specified rectangle:
|
center | Specifies 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. |
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.
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.
filename | Specifies the filename of the string translation file. |
medium_type | Output type, must be FILE. |
separator1 | A char value that specifies the first separator character to be used in the generated output (for example, '#'). |
separator2 | A char value that specifies the second separator character to be used in the generated output (for example, '#'). |
charset_name | Name of a charset to use for encoding exported strings. If null, a default charset is used. |
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.
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.
filename | Specifies the filename of the tag remapping file. |
medium_type | Output type, must be FILE. |
separator1 | A char value that specifies the first separator character to be used in the generated output (for example, '#'). |
separator2 | A char value that specifies the second separator character to be used in the generated output (for example, '#'). |
charset_name | Name of a charset to use for encoding exported strings. If null, a default charset is used. |
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.
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.
resource_name | A 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_extent | If true, the method returns the X extent, otherwise it returns the Y extent. |
visible_only | If true, the method considers only visible data samples when calculating data extent, otherwise all samples are considered. |
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.
GlgDataType GetDataType | ( | ) |
Returns The data object's data type.
Double GetDResource | ( | String | resource_name | ) |
Returns the current value of the object's D (double) resource.
resource_name | Specifies the resource path of the object's scalar resource to query. |
If a scalar resource with the given resource path exists, this method returns its value, otherwise it generates an error message and returns null.
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.
resource_name | Specifies the resource path of the object's scalar resource to query. |
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.
Double GetDTag | ( | String | tag_source | ) |
Returns the current value of the object's D (double) tag.
tag_source | Specifies the TagSource of the scalar tag to query. |
If a scalar tag with the given TagSource exists, this method returns its value, otherwise it generates an error message and returns null.
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.
tag_source | Specifies the TagSource of the scalar tag to query. |
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.
GlgPoint GetGResource | ( | String | resource_name | ) |
Returns the current value of the object's G (geometrical or color) resource.
resource_name | Specifies the resource path of the G resource to query. |
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.
GlgPoint GetGTag | ( | String | tag_source | ) |
Returns the current value of the object's G (geometrical or color) tag.
tag_source | Specifies the TagSource of the G tag to query. All object's tags with the specified TagSource will be set to the supplied 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.
|
static |
Returns the current state of a modifier.
modifier | Specifies the modifier to query, may be one of the following constants: |
GlgObject GetNamedPlot | ( | String | resource_name, |
String | plot_name | ||
) |
Given a name of the chart's plot, returns the plot's object ID.
resource_name | A 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_name | The plot name. |
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.
resource_name | A 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. |
type | The type of a component to retrieve:
|
String GetObjectName | ( | ) |
Returns the object's name.
GlgObjectType GetObjectType | ( | ) |
Returns the object's type.
String GetSResource | ( | String | resource_name | ) |
Returns the current value of the object's S (string) resource.
resource_name | Specifies the resource path of the string resource to query. |
If a string resource with the given resource path exists, this method returns its value, otherwise it generates an error message and returns null.
|
static |
Returns current stack trace as a string.
|
static |
Returns the stack trace of the specified exception as a string.
e | An exception to generate the stack trace of. |
String GetSTag | ( | String | tag_source | ) |
Returns the current value of the object's S (string) tag.
tag_source | Specifies the TagSource of the string tag to query. |
If a string tag with the given TagSource exists, this method returns its value, otherwise it generates an error message and returns null.
char [] GetWidgetPassword | ( | String | resource_name | ) |
Returns password entered into the password text widget.
resource_name | A 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. |
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.
resource_name | The 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_type | The type of the GLG coordinate system to convert to or from:
|
coord_to_lat_lon |
|
in_point | GlgPoint containing input values (x/y in the selected coordinate system or lon/lat). |
out_point | GlgPoint that will receive converted output values (x/y in the selected coordinate system or lon/lat). |
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.
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.
resource_name | The resource path of a child GIS object to query or null to query the GIS object the method is invoked on. |
layers | A list of layers to query. |
x,y | Coordinates of a point in the screen coordinates of a viewport that contains the GIS object. |
select_labels | Specifies the label selection mode, can have the following values:
|
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.
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.
resource_name | The resource path of a child GIS object to query or null to query the GIS object the method is invoked on. |
layer_name | The name of the layer with elevation data to query. |
lon,lat | The lon/lat coordinates of a point on the map. |
|
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.
projection | A GIS map projection: RECTANGULAR_PROJECTION or ORTHOGRAPHIC_PROJECTION. |
stretch | Specifies if the map preserves the X/Y ratio (false) or not (true). |
coord_type | The type of the GLG coordinate system to convert to or from:
|
coord_to_lat_lon |
|
center | GlgPoint containing lat/lon coordinates of the map center. The Z coordinate must be set to 0. |
extent | GlgPoint 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. |
angle | A map rotation angle in degrees. |
min_x,max_x,min_y,max_y | A 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_point | GlgPoint containing coordinate values to be converted (x/y in the selected coordinate system or lon/lat). |
out_point | GlgPoint that will receive converted coordinate values (x/y in the selected coordinate system or lon/lat). |
|
static |
Queries device graphical capabilities.
boolean HasResourceObject | ( | String | resource_name | ) |
Checks if the object's named resource exists.
resource_name | The resource path of the resource object to query. |
boolean HasTagName | ( | String | tag_name | ) |
Checks if the object's data tag with a specified tag name exists.
tag_name | Specifies the TagName to query. |
boolean HasTagSource | ( | String | tag_source | ) |
Checks if the object's data tag with a specified tag source exists.
tag_source | Specifies the tag source to query. |
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.
filename | Specifies the file or the URL to load the string translation file from. |
medium_type | FILE or URL constant. |
verbose | If 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_name | Name of a charset to use for decoding imported strings. If null, a default charset is used. |
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.
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.
filename | Specifies the file or the URL to load the tag remapping file from. |
medium_type | FILE or URL constant. |
verbose | If true, generates an error for each tag that was not modified because it was missing a matching entry in the tag remapping file. |
charset_name | Name of a charset to use for decoding imported tag names. If null, a default charset is used. |
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.
|
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.
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:
|
static |
Queries the type of the GLG library.
|
static |
Loads an object from a stream using a default charset.
medium | The source to load the object from (Stream). |
medium_type | Source type, must be STREAM. |
|
static |
Loads an object from a stream using the specified charset.
medium | The source to load the object from (Stream). |
medium_type | Source type, must be STREAM. |
charset_name | Name of a charset for string decoding. |
|
static |
Loads an object from a GLG drawing file or a URL using a default charset.
filename | Specifies the name of the file or a URL to load the object from. |
medium_type | FILE or URL constant. |
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.
|
static |
Finds a viewport named $Widget inside an object and returns it.
glg_object | An object containing the $Widget viewport. |
|
static |
Loads a viewport named $Widget from a file or a URL using a default charset.
filename | Specifies the name of the file or the URL to load the widget from. |
medium_type | FILE or URL constant. |
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.
|
static |
Loads a viewport named $Widget from a file or a URL using the specified charset.
filename | Specifies the name of the file or the URL to load the widget from. |
medium_type | FILE or URL constant. |
charset_name | Name of a charset for string decoding. |
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.
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.
graphics | Print graphics context. |
|
static |
C-style printf method for formatting double values.
format | C-style format string. |
value | Double value to be formatted. |
|
static |
C-style printf method for formatting integer values.
format | C-style format string. |
value | Integer value to be formatted. |
|
static |
C-style printf method for formatting strings.
format | C-style format string. |
value | String value to be formatted. |
|
static |
Returns a random number in the specified range.
low | The low limit. |
high | The high limit. |
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.
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.
|
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
image | Image to save. |
image_file | Filename to save the image to. |
image_format | Image format to use. |
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.
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. |
message | A string that defines the message type. |
param1 | Message type dependent. |
param2 | Message type dependent. |
param3 | Message type dependent. |
param4 | Message type dependent. |
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.
|
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.
alarm_handler | An alarm handler that will be invoked to process alarm messages generated by the application's drawings. |
See GlgAlarmHandler for more information.
Sets the object for browsing with the GLG Resource, Tag and Alarm browser widgets.
browser | A viewport of the Resource, Tag or Alarm browser widget. |
glg_object | An object to browse. |
The browser widget will display the object's resources, tags or alarms depending on the type of the browser widget.
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.
resource_name | A 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. |
selection | A new selection string. |
filter | A new filter string. |
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.
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.
resource_name | A 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. |
filter | A custom data filter. |
client_data | Data to be passed to the custom filter when it is invoked. |
boolean SetCursorType | ( | String | resource_name, |
GlgCursorType | cursor_type | ||
) |
Sets cursor for the viewport's drawing or one of its child viewports.
resource_name | A 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_type | One of the system cursor types to be used: |
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.
boolean SetDResource | ( | String | resource_name, |
double | value | ||
) |
Sets a new value of the object's D (double) resource.
resource_name | Specifies the name of the object's scalar resource to be set. |
value | Specifies a new value. |
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.
boolean SetDResource | ( | String | resource_name, |
Double | value | ||
) |
Sets a new value of the object's D (double) resource.
resource_name | Specifies the name of the object's scalar resource to be set. |
value | Specifies a new value. |
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.
boolean SetDResource | ( | String | resource_name, |
double | value, | ||
boolean | if_changed | ||
) |
Sets a new value of the object's D (double) resource.
resource_name | Specifies the name of the object's scalar resource to be set. |
value | Specifies a new value. |
if_changed | If 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. |
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.
boolean SetDResource | ( | String | resource_name, |
Double | value, | ||
boolean | if_changed | ||
) |
Sets a new value of the object's D (double) resource.
resource_name | Specifies the name of the object's scalar resource to be set. |
value | Specifies a new value. |
if_changed | If 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. |
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.
boolean SetDResource | ( | String | resource_name, |
GlgDouble | value | ||
) |
Sets a new value of the object's D (double) resource.
resource_name | Specifies the name of the object's scalar resource to be set. |
value | Specifies a new value. |
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.
boolean SetDResource | ( | String | resource_name, |
GlgDouble | value, | ||
boolean | if_changed | ||
) |
Sets a new value of the object's D (double) resource.
resource_name | Specifies the name of the object's scalar resource to be set. |
value | Specifies a new value. |
if_changed | If 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. |
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.
boolean SetDTag | ( | String | tag_source, |
double | value, | ||
boolean | if_changed | ||
) |
Sets a new value of the object's D (double) tag.
tag_source | Specifies TagSource of the scalar tag to be set. All object's tags with the specified TagSource will be set to the supplied value. |
value | Specifies a new value. |
if_changed | If 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. |
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.
boolean SetDTag | ( | String | tag_source, |
Double | value, | ||
boolean | if_changed | ||
) |
Sets a new value of the object's D (double) tag.
tag_source | Specifies TagSource of the scalar tag to be set. All object's tags with the specified TagSource will be set to the supplied value. |
value | Specifies a new value. |
if_changed | If 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. |
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.
boolean SetDTag | ( | String | tag_source, |
GlgDouble | value, | ||
boolean | if_changed | ||
) |
Sets a new value of the object's D (double) tag.
tag_source | Specifies TagSource of the scalar tag to be set. All object's tags with the specified TagSource will be set to the supplied value. |
value | Specifies a new value. |
if_changed | If 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. |
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.
|
static |
Sets the viewport's edit mode to disable input objects in the viewport while the drawing is being edited.
viewport | A viewport object (either a Viewport or a Light Viewport) to set the editing mode of, or its parent. |
resource_name | A 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 |
|
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.
|
static |
Replaces the GLG Toolkit error handler and returns the previous error handler.
new_handler | Specifies 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. |
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.
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.
resource_name | A 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. |
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.
resource_name | Specifies the resource path of the geometrical or color resource to be set. |
x_value | Specifies the new X value. |
y_value | Specifies the new Y value. |
z_value | Specifies the new Z value. |
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.
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.
resource_name | Specifies the resource path of the geometrical or color resource to be set. |
x_value | Specifies the new X value. |
y_value | Specifies the new Y value. |
z_value | Specifies the new Z value. |
if_changed | If 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. |
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.
boolean SetGResource | ( | String | resource_name, |
GlgPoint | g_value | ||
) |
Sets new values of the object's G (geometrical or color) resource.
resource_name | Specifies the resource path of the geometrical or color resource to be set. |
g_value | A GlgPoint containing XYZ or RGB resource values. |
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.
boolean SetGResource | ( | String | resource_name, |
GlgPoint | g_value, | ||
boolean | if_changed | ||
) |
Sets new values of the object's G (geometrical or color) resource.
resource_name | Specifies the resource path of the geometrical or color resource to be set. |
g_value | A GlgPoint containing XYZ or RGB resource values. |
if_changed | If 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. |
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.
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.
tag_source | Specifies 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_value | Specifies the new X value. |
y_value | Specifies the new Y value. |
z_value | Specifies the new Z value. |
if_changed | If 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. |
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.
boolean SetGTag | ( | String | tag_source, |
GlgPoint | value, | ||
boolean | if_changed | ||
) |
Sets new values of the object's G (geometrical or color) tag.
tag_source | Specifies 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. |
value | A GlgPoint containing XYZ or RGB resource values. |
if_changed | If 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. |
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.
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.
resource_name | A 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. |
formatter | A custom label formatter. |
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.
resource_name | A 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_object | The axis to link with, or the axis' parent. |
axis_resource_name | A 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. |
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.
resource_name | Specifies the name of the D, S or G resource to be set. |
value | An object of the matching data type containing the new value. |
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.
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.
resource_name | Specifies the name of the resource to be set. |
value | Specifies the object containing the new value. |
if_changed | If 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. |
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.
boolean SetSResource | ( | String | resource_name, |
String | value | ||
) |
Replaces the string of the object's S (string) resource.
resource_name | Specifies the resource path of the string resource to be set. |
value | Specifies a new string. |
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.
boolean SetSResource | ( | String | resource_name, |
String | value, | ||
boolean | if_changed | ||
) |
Replaces the string of the object's S (string) resource.
resource_name | Specifies the resource path of the string resource to be set. |
value | Specifies a new string. |
if_changed | If 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. |
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.
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.
resource_name | Specifies the resource path of the string resource to be set. |
format | Specifies the C-style printf format to use (for example, "%.2f"). |
value | Specifies the numerical value to be converted to a string according to the specified format. |
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.
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.
resource_name | Specifies the resource path of the string resource to be set. |
format | Specifies the C-style printf format to use (for example, "%.2f"). |
value | Specifies the numerical value to be converted to a string according to the specified format. |
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.
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.
resource_name | Specifies the resource path of the string resource to be set. |
format | Specifies the C-style printf format to use (for example, "%.2f"). |
value | Specifies the numerical value to be converted to a string according to the specified format. |
if_changed | If 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. |
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.
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.
resource_name | Specifies the resource path of the string resource to be set. |
format | Specifies the C-style printf format to use (for example, "%.2f"). |
value | Specifies the numerical value to be converted to a string according to the specified format. |
if_changed | If 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. |
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.
boolean SetSTag | ( | String | tag_source, |
String | value, | ||
boolean | if_changed | ||
) |
Replaces the string of the object's S (string) tag.
tag_source | Specifies TagSource of the string tag to be set. All object's tags with the specified TagSource will be set to the supplied value. |
value | Specifies a new string. |
if_changed | If 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. |
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.
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.
tag_source | Specifies TagSource of the string tag to be set. All object's tags with the specified TagSource will be set to the supplied value. |
format | Specifies the C-style printf format to use (for example, "%.2f"). |
value | Specifies the numerical value to be converted to a string according to the specified format. |
if_changed | If 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. |
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.
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.
tag_source | Specifies TagSource of the string tag to be set. All object's tags with the specified TagSource will be set to the supplied value. |
format | Specifies the C-style printf format to use (for example, "%.2f"). |
value | Specifies the numerical value to be converted to a string according to the specified format. |
if_changed | If 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. |
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.
|
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.
formatter | Specifies a custom tooltip formatter. |
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.
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.
resource_name | A 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. |
type | A 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:
|
value | Specifies a value for zoom and pan operations as described above. |
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.
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.
resource_name | A 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_object | GIS or Chart object to be zoomed in the GIS and Chart zooming modes (or null for the Drawing zoom mode):
|
zoom_object_resource_name | Resource name of the GIS or Chart object.
|
zoom_mode | The zoom mode to set:
|
|
static |
Sleeps for the specified number of milliseconds.
millisec | Requested sleep time. |
|
static |
Flushes graphical output.
|
static |
Destroys GLG Toolkit's internal objects.
|
static |
Controls displaying a stack trace on errors.
user_error | Set to true to display a stack trace on application errors, such as "Can't find resource". |
internal_error | Set to true to display a stack trace on internal GLG errors. |
boolean Update | ( | ) |
Updates the drawing of a viewport or a light viewport with the latest resource values.
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.
boolean UpdateChartState | ( | String | resource_name, |
int | state | ||
) |
Triggers updating the chart's state after prefilling it with data using the quick mode of AddDataSampleNode.
resource_name | A 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. |
This method marks the selected chart states for updating. The actual update happens on the next invocation of the Update or SetupHierarchy methods.
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.
resource_name | A 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_stamp | A timestamp (or an index for a chart with an index X axis). |
initialize | May 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. |
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.
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.