Table Of Contents

Graph IDECustom Application ► Event Qualifier

The following shows how to instantiate an event qualifier for a Circle graphic. An event qualifier is enabled by default so all you need do is instantiate the programmatic state of the circle (or corresponding graphic's state).

@@class() Circle:Object

@@method(public, class) (id)stored;

@@end

{
id myCircle;

myCircle = [Circle stored];
}

The following API processes the events. If you wish to alter that processing then you must implement your own graphic state subclass and subclass these methods.

@@method(public, instance) (void)disableEventQualifier;
  Call like this:

[myLayer disableEventQualifier];

This method disables event qualifier processing for the Layer and Single Coordinate Graph states. Most likely, you will not need to call upon this method.

@@method(public, instance) (void)enableEventQualifier;
  Call like this:

[myLayer enableEventQualifier];

This method enables event qualifier processing for the Layer and Single Coordinate Graph states. Call upon this method in a program script. Calling upon this method for a graph enables that graph's processing for the data foreground and background layers so that graphics on the graph are detected and not the graph itself. If this method is not called upon for a graph then the graph itself is detected instead.

@@method(public, instance) (void)retrieveHitParameters;
  Call like this:

[self retrieveHitParameters]; That method is called in the performHit and performHover method to retrieve hit parameters. If you set the iVar popoverType to NO_EVENT_QUALIFIER_POPOVER_TYPE then the popover is not presented an only the hit parameters are retrieved in a call to [super performHit] or [super performHover]. Alternatively you can simply call [self retrieveHitParameters]; without calling super in order to retrieve the hit parameters.

Appends the x and y values to the list of data points for the graphic. The x and y values forms a 2D point. Each value must be of type double.

@@method(public, instance) (void)encodeHitMessage;
  Call like this:

[self encodeHitMessage];

This encodes the hit parameters into the strings hitTitle and hitMessage. This method can be overridden to present a custom message in the popover.

@@method(public, instance) (void)performHit;
  Call like this:

[super performHit];

This method is called when the receiver is hit (clicked upon) by the mouse button. The default implementation calls [self retrieveHitParameters]; and if the popover is on calls [self encodeHitMessage]; and then presents the popover, if on. You can subclass this method for your own distinct processing.

@@method(public, instance) (void)performHover;
  Call like this:

[super performHover];

This method is called when the receiver is hovered upon (when the mouse cursor is over the receiver). The default implementation calls [self retrieveHitParameters]; and if the popover is on calls [self encodeHitMessage]; and then updates the popover, if on. You can subclass this method for your own distinct processing.

@@method(public, instance) (void)resetHitParameters;
  Call like this:

[self resetHitParameters];

This method resets the hit instance variables according to the following.

@@method(public, instance) (void)retrieveHitParameters;
  Call like this:

[self retrieveHitParameters];

This method retrieves the hit instance variables according to the following.

  • Sets hitIndex to the index of the receiver in its layer and hitXValue and hitYValue to the hit coordinates for all Graphic objects. Incase the graphic is on a graph, the hit coordinate values are in the units of the graph.

  • Sets hitSegmentIndex and hitVertexIndex to the respective values in graphic objects that are point and segment related, such as Cubic Bezier, Function, Polygon, Scatter, Trajectory and Perspective Scatter. The index starts at zero.

  • Sets hitDataXValue and hitDataYValue to the data value hit for the Cubic Bezier, Function, Polygon, Scatter and Trajectory objects. The data values can differ from the hit values in that hit coordinates are resolved to the hit aperture and event processing resolution while the data values are retrieved directly from the data of the object.

  • Sets hit3DXValue, hit3DYValue and hit3DZValue to their respective values for the Perspective Scatter and Perspective Surface graphics. Those values are defined in terms of the 3D graph units.

  • Sets hitCellIndex to the cell index hit for the Perspective Surface graphic. The index starts at zero and increments contiguously along the x-direction one cellular triangle at a time. To get the grid rectangle index hit divide by two.
@@method(public, instance) (void)performUnHit;
  Call like this:

[super performUnHit];

This method is called when the receiver is unhit (the mouse button is released upon). The default implementation calls [self resetHitParameters];. You can subclass this method for your own distinct processing.

@@method(public, instance) (void)performUnHover;
  Call like this:

[super performUnHover];

This method is called when the receiver is unhovered (the mouse cursor leaves the graphic). The default implementation calls [self resetHitParameters];. You can subclass this method for your own distinct processing.

A premade Xcode project demonstrating the use of the methods above is described in the HitButton section.




© Copyright 1993-2022 by VVimaging, Inc. (VVI); All Rights Reserved. Please email support@vvi.com with any comments you have concerning this documentation. See Legal for trademark and legal information.