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
_additionalImage
private org.eclipse.swt.graphics.Rectangle
_bounds
private java.lang.Object
_data
private java.util.List
_dndGanttEvents
private IFillBackgroundColors
_fillColorManager
private java.util.List
_ganttEvents
private org.eclipse.swt.graphics.Color
_holidayBgColorBottom
private org.eclipse.swt.graphics.Color
_holidayBgColorTop
private boolean
_inheritBackgroud
private java.lang.String
_name
private org.eclipse.swt.graphics.Point
_nameExtent
private org.eclipse.swt.graphics.Image
_nameImage
private boolean
_needsNameUpdate
private GanttComposite
_parent
private org.eclipse.swt.graphics.Color
_saturdayBgColorBottom
private org.eclipse.swt.graphics.Color
_saturdayBgColorTop
private org.eclipse.swt.graphics.Color
_selectedBgColorBottom
private org.eclipse.swt.graphics.Color
_selectedBgColorTop
private org.eclipse.swt.graphics.Color
_selectedBgHeaderColorBottom
private org.eclipse.swt.graphics.Color
_selectedBgHeaderColorTop
private org.eclipse.swt.graphics.Color
_sundayBgColorBottom
private org.eclipse.swt.graphics.Color
_sundayBgColorTop
private int
_textOrientation
private org.eclipse.swt.graphics.Color
_weekdayBgColorBottom
private org.eclipse.swt.graphics.Color
_weekdayBgColorTop
-
Constructor Summary
Constructors Modifier Constructor Description private
GanttSection()
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) void
addDNDGanttEvent(GanttEvent ge)
void
addGanttEvent(int index, IGanttChartItem event)
Adds a Gantt Chart item at the given index.void
addGanttEvent(IGanttChartItem event)
Adds a Gantt Chart item (GanttSection, GanttGroup) to this section.(package private) void
clearDNDGanttEvents()
void
dispose()
Removes this section from the chart.org.eclipse.swt.graphics.Image
getAdditionalImage()
org.eclipse.swt.graphics.Rectangle
getBounds()
Returns the bounds of this GanttSectionjava.lang.Object
getData()
Returns the currently set data object.(package private) java.util.List
getDNDGanttEvents()
java.util.List
getEvents()
Returns a list of all IGanttChartItems (GanttEvent and GanttGroup) contained in this section.(package private) int
getEventsHeight(ISettings settings)
org.eclipse.swt.graphics.Color
getHolidayBackgroundColorBottom()
The bottom background gradient color used for drawing the holiday column.org.eclipse.swt.graphics.Color
getHolidayBackgroundColorTop()
The top background gradient color used for drawing the holiday column.java.lang.String
getName()
Returns the name of this section.(package private) org.eclipse.swt.graphics.Point
getNameExtent()
(package private) org.eclipse.swt.graphics.Image
getNameImage()
GanttComposite
getParentComposite()
Returns the parentGanttComposite
org.eclipse.swt.graphics.Color
getSaturdayBackgroundColorBottom()
The bottom background gradient color used for drawing the Saturday column.org.eclipse.swt.graphics.Color
getSaturdayBackgroundColorTop()
The top background gradient color used for drawing the Saturday column.org.eclipse.swt.graphics.Color
getSelectedDayColorBottom()
The bottom background gradient color used for drawing selected columns.org.eclipse.swt.graphics.Color
getSelectedDayColorTop()
The top background gradient color used for drawing selected columns.org.eclipse.swt.graphics.Color
getSelectedDayHeaderColorBottom()
The bottom background gradient color used for drawing selected columns in the header section.org.eclipse.swt.graphics.Color
getSelectedDayHeaderColorTop()
The top background gradient color used for drawing selected columns in the header section.org.eclipse.swt.graphics.Color
getSundayBackgroundColorBottom()
The bottom background gradient color used for drawing the Sunday column.org.eclipse.swt.graphics.Color
getSundayBackgroundColorTop()
The top background gradient color used for drawing the Sunday column.int
getTextOrientation()
Returns the text orientation of the section.org.eclipse.swt.graphics.Color
getWeekdayBackgroundColorBottom()
The bottom background gradient color used for drawing the weekday column.org.eclipse.swt.graphics.Color
getWeekdayBackgroundColorTop()
The top background gradient color used for drawing the weekday column.(package private) boolean
isInheritBackgroud()
Deprecated.IN PROGRESS(package private) boolean
needsNameUpdate()
void
removeGanttEvent(IGanttChartItem event)
Removes a Gantt Chart item (GanttSection, GanttGroup) from this section.void
setAdditionalImage(org.eclipse.swt.graphics.Image _additionalImage)
(package private) void
setBounds(org.eclipse.swt.graphics.Rectangle bounds)
void
setData(java.lang.Object data)
Sets the current data object.void
setHolidayBackgroundColorBottom(org.eclipse.swt.graphics.Color holidayBackgroundColorBottom)
void
setHolidayBackgroundColorTop(org.eclipse.swt.graphics.Color holidayBackgroundColorTop)
(package private) void
setInheritBackgroud(boolean inheritBackgroud)
Deprecated.IN PROGRESSvoid
setName(java.lang.String name)
Sets the name of this section.(package private) void
setNameExtent(org.eclipse.swt.graphics.Point extent)
(package private) void
setNameImage(org.eclipse.swt.graphics.Image nameImage)
(package private) void
setNeedsNameUpdate(boolean need)
void
setSaturdayBackgroundColorBottom(org.eclipse.swt.graphics.Color saturdayBackgroundColorBottom)
void
setSaturdayBackgroundColorTop(org.eclipse.swt.graphics.Color saturdayBackgroundColorTop)
void
setSelectedBackgroundColorBottom(org.eclipse.swt.graphics.Color selectedBackgroundColorBottom)
void
setSelectedBackgroundColorTop(org.eclipse.swt.graphics.Color selectedBackgroundColorTop)
void
setSelectedBackgroundHeaderColorBottom(org.eclipse.swt.graphics.Color selectedBackgroundHeaderColorBottom)
void
setSelectedBackgroundHeaderColorTop(org.eclipse.swt.graphics.Color selectedBackgroundHeaderColorTop)
void
setSundayBackgroundColorBottom(org.eclipse.swt.graphics.Color sundayBackgroundColorBottom)
void
setSundayBackgroundColorTop(org.eclipse.swt.graphics.Color sundayBackgroundColorTop)
void
setTextOrientation(int textOrientation)
Sets the text orientation of the section.void
setWeekdayBackgroundColorBottom(org.eclipse.swt.graphics.Color weekdayBackgroundColorBottom)
void
setWeekdayBackgroundColorTop(org.eclipse.swt.graphics.Color weekdayBackgroundColorTop)
java.lang.String
toString()
-
-
-
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:IFillBackgroundColors
The bottom background gradient color used for drawing the Saturday column.- Specified by:
getSaturdayBackgroundColorBottom
in interfaceIFillBackgroundColors
- Returns:
- Color
-
getSaturdayBackgroundColorTop
public org.eclipse.swt.graphics.Color getSaturdayBackgroundColorTop()
Description copied from interface:IFillBackgroundColors
The top background gradient color used for drawing the Saturday column.- Specified by:
getSaturdayBackgroundColorTop
in interfaceIFillBackgroundColors
- Returns:
- Color
-
getSundayBackgroundColorBottom
public org.eclipse.swt.graphics.Color getSundayBackgroundColorBottom()
Description copied from interface:IFillBackgroundColors
The bottom background gradient color used for drawing the Sunday column.- Specified by:
getSundayBackgroundColorBottom
in interfaceIFillBackgroundColors
- Returns:
- Color
-
getSundayBackgroundColorTop
public org.eclipse.swt.graphics.Color getSundayBackgroundColorTop()
Description copied from interface:IFillBackgroundColors
The top background gradient color used for drawing the Sunday column.- Specified by:
getSundayBackgroundColorTop
in interfaceIFillBackgroundColors
- Returns:
- Color
-
getHolidayBackgroundColorBottom
public org.eclipse.swt.graphics.Color getHolidayBackgroundColorBottom()
Description copied from interface:IFillBackgroundColors
The bottom background gradient color used for drawing the holiday column.- Specified by:
getHolidayBackgroundColorBottom
in interfaceIFillBackgroundColors
- Returns:
- Color
-
getHolidayBackgroundColorTop
public org.eclipse.swt.graphics.Color getHolidayBackgroundColorTop()
Description copied from interface:IFillBackgroundColors
The top background gradient color used for drawing the holiday column.- Specified by:
getHolidayBackgroundColorTop
in interfaceIFillBackgroundColors
- Returns:
- Color
-
getWeekdayBackgroundColorBottom
public org.eclipse.swt.graphics.Color getWeekdayBackgroundColorBottom()
Description copied from interface:IFillBackgroundColors
The bottom background gradient color used for drawing the weekday column.- Specified by:
getWeekdayBackgroundColorBottom
in interfaceIFillBackgroundColors
- Returns:
- Color
-
getWeekdayBackgroundColorTop
public org.eclipse.swt.graphics.Color getWeekdayBackgroundColorTop()
Description copied from interface:IFillBackgroundColors
The top background gradient color used for drawing the weekday column.- Specified by:
getWeekdayBackgroundColorTop
in interfaceIFillBackgroundColors
- Returns:
- Color
-
getSelectedDayColorBottom
public org.eclipse.swt.graphics.Color getSelectedDayColorBottom()
Description copied from interface:IFillBackgroundColors
The bottom background gradient color used for drawing selected columns.- Specified by:
getSelectedDayColorBottom
in interfaceIFillBackgroundColors
- Returns:
- Color
-
getSelectedDayColorTop
public org.eclipse.swt.graphics.Color getSelectedDayColorTop()
Description copied from interface:IFillBackgroundColors
The top background gradient color used for drawing selected columns.- Specified by:
getSelectedDayColorTop
in interfaceIFillBackgroundColors
- Returns:
-
getSelectedDayHeaderColorBottom
public org.eclipse.swt.graphics.Color getSelectedDayHeaderColorBottom()
Description copied from interface:IFillBackgroundColors
The bottom background gradient color used for drawing selected columns in the header section.- Specified by:
getSelectedDayHeaderColorBottom
in interfaceIFillBackgroundColors
- Returns:
- Color
-
getSelectedDayHeaderColorTop
public org.eclipse.swt.graphics.Color getSelectedDayHeaderColorTop()
Description copied from interface:IFillBackgroundColors
The top background gradient color used for drawing selected columns in the header section.- Specified by:
getSelectedDayHeaderColorTop
in 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:
toString
in classjava.lang.Object
-
-