Class GanttPhase


  • public final class GanttPhase
    extends java.lang.Object
    This class represents one GanttPhase in the chart. A phase is basically a background color and a title that spans over two dates. It's merely a visual aid to help users locate certain "important date ranges" in the chart.

    Compared to a recurring date range a Phase can be moved / resized by the user and also has a title.

    • Field Detail

      • _startDate

        private java.util.Calendar _startDate
      • _endDate

        private java.util.Calendar _endDate
      • _title

        private java.lang.String _title
      • _locked

        private boolean _locked
      • _headerBgColor

        private org.eclipse.swt.graphics.Color _headerBgColor
      • _headerFgColor

        private org.eclipse.swt.graphics.Color _headerFgColor
      • _headerTextColor

        private org.eclipse.swt.graphics.Color _headerTextColor
      • _bodyTopColor

        private org.eclipse.swt.graphics.Color _bodyTopColor
      • _bodyBottomColor

        private org.eclipse.swt.graphics.Color _bodyBottomColor
      • _alpha

        private int _alpha
      • _data

        private java.lang.Object _data
      • _hidden

        private boolean _hidden
      • _resizable

        private boolean _resizable
      • _moveable

        private boolean _moveable
      • _drawBorders

        private boolean _drawBorders
      • _borderWidth

        private int _borderWidth
      • _borderColor

        private org.eclipse.swt.graphics.Color _borderColor
      • _start

        private long _start
      • _end

        private long _end
      • _headerFont

        private org.eclipse.swt.graphics.Font _headerFont
      • _allowZeroWidth

        private boolean _allowZeroWidth
      • _headerBounds

        private org.eclipse.swt.graphics.Rectangle _headerBounds
      • _bounds

        private org.eclipse.swt.graphics.Rectangle _bounds
      • _dDayStart

        private int _dDayStart
      • _dDayEnd

        private int _dDayEnd
      • _daysBtwStartEnd

        private int _daysBtwStartEnd
      • _dragStartCal

        private java.util.Calendar _dragStartCal
      • _dragEndCal

        private java.util.Calendar _dragEndCal
      • _dragStartLong

        private long _dragStartLong
      • _dragEndLong

        private long _dragEndLong
    • Constructor Detail

      • GanttPhase

        GanttPhase()
      • GanttPhase

        public GanttPhase​(GanttChart parent,
                          java.lang.String title)
      • GanttPhase

        public GanttPhase​(GanttChart parent,
                          java.util.Calendar start,
                          java.util.Calendar end,
                          java.lang.String title)
    • Method Detail

      • getStartDate

        public java.util.Calendar getStartDate()
      • setStartDate

        public void setStartDate​(java.util.Calendar startDate)
      • getEndDate

        public java.util.Calendar getEndDate()
      • setEndDate

        public void setEndDate​(java.util.Calendar endDate)
      • getTitle

        public java.lang.String getTitle()
      • setTitle

        public void setTitle​(java.lang.String title)
      • isLocked

        public boolean isLocked()
      • setLocked

        public void setLocked​(boolean locked)
      • getHeaderBackgroundColor

        public org.eclipse.swt.graphics.Color getHeaderBackgroundColor()
      • setHeaderBackgroundColor

        public void setHeaderBackgroundColor​(org.eclipse.swt.graphics.Color color)
      • getHeaderForegroundColor

        public org.eclipse.swt.graphics.Color getHeaderForegroundColor()
      • setHeaderForegroundColor

        public void setHeaderForegroundColor​(org.eclipse.swt.graphics.Color color)
      • getBodyTopColor

        public org.eclipse.swt.graphics.Color getBodyTopColor()
      • setBodyTopColor

        public void setBodyTopColor​(org.eclipse.swt.graphics.Color bodyTopColor)
      • getBodyBottomColor

        public org.eclipse.swt.graphics.Color getBodyBottomColor()
      • setBodyBottomColor

        public void setBodyBottomColor​(org.eclipse.swt.graphics.Color bodyBottomColor)
      • getAlpha

        public int getAlpha()
      • setAlpha

        public void setAlpha​(int alpha)
      • getData

        public java.lang.Object getData()
      • setData

        public void setData​(java.lang.Object data)
      • isHidden

        public boolean isHidden()
      • setHidden

        public void setHidden​(boolean hidden)
      • isResizable

        public boolean isResizable()
      • setResizable

        public void setResizable​(boolean resizable)
      • isMoveable

        public boolean isMoveable()
      • setMoveable

        public void setMoveable​(boolean moveable)
      • getHeaderFont

        public org.eclipse.swt.graphics.Font getHeaderFont()
      • setHeaderFont

        public void setHeaderFont​(org.eclipse.swt.graphics.Font headerFont)
      • isDrawBorders

        public boolean isDrawBorders()
      • setDrawBorders

        public void setDrawBorders​(boolean drawBorders)
      • getBorderWidth

        public int getBorderWidth()
      • setBorderWidth

        public void setBorderWidth​(int borderWidth)
      • getBorderColor

        public org.eclipse.swt.graphics.Color getBorderColor()
      • setBorderColor

        public void setBorderColor​(org.eclipse.swt.graphics.Color borderColor)
      • setStart

        public void setStart​(long start)
      • setEnd

        public void setEnd​(long end)
      • getHeaderTextColor

        public org.eclipse.swt.graphics.Color getHeaderTextColor()
      • setHeaderTextColor

        public void setHeaderTextColor​(org.eclipse.swt.graphics.Color headerTextColor)
      • 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)
      • updateDaysBetweenStartAndEnd

        private void updateDaysBetweenStartAndEnd()
      • isAllowZeroWidth

        boolean isAllowZeroWidth()
      • setAllowZeroWidth

        void setAllowZeroWidth​(boolean allowZeroWidth)
      • getHeaderBounds

        org.eclipse.swt.graphics.Rectangle getHeaderBounds()
      • setHeaderBounds

        void setHeaderBounds​(org.eclipse.swt.graphics.Rectangle headerBounds)
      • getBounds

        org.eclipse.swt.graphics.Rectangle getBounds()
      • setBounds

        void setBounds​(org.eclipse.swt.graphics.Rectangle bounds)
      • getStart

        long getStart()
      • getEnd

        long getEnd()
      • isDisplayable

        boolean isDisplayable()
      • overlaps

        boolean overlaps​(GanttPhase other)
      • willOverlapResize

        boolean willOverlapResize​(GanttPhase other,
                                  int calType,
                                  int val,
                                  boolean start)
      • move

        void move​(int calType,
                  int val)
      • moveStart

        void moveStart​(int calType,
                       int val)
      • moveEnd

        void moveEnd​(int calType,
                     int val)
      • getDaysBetweenStartAndEnd

        int getDaysBetweenStartAndEnd()
      • markDragStart

        void markDragStart()
      • undoLastDragDrop

        void undoLastDragDrop()