Class GanttEvent

  • All Implemented Interfaces:
    java.lang.Cloneable, IGanttChartItem
    Direct Known Subclasses:
    GanttCheckpoint, GanttImage, GanttScope

    public class GanttEvent
    extends AbstractGanttEvent
    implements IGanttChartItem, java.lang.Cloneable
    One GanttEvent represents one "active" object in the GANTT chart.

    This object can take many shapes, here is a list of a few:

    • Normal event
    • Checkpoint event
    • Scope event
    • Image event
    • And so on...
    The event may also take revised start and end dates, and can be modified individually to be locked, non-movable, non-resizable and much more.

    Events may be modified on the fly to become a different object type from the above list. Please do ensure that the ALL parameters are set for it to become the new object before you do so.

    Once an event has been created, add it onto the GanttChart widget via the addScopeEvent(...) methods available.

    Sample Code:

    // make a 10 day long event
    Calendar cStartDate = Calendar.getInstance(Locale.getDefault());
    Calendar cEndDate = Calendar.getInstance(Locale.getDefault());
    cEndDate.add(Calendar.DATE, 10);

    // we're setting the percentage complete to 50%
    GanttEvent ganttEvent = new GanttEvent(ganttChart, "Event Name", cStartDate, cEndDate, 50);



    This class should not be subclassed, do so at your own risk.

    • Field Detail

      • FIXED_ROW_HEIGHT_AUTOMATIC

        public static final int FIXED_ROW_HEIGHT_AUTOMATIC
        See Also:
        Constant Field Values
      • _data

        private java.lang.Object _data
      • _name

        private java.lang.String _name
      • _revisedStart

        private java.util.Calendar _revisedStart
      • _revisedEnd

        private java.util.Calendar _revisedEnd
      • _startDate

        private java.util.Calendar _startDate
      • _endDate

        private java.util.Calendar _endDate
      • _percentComplete

        private int _percentComplete
      • _checkpoint

        private boolean _checkpoint
      • _scope

        private boolean _scope
      • _locked

        private boolean _locked
      • _image

        private boolean _image
      • _resizable

        private boolean _resizable
      • _moveable

        private boolean _moveable
      • _x

        private int _x
      • _y

        private int _y
      • _width

        private int _width
      • _height

        private int _height
      • _earliestStartX

        private int _earliestStartX
      • _latestEndX

        private int _latestEndX
      • _actualWidth

        private int _actualWidth
      • _statusColor

        private org.eclipse.swt.graphics.Color _statusColor
      • _gradientStatusColor

        private org.eclipse.swt.graphics.Color _gradientStatusColor
      • _showBoldText

        private boolean _showBoldText
      • _textDisplayFormat

        private java.lang.String _textDisplayFormat
      • _scopeEvents

        private java.util.List _scopeEvents
      • _picture

        private org.eclipse.swt.graphics.Image _picture
      • _menu

        private org.eclipse.swt.widgets.Menu _menu
      • _hidden

        private boolean _hidden
      • _widthWithtText

        private int _widthWithtText
      • _visibility

        private int _visibility
      • _boundsHaveBeenSet

        private boolean _boundsHaveBeenSet
      • _fixedRowHeight

        private int _fixedRowHeight
      • _verticalEventAlignment

        private int _verticalEventAlignment
      • _horizontalLineTopY

        private int _horizontalLineTopY
      • _horizontalLineBottomY

        private int _horizontalLineBottomY
      • _noMoveBeforeDate

        private java.util.Calendar _noMoveBeforeDate
      • _noMoveAfterDate

        private java.util.Calendar _noMoveAfterDate
      • _nameChanged

        private boolean _nameChanged
      • _nameExtent

        private org.eclipse.swt.graphics.Point _nameExtent
      • _parsedString

        private java.lang.String _parsedString
      • _horizontalTextLocation

        private int _horizontalTextLocation
      • _verticalTextLocation

        private int _verticalTextLocation
      • _showText

        private boolean _showText
      • _textFont

        private org.eclipse.swt.graphics.Font _textFont
      • _daysBetweenStartAndEnd

        private int _daysBetweenStartAndEnd
      • _preMoveDateEstiStart

        private java.util.Calendar _preMoveDateEstiStart
      • _preMoveDateEstiEnd

        private java.util.Calendar _preMoveDateEstiEnd
      • _preMoveDateRevisedStart

        private java.util.Calendar _preMoveDateRevisedStart
      • _preMoveDateRevisedEnd

        private java.util.Calendar _preMoveDateRevisedEnd
      • _preMoveBounds

        private org.eclipse.swt.graphics.Rectangle _preMoveBounds
      • _moving

        private boolean _moving
      • _moveType

        private int _moveType
      • _preMoveGanttSectionIndex

        private int _preMoveGanttSectionIndex
      • _preMoveGanttSectionEventLocationIndex

        private int _preMoveGanttSectionEventLocationIndex
      • _dDayStart

        private int _dDayStart
      • _dDayEnd

        private int _dDayEnd
      • _savedVerticalDragY

        private int _savedVerticalDragY
      • _preVerticalDragBounds

        private org.eclipse.swt.graphics.Rectangle _preVerticalDragBounds
    • Constructor Detail

      • GanttEvent

        public GanttEvent​(GanttChart parent,
                          java.lang.String name,
                          java.util.Calendar startDate,
                          java.util.Calendar endDate,
                          int percentComplete)
        Creates a new GanttEvent.
        Parameters:
        parent - Parent chart
        name - Name of event
        startDate - Start date
        endDate - End date
        percentComplete - Percent complete
      • GanttEvent

        public GanttEvent​(GanttChart parent,
                          java.lang.Object data,
                          java.lang.String name,
                          java.util.Calendar startDate,
                          java.util.Calendar endDate,
                          int percentComplete)
        Creates a new GanttEvent object.
        Parameters:
        parent - Parent chart
        data - Data object
        name - Name of event
        startDate - Start date
        endDate - End date
        percentComplete - Percent complete
      • GanttEvent

        public GanttEvent​(GanttChart parent,
                          java.lang.String name,
                          java.util.Calendar startDate,
                          java.util.Calendar endDate,
                          java.util.Calendar revisedStart,
                          java.util.Calendar revisedEnd,
                          int percentComplete)
        Creates a new GanttEvent.
        Parameters:
        parent - Parent chart
        name - Name of event
        startDate - Start date
        endDate - End date
        revisedStart - Revised start
        revisedEnd - Revised end
        percentComplete - Percent complete
      • GanttEvent

        public GanttEvent​(GanttChart parent,
                          java.lang.Object data,
                          java.lang.String name,
                          java.util.Calendar startDate,
                          java.util.Calendar endDate,
                          java.util.Calendar revisedStart,
                          java.util.Calendar revisedEnd,
                          int percentComplete)
        Creates a new GanttEvent object with revised start and end dates.
        Parameters:
        parent - Parent GanttChart
        data - Data object
        name - Display name
        startDate - Start date
        endDate - End date
        revisedStart - Revised start date
        revisedEnd - Revised end date
        percentComplete - Percentage complete
      • GanttEvent

        public GanttEvent​(GanttChart parent,
                          int dDayStart,
                          int dDayEnd)
        D-day event creation.
        Parameters:
        parent - Parent chart
        dDayStart - D day start value (zero based)
        dDayEnd - D day end value (zero based)
      • GanttEvent

        public GanttEvent​(GanttChart parent,
                          java.lang.String name)
        Creates a GanttEvent intended to be a scope.
        Parameters:
        parent - Chart parent
        name - Name of scope
      • GanttEvent

        public GanttEvent​(GanttChart parent,
                          java.lang.Object data,
                          java.lang.String name)
        Creates a GanttEvent intended to be a scope.
        Parameters:
        parent - Chart parent
        data - Data object
        name - Name of scope
      • GanttEvent

        public GanttEvent​(GanttChart parent,
                          java.lang.String name,
                          java.util.Calendar date)
        Creates a GanttEvent intended to be a checkpoint.
        Parameters:
        parent - Chart parent
        name - Name of checkpoint
        date - Checkpoint start (and end) date
      • GanttEvent

        public GanttEvent​(GanttChart parent,
                          java.lang.Object data,
                          java.lang.String name,
                          java.util.Calendar date)
        Creates a GanttEvent intended to be a checkpoint.
        Parameters:
        parent - Chart parent
        data - Data object
        name - Name of checkpoint
        date - Start (and end) date
      • GanttEvent

        public GanttEvent​(GanttChart parent,
                          java.lang.String name,
                          java.util.Calendar date,
                          org.eclipse.swt.graphics.Image picture)
        Creates a GanttEvent intended to be an image.
        Parameters:
        parent - Chart parent
        name - Name of image
        date - Start (and end) date
        picture - Image to show
      • GanttEvent

        public GanttEvent​(GanttChart parent,
                          java.lang.Object data,
                          java.lang.String name,
                          java.util.Calendar date,
                          org.eclipse.swt.graphics.Image picture)
        Creates a GanttEvent intended to be an image.
        Parameters:
        parent - Chart parent
        data - Data object
        name - Name of image
        date - Start (and end) date
        picture - Image to show
    • Method Detail

      • init

        private final void init()
      • 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
      • getName

        public java.lang.String getName()
        Returns the display name of this event.
        Returns:
        Display name
      • setName

        public void setName​(java.lang.String name)
        Sets the display name of this event.
        Parameters:
        name - Display name
      • getStartDate

        public java.util.Calendar getStartDate()
        Returns the start date of this event.
        Returns:
        Start date
      • getActualStartDate

        public java.util.Calendar getActualStartDate()
        Returns the revised start date if set, or the start date if not.
        Returns:
        Start date or null
      • getActualEndDate

        public java.util.Calendar getActualEndDate()
        Returns the revised end date if set, or the end date if not.
        Returns:
        End date or null
      • getEarliestStartDate

        public java.util.Calendar getEarliestStartDate()
        Returns whatever is the earliest calendar of the start date and the actual start date. If any of them are null, whichever has a calendar is returned. If both are null, null is returned.
        Returns:
        Earliest start date
      • getLatestEndDate

        public java.util.Calendar getLatestEndDate()
        Returns whatever is the latest calendar of the end date and the actual end date. If any of them are null, whichever has a calendar is returned. If both are null, null is returned.
        Returns:
        Latest end date
      • setStartDate

        public void setStartDate​(java.util.Calendar startDate)
        Sets the end date of this event.
        Parameters:
        startDate - Start date
      • update

        public void update​(boolean redraw)
        Forces the chart to recognize that something within this event has changed and that it needs an update. This method will cause a redraw if told to redraw.
        Parameters:
        redraw - if to redraw the chart after notifying of changes.
      • getEndDate

        public java.util.Calendar getEndDate()
        Returns the end date of this event.
        Returns:
        End date
      • setEndDate

        public void setEndDate​(java.util.Calendar endDate)
        Sets the end date of this event.
        Parameters:
        endDate - End date
      • getPercentComplete

        public int getPercentComplete()
        Returns the percentage complete of this event.
        Returns:
        Percentage complete
      • setPercentComplete

        public void setPercentComplete​(int percentComplete)
        Sets the percentage complete of this event.
        Parameters:
        percentComplete - Percentage complete
      • getMenu

        public org.eclipse.swt.widgets.Menu getMenu()
        Returns the individual Menu for this event for which custom events can be created. Custom events will be mixed with built-in events (if they exist). The menu will be created on the first get call to this method, any subsequent method calls will return the same menu object. Do remember that a menu counts as a handle towards the maximum number of handles. If you have very many events, it is probably better to use a different way of creating menus, this is merely meant as a convenience.
        Returns:
        Menu
      • setBounds

        void setBounds​(int x,
                       int y,
                       int width,
                       int height)
        Sets the bounds of the event. This is done internally.
        Parameters:
        x - x location
        y - y location
        width - width of event
        height - height of event
      • setBounds

        void setBounds​(org.eclipse.swt.graphics.Rectangle bounds)
        Sets the bounds of the event.
        Parameters:
        bounds - New bounds
      • updateX

        void updateX​(int x)
      • updateOtherXs

        private void updateOtherXs()
      • updateY

        void updateY​(int y)
      • updateHeight

        void updateHeight​(int height)
      • updateWidth

        void updateWidth​(int width)
      • isCheckpoint

        public boolean isCheckpoint()
        Whether this is a checkpoint or not.
        Returns:
        true if this is a checkpoint
      • setCheckpoint

        public void setCheckpoint​(boolean checkpoint)
        Sets the event to be a checkpoint.
        Parameters:
        checkpoint - true if the event should be a checkpoint
      • getX

        public int getX()
        Returns the x location of this event.
        Returns:
        x location
      • getXEnd

        public int getXEnd()
        Returns the ending x location for this event.
        Returns:
        x end location
      • getY

        public int getY()
        Returns the y location of this event.
        Returns:
        y location
      • getBottomY

        public int getBottomY()
        Returns the bottom y of this event.
        Returns:
        y bottom
      • getWidth

        public int getWidth()
        Returns the width of this event.
        Returns:
        width
      • getHeight

        public int getHeight()
        Returns the height of this event.
        Returns:
        height
      • getRevisedStart

        public java.util.Calendar getRevisedStart()
        Returns the revised start date of this event.
        Returns:
        Revised date
      • setRevisedStart

        public void setRevisedStart​(java.util.Calendar revisedStart)
        Sets the revised start date of this event.
        Parameters:
        revisedStart -
      • getRevisedEnd

        public java.util.Calendar getRevisedEnd()
        Returns the revised end date of this event.
        Returns:
        revised end date
      • setRevisedEnd

        public void setRevisedEnd​(java.util.Calendar revisedEnd)
        Sets the revised end date of this event.
        Parameters:
        revisedEnd - Revised end date
      • setRevisedStart

        public void setRevisedStart​(int dDayStart)
        Sets the revised D-day start.
        Parameters:
        dDayStart - d-day start.
      • setRevisedEnd

        public void setRevisedEnd​(int dDayEnd)
        Sets the revised D-day end.
        Parameters:
        dDayEnd - d-day end
      • setRevisedDates

        private void setRevisedDates​(java.util.Calendar revisedStart,
                                     java.util.Calendar revisedEnd)
        Sets new revised dates. This is useful when you need to update two dates that move at the same time (such as manually doing a move via setDates). Normally each setting of a date would check it against its start date or end date to make sure it doesn't overlap. This does too, but at the same time, thus, no oddity in movement will appear. This is rather difficult to explain, but if you experience event-length changes when using individual start and end date sets that appear at the same time, you probably want to use this method instead.

        Either parameter may be null to set just one, but both may not be null

        Parameters:
        revisedStart - New revised Start date
        revisedEnd - New revised End date
      • setRevisedStart

        public void setRevisedStart​(java.util.Calendar revisedStart,
                                    boolean validate)
        When you need to move events manually you may run into issues as one date always has to be set before the other. So when you set a new end and start date one is checked for overlap before the other and is thus ignored. Sometimes you just want to set the dates and not enforce validation. Do remember, you need to validate the dates yourself before setting them. If the start comes after the end or vice versa you will run into serious drawing issues and strange behavior.
        Parameters:
        revisedStart - New revised start date
        validate - true if to validate the date as normal, false to just set the date as is.
      • setRevisedEnd

        public void setRevisedEnd​(java.util.Calendar revisedEnd,
                                  boolean validate)
        When you need to move events manually you may run into issues as one date always has to be set before the other. So when you set a new end and start date one is checked for overlap before the other and is thus ignored. Sometimes you just want to set the dates and not enforce validation. Do remember, you need to validate the dates yourself before setting them. If the start comes after the end or vice versa you will run into serious drawing issues and strange behavior.
        Parameters:
        revisedStart - New revised start date
        validate - true if to validate the date as normal, false to just set the date as is.
      • setRevisedDates

        public void setRevisedDates​(java.util.Calendar revisedStart,
                                    java.util.Calendar revisedEnd,
                                    int order)
        Another utility method for setting new dates but this method enforces the usual validation. The difference here is that you can tell the method in which order the new dates should be set. If you say left to right, the start is set first, the end last.
        Parameters:
        revisedStart - Revised start date
        revisedEnd - Revised end date
        order - SWT.LEFT_TO_RIHT or SWT.RIGHT_TO_LEFT
      • isLocked

        public boolean isLocked()
        Whether this event is locked or not.
        Returns:
        true if event is locked.
      • setLocked

        public void setLocked​(boolean locked)
        Sets whether this event is locked or not.
        Parameters:
        locked - true if locked
      • getGradientStatusColor

        public org.eclipse.swt.graphics.Color getGradientStatusColor()
        Returns the status color used as part of the gradient colors used to draw the event.
        Returns:
        Gradient color
      • setGradientStatusColor

        public void setGradientStatusColor​(org.eclipse.swt.graphics.Color gradientStatusColor)
        Sets the status color used as part of the gradient colors used to draw the event.
        Parameters:
        gradientStatusColor - Gradient color
      • getStatusColor

        public org.eclipse.swt.graphics.Color getStatusColor()
        Returns the status color of this event. This is also used for drawing gradients.
        Returns:
        Status color
      • setStatusColor

        public void setStatusColor​(org.eclipse.swt.graphics.Color statusColor)
        Sets the status color of this event. This is also used for drawing gradients.
        Parameters:
        statusColor - Status color
      • showBoldText

        public boolean showBoldText()
        Whether to show the display name in bold text or not.
        Returns:
        true if to show bold text
      • setShowBoldText

        public void setShowBoldText​(boolean showBoldText)
        Sets whether to show the display name in bold text or not.
        Parameters:
        showBoldText - Set to true if to show bold text
      • getBounds

        public org.eclipse.swt.graphics.Rectangle getBounds()
        Returns the bounds of this event (do note that events may have no bounds if they are invisible or hidden and will not get actual bounds set until they are shown).
        Returns:
        Bounds
      • getTextDisplayFormat

        public java.lang.String getTextDisplayFormat()
        Returns the text display format of this event. Please see ISettings.getTextDisplayFormat() for an overview. If this method returns null, whatever is set in the settings will be used.
        Returns:
        Text format or null
        See Also:
        ISettings.getTextDisplayFormat()
      • setTextDisplayFormat

        public void setTextDisplayFormat​(java.lang.String format)
        Sets the text display format of this event. Please see ISettings.getTextDisplayFormat() for an overview.
        See Also:
        ISettings.getTextDisplayFormat()
      • isScope

        public boolean isScope()
        Returns whether this is a scope or not.
        Returns:
        true if scope
      • addScopeEvent

        public void addScopeEvent​(GanttEvent event)
        Adds an event that this event should cover if it has been set to be a scope.
        Parameters:
        event - GanttEvent to encompass
      • removeScopeEvent

        public void removeScopeEvent​(GanttEvent event)
        Removes event that this event encompasses as a scope.
        Parameters:
        event - GanttEvent
      • getScopeEvents

        public java.util.List getScopeEvents()
        Returns the list of GanttEvents that the scope encompasses.
        Returns:
        List of events
      • getEarliestOrLatestScopeEvent

        private GanttEvent getEarliestOrLatestScopeEvent​(boolean earliest)
      • getEarliestScopeEvent

        public GanttEvent getEarliestScopeEvent()
        Returns the event that has the earliest date of all events in a scope.
        Returns:
        Earliest event or null if none
      • getLatestScopeEvent

        public GanttEvent getLatestScopeEvent()
        Returns the event that has the latest date of all events in a scope.
        Returns:
        Latest event or null if none
      • getPicture

        public org.eclipse.swt.graphics.Image getPicture()
        Returns the picture image for this event.
        Returns:
        Picture
      • setPicture

        public void setPicture​(org.eclipse.swt.graphics.Image picture)
        Sets the picture image for this event.
        Parameters:
        picture - Image picture
      • setImage

        public void setImage​(boolean image)
        Sets this event to be represented by an image.
        Parameters:
        image - true if it's an image
      • isImage

        public boolean isImage()
        Returns whether this event is an image representation or not.
        Returns:
        true if this event is an image representation
      • getGanttGroup

        public GanttGroup getGanttGroup()
        Returns what GanttGroup this event belongs to. Grouped events are drawn on the same line. Set null for no group.
        Returns:
        GanttGroup
      • setGanttGroup

        public void setGanttGroup​(GanttGroup group)
        Sets what group this event belongs to. Grouped events are drawn on the same line.
        Parameters:
        group - GanttGroup or null if none
      • setGanttSection

        void setGanttSection​(GanttSection ganttSection)
        Sets the GanttSection that this event belongs to
        Parameters:
        ganttSection -
      • setHidden

        public void setHidden​(boolean hidden)
        Sets if this event should be hidden or not. Hidden events are not shown on the chart and the space they normally would occupy is free.
        Parameters:
        hidden - true to hide event.
      • isHidden

        public boolean isHidden()
        Returns whether this event is hidden or not. Hidden events are not shown on the chart and the space they normally would occupy is free.
        Returns:
        true if hidden.
      • internalSetAllChildrenHidden

        private void internalSetAllChildrenHidden​(boolean hidden)
      • hideAllChildren

        public void hideAllChildren()
        Hides all children from view. Children only exist on Scoped events.
        See Also:
        isHidden()
      • showAllChildren

        public void showAllChildren()
        Un-hides all children from view. Children only exist on Scoped events.
        See Also:
        isHidden()
      • isChildrenHidden

        public boolean isChildrenHidden()
        Returns whether all children are hidden or not. Children only exist on Scoped events.
        Returns:
        true if all children are hidden.
      • getWidthWithText

        public int getWidthWithText()
        Returns the full right most x value if event has text or images drawn after it.
        Returns:
        x position
      • setWidthWithText

        public void setWidthWithText​(int width)
        Sets the full width of the event width and the text and images that come after it.
        Parameters:
        width - x width
      • getAdvancedTooltip

        public AdvancedTooltip getAdvancedTooltip()
        Returns the currently set Advanced tooltip, or null if none is set.
        Returns:
        Advanced tooltip
      • setAdvancedTooltip

        public void setAdvancedTooltip​(AdvancedTooltip advancedTooltip)
        Sets the advanced tooltip. If none is set, a default tooltip will be used.
        Parameters:
        advancedTooltip -
      • getFixedRowHeight

        public int getFixedRowHeight()
        Returns the fixed row height in pixels.
        Specified by:
        getFixedRowHeight in interface IGanttChartItem
        Returns:
        Fixed row height
      • setFixedRowHeight

        public void setFixedRowHeight​(int fixedRowHeight)
        Sets the fixed row height in pixels.
        Specified by:
        setFixedRowHeight in interface IGanttChartItem
        Parameters:
        fixedRowHeight - Fixed row height
      • isAutomaticRowHeight

        public boolean isAutomaticRowHeight()
        Whether the row height is calculated automatically or if it's fixed
        Specified by:
        isAutomaticRowHeight in interface IGanttChartItem
        Returns:
        true if automatic
      • setAutomaticRowHeight

        public void setAutomaticRowHeight()
        Resets the row height to be calculated automatically should the row height have been set to a specific value.
        Specified by:
        setAutomaticRowHeight in interface IGanttChartItem
      • getVerticalEventAlignment

        public int getVerticalEventAlignment()
        Returns the vertical alignment set. Alignments are only valid if the row height is a fixed value.
        Returns:
        Row alignment, one of SWT.TOP, SWT.CENTER, SWT.BOTTOM. Default is SWT.TOP.
      • setVerticalEventAlignment

        public void setVerticalEventAlignment​(int verticalEventAlignment)
        Sets the vertical alignment for this event. Alignments are only valid if the row height is a fixed value.
        Parameters:
        verticalEventAlignment - one of SWT.TOP, SWT.CENTER, SWT.BOTTOM
      • isResizable

        public boolean isResizable()
        Whether this event is resizable. If resizing is turned off in the settings this method does nothing.
        Returns:
        true if resizable. Default is true.
      • setResizable

        public void setResizable​(boolean resizable)
        Sets this event to be resizable or not. If resizing is turned off in the settings this method does nothing.
        Parameters:
        resizable - true to make event resizable.
      • isMoveable

        public boolean isMoveable()
        Whether this event is moveable. If moving is turned off in the settings this method does nothing.
        Returns:
        true if moveable. Default is true.
      • setMoveable

        public void setMoveable​(boolean moveable)
        Sets this event to be moveable or not. If moving is turned off in the settings this method does nothing.
        Parameters:
        resizable - true to make event moveable.
      • getNoMoveBeforeDate

        public java.util.Calendar getNoMoveBeforeDate()
        Returns the date prior to which no moves or resizes are allowed. Any events moved towards or across the date mark will stop at this mark.
        Returns:
        Calendar or null.
      • setNoMoveBeforeDate

        public void setNoMoveBeforeDate​(java.util.Calendar noMoveBeforeDate)
        Sets the date prior to which no moves or resizes are allowed. Any events moved towards or across the date mark will stop at this mark.
        Parameters:
        noMoveBeforeDate - Calendar or null.
      • getNoMoveAfterDate

        public java.util.Calendar getNoMoveAfterDate()
        Returns the date after which no moves or resizes are allowed. Any events moved towards or across the date mark will stop at this mark.
        Returns:
        Calendar or null.
      • setNoMoveAfterDate

        public void setNoMoveAfterDate​(java.util.Calendar noMoveAfterDate)
        Sets the date after which no moves or resizes are allowed. Any events moved towards or across the date mark will stop at this mark.
        Parameters:
        noMoveAfterDate - Calendar or null.
      • getHorizontalTextLocation

        public int getHorizontalTextLocation()
        Returns the location where the event text will be displayed. Default is SWT.RIGHT.
        Returns:
        Event text location
      • setHorizontalTextLocation

        public void setHorizontalTextLocation​(int textLocation)
        Sets the location of where the event text will be displayed. Options are: SWT.LEFT, SWT.CENTER, SWT.RIGHT. Center means the text will be drawn inside the event. Default is SWT.RIGHT.
        Parameters:
        textLocation - Text location, one of SWT.LEFT, SWT.CENTER, SWT.RIGHT.
      • getVerticalTextLocation

        public int getVerticalTextLocation()
        Returns the lcoation where the event text will be displayed vertically. Default is SWT.CENTER which is right behind the event itself.
        Returns:
        Vertical text location.
      • setVerticalTextLocation

        public void setVerticalTextLocation​(int verticalTextLocation)
        Sets the vertical location where the event text will be displayed. Options are: SWT.TOP, SWT.CENTER, SWT.BOTTOM. Default is SWT.CENTER.
        Parameters:
        verticalTextLocation - Vertical text location
      • getTextFont

        public org.eclipse.swt.graphics.Font getTextFont()
        Returns the text font to use when drawing the event text. Default is null.
        Returns:
        Event font
      • setTextFont

        public void setTextFont​(org.eclipse.swt.graphics.Font textFont)
        Sets the text font to use when drawing the event text. Default is null. Setting a font will override any flags for font settings in the Settings implementation.
        Parameters:
        textFont - Font or null.
      • dispose

        public void dispose()
        Removes this item from the chart.
      • getActualDDayStart

        public int getActualDDayStart()
      • getActualDDayEnd

        public int getActualDDayEnd()
      • getDDayStart

        public int getDDayStart()
        Returns the D-day start value.
        Returns:
      • getDDayRevisedStart

        public int getDDayRevisedStart()
      • getDDayRevisedEnd

        public int getDDayRevisedEnd()
      • setDDayStart

        public void setDDayStart​(int day)
        Sets the D-day start value.
        Parameters:
        day -
      • getDDayEnd

        public int getDDayEnd()
      • setDDayEnd

        public void setDDayEnd​(int day)
      • getDDateRange

        public int getDDateRange()
      • getRevisedDDateRange

        public int getRevisedDDateRange()
      • getActualBounds

        public org.eclipse.swt.graphics.Rectangle getActualBounds()
        This takes any text drawing widths into account and returns the bounds as such
        Returns:
        Rectangle of bounds
      • calculateScope

        void calculateScope()
      • hasMovementConstraints

        boolean hasMovementConstraints()
      • getVisibility

        int getVisibility()
      • setVisibility

        void setVisibility​(int visibility)
      • isBoundsSet

        boolean isBoundsSet()
      • setBoundsSet

        void setBoundsSet​(boolean set)
      • setHorizontalLineTopY

        void setHorizontalLineTopY​(int y)
      • getHorizontalLineTopY

        int getHorizontalLineTopY()
      • getHorizontalLineBottomY

        int getHorizontalLineBottomY()
      • setHorizontalLineBottomY

        void setHorizontalLineBottomY​(int y)
      • setNameChanged

        void setNameChanged​(boolean changed)
      • isNameChanged

        boolean isNameChanged()
      • getNameExtent

        org.eclipse.swt.graphics.Point getNameExtent()
      • setNameExtent

        void setNameExtent​(org.eclipse.swt.graphics.Point extent)
      • getParsedString

        java.lang.String getParsedString()
      • setParsedString

        void setParsedString​(java.lang.String parsed)
      • getDaysBetweenStartAndEnd

        int getDaysBetweenStartAndEnd()
      • updateDaysBetweenStartAndEnd

        private final void updateDaysBetweenStartAndEnd()
      • moveStarted

        void moveStarted​(int moveType)
      • getPostMoveOrResizeUndoCommand

        IUndoRedoCommand getPostMoveOrResizeUndoCommand()
        Call after a move/resize is done to get the command to undo/redo the latest move/resize
        Returns:
        Command or null if none of the given move events matched
      • moveCancelled

        void moveCancelled()
      • moveFinished

        void moveFinished()
      • getScopeParent

        public GanttEvent getScopeParent()
        Returns the scope parent of this event if it has one.
        Returns:
        Scope parent
      • setScopeParent

        void setScopeParent​(GanttEvent parent)
      • setEarliestStartX

        void setEarliestStartX​(int x)
      • setLatestEndX

        void setLatestEndX​(int x)
      • getEarliestStartX

        int getEarliestStartX()
      • getLatestEndX

        int getLatestEndX()
      • getActualWidth

        int getActualWidth()
      • updateActualWidth

        void updateActualWidth()
      • flagDragging

        void flagDragging()
      • getPreVerticalDragBounds

        org.eclipse.swt.graphics.Rectangle getPreVerticalDragBounds()
      • undoVerticalDragging

        void undoVerticalDragging()
      • wasVerticallyMovedUp

        boolean wasVerticallyMovedUp()
      • hasMovedVertically

        boolean hasMovedVertically()
      • reparentToNewGanttSection

        public void reparentToNewGanttSection​(int index,
                                              GanttSection newSection)
        Reparents this event from the current GanttSection to a new GanttSection
        Parameters:
        index - index to put event at in new section
        newSection - new section to put event in
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • setNoUpdatePlannedDates

        public void setNoUpdatePlannedDates​(java.util.Calendar start,
                                            java.util.Calendar end)
        Will update planned dates without question or internal checks. This is used internally, it's not recommended to be used externally.
        Parameters:
        start - Date or null
        end - Date or null
      • setNoUpdateRevisedDates

        public void setNoUpdateRevisedDates​(java.util.Calendar start,
                                            java.util.Calendar end)
        Will update revised dates without question or internal checks. This is used internally, it's not recommended to be used externally.
        Parameters:
        start - Date or null
        end - Date or null
      • clone

        public java.lang.Object clone()
                               throws java.lang.CloneNotSupportedException
        Clones the GanttEvent and all objects of it (assuming they are cloneable). The clone should be exactly like the original except for a possible few internal flags. The clone does not need to be re-added to the chart, but if it needs to exist below a certain parent it will need to be re-added to that parent (such as a scope).
        Overrides:
        clone in class java.lang.Object
        Throws:
        java.lang.CloneNotSupportedException
      • isShowText

        public boolean isShowText()
        Returns:
        the _showText
      • setShowText

        public void setShowText​(boolean _showText)
        Parameters:
        _showText - the _showText to set