rwlogo

Rogue Wave Views
Gantt Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

 All Classes Files Functions Variables Typedefs Enumerations Enumerator
List of all members | Public Member Functions
IlvGanttAddNodeInteractor Class Reference

Interactor to add nodes to a Gantt chart. More...

#include <ilviews/gantt/ganttint.h>

Inheritance diagram for IlvGanttAddNodeInteractor:
IlvDragRectangleInteractor IlvManagerViewInteractor

Public Member Functions

 IlvGanttAddNodeInteractor (IlvGanttChart *gantt, IlvView *view, IlUShort button=IlvLeftButton, IlBoolean asBreak=IlFalse)
 Constructor. More...
 
virtual void doIt (IlvRect &rect)
 Creates and adds the Gantt node. More...
 
virtual void ensureVisible (const IlvPoint &p)
 Translates the working view according to the mouse position. More...
 
IlvGanttChartgetGanttChart () const
 Returns the Gantt chart with which this interactor is associated. More...
 
IlBoolean isBreak () const
 Indicates whether break nodes are created. More...
 
virtual IlvGanttNodemakeNode (IlInt startMin, IlInt startMax, IlInt endMin, IlInt endMax, IlvGanttLine *line)
 Factory method to create Gantt nodes. More...
 
void setAsBreak (IlBoolean asBreak=IlTrue)
 Indicates whether break nodes are created. More...
 

Detailed Description

Interactor to add nodes to a Gantt chart.

Library: ilvgantt

This interactor class lets you interactively add a Gantt node to the Gantt chart. IlvGanttAddNodeInteractor can also be used to add a break node to the Gantt chart. Such an Interactor is called an add break interactor. There are two different ways to obtain an add break interactor.

See Also
IlvGanttChart, IlvGanttSubNode, IlvGanttNode

Constructor & Destructor Documentation

IlvGanttAddNodeInteractor::IlvGanttAddNodeInteractor ( IlvGanttChart gantt,
IlvView view,
IlUShort  button = IlvLeftButton,
IlBoolean  asBreak = IlFalse 
)

Constructor.

The constructor initializes a new instance of the IlvGanttAddNodeInteractor class that adds nodes to the Gantt chart gantt in the grapher view view. Set button to the mouse button to be used for adding the node. If asBreak is set to IlTrue, the constructor creates an add break interactor.

Parameters
ganttThe gantt to which the interactor is attached.
viewThe gantt chart view to which the interactor is attached. This view must be one of the Gantt grapher view where activities (nodes) are displayed.
buttonThe mouse button that is used for the interaction.
asBreakA Boolean value indicating whether break nodes are created.

Member Function Documentation

virtual void IlvGanttAddNodeInteractor::doIt ( IlvRect rect)
virtual

Creates and adds the Gantt node.

Computes the start and end times of the Gantt node from the rectangle rect that the user is dragging. It also determines the Gantt line this node is associated with. Once these values have been computed, the IlvGanttAddNodeInteractor::makeNode method is called and the created node is added to the Gantt chart.

Parameters
rectThe rectangle drawn by the user, in view coordinates.

Reimplemented from IlvDragRectangleInteractor.

virtual void IlvGanttAddNodeInteractor::ensureVisible ( const IlvPoint p)
virtual

Translates the working view according to the mouse position.

Performs a logical view translation when the user drags the mouse outside the view.

Parameters
pThe location of the mouse, in view coordinates.

Reimplemented from IlvDragRectangleInteractor.

IlvGanttChart* IlvGanttAddNodeInteractor::getGanttChart ( ) const

Returns the Gantt chart with which this interactor is associated.

Returns
The Gantt chart with which this interactor is associated.
IlBoolean IlvGanttAddNodeInteractor::isBreak ( ) const

Indicates whether break nodes are created.

Returns
IlTrue if the interactor is an add break interactor, and IlFalse otherwise.
virtual IlvGanttNode* IlvGanttAddNodeInteractor::makeNode ( IlInt  startMin,
IlInt  startMax,
IlInt  endMin,
IlInt  endMax,
IlvGanttLine line 
)
virtual

Factory method to create Gantt nodes.

The default implementation returns a Gantt node that contains one Gantt subnode initialized with the given parameters. You can overload this method to create custom nodes.

Parameters
startMinThe earliest start time of the node.
startMaxThe latest start time of the node.
endMinThe earliest end time of the node.
endMaxThe latest end time of the node.
lineThe Gantt line with which the node must be associated.
Returns
The created Gantt node.
void IlvGanttAddNodeInteractor::setAsBreak ( IlBoolean  asBreak = IlTrue)

Indicates whether break nodes are created.

If asBreak is set to IlTrue, you transform the interactor to an add break interactor.

Parameters
asBreakA Boolean value indicating whether break nodes are created by the interactor.
See Also
isBreak.

© Copyright 2015, 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.