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
................................................
-
-
Field Summary
Fields Modifier and Type Field Description private org.eclipse.swt.graphics.Image_additionalImageprivate org.eclipse.swt.graphics.Rectangle_boundsprivate java.lang.Object_dataprivate java.util.List_dndGanttEventsprivate IFillBackgroundColors_fillColorManagerprivate java.util.List_ganttEventsprivate org.eclipse.swt.graphics.Color_holidayBgColorBottomprivate org.eclipse.swt.graphics.Color_holidayBgColorTopprivate boolean_inheritBackgroudprivate java.lang.String_nameprivate org.eclipse.swt.graphics.Point_nameExtentprivate org.eclipse.swt.graphics.Image_nameImageprivate boolean_needsNameUpdateprivate GanttComposite_parentprivate org.eclipse.swt.graphics.Color_saturdayBgColorBottomprivate org.eclipse.swt.graphics.Color_saturdayBgColorTopprivate org.eclipse.swt.graphics.Color_selectedBgColorBottomprivate org.eclipse.swt.graphics.Color_selectedBgColorTopprivate org.eclipse.swt.graphics.Color_selectedBgHeaderColorBottomprivate org.eclipse.swt.graphics.Color_selectedBgHeaderColorTopprivate org.eclipse.swt.graphics.Color_sundayBgColorBottomprivate org.eclipse.swt.graphics.Color_sundayBgColorTopprivate int_textOrientationprivate org.eclipse.swt.graphics.Color_weekdayBgColorBottomprivate org.eclipse.swt.graphics.Color_weekdayBgColorTop
-
Constructor Summary
Constructors Modifier Constructor Description privateGanttSection()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
All Methods Instance Methods Concrete Methods Deprecated Methods 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()
-
-
-
Field Detail
-
_data
private java.lang.Object _data
-
_name
private java.lang.String _name
-
_parent
private GanttComposite _parent
-
_ganttEvents
private java.util.List _ganttEvents
-
_dndGanttEvents
private java.util.List _dndGanttEvents
-
_bounds
private org.eclipse.swt.graphics.Rectangle _bounds
-
_nameImage
private org.eclipse.swt.graphics.Image _nameImage
-
_additionalImage
private org.eclipse.swt.graphics.Image _additionalImage
-
_needsNameUpdate
private boolean _needsNameUpdate
-
_fillColorManager
private IFillBackgroundColors _fillColorManager
-
_saturdayBgColorTop
private org.eclipse.swt.graphics.Color _saturdayBgColorTop
-
_saturdayBgColorBottom
private org.eclipse.swt.graphics.Color _saturdayBgColorBottom
-
_sundayBgColorTop
private org.eclipse.swt.graphics.Color _sundayBgColorTop
-
_sundayBgColorBottom
private org.eclipse.swt.graphics.Color _sundayBgColorBottom
-
_holidayBgColorTop
private org.eclipse.swt.graphics.Color _holidayBgColorTop
-
_holidayBgColorBottom
private org.eclipse.swt.graphics.Color _holidayBgColorBottom
-
_weekdayBgColorTop
private org.eclipse.swt.graphics.Color _weekdayBgColorTop
-
_weekdayBgColorBottom
private org.eclipse.swt.graphics.Color _weekdayBgColorBottom
-
_selectedBgColorTop
private org.eclipse.swt.graphics.Color _selectedBgColorTop
-
_selectedBgColorBottom
private org.eclipse.swt.graphics.Color _selectedBgColorBottom
-
_selectedBgHeaderColorTop
private org.eclipse.swt.graphics.Color _selectedBgHeaderColorTop
-
_selectedBgHeaderColorBottom
private org.eclipse.swt.graphics.Color _selectedBgHeaderColorBottom
-
_nameExtent
private org.eclipse.swt.graphics.Point _nameExtent
-
_textOrientation
private int _textOrientation
-
_inheritBackgroud
private boolean _inheritBackgroud
-
-
Constructor Detail
-
GanttSection
private GanttSection()
-
GanttSection
public GanttSection(GanttChart parent, java.lang.String name)
Creates a new GanttSection.- Parameters:
parent- GanttChartname- GanttSection name
-
GanttSection
public GanttSection(GanttChart parent, java.lang.String name, IFillBackgroundColors fillManager)
Creates a new GanttSection with a fill manager that controls background colors.- Parameters:
parent- GanttChartname- GanttSection namefillManager- Fill manager
-
-
Method Detail
-
addGanttEvent
public void addGanttEvent(IGanttChartItem event)
Adds a Gantt Chart item (GanttSection, GanttGroup) to this section.- Parameters:
event- Item to add
-
addGanttEvent
public void addGanttEvent(int index, IGanttChartItem event)Adds a Gantt Chart item at the given index.- Parameters:
index- Index to add item atevent- Item to add
-
removeGanttEvent
public void removeGanttEvent(IGanttChartItem event)
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
public GanttComposite 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
int getEventsHeight(ISettings settings)
-
addDNDGanttEvent
void addDNDGanttEvent(GanttEvent ge)
-
clearDNDGanttEvents
void clearDNDGanttEvents()
-
getDNDGanttEvents
java.util.List getDNDGanttEvents()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-