rwlogo
Rogue Wave Views 5.6

Rogue Wave Views
Gantt Package API Reference Guide

Product Documentation:

Rogue Wave Views
Documentation Home

IlvGanttAddNodeInteractor Class Reference

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

#include <ilviews/gantt/ganttint.h>

Inheritance diagram for IlvGanttAddNodeInteractor:
IlvDragRectangleInteractor IlvManagerViewInteractor

List of all members.

Public Member Functions

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

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:
gantt The gantt to which the interactor is attached.
view The gantt chart view to which the interactor is attached. This view must be one of the Gantt grapher view where activities (nodes) are displayed.
button The mouse button that is used for the interaction.
asBreak A 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:
rect The 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:
p The location of the mouse, in view coordinates.

Reimplemented from IlvManagerViewInteractor.

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:
startMin The earliest start time of the node.
startMax The latest start time of the node.
endMin The earliest end time of the node.
endMax The latest end time of the node.
line The 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:
asBreak A Boolean value indicating whether break nodes are created by the interactor.
See also:
isBreak.
 All Classes Files Functions Variables Typedefs Enumerations Friends

© 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.