Creating Activity Entries

Activity entries are used to render the day-to-day tasks, these tasks are defined as task which have a start and an end point only as the data behind them..

Adding such an entry to the table is easy all that is required is to replace the data value for all in this column with a DrawingState.


The DrawingState itself can be generated automatically via the static helper method
GanttEntryHelper.createActivityEntry(startPoint, endPoint) which requires a start date and an end date.

As the data is specified via the constructor E-Gantt will automatically calculate the data type! There are many more methods in GanttyEntryHelper for all kinds of default effects.

String[][] columnNames = {
{"First Name", "Last Name", "Sport", "# of Years"},
{ "Vegetarian"}};
// Data works the same with E-Gantt but in this example we are going
// to specify a graphics object for rendering
Object[][] data = {
{"Mary", "Campione",
"Snowboarding", new Integer(5), GanttEntryHelper.createActivityEntry(new Date(0), new Date(100))},
{"Alison", "Huml",
"Rowing", new Integer(3), GanttEntryHelper.createActivityEntry(new Date(10), new Date(90))},
{"Kathy", "Walrath",
"Knitting", new Integer(2), GanttEntryHelper.createActivityEntry(new Date(20), new Date(80))},
{"Sharon", "Zakhour",
"Speed reading", new Integer(20), GanttEntryHelper.createActivityEntry(new Date(10), new Date(90))},
{"Philip", "Milne",
"Pool", new Integer(10), GanttEntryHelper.createActivityEntry(new Date(0), new Date(100))}
final GanttTable table = new GanttTable(data, columnNames);
external image sflogo.php?group_id=49356