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) 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()
-
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: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
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:
toString
in classjava.lang.Object
-