Class GanttComposite
- java.lang.Object
-
- org.eclipse.swt.widgets.Widget
-
- org.eclipse.swt.widgets.Control
-
- org.eclipse.swt.widgets.Scrollable
-
- org.eclipse.swt.widgets.Composite
-
- org.eclipse.swt.widgets.Canvas
-
- org.eclipse.nebula.widgets.ganttchart.GanttComposite
-
- All Implemented Interfaces:
java.util.EventListener,IZoomHandler,org.eclipse.swt.events.KeyListener,org.eclipse.swt.events.MouseListener,org.eclipse.swt.events.MouseMoveListener,org.eclipse.swt.events.MouseTrackListener,org.eclipse.swt.graphics.Drawable,org.eclipse.swt.internal.SWTEventListener
public final class GanttComposite extends org.eclipse.swt.widgets.Canvas implements org.eclipse.swt.events.MouseListener, org.eclipse.swt.events.MouseMoveListener, org.eclipse.swt.events.MouseTrackListener, org.eclipse.swt.events.KeyListener, IZoomHandler
The GanttComposite is the workhorse of the GANTT chart. It contains a few public methods available for use, but most of the functionality is private.
There is a serious amount of calculation done in this chart, it's about 80% calculation and 20% drawing. In fact, most of the drawing is delegated to other classes.
A lot of settings method calls are set as class variables, but some are called straight off the settings object. The logic isn't that deep, it's mostly just the over-and-over used variables that get class members. Slow stuff is cached, such as the use ofgc.stringExtent(), image rotation and so on. Anything that is slow _should_ be cached as it is a slowdown to the chart. A redraw should be as fast as possible and whenever possible should be specific to certain bounds instead of a full redraw.
This class may not be subclassed.
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.Set<java.lang.Object>_allEventsCombinedprivate org.eclipse.swt.graphics.Color_arrowColorprivate int_autoScrollDirprivate int_bottomMostYprivate int_calStartOffsetprivate IColorManager_colorManagerprivate int_currentViewprivate int_cursorprivate java.util.Map<java.lang.String,org.eclipse.swt.graphics.Point>_dayLetterStringExtentMapprivate int_daysVisibleprivate int_dayWidthprivate java.util.Calendar_dDayCalendarprivate java.util.Locale_defaultLocaleprivate java.util.List<GanttEvent>_dragEventsprivate boolean_draggingprivate GanttPhase_dragPhaseprivate java.util.Calendar_dragStartDateprivate org.eclipse.swt.graphics.Point_dragStartLocprivate boolean_drawHorizontalLinesprivate boolean_drawToMinuteprivate boolean_drawVerticalLinesprivate java.util.Calendar_endCalendarprivate int_eventHeightprivate java.util.List<IGanttEventListener>_eventListenersprivate int_eventSpacerprivate int_fixedRowHeightprivate boolean_forceSBUpdateprivate boolean_freeDraggingprivate java.util.List<GanttConnection>_ganttConnectionsprivate java.util.List<GanttEvent>_ganttEventsprivate java.util.List<GanttGroup>_ganttGroupsprivate java.util.List<GanttPhase>_ganttPhasesprivate java.util.List<GanttSection>_ganttSectionsprivate java.util.Set<java.lang.Integer>_hiddenLayersprivate org.eclipse.swt.graphics.Color_holidayBGColorBottomprivate org.eclipse.swt.graphics.Color_holidayBGColorTopprivate int_hoursVisibleprivate HorizontalScrollbarHandler_hScrollHandlerprivate int_initialHoursDragOffsetprivate boolean_justStartedMoveOrResizeprivate ILanguageManager_languageManagerprivate boolean_lastLeftprivate int_lastVScrollPosprivate int_lastXprivate int_lastYprivate java.util.Map<java.lang.Integer,java.lang.Integer>_layerOpacityMapprivate org.eclipse.swt.graphics.Color_lineColorprivate org.eclipse.swt.graphics.Color_linePeriodColorprivate org.eclipse.swt.graphics.Color_lineTodayColorprivate org.eclipse.swt.graphics.Color_lineWkDivColorprivate int_lockedHeaderYprivate org.eclipse.swt.graphics.Rectangle_mainBoundsprivate java.util.Calendar_mainCalendarprivate int_minuteDayWidthprivate int_monthDayWidthprivate int_monthWeekWidthprivate org.eclipse.swt.graphics.Point_mouseDragStartLocationprivate boolean_mouseIsDownprivate int_moveAreaInsetsprivate boolean_multiSelectprivate org.eclipse.swt.graphics.Point_originstatic int_osTypeprivate IPaintManager_paintManagerprivate GanttChart_parentChartprivate org.eclipse.swt.graphics.Color_phaseHeaderBGColorBottomprivate org.eclipse.swt.graphics.Color_phaseHeaderBGColorTopprivate boolean_recalcScopesprivate boolean_recalcSecBoundsprivate boolean_resizingprivate org.eclipse.swt.graphics.Color_reverseArrowColorprivate org.eclipse.swt.widgets.Menu_rightClickMenuprivate org.eclipse.swt.graphics.Color_satBGColorBottomprivate org.eclipse.swt.graphics.Color_satBGColorTopprivate org.eclipse.swt.graphics.Color_satTextColorprivate boolean_savingChartImageprivate java.util.List<java.lang.Object>_selectedEventsprivate java.util.List<java.util.Calendar>_selHeaderDatesprivate ISettings_settingsprivate boolean_showNumDaysprivate boolean_showPlannedDatesprivate boolean_showZoomHelperprivate java.util.List<GanttSpecialDateRange>_specDateRangesprivate java.util.Calendar_startCalendarprivate java.util.Map<java.lang.String,org.eclipse.swt.graphics.Point>_stringWidthCacheprivate int_styleprivate org.eclipse.swt.graphics.Color_sunBGColorBottomprivate org.eclipse.swt.graphics.Color_sunBGColorTopprivate org.eclipse.swt.graphics.Color_sunTextColorprivate org.eclipse.swt.graphics.Color_textColorprivate boolean_threeDeeprivate org.eclipse.swt.graphics.Color_timeHeaderBGColorBottomprivate org.eclipse.swt.graphics.Color_timeHeaderBGColorTopprivate org.eclipse.swt.graphics.Color_todayBGColorBottomprivate org.eclipse.swt.graphics.Color_todayBGColorTopprivate int_totVisEventCntprivate org.eclipse.swt.widgets.Tracker_trackerprivate org.eclipse.swt.graphics.Color_txtHeaderBGColorBottomprivate org.eclipse.swt.graphics.Color_txtHeaderBGColorTopprivate GanttUndoRedoManager_undoRedoManagerprivate boolean_useAdvTooltipsprivate boolean_useAlphaprivate VerticalDragDropManager_vDNDManagerprivate int_vDragDirprivate java.util.List<java.lang.Integer>_verticalLineLocationsprivate java.util.Set<java.lang.Integer>_verticalWeekDividerLineLocationsprivate IViewPortHandler2_viewPortHandlerprivate org.eclipse.swt.graphics.Rectangle_visibleBoundsprivate org.eclipse.swt.widgets.ScrollBar_vScrollBarprivate int_vScrollPosprivate org.eclipse.swt.graphics.Color_weekdayTextColorprivate int_weekWidthprivate org.eclipse.swt.graphics.Color_wkBGColorBottomprivate org.eclipse.swt.graphics.Color_wkBGColorTopprivate int_yearDayWidthprivate int_zoomLevelprivate org.eclipse.swt.graphics.Rectangle_zoomLevelAreaprivate boolean_zoomLevelChangedprivate IEventFactoryeventFactoryprivate IEventMenuItemFactoryeventMenuItemFactoryprivate Holiday[]holidaysprivate IMenuItemFactorymenuItemFactoryprivate java.util.List<ISectionDetailMoreClickListener>sectionDetailMoreClickListenerprivate java.util.Map<GanttSection,org.eclipse.swt.graphics.Rectangle>sectionDetailMoreIconsprivate IZoomHandlerzoomHandler
-
Constructor Summary
Constructors Constructor Description GanttComposite(GanttChart parent, int style, ISettings settings, IColorManager colorManager, IPaintManager paintManager, ILanguageManager languageManager)GanttComposite(GanttChart parent, int style, ISettings settings, IColorManager colorManager, IPaintManager paintManager, ILanguageManager languageManager, Holiday[] holidays)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddConnection(GanttEvent source, GanttEvent target)Same as addDependency().voidaddConnection(GanttEvent source, GanttEvent target, org.eclipse.swt.graphics.Color color)Same as addDependency().voidaddDependency(GanttEvent source, GanttEvent target)Adds a connection between two GanttEvents.voidaddDependency(GanttEvent source, GanttEvent target, org.eclipse.swt.graphics.Color color)Adds a connection between two GanttEvents.voidaddEvent(GanttEvent event)Adds a GanttEvent to the chart.voidaddEvent(GanttEvent event, boolean redraw)Adds an GanttEvent to the chart and redraws.voidaddEvent(GanttEvent event, int index)Adds an event at a given index.voidaddGanttEventListener(IGanttEventListener listener)Adds a listener that will be notified of Gantt events.voidaddGroup(GanttGroup group)Adds a GanttGroup to the chart.voidaddPhase(GanttPhase phase)Adds a GanttPhase to the chart.voidaddPhase(GanttPhase phase, boolean redraw)Adds a GanttPhase to the chart with optional redraw call.voidaddSection(GanttSection section)Adds a GanttSection to the chart.voidaddSection(GanttSection section, int index)Adds a GanttSection to the chart.voidaddSelectionDetailClickListener(ISectionDetailMoreClickListener listener)voidaddSpecialDateRange(GanttSpecialDateRange range)Adds aGanttSpecialDateRangeto the chart.voidaddSpecialDateRange(GanttSpecialDateRange range, boolean redraw)Adds aGanttSpecialDateRangeand optionally redraws.private voidcalculateAllScopes(org.eclipse.swt.graphics.Rectangle bounds, GanttSection gs)private intcalculateMinuteAdjustment(java.util.Calendar date)private voidcalculateSectionBounds(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)private voidcalculateVerticalInsertLocations()Calculates where a vertically DND'd event will end up if droppedvoidclearAllSelectedHeaders()Clears all selected headers and redraws the chart.voidclearChart()Clears the entire chart of everything (all types of events) and leaves the chart blank.voidclearGanttEvents()Clears all GanttEvents events from the chart.voidclearGanttGroups()Clears all GanttGroups from the chart.voidclearGanttSections()Clears all GanttSections from the chart.voidclearPhases()Removes all GanttPhases from the chartvoidclearSpecialDateRanges()Removes allGanttSpecialDateRanges and redraws.(package private) voidconnectionAdded(GanttConnection conn)(package private) voidconnectionRemoved(GanttConnection conn)voiddeselectAll()Clears all selected eventsprivate voiddoAutoScroll(int direction)private voiddoAutoScroll(org.eclipse.swt.events.MouseEvent event)Deals with figuring out what direction we are auto-scrolling in, if any.private voiddoMultiSelect(org.eclipse.swt.graphics.Rectangle rect, org.eclipse.swt.events.MouseEvent me)Selects a region of events.private org.eclipse.swt.graphics.PointdrawBend(org.eclipse.swt.graphics.GC gc, int style, int x, int y, boolean rounded)private voiddrawChartOntoGC(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle boundsOverride)private voiddrawConnections(org.eclipse.swt.graphics.GC gc)private voiddrawDDayBottomBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, boolean calculateOnly)private voiddrawDDayTopBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)private voiddrawEvents(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)private voiddrawEvents(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, GanttSection gs)private voiddrawFills(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)private voiddrawFills(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, GanttSection gs)private voiddrawGanttPhases(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, boolean header, GanttSection gs)private voiddrawGanttSpecialDateRanges(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, GanttSection gs)private voiddrawHeader(org.eclipse.swt.graphics.GC gc, boolean calculateOnly)Draws the header but if calculateOnly is set it doesn't actually draw, it only calculates locations of thingsprivate voiddrawHorizontalLines(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)private voiddrawHourBottomBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, boolean calculateOnly)private voiddrawHourTopBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)voiddrawMarker(java.util.Date date)Draws a dotted vertical marker at the given date.private voiddrawMinuteBottomBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, boolean calculateOnly)private voiddrawMinuteTopBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)private voiddrawMonthBottomBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, boolean calculateOnly)private voiddrawMonthTopBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)private voiddrawOneEvent(org.eclipse.swt.graphics.GC gc, GanttEvent ge, org.eclipse.swt.graphics.Rectangle boundsToUse)private voiddrawSectionColumn(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, boolean columnOnly, boolean forceUsageOfBounds, boolean drawCornerOnly, boolean force)private voiddrawSectionDetails(org.eclipse.swt.graphics.GC gc, int x, int y, GanttSection section)private voiddrawSelectionAroundEvent(org.eclipse.swt.graphics.GC gc, GanttEvent ge, int xPos, int yPos, int eventWidth, org.eclipse.swt.graphics.Rectangle bounds)private voiddrawTodayLine(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, int x, int dayOfWeek, org.eclipse.swt.graphics.Color lineColor)private voiddrawTopHorizontalLines(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)private voiddrawVerticalInsertMarkers(org.eclipse.swt.graphics.GC gc)private voiddrawVerticalLines(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, boolean applyVscroll)private voiddrawWeekBottomBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, boolean calculateOnly)private voiddrawWeekTopBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)private voiddrawYearBottomBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, boolean calculateOnly)private voiddrawYearTopBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)private voiddrawZoomLevel(org.eclipse.swt.graphics.GC gc)private voidendAutoScroll()private voidendEverything()(package private) voideventDatesChanged(GanttEvent ge, boolean redraw)private voideventNumbersChanged()private java.lang.StringfixTooltipString(java.lang.String input, java.lang.String name, java.lang.String startDate, java.lang.String endDate, java.lang.String plannedStart, java.lang.String plannedEnd, long days, long plannedDays, int percentageComplete)(package private) voidflagForceFullUpdate()(package private) static org.eclipse.swt.graphics.ImageDataflip(org.eclipse.swt.graphics.ImageData srcData, boolean vertical)(package private) voidforceFullUpdate()java.util.ListgetAllSelectedHeaderDates()Returns a list of all selected header dates (Calendar).GanttEventgetBottomEvent()Returns the bottom most visible event in the current view of the chart.org.eclipse.swt.graphics.RectanglegetBounds()private java.lang.StringgetCurrentDDate()intgetCurrentView()Returns the current view.java.util.CalendargetDate()Returns the current date (left-most date).java.util.CalendargetDateAt(int x)Gets the date for a given x position.private java.lang.StringgetDateString(java.util.Calendar cal, boolean top)private org.eclipse.swt.graphics.ColorgetDayBackgroundGradient(int day, boolean top, GanttSection gs)intgetDaysVisible()private org.eclipse.swt.graphics.ColorgetDayTextColor(int day)intgetDayWidth()Returns the width of one day in the current zoom level.java.util.CalendargetDDayCalendar()Returns (a clone) of the D-Day calendarprivate GanttEventgetEvent(boolean earliest, boolean pixelComparison)private java.util.DategetEventDate(boolean earliest)java.util.ListgetEvents()Returns all events.private java.util.List<java.lang.Object>getEventsDependingOn(GanttEvent ge)private intgetEventVisibility(GanttEvent event, org.eclipse.swt.graphics.Rectangle bounds)private org.eclipse.swt.graphics.RectanglegetFirstStub(GanttConnection con)org.eclipse.swt.graphics.ImagegetFullImage()Returns the image that is the entire chart, regardless of what is currently visible.java.util.ListgetGanttConnections()Returns all currently connected events as a list ofGanttConnectionobjects.java.util.ListgetGanttSections()Returns a list of all GanttSections.java.util.List<GanttGroup>getGroups()Returns a list of all GanttGroups.intgetHeaderHeight()private HolidaygetHoliday(java.util.Calendar day)private org.eclipse.swt.graphics.ColorgetHolidayBackgroundGradient(boolean top, GanttSection gs)org.eclipse.swt.graphics.ImagegetImage()Returns the current visible area of the chart as an imageorg.eclipse.swt.graphics.ImagegetImage(org.eclipse.swt.graphics.Rectangle bounds)Returns the chart as an image for the given bounds.intgetLayerOpacity(int layer)Returns the layer opacity for a layer.(package private) intgetLeftMostPixel()private intgetPixel(boolean left)(package private) intgetRightMostPixel()java.util.CalendargetRootCalendar()Returns the non-cloned root calendar of the chart.java.util.CalendargetRootEndCalendar()Returns the non-cloned root end calendar of the chart.java.util.CalendargetRootStartCalendar()Returns the non-cloned root start calendar of the chart.GanttSectiongetSectionAt(org.eclipse.swt.events.MouseEvent me)Returns a section that corresponds to where the given MouseEvent is firedprivate GanttSectiongetSectionForVerticalDND(GanttEvent event, boolean accountForVerticalDragDirection)Returns a section that corresponds to where the given event is currently hovering overjava.util.List<java.lang.Object>getSelectedEvents()Returns the a list of all currently selected events, or an emtpy list if none.ISettingsgetSettings()intgetStartingXFor(java.util.Calendar date)Returns the starting x for a given date.private intgetStartingXFor(GanttEvent event)intgetStartingXForEventDate(java.util.Calendar date)Returns the starting x position for a given date in the current view.private intgetStartingXForEventHours(java.util.Calendar start)private intgetStartingXForEventHours(GanttEvent event)private java.lang.StringgetStringForEvent(GanttEvent ge)private java.lang.StringgetStringToDisplay(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle area, java.lang.String text)Fetches a dot-concatenated string that will fit the given space.private java.util.ListgetSurroundingVerticalEvents(GanttEvent event, GanttSection section)Returns a list of all surrounding vertical events to a given event.GanttEventgetTopEvent()Returns the topmost visible event in the current view of the chart.intgetTotalVisibileGanttEvents()Returns the number of visible events on in the current viewportGanttUndoRedoManagergetUndoRedoManager()Returns the Undo/Redo manager.org.eclipse.swt.graphics.ImagegetVerticallyFullImage()Returns the chart as an image with the visible horizontal area but showing all information in the chart vertically.IViewPortHandlergetViewPortHandler()org.eclipse.swt.graphics.RectanglegetVisibleBounds()Returns a rectangle with the bounds of what is actually visible inside the chart.intgetXForDate(java.util.Calendar cal)Gets the x position where the given date starts in the current visible area.intgetXForDate(java.util.Date date)Gets the X for a given date.private intgetXLengthForEvent(GanttEvent event)private intgetXLengthForEventHours(GanttEvent event)private voidhandleMove(org.eclipse.swt.events.MouseEvent me, GanttEvent event, int type, boolean showToolTip)Handles the actual moving of an event.private voidhandlePhaseMove(org.eclipse.swt.events.MouseEvent me, GanttPhase phase, int type, boolean showToolTip)private voidhandlePostVerticalDragDrop()This method deals with moving events around so that vertical gaps are filled where they left holes after a vertical drag/dropprivate voidhandleResize(boolean redraw)booleanhasEvent(GanttEvent event)Checks whether the chart has a given event.(package private) booleanhasGanttPhases()(package private) booleanhasGanttSections()(package private) booleanhasSpecialDateRanges()voidheavyRedraw()This will cause a full recaclulation of events and a lot of other things.voidhideAllLayers()Hides all layers and redraws the event area.voidhideLayer(int layer)Hides all layers of the given value and redraws the event area.private voidinitColors()private voidinitListeners()private voidinternalAddEvent(int index, GanttEvent event)private voidinternalAddGroup(int index, GanttGroup group)private voidinternalAddSection(int index, GanttSection section)private voidinternalDrawEvents(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, GanttSection gs)private voidinternalDrawFills(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, GanttSection gs)private org.eclipse.swt.graphics.ColorinternalGetDayBackgroundGradient(int day, boolean top, GanttSection gs)private voidinternalRemoveEvent(GanttEvent event)private voidinternalRemoveGroup(GanttGroup group)private voidinternalRemoveSection(GanttSection section)private voidinternalSetDate(java.util.Calendar date, int side, boolean clearMinutes, boolean redraw)private voidinternalSetDateAtX(int x, java.util.Calendar preZoomDate, boolean clearMinutes, boolean redraw, boolean zoomIn)(package private) booleanisChartReady()booleanisConnected(GanttEvent ge)Returns true if the given event is connected to another.booleanisConnected(GanttEvent source, GanttEvent target)Checks whether two events are connected to each other.(package private) booleanisDDayCalendar()booleanisEventVisible(GanttEvent event, org.eclipse.swt.graphics.Rectangle bounds)Checks whether a certain event is visible in the current bounds.private booleanisInMoveArea(GanttEvent event, int x)private booleanisInside(int x, int y, org.eclipse.swt.graphics.Rectangle rect)private booleanisNoOverlap(java.util.Calendar dat1, java.util.Calendar dat2)booleanisShowingDaysOnEvents()Returns whether event day number drawing is currently on or off.booleanisShowingGanttSections()Whether the chart has gantt sections or notbooleanisShowingPlannedDates()Returns whether planned date drawing is currently on or off.private booleanisUseAdvancedTooltips()voidjumpToEarliestEvent()Moves the calendar to the earliest event date.private voidjumpToEvent(boolean earliestEvent)voidjumpToEvent(GanttEvent event, boolean start, int side)Moves the calendar to a particular event date horizontally.voidjumpToLatestEvent()Moves the calendar to the latest event date.voidjumpToToday()Moves calendar to the current date/time.voidjumpToToday(int side)Moves calendar to the current date/time.voidkeyPressed(org.eclipse.swt.events.KeyEvent e)voidkeyReleased(org.eclipse.swt.events.KeyEvent e)(package private) voidkillDialogs()private voidkillMouseState()voidmouseDoubleClick(org.eclipse.swt.events.MouseEvent me)voidmouseDown(org.eclipse.swt.events.MouseEvent me)voidmouseEnter(org.eclipse.swt.events.MouseEvent event)voidmouseExit(org.eclipse.swt.events.MouseEvent event)voidmouseHover(org.eclipse.swt.events.MouseEvent me)voidmouseMove(org.eclipse.swt.events.MouseEvent me)private voidmouseMoveMinutes(java.lang.String dateFormat, org.eclipse.swt.events.MouseEvent me)voidmouseUp(org.eclipse.swt.events.MouseEvent event)private voidmoveEvent(GanttEvent ge, int diff, int stateMask, org.eclipse.swt.events.MouseEvent me, int type)(package private) voidmoveXBounds(boolean positive)private voidmoveYBounds(int move)voidnextDay()Jumps one day forward.voidnextHour()Jumps to the next hour.voidnextMinute()Jumps to the next hour.voidnextMonth()Jumps to the next month.voidnextWeek()Jumps one week forward.voidprevDay()Jumps one day backwards.voidprevHour()Jumps to the previous hour.voidprevMinute()Jumps to the previous minute.voidprevMonth()Jumps to the previous month.voidprevWeek()Jumps one week backwards.private java.util.SetrecursiveGetEventsDependingOn(GanttEvent ge, GanttMap gm, java.util.Set ret)voidredraw()voidredraw(org.eclipse.swt.graphics.Rectangle rect)private voidredrawEventsArea()voidrefresh()Redraws the calendar should some event not do it automatically.voidreindex(GanttEvent event, int newIndex)Re-indexes an event to a new index.voidreindex(GanttGroup group, int newIndex)Re-indexes a GanttGroup to a new index.voidreindex(GanttSection section, int newIndex)Re-indexes a GanttSection to a new index.booleanremoveEvent(GanttEvent event)Removes a GanttEvent from the chart.voidremoveGanttEventListener(IGanttEventListener listener)Removes a listener from being notified of Gantt events.voidremoveGroup(GanttGroup group)Removes a GanttGroup from the chart.voidremovePhase(GanttPhase phase)Removes a GanttPhase from the chart.voidremovePhase(GanttPhase phase, boolean redraw)Removes a GanttPhase from the chart with optional redraw call.voidremoveSection(GanttSection section)Removes a GanttSection from the chart.voidremoveSelectionDetailClickListener(ISectionDetailMoreClickListener listener)voidremoveSpecialDateRange(GanttSpecialDateRange range)Removes aGanttSpecialDateRangeto the chart and redraws.voidremoveSpecialDateRange(GanttSpecialDateRange range, boolean redraw)Removes aGanttSpecialDateRangeto the chart and redraws.private voidrepaint(org.eclipse.swt.events.PaintEvent event)voidresetZoom()Resets the zoom level to that set in the settings.(package private) static org.eclipse.swt.graphics.ImageDatarotate(org.eclipse.swt.graphics.ImageData srcData, int direction)voidselectAll()Selects all eventsvoidsetDate(java.util.Calendar date)Sets the calendar date.voidsetDate(java.util.Calendar date, boolean applyOffset)Sets the new date of the calendar and redraws.private voidsetDate(java.util.Calendar date, boolean applyOffset, boolean redraw)voidsetDate(java.util.Calendar date, int side)Sets the calendar date to the given date and shows it on the chart.voidsetDate(java.util.Calendar date, int side, boolean clearMinutes)Sets the calendar date to the given date and shows it on the chart.voidsetDrawHorizontalLinesOverride(boolean drawHorizontal)Setting this to true will force horizontal lines to draw despite what may be set in the settings.voidsetDrawVerticalLinesOverride(boolean drawVertical)Setting this to true will force vertical lines to draw despite what may be set in the settings.voidsetEventFactory(IEventFactory factory)voidsetEventMenuItemFactory(IEventMenuItemFactory factory)voidsetEventSpacerOverride(int height)Setting a fixed event spacer overrides all individual event space settings on chart items and all settings.voidsetFixedRowHeightOverride(int height)Setting a fixed row height override causes all rows to be the set height regardless of individual row heights set on items themselves and all settings.voidsetHolidays(Holiday[] holidays)voidsetLayerOpacity(int layer, int opacity)Sets the drawing opacity for a layer.voidsetMenuItemFactory(IMenuItemFactory factory)(package private) voidsetNoRecalc()voidsetSelectedHeaderDates(java.util.List dates)Sets a list of header dates that should be the selected dates.voidsetSelection(java.util.List list)Sets the selection to be a set of GanttEvents.voidsetSelection(GanttEvent event)Sets the selection to be a specific GanttEvent.voidsetShowDaysOnEvents(boolean showDates)Flag whether to show the number of days on events.voidsetShowPlannedDates(boolean showPlanned)Flag whether to show planned dates or not.voidsetTopItem(GanttEvent ge, int side)Sets the top visible item in the chart and scrolls to show it.voidsetTopItem(GanttEvent ge, int yOffset, int side)Sets the top visible item in the chart and scrolls to show it.voidsetUseAdvancedTooltips(boolean useAdvancedTooltips)Sets whether to use advanced tooltips or not.voidsetView(int view)Sets the current view.voidsetViewPortHandler(IViewPortHandler2 vph)voidsetZoomHandler(IZoomHandler zoomHandler)voidsetZoomLevel(int level)Sets the zoom level.voidshowAllLayers()Shows all layers and redraws the event area.voidshowEvent(GanttEvent ge, int side)Scrolls the chart to the selected item regardless if it is visible or not.voidshowLayer(int layer)Shows all layers of the given value and redraws the event area.private voidshowMenu(int x, int y, GanttEvent event, org.eclipse.swt.events.MouseEvent me)(package private) voidshowScrollDate()private voidshowTooltip(GanttEvent event, org.eclipse.swt.events.MouseEvent me)private voidshowTooltip(Holiday holiday, org.eclipse.swt.events.MouseEvent me)private voidstartMidnightThread()private voidupdateEventVisibilities(org.eclipse.swt.graphics.Rectangle bounds)(package private) voidupdateHorizontalScrollbar()private voidupdateScopeXY(GanttEvent ge)(package private) voidupdateVerticalScrollBar(boolean redraw)private voidupdateZoomLevel()voidvScroll()private voidvScroll(org.eclipse.swt.widgets.Event event)private voidvScrollToY(int yPos, boolean redraw)voidzoomIn()Zooms in.voidzoomIn(boolean fromMouseWheel, org.eclipse.swt.graphics.Point mouseLoc)voidzoomOut()Zooms out.voidzoomOut(boolean fromMouseWheel, org.eclipse.swt.graphics.Point mouseLoc)-
Methods inherited from class org.eclipse.swt.widgets.Canvas
drawBackground, getCaret, getIME, scroll, setCaret, setFont, setIME
-
Methods inherited from class org.eclipse.swt.widgets.Composite
changed, checkSubclass, drawBackground, getBackgroundMode, getChildren, getLayout, getLayoutDeferred, getTabList, isLayoutDeferred, layout, layout, layout, layout, layout, setBackgroundMode, setFocus, setLayout, setLayoutDeferred, setTabList
-
Methods inherited from class org.eclipse.swt.widgets.Scrollable
computeTrim, getClientArea, getHorizontalBar, getScrollbarsMode, getVerticalBar
-
Methods inherited from class org.eclipse.swt.widgets.Control
addControlListener, addDragDetectListener, addFocusListener, addGestureListener, addHelpListener, addKeyListener, addMenuDetectListener, addMouseListener, addMouseMoveListener, addMouseTrackListener, addMouseWheelListener, addPaintListener, addTouchListener, addTraverseListener, computeSize, computeSize, dragDetect, dragDetect, forceFocus, getAccessible, getBackground, getBackgroundImage, getBorderWidth, getCursor, getDragDetect, getEnabled, getFont, getForeground, getLayoutData, getLocation, getMenu, getMonitor, getOrientation, getParent, getRegion, getShell, getSize, getTextDirection, getToolTipText, getTouchEnabled, getVisible, internal_dispose_GC, internal_new_GC, isAutoScalable, isEnabled, isFocusControl, isReparentable, isVisible, moveAbove, moveBelow, pack, pack, print, redraw, removeControlListener, removeDragDetectListener, removeFocusListener, removeGestureListener, removeHelpListener, removeKeyListener, removeMenuDetectListener, removeMouseListener, removeMouseMoveListener, removeMouseTrackListener, removeMouseWheelListener, removePaintListener, removeTouchListener, removeTraverseListener, requestLayout, setBackground, setBackgroundImage, setBounds, setBounds, setCapture, setCursor, setDragDetect, setEnabled, setForeground, setLayoutData, setLocation, setLocation, setMenu, setOrientation, setParent, setRedraw, setRegion, setSize, setSize, setTextDirection, setToolTipText, setTouchEnabled, setVisible, toControl, toControl, toDisplay, toDisplay, traverse, traverse, traverse, update
-
Methods inherited from class org.eclipse.swt.widgets.Widget
addDisposeListener, addListener, checkWidget, dispose, getData, getData, getDisplay, getListeners, getStyle, isAutoDirection, isDisposed, isListening, notifyListeners, removeDisposeListener, removeListener, removeListener, reskin, setData, setData, toString
-
-
-
-
Field Detail
-
_osType
public static int _osType
-
_parentChart
private final GanttChart _parentChart
-
_autoScrollDir
private int _autoScrollDir
-
_showZoomHelper
private boolean _showZoomHelper
-
_zoomLevelArea
private org.eclipse.swt.graphics.Rectangle _zoomLevelArea
-
_zoomLevel
private int _zoomLevel
-
_zoomLevelChanged
private boolean _zoomLevelChanged
-
_forceSBUpdate
private boolean _forceSBUpdate
-
_currentView
private int _currentView
-
_threeDee
private boolean _threeDee
-
_showNumDays
private boolean _showNumDays
-
_showPlannedDates
private boolean _showPlannedDates
-
_calStartOffset
private final int _calStartOffset
-
_moveAreaInsets
private final int _moveAreaInsets
-
_yearDayWidth
private int _yearDayWidth
-
_monthDayWidth
private int _monthDayWidth
-
_monthWeekWidth
private int _monthWeekWidth
-
_minuteDayWidth
private int _minuteDayWidth
-
_dayWidth
private int _dayWidth
-
_weekWidth
private int _weekWidth
-
_bottomMostY
private int _bottomMostY
-
_lineTodayColor
private org.eclipse.swt.graphics.Color _lineTodayColor
-
_linePeriodColor
private org.eclipse.swt.graphics.Color _linePeriodColor
-
_lineColor
private org.eclipse.swt.graphics.Color _lineColor
-
_lineWkDivColor
private org.eclipse.swt.graphics.Color _lineWkDivColor
-
_textColor
private org.eclipse.swt.graphics.Color _textColor
-
_satBGColorTop
private org.eclipse.swt.graphics.Color _satBGColorTop
-
_satBGColorBottom
private org.eclipse.swt.graphics.Color _satBGColorBottom
-
_weekdayTextColor
private org.eclipse.swt.graphics.Color _weekdayTextColor
-
_satTextColor
private org.eclipse.swt.graphics.Color _satTextColor
-
_sunTextColor
private org.eclipse.swt.graphics.Color _sunTextColor
-
_sunBGColorTop
private org.eclipse.swt.graphics.Color _sunBGColorTop
-
_sunBGColorBottom
private org.eclipse.swt.graphics.Color _sunBGColorBottom
-
_holidayBGColorTop
private org.eclipse.swt.graphics.Color _holidayBGColorTop
-
_holidayBGColorBottom
private org.eclipse.swt.graphics.Color _holidayBGColorBottom
-
_wkBGColorTop
private org.eclipse.swt.graphics.Color _wkBGColorTop
-
_wkBGColorBottom
private org.eclipse.swt.graphics.Color _wkBGColorBottom
-
_txtHeaderBGColorTop
private org.eclipse.swt.graphics.Color _txtHeaderBGColorTop
-
_txtHeaderBGColorBottom
private org.eclipse.swt.graphics.Color _txtHeaderBGColorBottom
-
_timeHeaderBGColorTop
private org.eclipse.swt.graphics.Color _timeHeaderBGColorTop
-
_timeHeaderBGColorBottom
private org.eclipse.swt.graphics.Color _timeHeaderBGColorBottom
-
_phaseHeaderBGColorTop
private org.eclipse.swt.graphics.Color _phaseHeaderBGColorTop
-
_phaseHeaderBGColorBottom
private org.eclipse.swt.graphics.Color _phaseHeaderBGColorBottom
-
_arrowColor
private org.eclipse.swt.graphics.Color _arrowColor
-
_reverseArrowColor
private org.eclipse.swt.graphics.Color _reverseArrowColor
-
_todayBGColorTop
private org.eclipse.swt.graphics.Color _todayBGColorTop
-
_todayBGColorBottom
private org.eclipse.swt.graphics.Color _todayBGColorBottom
-
_selectedEvents
private final java.util.List<java.lang.Object> _selectedEvents
-
_mainCalendar
private java.util.Calendar _mainCalendar
-
_startCalendar
private java.util.Calendar _startCalendar
-
_endCalendar
private java.util.Calendar _endCalendar
-
_daysVisible
private int _daysVisible
-
_hoursVisible
private int _hoursVisible
-
_ganttEvents
private final java.util.List<GanttEvent> _ganttEvents
-
_ganttConnections
private final java.util.List<GanttConnection> _ganttConnections
-
_dayLetterStringExtentMap
private final java.util.Map<java.lang.String,org.eclipse.swt.graphics.Point> _dayLetterStringExtentMap
-
_dragging
private boolean _dragging
-
_resizing
private boolean _resizing
-
_dragStartLoc
private org.eclipse.swt.graphics.Point _dragStartLoc
-
_freeDragging
private boolean _freeDragging
-
_vDragDir
private int _vDragDir
-
_lastX
private int _lastX
-
_lastY
private int _lastY
-
_cursor
private int _cursor
-
_dragEvents
private java.util.List<GanttEvent> _dragEvents
-
_dragPhase
private GanttPhase _dragPhase
-
_lastLeft
private boolean _lastLeft
-
_dragStartDate
private java.util.Calendar _dragStartDate
-
_justStartedMoveOrResize
private boolean _justStartedMoveOrResize
-
_initialHoursDragOffset
private int _initialHoursDragOffset
-
_settings
private final ISettings _settings
-
_colorManager
private final IColorManager _colorManager
-
_paintManager
private final IPaintManager _paintManager
-
_languageManager
private final ILanguageManager _languageManager
-
_eventListeners
private final java.util.List<IGanttEventListener> _eventListeners
-
_mouseIsDown
private boolean _mouseIsDown
-
_mouseDragStartLocation
private org.eclipse.swt.graphics.Point _mouseDragStartLocation
-
_ganttGroups
private final java.util.List<GanttGroup> _ganttGroups
-
_ganttSections
private final java.util.List<GanttSection> _ganttSections
-
_rightClickMenu
private org.eclipse.swt.widgets.Menu _rightClickMenu
-
_useAdvTooltips
private boolean _useAdvTooltips
-
_useAlpha
private boolean _useAlpha
-
_mainBounds
private org.eclipse.swt.graphics.Rectangle _mainBounds
-
_visibleBounds
private org.eclipse.swt.graphics.Rectangle _visibleBounds
-
_defaultLocale
private final java.util.Locale _defaultLocale
-
_eventHeight
private final int _eventHeight
-
_recalcScopes
private boolean _recalcScopes
-
_recalcSecBounds
private boolean _recalcSecBounds
-
_allEventsCombined
private final java.util.Set<java.lang.Object> _allEventsCombined
-
_verticalLineLocations
private final java.util.List<java.lang.Integer> _verticalLineLocations
-
_verticalWeekDividerLineLocations
private final java.util.Set<java.lang.Integer> _verticalWeekDividerLineLocations
-
_hiddenLayers
private final java.util.Set<java.lang.Integer> _hiddenLayers
-
_layerOpacityMap
private final java.util.Map<java.lang.Integer,java.lang.Integer> _layerOpacityMap
-
_eventSpacer
private int _eventSpacer
-
_fixedRowHeight
private int _fixedRowHeight
-
_drawVerticalLines
private boolean _drawVerticalLines
-
_drawHorizontalLines
private boolean _drawHorizontalLines
-
_lockedHeaderY
private int _lockedHeaderY
-
_vScrollPos
private int _vScrollPos
-
_origin
private final org.eclipse.swt.graphics.Point _origin
-
_lastVScrollPos
private int _lastVScrollPos
-
_vScrollBar
private org.eclipse.swt.widgets.ScrollBar _vScrollBar
-
_selHeaderDates
private java.util.List<java.util.Calendar> _selHeaderDates
-
_style
private final int _style
-
_tracker
private org.eclipse.swt.widgets.Tracker _tracker
-
_multiSelect
private final boolean _multiSelect
-
_dDayCalendar
private java.util.Calendar _dDayCalendar
-
_hScrollHandler
private HorizontalScrollbarHandler _hScrollHandler
-
_viewPortHandler
private IViewPortHandler2 _viewPortHandler
-
_savingChartImage
private boolean _savingChartImage
-
_ganttPhases
private final java.util.List<GanttPhase> _ganttPhases
-
_specDateRanges
private final java.util.List<GanttSpecialDateRange> _specDateRanges
-
_stringWidthCache
private final java.util.Map<java.lang.String,org.eclipse.swt.graphics.Point> _stringWidthCache
-
_totVisEventCnt
private int _totVisEventCnt
-
_vDNDManager
private final VerticalDragDropManager _vDNDManager
-
_undoRedoManager
private final GanttUndoRedoManager _undoRedoManager
-
_drawToMinute
private boolean _drawToMinute
-
eventFactory
private IEventFactory eventFactory
-
eventMenuItemFactory
private IEventMenuItemFactory eventMenuItemFactory
-
menuItemFactory
private IMenuItemFactory menuItemFactory
-
holidays
private Holiday[] holidays
-
zoomHandler
private IZoomHandler zoomHandler
-
sectionDetailMoreIcons
private java.util.Map<GanttSection,org.eclipse.swt.graphics.Rectangle> sectionDetailMoreIcons
-
sectionDetailMoreClickListener
private final java.util.List<ISectionDetailMoreClickListener> sectionDetailMoreClickListener
-
-
Constructor Detail
-
GanttComposite
public GanttComposite(GanttChart parent, int style, ISettings settings, IColorManager colorManager, IPaintManager paintManager, ILanguageManager languageManager)
-
GanttComposite
public GanttComposite(GanttChart parent, int style, ISettings settings, IColorManager colorManager, IPaintManager paintManager, ILanguageManager languageManager, Holiday[] holidays)
-
-
Method Detail
-
startMidnightThread
private void startMidnightThread()
-
initListeners
private void initListeners()
-
vScroll
public void vScroll()
-
vScroll
private void vScroll(org.eclipse.swt.widgets.Event event)
-
updateVerticalScrollBar
void updateVerticalScrollBar(boolean redraw)
-
handleResize
private void handleResize(boolean redraw)
-
initColors
private void initColors()
-
getDate
public java.util.Calendar getDate()
Returns the current date (left-most date).- Returns:
-
getRootCalendar
public java.util.Calendar getRootCalendar()
Returns the non-cloned root calendar of the chart. DO NOT modify this outside of the chart. This method is considered internal public and will be removed later.- Returns:
- Calendar
-
getRootEndCalendar
public java.util.Calendar getRootEndCalendar()
Returns the non-cloned root end calendar of the chart. DO NOT modify this outside of the chart. This method is considered internal public and will be removed later.- Returns:
- Calendar
-
getRootStartCalendar
public java.util.Calendar getRootStartCalendar()
Returns the non-cloned root start calendar of the chart. DO NOT modify this outside of the chart. This method is considered internal public and will be removed later.- Returns:
- Calendar
-
hideLayer
public void hideLayer(int layer)
Hides all layers of the given value and redraws the event area.- Parameters:
layer- Layer to hide.
-
showLayer
public void showLayer(int layer)
Shows all layers of the given value and redraws the event area.- Parameters:
layer- Layer to show.
-
redraw
public void redraw(org.eclipse.swt.graphics.Rectangle rect)
-
showAllLayers
public void showAllLayers()
Shows all layers and redraws the event area.
-
hideAllLayers
public void hideAllLayers()
Hides all layers and redraws the event area.
-
setLayerOpacity
public void setLayerOpacity(int layer, int opacity)Sets the drawing opacity for a layer. Do note that this may reduce the drawing speed of the chart by a lot. The opacity range is from 0 to 255. Note that if alpha settings are turned on in settings, those values will still be used, so it may be wise to turn them off if you are doing layer blending.- Parameters:
layer- Layer to set opacity onopacity- Opacity between 0 and 255
-
getLayerOpacity
public int getLayerOpacity(int layer)
Returns the layer opacity for a layer.- Parameters:
layer- Layer to get opacity for- Returns:
- Layer opacity, -1 if layer has no opacity set.
-
setFixedRowHeightOverride
public void setFixedRowHeightOverride(int height)
Setting a fixed row height override causes all rows to be the set height regardless of individual row heights set on items themselves and all settings.- Parameters:
height- Height to set. Set to zero to turn off.
-
setEventSpacerOverride
public void setEventSpacerOverride(int height)
Setting a fixed event spacer overrides all individual event space settings on chart items and all settings.- Parameters:
height- Height to set. Set to zero to turn off.
-
setDrawHorizontalLinesOverride
public void setDrawHorizontalLinesOverride(boolean drawHorizontal)
Setting this to true will force horizontal lines to draw despite what may be set in the settings.- Parameters:
drawHorizontal- true to draw horizontal lines.
-
setDrawVerticalLinesOverride
public void setDrawVerticalLinesOverride(boolean drawVertical)
Setting this to true will force vertical lines to draw despite what may be set in the settings.- Parameters:
drawVertical- true to draw vertical lines.
-
setSelection
public void setSelection(GanttEvent event)
Sets the selection to be a specific GanttEvent. This method will cause a redraw.- Parameters:
event- GanttEvent to select
-
setSelection
public void setSelection(java.util.List list)
Sets the selection to be a set of GanttEvents. If the chart is set toSWT.SINGLEyou should be usingsetSelection(GanttEvent)as this method will do nothing. This method will cause a redraw.- Parameters:
list- List of GanttEvents to select
-
addGroup
public void addGroup(GanttGroup group)
Adds a GanttGroup to the chart.- Parameters:
group- Group to add
-
getGroups
public java.util.List<GanttGroup> getGroups()
Returns a list of all GanttGroups.- Returns:
- List of GanttGroups
-
removeGroup
public void removeGroup(GanttGroup group)
Removes a GanttGroup from the chart.- Parameters:
group- Group to remove
-
addSection
public void addSection(GanttSection section)
Adds a GanttSection to the chart.- Parameters:
section- Section to add
-
addSection
public void addSection(GanttSection section, int index)
Adds a GanttSection to the chart.- Parameters:
section- Section to addindex- the index to add the Section at
-
removeSection
public void removeSection(GanttSection section)
Removes a GanttSection from the chart.- Parameters:
section- Section to remove
-
getGanttSections
public java.util.List getGanttSections()
Returns a list of all GanttSections.- Returns:
- List of GanttSections.
-
showScrollDate
void showScrollDate()
-
getTopEvent
public GanttEvent getTopEvent()
Returns the topmost visible event in the current view of the chart.- Returns:
- GanttEvent or null
-
getBottomEvent
public GanttEvent getBottomEvent()
Returns the bottom most visible event in the current view of the chart.- Returns:
- GanttEvent or null
-
killDialogs
void killDialogs()
-
repaint
private void repaint(org.eclipse.swt.events.PaintEvent event)
-
drawChartOntoGC
private void drawChartOntoGC(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle boundsOverride)
-
setShowPlannedDates
public void setShowPlannedDates(boolean showPlanned)
Flag whether to show planned dates or not. This will override any settings value and will cause a redraw.- Parameters:
showPlanned- true to show planned dates
-
isShowingPlannedDates
public boolean isShowingPlannedDates()
Returns whether planned date drawing is currently on or off.- Returns:
- true if on
-
setShowDaysOnEvents
public void setShowDaysOnEvents(boolean showDates)
Flag whether to show the number of days on events. This will override any settings value and will cause a redraw.- Parameters:
showDates-
-
isShowingDaysOnEvents
public boolean isShowingDaysOnEvents()
Returns whether event day number drawing is currently on or off.- Returns:
- true if on
-
isShowingGanttSections
public boolean isShowingGanttSections()
Whether the chart has gantt sections or not- Returns:
- true if has gantt sections
-
drawHeader
private void drawHeader(org.eclipse.swt.graphics.GC gc, boolean calculateOnly)Draws the header but if calculateOnly is set it doesn't actually draw, it only calculates locations of things
-
showMenu
private void showMenu(int x, int y, GanttEvent event, org.eclipse.swt.events.MouseEvent me)
-
getSelectedEvents
public java.util.List<java.lang.Object> getSelectedEvents()
Returns the a list of all currently selected events, or an emtpy list if none.- Returns:
- GanttEvent or null
-
setTopItem
public void setTopItem(GanttEvent ge, int yOffset, int side)
Sets the top visible item in the chart and scrolls to show it. Passing SWT.NONE prevents any horizontal alignment from occurring.- Parameters:
ge- Event to showyOffset- y offset modifierside- one ofSWT.LEFT,SWT.CENTER,SWT.RIGHT,SWT.NONE
-
setTopItem
public void setTopItem(GanttEvent ge, int side)
Sets the top visible item in the chart and scrolls to show it. Passing SWT.NONE prevents any horizontal alignment from occurring.- Parameters:
ge- Event to showside- one ofSWT.LEFT,SWT.CENTER,SWT.RIGHT,SWT.NONE
-
showEvent
public void showEvent(GanttEvent ge, int side)
Scrolls the chart to the selected item regardless if it is visible or not.- Parameters:
ge- GanttEvent to scroll to.side- one ofSWT.LEFT,SWT.CENTER,SWT.RIGHT
-
vScrollToY
private void vScrollToY(int yPos, boolean redraw)
-
getBounds
public org.eclipse.swt.graphics.Rectangle getBounds()
- Overrides:
getBoundsin classorg.eclipse.swt.widgets.Control
-
calculateSectionBounds
private void calculateSectionBounds(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)
-
getHeaderHeight
public int getHeaderHeight()
-
drawFills
private void drawFills(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, GanttSection gs)
-
drawFills
private void drawFills(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)
-
internalDrawFills
private void internalDrawFills(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, GanttSection gs)
-
getHoliday
private Holiday getHoliday(java.util.Calendar day)
-
drawZoomLevel
private void drawZoomLevel(org.eclipse.swt.graphics.GC gc)
-
drawSectionColumn
private void drawSectionColumn(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, boolean columnOnly, boolean forceUsageOfBounds, boolean drawCornerOnly, boolean force)
-
drawSectionDetails
private void drawSectionDetails(org.eclipse.swt.graphics.GC gc, int x, int y, GanttSection section)
-
drawHorizontalLines
private void drawHorizontalLines(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)
-
drawVerticalLines
private void drawVerticalLines(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, boolean applyVscroll)
-
drawYearBottomBoxes
private void drawYearBottomBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, boolean calculateOnly)
-
drawYearTopBoxes
private void drawYearTopBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)
-
drawMonthBottomBoxes
private void drawMonthBottomBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, boolean calculateOnly)
-
drawMonthTopBoxes
private void drawMonthTopBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)
-
drawWeekTopBoxes
private void drawWeekTopBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)
-
drawWeekBottomBoxes
private void drawWeekBottomBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, boolean calculateOnly)
-
drawDDayTopBoxes
private void drawDDayTopBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)
-
drawDDayBottomBoxes
private void drawDDayBottomBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, boolean calculateOnly)
-
drawHourTopBoxes
private void drawHourTopBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)
-
drawHourBottomBoxes
private void drawHourBottomBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, boolean calculateOnly)
-
drawMinuteTopBoxes
private void drawMinuteTopBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)
-
drawMinuteBottomBoxes
private void drawMinuteBottomBoxes(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, boolean calculateOnly)
-
drawGanttSpecialDateRanges
private void drawGanttSpecialDateRanges(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, GanttSection gs)
-
drawGanttPhases
private void drawGanttPhases(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, boolean header, GanttSection gs)
-
getStringToDisplay
private java.lang.String getStringToDisplay(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle area, java.lang.String text)Fetches a dot-concatenated string that will fit the given space. Newlines are not taken into account.- Parameters:
gc- GCarea- Area to fit text intext- Text to fit in area- Returns:
- String concatenated string with ellipsis at end
-
getDayBackgroundGradient
private org.eclipse.swt.graphics.Color getDayBackgroundGradient(int day, boolean top, GanttSection gs)
-
getHolidayBackgroundGradient
private org.eclipse.swt.graphics.Color getHolidayBackgroundGradient(boolean top, GanttSection gs)
-
internalGetDayBackgroundGradient
private org.eclipse.swt.graphics.Color internalGetDayBackgroundGradient(int day, boolean top, GanttSection gs)
-
getDayTextColor
private org.eclipse.swt.graphics.Color getDayTextColor(int day)
-
drawEvents
private void drawEvents(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, GanttSection gs)
-
drawEvents
private void drawEvents(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)
-
internalDrawEvents
private void internalDrawEvents(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, GanttSection gs)
-
drawOneEvent
private void drawOneEvent(org.eclipse.swt.graphics.GC gc, GanttEvent ge, org.eclipse.swt.graphics.Rectangle boundsToUse)
-
updateEventVisibilities
private void updateEventVisibilities(org.eclipse.swt.graphics.Rectangle bounds)
-
calculateAllScopes
private void calculateAllScopes(org.eclipse.swt.graphics.Rectangle bounds, GanttSection gs)
-
getStringForEvent
private java.lang.String getStringForEvent(GanttEvent ge)
-
drawTopHorizontalLines
private void drawTopHorizontalLines(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds)
-
addDependency
public void addDependency(GanttEvent source, GanttEvent target)
Adds a connection between two GanttEvents. ge1 will connect to ge2.- Parameters:
source- Source eventtarget- Target event
-
addDependency
public void addDependency(GanttEvent source, GanttEvent target, org.eclipse.swt.graphics.Color color)
Adds a connection between two GanttEvents.Sourcewill connect toTarget.- Parameters:
source- Source eventtarget- Target eventColor- to use to draw connection. Set null to use default color from Settings.
-
connectionAdded
void connectionAdded(GanttConnection conn)
-
connectionRemoved
void connectionRemoved(GanttConnection conn)
-
isConnected
public boolean isConnected(GanttEvent ge)
Returns true if the given event is connected to another.- Parameters:
ge- GanttEvent to check- Returns:
- true if the GanttEvent is connected
-
isConnected
public boolean isConnected(GanttEvent source, GanttEvent target)
Checks whether two events are connected to each other.- Parameters:
source- Source eventtarget- Target event- Returns:
- true if a connection exists
-
addConnection
public void addConnection(GanttEvent source, GanttEvent target)
Same as addDependency().- Parameters:
source- Source eventtarget- Target event
-
addConnection
public void addConnection(GanttEvent source, GanttEvent target, org.eclipse.swt.graphics.Color color)
Same as addDependency().- Parameters:
source- Source eventtarget- Target eventColor- to use to draw connection. Set null to use defaults.
-
getFirstStub
private org.eclipse.swt.graphics.Rectangle getFirstStub(GanttConnection con)
-
drawConnections
private void drawConnections(org.eclipse.swt.graphics.GC gc)
-
drawBend
private org.eclipse.swt.graphics.Point drawBend(org.eclipse.swt.graphics.GC gc, int style, int x, int y, boolean rounded)
-
drawTodayLine
private void drawTodayLine(org.eclipse.swt.graphics.GC gc, org.eclipse.swt.graphics.Rectangle bounds, int x, int dayOfWeek, org.eclipse.swt.graphics.Color lineColor)
-
getDateString
private java.lang.String getDateString(java.util.Calendar cal, boolean top)
-
setDate
public void setDate(java.util.Calendar date)
Sets the calendar date.- Parameters:
date-- See Also:
setDate(Calendar, boolean),setDate(Calendar, int),setDate(Calendar, int, boolean)
-
jumpToToday
public void jumpToToday()
Moves calendar to the current date/time.
-
jumpToToday
public void jumpToToday(int side)
Moves calendar to the current date/time.- Parameters:
side- one ofSWT.LEFT,SWT.CENTER,SWT.RIGHT
-
jumpToEarliestEvent
public void jumpToEarliestEvent()
Moves the calendar to the earliest event date.
-
jumpToLatestEvent
public void jumpToLatestEvent()
Moves the calendar to the latest event date.
-
jumpToEvent
private void jumpToEvent(boolean earliestEvent)
-
jumpToEvent
public void jumpToEvent(GanttEvent event, boolean start, int side)
Moves the calendar to a particular event date horizontally. To move to an event completely, you may use#setTopItem(GanttEvent)orsetTopItem(GanttEvent, int).- Parameters:
event- Event to move tostart- true if to jump to the start date, false if to jump to the end date.side- one ofSWT.LEFT,SWT.CENTER,SWT.RIGHT
-
getEvent
private GanttEvent getEvent(boolean earliest, boolean pixelComparison)
-
getEventDate
private java.util.Date getEventDate(boolean earliest)
-
setDate
public void setDate(java.util.Calendar date, int side, boolean clearMinutes)Sets the calendar date to the given date and shows it on the chart. You may provide the side that the date is to be visible on. This method does not apply any offset or other settings-related magic, but sets the date "purely". This method will only clear minutes, seconds and milliseconds if the clearMinutes variable is set to true.- Parameters:
date- Dateside- one ofSWT.LEFT,SWT.CENTER,SWT.RIGHTclearMinutes- true if to clear minutes, seconds, milliseconds- See Also:
setDate(Calendar, int)
-
setDate
public void setDate(java.util.Calendar date, int side)Sets the calendar date to the given date and shows it on the chart. You may provide the side that the date is to be visible on. This method does not apply any offset or other settings-related magic, but sets the date "purely". This method will clear minutes, seconds and milliseconds and set them to zero. If you do not wish this, usesetDate(Calendar, int, boolean)- Parameters:
date- Dateside- one ofSWT.LEFT,SWT.CENTER,SWT.RIGHT
-
internalSetDateAtX
private void internalSetDateAtX(int x, java.util.Calendar preZoomDate, boolean clearMinutes, boolean redraw, boolean zoomIn)
-
internalSetDate
private void internalSetDate(java.util.Calendar date, int side, boolean clearMinutes, boolean redraw)
-
setDate
public void setDate(java.util.Calendar date, boolean applyOffset)Sets the new date of the calendar and redraws. This method will apply any offsets and other date magic that is set in the Settings.- Parameters:
date- Date to setapplyOffset- whether to apply the settings offset- See Also:
setDate(Calendar),setDate(Calendar, int),setDate(Calendar, int, boolean)
-
setDate
private void setDate(java.util.Calendar date, boolean applyOffset, boolean redraw)
-
reindex
public void reindex(GanttEvent event, int newIndex)
Re-indexes an event to a new index.- Parameters:
event- GanttEvent to reindexnewIndex- new index
-
reindex
public void reindex(GanttSection section, int newIndex)
Re-indexes a GanttSection to a new index.- Parameters:
section- GanttSection to reindexnewIndex- new index
-
reindex
public void reindex(GanttGroup group, int newIndex)
Re-indexes a GanttGroup to a new index.- Parameters:
group- GanttGroup to reindexnewIndex- new index
-
addPhase
public void addPhase(GanttPhase phase)
Adds a GanttPhase to the chart.- Parameters:
phase- GanttPhase to add
-
removePhase
public void removePhase(GanttPhase phase)
Removes a GanttPhase from the chart.- Parameters:
phase- GanttPhase to remove
-
addSpecialDateRange
public void addSpecialDateRange(GanttSpecialDateRange range)
Adds aGanttSpecialDateRangeto the chart.- Parameters:
range-GanttSpecialDateRangeto add.
-
removeSpecialDateRange
public void removeSpecialDateRange(GanttSpecialDateRange range)
Removes aGanttSpecialDateRangeto the chart and redraws.- Parameters:
range-GanttSpecialDateRangeto remove
-
removeSpecialDateRange
public void removeSpecialDateRange(GanttSpecialDateRange range, boolean redraw)
Removes aGanttSpecialDateRangeto the chart and redraws.- Parameters:
range-GanttSpecialDateRangeto removeredraw- true to redraw
-
clearSpecialDateRanges
public void clearSpecialDateRanges()
Removes allGanttSpecialDateRanges and redraws.
-
addSpecialDateRange
public void addSpecialDateRange(GanttSpecialDateRange range, boolean redraw)
Adds aGanttSpecialDateRangeand optionally redraws.- Parameters:
range-GanttSpecialDateRangeto addredraw- true to redraw
-
addPhase
public void addPhase(GanttPhase phase, boolean redraw)
Adds a GanttPhase to the chart with optional redraw call.- Parameters:
phase- GanttPhase to addredraw- true to redraw
-
removePhase
public void removePhase(GanttPhase phase, boolean redraw)
Removes a GanttPhase from the chart with optional redraw call.- Parameters:
phase- GanttPhase to removeredraw- true to redraw
-
clearPhases
public void clearPhases()
Removes all GanttPhases from the chart
-
addEvent
public void addEvent(GanttEvent event)
Adds a GanttEvent to the chart.- Parameters:
event- GanttEvent
-
addEvent
public void addEvent(GanttEvent event, int index)
Adds an event at a given index.- Parameters:
event- GanttEventindex- index
-
addEvent
public void addEvent(GanttEvent event, boolean redraw)
Adds an GanttEvent to the chart and redraws.- Parameters:
event- GanttEventredraw- true if to redraw chart
-
removeEvent
public boolean removeEvent(GanttEvent event)
Removes a GanttEvent from the chart.- Parameters:
event- GanttEvent to remove- Returns:
- true if removed
-
getGanttConnections
public java.util.List getGanttConnections()
Returns all currently connected events as a list ofGanttConnectionobjects.- Returns:
- List of connections.
-
eventDatesChanged
void eventDatesChanged(GanttEvent ge, boolean redraw)
-
clearGanttEvents
public void clearGanttEvents()
Clears all GanttEvents events from the chart.
-
clearGanttGroups
public void clearGanttGroups()
Clears all GanttGroups from the chart.
-
clearGanttSections
public void clearGanttSections()
Clears all GanttSections from the chart.
-
clearChart
public void clearChart()
Clears the entire chart of everything (all types of events) and leaves the chart blank.
-
hasEvent
public boolean hasEvent(GanttEvent event)
Checks whether the chart has a given event.- Parameters:
event- GanttEvent- Returns:
- true if event exists
-
nextMonth
public void nextMonth()
Jumps to the next month.
-
prevMonth
public void prevMonth()
Jumps to the previous month.
-
nextWeek
public void nextWeek()
Jumps one week forward.
-
prevWeek
public void prevWeek()
Jumps one week backwards.
-
nextHour
public void nextHour()
Jumps to the next hour.
-
prevMinute
public void prevMinute()
Jumps to the previous minute.
-
nextMinute
public void nextMinute()
Jumps to the next hour.
-
prevHour
public void prevHour()
Jumps to the previous hour.
-
nextDay
public void nextDay()
Jumps one day forward.
-
prevDay
public void prevDay()
Jumps one day backwards.
-
setNoRecalc
void setNoRecalc()
-
internalAddEvent
private void internalAddEvent(int index, GanttEvent event)
-
internalRemoveEvent
private void internalRemoveEvent(GanttEvent event)
-
internalAddGroup
private void internalAddGroup(int index, GanttGroup group)
-
internalRemoveGroup
private void internalRemoveGroup(GanttGroup group)
-
internalAddSection
private void internalAddSection(int index, GanttSection section)
-
internalRemoveSection
private void internalRemoveSection(GanttSection section)
-
eventNumbersChanged
private void eventNumbersChanged()
-
moveXBounds
void moveXBounds(boolean positive)
-
moveYBounds
private void moveYBounds(int move)
-
refresh
public void refresh()
Redraws the calendar should some event not do it automatically.
-
redrawEventsArea
private void redrawEventsArea()
-
isEventVisible
public boolean isEventVisible(GanttEvent event, org.eclipse.swt.graphics.Rectangle bounds)
Checks whether a certain event is visible in the current bounds.- Parameters:
event- GanttEventbounds- Bounds- Returns:
- true if event is visible
-
getEventVisibility
private int getEventVisibility(GanttEvent event, org.eclipse.swt.graphics.Rectangle bounds)
-
getStartingXFor
private int getStartingXFor(GanttEvent event)
-
getStartingXForEventDate
public int getStartingXForEventDate(java.util.Calendar date)
Returns the starting x position for a given date in the current view.- Parameters:
date- Date- Returns:
- x position, -1 should it for some reason not be found
-
getStartingXForEventHours
private int getStartingXForEventHours(GanttEvent event)
-
getStartingXForEventHours
private int getStartingXForEventHours(java.util.Calendar start)
-
getStartingXFor
public int getStartingXFor(java.util.Calendar date)
Returns the starting x for a given date.- Parameters:
date- Calendar date- Returns:
- x position or -1 if it for some reason should not be found
-
getXLengthForEventHours
private int getXLengthForEventHours(GanttEvent event)
-
getXLengthForEvent
private int getXLengthForEvent(GanttEvent event)
-
getDayWidth
public int getDayWidth()
Returns the width of one day in the current zoom level. Do note that "one day" refers to 1 tick mark, so it might not be one day in a smaller or larger zoom level.- Returns:
- One tick mark width
-
isInside
private boolean isInside(int x, int y, org.eclipse.swt.graphics.Rectangle rect)
-
mouseDoubleClick
public void mouseDoubleClick(org.eclipse.swt.events.MouseEvent me)
- Specified by:
mouseDoubleClickin interfaceorg.eclipse.swt.events.MouseListener
-
killMouseState
private void killMouseState()
-
getAllSelectedHeaderDates
public java.util.List getAllSelectedHeaderDates()
Returns a list of all selected header dates (Calendar).- Returns:
- List of calendars or empty list if none
-
clearAllSelectedHeaders
public void clearAllSelectedHeaders()
Clears all selected headers and redraws the chart.
-
setSelectedHeaderDates
public void setSelectedHeaderDates(java.util.List dates)
Sets a list of header dates that should be the selected dates. This list must be a list of Calendars.- Parameters:
dates- List of Calendar objects representing selected header dates.
-
doMultiSelect
private void doMultiSelect(org.eclipse.swt.graphics.Rectangle rect, org.eclipse.swt.events.MouseEvent me)Selects a region of events.- Parameters:
rect- Rectangle of region to selectme-
-
mouseDown
public void mouseDown(org.eclipse.swt.events.MouseEvent me)
- Specified by:
mouseDownin interfaceorg.eclipse.swt.events.MouseListener
-
drawSelectionAroundEvent
private void drawSelectionAroundEvent(org.eclipse.swt.graphics.GC gc, GanttEvent ge, int xPos, int yPos, int eventWidth, org.eclipse.swt.graphics.Rectangle bounds)
-
mouseUp
public void mouseUp(org.eclipse.swt.events.MouseEvent event)
- Specified by:
mouseUpin interfaceorg.eclipse.swt.events.MouseListener
-
handlePostVerticalDragDrop
private void handlePostVerticalDragDrop()
This method deals with moving events around so that vertical gaps are filled where they left holes after a vertical drag/drop
-
getSectionForVerticalDND
private GanttSection getSectionForVerticalDND(GanttEvent event, boolean accountForVerticalDragDirection)
Returns a section that corresponds to where the given event is currently hovering over- Parameters:
event- Event to checkaccountForVerticalDragDirection- whether to account for if user is dragging up or down when returning section, if user is between two sections this may play a part- Returns:
- Section it is over or null if none
-
getSectionAt
public GanttSection getSectionAt(org.eclipse.swt.events.MouseEvent me)
Returns a section that corresponds to where the given MouseEvent is fired- Parameters:
event- MouseEvent to check- Returns:
- Section it is over or null if none
-
getSurroundingVerticalEvents
private java.util.List getSurroundingVerticalEvents(GanttEvent event, GanttSection section)
Returns a list of all surrounding vertical events to a given event. If a GanttSection is given, only the events in that section will be used in calculating.- Parameters:
event- Event to get surrounding events forsection- GanttSection optional (pass null for using all events)- Returns:
- 2-size array with entry 0 being the top event and entry 1 being the bottom event. Any or all can be null.
-
keyPressed
public void keyPressed(org.eclipse.swt.events.KeyEvent e)
- Specified by:
keyPressedin interfaceorg.eclipse.swt.events.KeyListener
-
keyReleased
public void keyReleased(org.eclipse.swt.events.KeyEvent e)
- Specified by:
keyReleasedin interfaceorg.eclipse.swt.events.KeyListener
-
endEverything
private void endEverything()
-
mouseMove
public void mouseMove(org.eclipse.swt.events.MouseEvent me)
- Specified by:
mouseMovein interfaceorg.eclipse.swt.events.MouseMoveListener
-
mouseMoveMinutes
private void mouseMoveMinutes(java.lang.String dateFormat, org.eclipse.swt.events.MouseEvent me)
-
getDaysVisible
public int getDaysVisible()
-
getCurrentDDate
private java.lang.String getCurrentDDate()
-
isInMoveArea
private boolean isInMoveArea(GanttEvent event, int x)
-
doAutoScroll
private void doAutoScroll(org.eclipse.swt.events.MouseEvent event)
Deals with figuring out what direction we are auto-scrolling in, if any.- Parameters:
event- MouseEvent
-
doAutoScroll
private void doAutoScroll(int direction)
-
isChartReady
boolean isChartReady()
-
endAutoScroll
private void endAutoScroll()
-
getXForDate
public int getXForDate(java.util.Date date)
Gets the X for a given date.- Parameters:
date- Date- Returns:
- x position or -1 if date was not found
-
getXForDate
public int getXForDate(java.util.Calendar cal)
Gets the x position where the given date starts in the current visible area.- Parameters:
cal- Calendar- Returns:
- -1 if date was not found
-
calculateMinuteAdjustment
private int calculateMinuteAdjustment(java.util.Calendar date)
-
getDateAt
public java.util.Calendar getDateAt(int x)
Gets the date for a given x position.- Parameters:
x- x location- Returns:
- Calendar of date
-
isNoOverlap
private boolean isNoOverlap(java.util.Calendar dat1, java.util.Calendar dat2)
-
drawMarker
public void drawMarker(java.util.Date date)
Draws a dotted vertical marker at the given date. It will get removed on repaint, so make sure it's drawn as often as needed.- Parameters:
date- Date to draw it at
-
handlePhaseMove
private void handlePhaseMove(org.eclipse.swt.events.MouseEvent me, GanttPhase phase, int type, boolean showToolTip)
-
calculateVerticalInsertLocations
private void calculateVerticalInsertLocations()
Calculates where a vertically DND'd event will end up if dropped
-
drawVerticalInsertMarkers
private void drawVerticalInsertMarkers(org.eclipse.swt.graphics.GC gc)
-
handleMove
private void handleMove(org.eclipse.swt.events.MouseEvent me, GanttEvent event, int type, boolean showToolTip)Handles the actual moving of an event.
-
updateScopeXY
private void updateScopeXY(GanttEvent ge)
-
moveEvent
private void moveEvent(GanttEvent ge, int diff, int stateMask, org.eclipse.swt.events.MouseEvent me, int type)
-
mouseEnter
public void mouseEnter(org.eclipse.swt.events.MouseEvent event)
- Specified by:
mouseEnterin interfaceorg.eclipse.swt.events.MouseTrackListener
-
mouseExit
public void mouseExit(org.eclipse.swt.events.MouseEvent event)
- Specified by:
mouseExitin interfaceorg.eclipse.swt.events.MouseTrackListener
-
mouseHover
public void mouseHover(org.eclipse.swt.events.MouseEvent me)
- Specified by:
mouseHoverin interfaceorg.eclipse.swt.events.MouseTrackListener
-
showTooltip
private void showTooltip(GanttEvent event, org.eclipse.swt.events.MouseEvent me)
-
fixTooltipString
private java.lang.String fixTooltipString(java.lang.String input, java.lang.String name, java.lang.String startDate, java.lang.String endDate, java.lang.String plannedStart, java.lang.String plannedEnd, long days, long plannedDays, int percentageComplete)
-
showTooltip
private void showTooltip(Holiday holiday, org.eclipse.swt.events.MouseEvent me)
-
getVisibleBounds
public org.eclipse.swt.graphics.Rectangle getVisibleBounds()
Returns a rectangle with the bounds of what is actually visible inside the chart.- Returns:
- Rectangle
-
getCurrentView
public int getCurrentView()
Returns the current view.- Returns:
- View
-
setView
public void setView(int view)
Sets the current view.- Parameters:
view- View
-
getEvents
public java.util.List getEvents()
Returns all events.- Returns:
- List of all events.
-
getImage
public org.eclipse.swt.graphics.Image getImage()
Returns the current visible area of the chart as an image- Returns:
- Image of the chart
-
getVerticallyFullImage
public org.eclipse.swt.graphics.Image getVerticallyFullImage()
Returns the chart as an image with the visible horizontal area but showing all information in the chart vertically.- Returns:
- Image of the chart
-
getFullImage
public org.eclipse.swt.graphics.Image getFullImage()
Returns the image that is the entire chart, regardless of what is currently visible. If chart contains no events,getImage()is called from within.Do note that if the chart is "huge", you may need to increase your heap size. If you're zoomed in that's also taken into account and you may need a massive heap to work with hours views as they are simply huge in a pixel-size sense.
- Returns:
- Image
-
getImage
public org.eclipse.swt.graphics.Image getImage(org.eclipse.swt.graphics.Rectangle bounds)
Returns the chart as an image for the given bounds.- Parameters:
bounds- Rectangle bounds- Returns:
- Image of chart
-
getEventsDependingOn
private java.util.List<java.lang.Object> getEventsDependingOn(GanttEvent ge)
-
recursiveGetEventsDependingOn
private java.util.Set recursiveGetEventsDependingOn(GanttEvent ge, GanttMap gm, java.util.Set ret)
-
updateZoomLevel
private void updateZoomLevel()
-
heavyRedraw
public void heavyRedraw()
This will cause a full recaclulation of events and a lot of other things. Normally this is used internally when there are zoom changes and/or other events that cause the chart to need a full recalculation. It is NOT intended to be used outside of the chart, but is available as a workaround if there is a bug that you can't get around and you need to force a full update. See this method as a temporary solution if you need to use it.
-
forceFullUpdate
void forceFullUpdate()
-
flagForceFullUpdate
void flagForceFullUpdate()
-
getViewPortHandler
public IViewPortHandler getViewPortHandler()
-
setViewPortHandler
public void setViewPortHandler(IViewPortHandler2 vph)
-
updateHorizontalScrollbar
void updateHorizontalScrollbar()
-
getLeftMostPixel
int getLeftMostPixel()
-
getRightMostPixel
int getRightMostPixel()
-
getPixel
private int getPixel(boolean left)
-
setZoomLevel
public void setZoomLevel(int level)
Sets the zoom level. If the new level is zoomed in from the previous set zoom level a zoom in event will be reported, otherwise a zoom out.- Parameters:
level- Level to set
-
zoomIn
public void zoomIn()
Zooms in. If zooming is disabled, does nothing.- Specified by:
zoomInin interfaceIZoomHandler
-
zoomIn
public void zoomIn(boolean fromMouseWheel, org.eclipse.swt.graphics.Point mouseLoc)- Specified by:
zoomInin interfaceIZoomHandler
-
zoomOut
public void zoomOut()
Zooms out. If zooming is disabled, does nothing.- Specified by:
zoomOutin interfaceIZoomHandler
-
zoomOut
public void zoomOut(boolean fromMouseWheel, org.eclipse.swt.graphics.Point mouseLoc)- Specified by:
zoomOutin interfaceIZoomHandler
-
resetZoom
public void resetZoom()
Resets the zoom level to that set in the settings.- Specified by:
resetZoomin interfaceIZoomHandler
-
redraw
public void redraw()
- Overrides:
redrawin classorg.eclipse.swt.widgets.Control
-
addGanttEventListener
public void addGanttEventListener(IGanttEventListener listener)
Adds a listener that will be notified of Gantt events.- Parameters:
listener- Listener
-
removeGanttEventListener
public void removeGanttEventListener(IGanttEventListener listener)
Removes a listener from being notified of Gantt events.- Parameters:
listener- Listener
-
isUseAdvancedTooltips
private boolean isUseAdvancedTooltips()
-
setUseAdvancedTooltips
public void setUseAdvancedTooltips(boolean useAdvancedTooltips)
Sets whether to use advanced tooltips or not. This method will override the settings implementation with the same name.- Parameters:
useAdvancedTooltips- true whether to use advanced tooltips.
-
getDDayCalendar
public java.util.Calendar getDDayCalendar()
Returns (a clone) of the D-Day calendar- Returns:
- D-Day calendar
-
getUndoRedoManager
public GanttUndoRedoManager getUndoRedoManager()
Returns the Undo/Redo manager.- Returns:
GanttUndoRedoManager
-
getTotalVisibileGanttEvents
public int getTotalVisibileGanttEvents()
Returns the number of visible events on in the current viewport- Returns:
- number of visible events on in the current viewport
-
selectAll
public void selectAll()
Selects all events
-
deselectAll
public void deselectAll()
Clears all selected events
-
rotate
static org.eclipse.swt.graphics.ImageData rotate(org.eclipse.swt.graphics.ImageData srcData, int direction)
-
flip
static org.eclipse.swt.graphics.ImageData flip(org.eclipse.swt.graphics.ImageData srcData, boolean vertical)
-
hasGanttPhases
boolean hasGanttPhases()
-
hasGanttSections
boolean hasGanttSections()
-
hasSpecialDateRanges
boolean hasSpecialDateRanges()
-
isDDayCalendar
boolean isDDayCalendar()
-
getSettings
public ISettings getSettings()
-
setEventFactory
public void setEventFactory(IEventFactory factory)
-
setEventMenuItemFactory
public void setEventMenuItemFactory(IEventMenuItemFactory factory)
-
setMenuItemFactory
public void setMenuItemFactory(IMenuItemFactory factory)
-
setZoomHandler
public void setZoomHandler(IZoomHandler zoomHandler)
-
addSelectionDetailClickListener
public void addSelectionDetailClickListener(ISectionDetailMoreClickListener listener)
-
removeSelectionDetailClickListener
public void removeSelectionDetailClickListener(ISectionDetailMoreClickListener listener)
-
setHolidays
public void setHolidays(Holiday[] holidays)
-
-