Class GanttSection
java.lang.Object
org.eclipse.nebula.widgets.ganttchart.GanttSection
- All Implemented Interfaces:
IFillBackgroundColors
public class GanttSection extends java.lang.Object implements IFillBackgroundColors
A GanttSection is a "box" section of the chart. A section will automatically get a left-side border that shows the
name, and the background colors drawn for that section can differ from the rest of the chart. Here's an view of it:
................................................
Header
................................................
n
a Section
m
e
................................................
................................................
Header
................................................
n
a Section
m
e
................................................
-
Constructor Summary
Constructors Constructor Description GanttSection(GanttChart parent, java.lang.String name)Creates a new GanttSection.GanttSection(GanttChart parent, java.lang.String name, IFillBackgroundColors fillManager)Creates a new GanttSection with a fill manager that controls background colors. -
Method Summary
Modifier and Type Method Description (package private) voidaddDNDGanttEvent(GanttEvent ge)voidaddGanttEvent(int index, IGanttChartItem event)Adds a Gantt Chart item at the given index.voidaddGanttEvent(IGanttChartItem event)Adds a Gantt Chart item (GanttSection, GanttGroup) to this section.(package private) voidclearDNDGanttEvents()voiddispose()Removes this section from the chart.org.eclipse.swt.graphics.ImagegetAdditionalImage()org.eclipse.swt.graphics.RectanglegetBounds()Returns the bounds of this GanttSectionjava.lang.ObjectgetData()Returns the currently set data object.(package private) java.util.ListgetDNDGanttEvents()java.util.ListgetEvents()Returns a list of all IGanttChartItems (GanttEvent and GanttGroup) contained in this section.(package private) intgetEventsHeight(ISettings settings)org.eclipse.swt.graphics.ColorgetHolidayBackgroundColorBottom()The bottom background gradient color used for drawing the holiday column.org.eclipse.swt.graphics.ColorgetHolidayBackgroundColorTop()The top background gradient color used for drawing the holiday column.java.lang.StringgetName()Returns the name of this section.(package private) org.eclipse.swt.graphics.PointgetNameExtent()(package private) org.eclipse.swt.graphics.ImagegetNameImage()GanttCompositegetParentComposite()Returns the parentGanttCompositeorg.eclipse.swt.graphics.ColorgetSaturdayBackgroundColorBottom()The bottom background gradient color used for drawing the Saturday column.org.eclipse.swt.graphics.ColorgetSaturdayBackgroundColorTop()The top background gradient color used for drawing the Saturday column.org.eclipse.swt.graphics.ColorgetSelectedDayColorBottom()The bottom background gradient color used for drawing selected columns.org.eclipse.swt.graphics.ColorgetSelectedDayColorTop()The top background gradient color used for drawing selected columns.org.eclipse.swt.graphics.ColorgetSelectedDayHeaderColorBottom()The bottom background gradient color used for drawing selected columns in the header section.org.eclipse.swt.graphics.ColorgetSelectedDayHeaderColorTop()The top background gradient color used for drawing selected columns in the header section.org.eclipse.swt.graphics.ColorgetSundayBackgroundColorBottom()The bottom background gradient color used for drawing the Sunday column.org.eclipse.swt.graphics.ColorgetSundayBackgroundColorTop()The top background gradient color used for drawing the Sunday column.intgetTextOrientation()Returns the text orientation of the section.org.eclipse.swt.graphics.ColorgetWeekdayBackgroundColorBottom()The bottom background gradient color used for drawing the weekday column.org.eclipse.swt.graphics.ColorgetWeekdayBackgroundColorTop()The top background gradient color used for drawing the weekday column.(package private) booleanisInheritBackgroud()Deprecated.IN PROGRESS(package private) booleanneedsNameUpdate()voidremoveGanttEvent(IGanttChartItem event)Removes a Gantt Chart item (GanttSection, GanttGroup) from this section.voidsetAdditionalImage(org.eclipse.swt.graphics.Image _additionalImage)(package private) voidsetBounds(org.eclipse.swt.graphics.Rectangle bounds)voidsetData(java.lang.Object data)Sets the current data object.voidsetHolidayBackgroundColorBottom(org.eclipse.swt.graphics.Color holidayBackgroundColorBottom)voidsetHolidayBackgroundColorTop(org.eclipse.swt.graphics.Color holidayBackgroundColorTop)(package private) voidsetInheritBackgroud(boolean inheritBackgroud)Deprecated.IN PROGRESSvoidsetName(java.lang.String name)Sets the name of this section.(package private) voidsetNameExtent(org.eclipse.swt.graphics.Point extent)(package private) voidsetNameImage(org.eclipse.swt.graphics.Image nameImage)(package private) voidsetNeedsNameUpdate(boolean need)voidsetSaturdayBackgroundColorBottom(org.eclipse.swt.graphics.Color saturdayBackgroundColorBottom)voidsetSaturdayBackgroundColorTop(org.eclipse.swt.graphics.Color saturdayBackgroundColorTop)voidsetSelectedBackgroundColorBottom(org.eclipse.swt.graphics.Color selectedBackgroundColorBottom)voidsetSelectedBackgroundColorTop(org.eclipse.swt.graphics.Color selectedBackgroundColorTop)voidsetSelectedBackgroundHeaderColorBottom(org.eclipse.swt.graphics.Color selectedBackgroundHeaderColorBottom)voidsetSelectedBackgroundHeaderColorTop(org.eclipse.swt.graphics.Color selectedBackgroundHeaderColorTop)voidsetSundayBackgroundColorBottom(org.eclipse.swt.graphics.Color sundayBackgroundColorBottom)voidsetSundayBackgroundColorTop(org.eclipse.swt.graphics.Color sundayBackgroundColorTop)voidsetTextOrientation(int textOrientation)Sets the text orientation of the section.voidsetWeekdayBackgroundColorBottom(org.eclipse.swt.graphics.Color weekdayBackgroundColorBottom)voidsetWeekdayBackgroundColorTop(org.eclipse.swt.graphics.Color weekdayBackgroundColorTop)java.lang.StringtoString()
-
Constructor Details
-
GanttSection
Creates a new GanttSection.- Parameters:
parent- GanttChartname- GanttSection name
-
GanttSection
Creates a new GanttSection with a fill manager that controls background colors.- Parameters:
parent- GanttChartname- GanttSection namefillManager- Fill manager
-
-
Method Details
-
addGanttEvent
Adds a Gantt Chart item (GanttSection, GanttGroup) to this section.- Parameters:
event- Item to add
-
addGanttEvent
Adds a Gantt Chart item at the given index.- Parameters:
index- Index to add item atevent- Item to add
-
removeGanttEvent
Removes a Gantt Chart item (GanttSection, GanttGroup) from this section.- Parameters:
event- Item to remove
-
getAdditionalImage
public org.eclipse.swt.graphics.Image getAdditionalImage()- Returns:
- the additional image
-
setAdditionalImage
public void setAdditionalImage(org.eclipse.swt.graphics.Image _additionalImage)- Parameters:
_additionalImage- the additional image to set
-
getEvents
public java.util.List getEvents()Returns a list of all IGanttChartItems (GanttEvent and GanttGroup) contained in this section.- Returns:
- List of items
-
getData
public java.lang.Object getData()Returns the currently set data object.- Returns:
- Data object
-
setData
public void setData(java.lang.Object data)Sets the current data object.- Parameters:
data- Data object
-
setName
public void setName(java.lang.String name)Sets the name of this section. This method does not force a redraw.- Parameters:
name- GanttSection name
-
getName
public java.lang.String getName()Returns the name of this section.- Returns:
- GanttSection name
-
getBounds
public org.eclipse.swt.graphics.Rectangle getBounds()Returns the bounds of this GanttSection- Returns:
- Rectangle
-
getSaturdayBackgroundColorBottom
public org.eclipse.swt.graphics.Color getSaturdayBackgroundColorBottom()Description copied from interface:IFillBackgroundColorsThe bottom background gradient color used for drawing the Saturday column.- Specified by:
getSaturdayBackgroundColorBottomin interfaceIFillBackgroundColors- Returns:
- Color
-
getSaturdayBackgroundColorTop
public org.eclipse.swt.graphics.Color getSaturdayBackgroundColorTop()Description copied from interface:IFillBackgroundColorsThe top background gradient color used for drawing the Saturday column.- Specified by:
getSaturdayBackgroundColorTopin interfaceIFillBackgroundColors- Returns:
- Color
-
getSundayBackgroundColorBottom
public org.eclipse.swt.graphics.Color getSundayBackgroundColorBottom()Description copied from interface:IFillBackgroundColorsThe bottom background gradient color used for drawing the Sunday column.- Specified by:
getSundayBackgroundColorBottomin interfaceIFillBackgroundColors- Returns:
- Color
-
getSundayBackgroundColorTop
public org.eclipse.swt.graphics.Color getSundayBackgroundColorTop()Description copied from interface:IFillBackgroundColorsThe top background gradient color used for drawing the Sunday column.- Specified by:
getSundayBackgroundColorTopin interfaceIFillBackgroundColors- Returns:
- Color
-
getHolidayBackgroundColorBottom
public org.eclipse.swt.graphics.Color getHolidayBackgroundColorBottom()Description copied from interface:IFillBackgroundColorsThe bottom background gradient color used for drawing the holiday column.- Specified by:
getHolidayBackgroundColorBottomin interfaceIFillBackgroundColors- Returns:
- Color
-
getHolidayBackgroundColorTop
public org.eclipse.swt.graphics.Color getHolidayBackgroundColorTop()Description copied from interface:IFillBackgroundColorsThe top background gradient color used for drawing the holiday column.- Specified by:
getHolidayBackgroundColorTopin interfaceIFillBackgroundColors- Returns:
- Color
-
getWeekdayBackgroundColorBottom
public org.eclipse.swt.graphics.Color getWeekdayBackgroundColorBottom()Description copied from interface:IFillBackgroundColorsThe bottom background gradient color used for drawing the weekday column.- Specified by:
getWeekdayBackgroundColorBottomin interfaceIFillBackgroundColors- Returns:
- Color
-
getWeekdayBackgroundColorTop
public org.eclipse.swt.graphics.Color getWeekdayBackgroundColorTop()Description copied from interface:IFillBackgroundColorsThe top background gradient color used for drawing the weekday column.- Specified by:
getWeekdayBackgroundColorTopin interfaceIFillBackgroundColors- Returns:
- Color
-
getSelectedDayColorBottom
public org.eclipse.swt.graphics.Color getSelectedDayColorBottom()Description copied from interface:IFillBackgroundColorsThe bottom background gradient color used for drawing selected columns.- Specified by:
getSelectedDayColorBottomin interfaceIFillBackgroundColors- Returns:
- Color
-
getSelectedDayColorTop
public org.eclipse.swt.graphics.Color getSelectedDayColorTop()Description copied from interface:IFillBackgroundColorsThe top background gradient color used for drawing selected columns.- Specified by:
getSelectedDayColorTopin interfaceIFillBackgroundColors- Returns:
-
getSelectedDayHeaderColorBottom
public org.eclipse.swt.graphics.Color getSelectedDayHeaderColorBottom()Description copied from interface:IFillBackgroundColorsThe bottom background gradient color used for drawing selected columns in the header section.- Specified by:
getSelectedDayHeaderColorBottomin interfaceIFillBackgroundColors- Returns:
- Color
-
getSelectedDayHeaderColorTop
public org.eclipse.swt.graphics.Color getSelectedDayHeaderColorTop()Description copied from interface:IFillBackgroundColorsThe top background gradient color used for drawing selected columns in the header section.- Specified by:
getSelectedDayHeaderColorTopin interfaceIFillBackgroundColors- Returns:
- Color
-
setSaturdayBackgroundColorTop
public void setSaturdayBackgroundColorTop(org.eclipse.swt.graphics.Color saturdayBackgroundColorTop) -
setSaturdayBackgroundColorBottom
public void setSaturdayBackgroundColorBottom(org.eclipse.swt.graphics.Color saturdayBackgroundColorBottom) -
setSundayBackgroundColorTop
public void setSundayBackgroundColorTop(org.eclipse.swt.graphics.Color sundayBackgroundColorTop) -
setSundayBackgroundColorBottom
public void setSundayBackgroundColorBottom(org.eclipse.swt.graphics.Color sundayBackgroundColorBottom) -
setHolidayBackgroundColorTop
public void setHolidayBackgroundColorTop(org.eclipse.swt.graphics.Color holidayBackgroundColorTop) -
setHolidayBackgroundColorBottom
public void setHolidayBackgroundColorBottom(org.eclipse.swt.graphics.Color holidayBackgroundColorBottom) -
setWeekdayBackgroundColorTop
public void setWeekdayBackgroundColorTop(org.eclipse.swt.graphics.Color weekdayBackgroundColorTop) -
setWeekdayBackgroundColorBottom
public void setWeekdayBackgroundColorBottom(org.eclipse.swt.graphics.Color weekdayBackgroundColorBottom) -
setSelectedBackgroundColorTop
public void setSelectedBackgroundColorTop(org.eclipse.swt.graphics.Color selectedBackgroundColorTop) -
setSelectedBackgroundColorBottom
public void setSelectedBackgroundColorBottom(org.eclipse.swt.graphics.Color selectedBackgroundColorBottom) -
setSelectedBackgroundHeaderColorTop
public void setSelectedBackgroundHeaderColorTop(org.eclipse.swt.graphics.Color selectedBackgroundHeaderColorTop) -
setSelectedBackgroundHeaderColorBottom
public void setSelectedBackgroundHeaderColorBottom(org.eclipse.swt.graphics.Color selectedBackgroundHeaderColorBottom) -
getTextOrientation
public int getTextOrientation()Returns the text orientation of the section. Default is SWT.VERTICAL.- Returns:
- Text orientation.
-
setTextOrientation
public void setTextOrientation(int textOrientation)Sets the text orientation of the section. One of SWT.HORIZONTAL or SWT.VERTICAL. Default is SWT.VERTICAL.- Parameters:
textOrientation- SWT.VERTICAL or SWT.HORIZONTAL
-
isInheritBackgroud
boolean isInheritBackgroud()Deprecated.IN PROGRESSWhether this section should just inherit the background colors of the main chart.- Returns:
- true if set
-
setInheritBackgroud
void setInheritBackgroud(boolean inheritBackgroud)Deprecated.IN PROGRESSSets whether this section should inherit the background colors of the main chart for drawing date fills.- Parameters:
inheritBackgroud- true to inherit. Default is false.
-
getParentComposite
Returns the parentGanttComposite- Returns:
GanttComposite
-
dispose
public void dispose()Removes this section from the chart. Do note that all belonging GanttEvents will be orphaned, so you should probably deal with that post disposal. -
getNameExtent
org.eclipse.swt.graphics.Point getNameExtent() -
setNameExtent
void setNameExtent(org.eclipse.swt.graphics.Point extent) -
setBounds
void setBounds(org.eclipse.swt.graphics.Rectangle bounds) -
getNameImage
org.eclipse.swt.graphics.Image getNameImage() -
setNameImage
void setNameImage(org.eclipse.swt.graphics.Image nameImage) -
needsNameUpdate
boolean needsNameUpdate() -
setNeedsNameUpdate
void setNeedsNameUpdate(boolean need) -
getEventsHeight
-
addDNDGanttEvent
-
clearDNDGanttEvents
void clearDNDGanttEvents() -
getDNDGanttEvents
java.util.List getDNDGanttEvents() -
toString
public java.lang.String toString()- Overrides:
toStringin classjava.lang.Object
-