Vertical layout of an activity in a Gantt row

Article ID: 2351
Last updated: 29 May, 2018
Article ID: 2351
Last updated: 29 May, 2018
Revision: 3
Views: 573
Posted: 30 Jan, 2014
by Dean J.
Updated: 29 May, 2018
by Gargani A.

Question

How to vertically position an activity inside a row?

Answer

The activities placement in a Gantt row is managed by an IlvActivityLayout set on its IlvGanttRow. The base implementation of this interface being the IlvActivitySimpleLayout class on which all of the other activity layouts do rely.

The base height of the activities inside a row is managed by this IlvActivitySimpleLayout class. Depending on the behavior that is required, here are different solutions:

  • If the activities have to be sized proportionally to the height of the row, use the IlvActivitySimpleLayout class and more specifically the IlvActivitySimpleLayout.setTopMargin(float) and IlvActivitySimpleLayout.setBottomMargin(float) methods of the layout. By setting this layout on the sheet or row, the margins are now interpreted as a fraction of the row height and changing the size of the margins will change the height of the activities.

          For example, setting a top and bottom margins of "0.2" will make the activities to take 60% of the row height.

  • Other behaviors are implemented in the IlvActivitySimpleLayout subclasses provided with the API (please refer the Java documentation for better reference to the IlvActivityLogisticLayout or IlvActivityTileLayout layouts)
  • If a more complex behavior is required to manage the height of the activities, subclass the class IlvActivitySimpleLayout and override the methods IlvActivityLayout.arrange(...) . There are two methods arrange: one is called to layout the position of a single graphic of an activity within a row, whereas the second one is called to layout the position of all the graphics of the activities within a row.

The sample that has been attached below is displaying an IlvScheduleChart and four activities. The height of the activities one and three have been resized thanks to the method IlvActivitySimpleLayout.arrange(IlvGanttRow, IlvActivityGraphic[]) that has been overloaded.

Note: In order to run this sample with JViews 8.7 and later, you must call the ilog.views.util.IlvProductUtil.DeploymentLicenseRequired method with the appropriate argument (uncomment line 116 of Main.java). See the General information > Deployment licenses > Declaring the use of IBM ILOG JViews services section in the documentation for more information.

This article was:   Helpful | Not helpful
Report an issue
Article ID: 2351
Last updated: 29 May, 2018
Revision: 3
Views: 573
Posted: 30 Jan, 2014 by Dean J.
Updated: 29 May, 2018 by Gargani A.
Attached files

Also listed in


Others in this category