Class GanttGroup
java.lang.Object
org.eclipse.nebula.widgets.ganttchart.AbstractGanttEvent
org.eclipse.nebula.widgets.ganttchart.GanttGroup
- All Implemented Interfaces:
IGanttChartItem
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 Summary
Fields Modifier and Type Field Description static int
FIXED_ROW_HEIGHT_AUTOMATIC
-
Constructor Summary
Constructors Constructor Description GanttGroup(GanttChart parent)
Creates a new GanttGroup on the given GanttChart. -
Method Summary
Modifier and Type Method Description void
addEvent(GanttEvent event)
Adds a GanttEvent to this group.boolean
containsEvent(GanttEvent event)
Checks whether this GanttGroup contains a given GanttEvent.void
dispose()
Disposes this event from the chart.java.util.List
getEventMembers()
Returns a list of all GanttEvents contained in this group.int
getFixedRowHeight()
Returns the fixed row height of this group.(package private) int
getTallestEvent()
int
getVerticalEventAlignment()
Returns the vertical alignment of all events in this row.boolean
isAutomaticRowHeight()
Whether this group is on automatic row height or if the height is fixed.void
removeEvent(GanttEvent event)
Removes a GanttEvent from this group.void
setAutomaticRowHeight()
Flags this group to use automatic row height calculation.void
setFixedRowHeight(int fixedRowHeight)
Sets the fixed row height for this group.void
setVerticalEventAlignment(int vAlignment)
Sets the vertical alignment of all contained events.java.lang.String
toString()
Methods inherited from class org.eclipse.nebula.widgets.ganttchart.AbstractGanttEvent
getLayer, getLayerInt, setLayer
-
Field Details
-
FIXED_ROW_HEIGHT_AUTOMATIC
public static final int FIXED_ROW_HEIGHT_AUTOMATIC- See Also:
- Constant Field Values
-
-
Constructor Details
-
GanttGroup
Creates a new GanttGroup on the given GanttChart.- Parameters:
parent
- GanttChart parent
-
-
Method Details
-
addEvent
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.- Parameters:
event
- GanttEvent to add.
-
removeEvent
Removes a GanttEvent from this group.- Parameters:
event
- GanttEvent to remove.
-
containsEvent
Checks whether this GanttGroup contains a given GanttEvent.- Parameters:
event
- GanttEvent to check if it exists in this GanttGroup.- Returns:
- 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.- Returns:
- List of GanttEvents.
-
getFixedRowHeight
public int getFixedRowHeight()Returns the fixed row height of this group.- Specified by:
getFixedRowHeight
in interfaceIGanttChartItem
- Returns:
- Fixed row height.
-
setFixedRowHeight
public void setFixedRowHeight(int fixedRowHeight)Sets the fixed row height for this group.- Specified by:
setFixedRowHeight
in interfaceIGanttChartItem
- Parameters:
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 interfaceIGanttChartItem
- Returns:
- true if row height is calculated automatically.
-
setAutomaticRowHeight
public void setAutomaticRowHeight()Flags this group to use automatic row height calculation.- Specified by:
setAutomaticRowHeight
in interfaceIGanttChartItem
-
getVerticalEventAlignment
public int getVerticalEventAlignment()Returns the vertical alignment of all events in this row.- Returns:
- Vertical alignment.
-
setVerticalEventAlignment
public void setVerticalEventAlignment(int vAlignment)Sets the vertical alignment of all contained events.- Parameters:
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()- Overrides:
toString
in classjava.lang.Object
-