Class GanttGroup

All Implemented Interfaces:

public class GanttGroup
extends AbstractGanttEvent
implements IGanttChartItem
A GanttGroup is a group of GanttEvents that will all draw on the same horizontal "line" or "row" in the GanttChart (next to each other instead of vertically arranged). One GanttEvent may only belong to one GanttGroup.

One GanttEvent can only exist in one GanttGroup. If an event already has a different GanttGroup parent, the old parent will be overwritten and the new one will be set on the event.

  • Field Details

  • Constructor Details

    • GanttGroup

      public GanttGroup​(GanttChart parent)
      Creates a new GanttGroup on the given GanttChart.
      parent - GanttChart parent
  • Method Details

    • addEvent

      public void addEvent​(GanttEvent event)
      Adds a GanttEvent to this group. Do note that if a GanttEvent exists in another group already, it will end up being moved to the new group.
      event - GanttEvent to add.
    • removeEvent

      public void removeEvent​(GanttEvent event)
      Removes a GanttEvent from this group.
      event - GanttEvent to remove.
    • containsEvent

      public boolean containsEvent​(GanttEvent event)
      Checks whether this GanttGroup contains a given GanttEvent.
      event - GanttEvent to check if it exists in this GanttGroup.
      true if the event is contained in this group.
    • getEventMembers

      public java.util.List getEventMembers()
      Returns a list of all GanttEvents contained in this group.
      List of GanttEvents.
    • getFixedRowHeight

      public int getFixedRowHeight()
      Returns the fixed row height of this group.
      Specified by:
      getFixedRowHeight in interface IGanttChartItem
      Fixed row height.
    • setFixedRowHeight

      public void setFixedRowHeight​(int fixedRowHeight)
      Sets the fixed row height for this group.
      Specified by:
      setFixedRowHeight in interface IGanttChartItem
      fixedRowHeight - Row height in pixels.
    • isAutomaticRowHeight

      public boolean isAutomaticRowHeight()
      Whether this group is on automatic row height or if the height is fixed.
      Specified by:
      isAutomaticRowHeight in interface IGanttChartItem
      true if row height is calculated automatically.
    • setAutomaticRowHeight

      public void setAutomaticRowHeight()
      Flags this group to use automatic row height calculation.
      Specified by:
      setAutomaticRowHeight in interface IGanttChartItem
    • getVerticalEventAlignment

      public int getVerticalEventAlignment()
      Returns the vertical alignment of all events in this row.
      Vertical alignment.
    • setVerticalEventAlignment

      public void setVerticalEventAlignment​(int vAlignment)
      Sets the vertical alignment of all contained events.
      vAlignment - Vertical alignment. Valid values are: SWT.TOP, SWT.CENTER, SWT.BOTTOM. Default is SWT.TOP.
    • dispose

      public void dispose()
      Disposes this event from the chart.
    • getTallestEvent

      int getTallestEvent()
    • toString

      public java.lang.String toString()
      toString in class java.lang.Object