rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Charts Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvChartSelectInteractor Class Reference

Allows data to be selected. More...

#include <ilviews/charts/chartint.h>

Inheritance diagram for IlvChartSelectInteractor:
IlvChartDataInteractor IlvChartInteractor IlvInteractor

List of all members.

Public Types

typedef void(* Action )(IlvChartGraphic *chart, IlvAbstractChartDisplayer *disp, IlvChartDataSet *dataSet, IlUInt pointIndex, IlBoolean select)
 Defines the type of the action to be triggered when data are selected or unselected.

Public Member Functions

 IlvChartSelectInteractor (IlUShort whichButton=IlvLeftButton)
 Constructor.
virtual IlBoolean handleEvent (IlvGraphic *chart, IlvEvent &ev, const IlvTransformer *t=0)
 Handles events received by the interactor.
void setAction (Action action)
 Sets the action to be triggered when data are selected or unselected.

Protected Member Functions

virtual void doIt (IlvChartGraphic *chart, IlvAbstractChartDisplayer *disp, IlvChartDataSet *dataSet, IlUInt pointIndex, IlBoolean select)
 Selects or unselects data.
virtual IlvChartDataPointInfomakeSelectionInfo (const IlvChartGraphic *chart, IlvAbstractChartDisplayer *disp, IlvChartDataSet *dataSet, IlUInt pointIndex) const
 Creates the point information object that is associated with the selected data to mark them as selected.

Detailed Description

Allows data to be selected.

Library: ilvcharts

This class allows the user to select data by clicking on a projected point in the data display area and then trigger an action on the selected data item(s). At the first click on a projected point, all the data points of the data set to which the projected point belongs are selected. These data points are marked as selected with markers by default. At the second click on a projected point that belongs to the same data set, only the corresponding data point is then selected. This data point is marked as selected with a marker by default. The graphic objects drawn to mark data points as selected can be redefined in a subclass.

The registered name of this interactor class is "ChartSelect".


Constructor & Destructor Documentation

IlvChartSelectInteractor::IlvChartSelectInteractor ( IlUShort  whichButton = IlvLeftButton  ) 

Constructor.

Initializes a new IlvChartSelectInteractor object.

Parameters:
whichButton The mouse button that should be used for the interaction.

Member Function Documentation

virtual void IlvChartSelectInteractor::doIt ( IlvChartGraphic chart,
IlvAbstractChartDisplayer disp,
IlvChartDataSet dataSet,
IlUInt  pointIndex,
IlBoolean  select 
) [protected, virtual]

Selects or unselects data.

This method is called when the user clicks a projected point to select or unselect data. The Boolean select indicates whether the method is called to select or to unselect data. If pointIndex is equal to IlvBadIndex, all the data points of the data set dataSet are selected or unselected, otherwise only the data point at the index pointIndex is selected or unselected.

If select is equal to IlTrue, the point information object to be added in order to mark the selected data points as selected is created by calling the IlvChartSelectInteractor::makeSelectionInfo method. The returned point information is then set on each selected data point.

If select is equal to IlFalse, the point information objects that have been set on the selected data point(s) are removed.

Warning:
[note] The point information objects are set at the level of the displayer that displays the selected data.

At the end, the action method, if it exists, is called with the same parameters as the current method.

Parameters:
chart The considered chart.
disp The displayer displaying the data set to which the selected data points belong.
dataSet The data set to which the selected data points belong.
pointIndex The index of the selected data point if only one data point is selected or IlvBadIndex if all the data points of the data set are selected.
select A Boolean value indicating whether the data must be selected (IlTrue) or unselected (IlFalse).
virtual IlBoolean IlvChartSelectInteractor::handleEvent ( IlvGraphic chart,
IlvEvent event,
const IlvTransformer t = 0 
) [virtual]

Handles events received by the interactor.

This method is the entry point of all events dispatched to this interactor.

Parameters:
chart The chart object that received the event.
event The received event.
t The transformer applied to the view in which the event occurred.
Returns:
IlTrue if the event was successfully handled and IlFalse otherwise.

Implements IlvChartInteractor.

virtual IlvChartDataPointInfo* IlvChartSelectInteractor::makeSelectionInfo ( const IlvChartGraphic chart,
IlvAbstractChartDisplayer disp,
IlvChartDataSet dataSet,
IlUInt  pointIndex 
) const [protected, virtual]

Creates the point information object that is associated with the selected data to mark them as selected.

The default implementation creates an IlvChartDataGraphicInfo object as the point information object and sets a marker as the graphic object.

Parameters:
chart The chart object for which data are selected.
disp The displayer displaying the data set to which the selected data points belong.
dataSet The data set to which the selected data points belong.
pointIndex The index of the selected data point if only one data point is selected or IlvBadIndex if all the data points of the data set are selected.
void IlvChartSelectInteractor::setAction ( Action  action  ) 

Sets the action to be triggered when data are selected or unselected.

Parameters:
action The action to be triggered.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

© Copyright 2012, Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is a registered trademark of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.