Class 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 Detail

      • _data

        private java.lang.Object _data
      • _name

        private java.lang.String _name
      • _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
      • _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 - GanttChart
        name - 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 - GanttChart
        name - GanttSection name
        fillManager - 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 at
        event - 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
      • 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 PROGRESS
        Whether this section should just inherit the background colors of the main chart.
        Returns:
        true if set
      • setInheritBackgroud

        void setInheritBackgroud​(boolean inheritBackgroud)
        Deprecated.
        IN PROGRESS
        Sets whether this section should inherit the background colors of the main chart for drawing date fills.
        Parameters:
        inheritBackgroud - true to inherit. Default is false.
      • 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 class java.lang.Object