Package com.amalgamasimulation.charts
Class AbstractGanttChart
java.lang.Object
com.amalgamasimulation.charts.Chart<IGanttChartVisualSet,GanttVisualSetContainer>
com.amalgamasimulation.charts.AbstractGanttChart
- All Implemented Interfaces:
IVerticalGuidelineOwner<IGanttChartVisualSet,
GanttVisualSetContainer>
- Direct Known Subclasses:
NumericGanttChart
,TimeGanttChart
public abstract class AbstractGanttChart
extends Chart<IGanttChartVisualSet,GanttVisualSetContainer>
implements IVerticalGuidelineOwner<IGanttChartVisualSet,GanttVisualSetContainer>
Abstract chart that shows history of some state changes or schedules in the
form of Gantt diagrams.
- Author:
- Aleksey Kirillov
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.amalgamasimulation.charts.internals.charts.GanttChartInternal
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddContextMenuItem
(GanttChartContextMenuItem contextMenuItem) Adds the new context menu item to the end of the items list.Adds the action to be executed every time the contents area is clicked.void
Adds the action to be executed every time the vertical guideline visibility or position is changed.Removes all context menu items added by the 'addContextMenuItem' calls.Removes all the contents area click actions.void
Clear all the vertical guideline visibility or position changed actions.final com.amalgamasimulation.charts.internals.charts.GanttChartInternal
javafx.scene.paint.Color
Returns the current color of the vertical guideline.Returns the formatter of the vertical guideline label.double
Returns the current X-axis position of vertical guideline.double
Returns the current width of the vertical guideline.Hides the currently displayed vertical guideline.boolean
Checks whether vertical guideline is displayed.boolean
Checks whether the vertical guideline label is drawn.boolean
Checks whether vertical guideline is snapped to grid lines.boolean
Checks whether the legend values are drawn.boolean
Checks whether vertical guideline is drawn.removeContextMenuItem
(GanttChartContextMenuItem contextMenuHandler) Removes the context menu item.Removes the contents area click action.void
Removes the vertical guideline visibility or position changed action.setShowGanttChartRowMenuItemVisible
(boolean visible) Adds a context menu element that controls the search and navigation for elements of the Y-axis.setVerticalGuidelineColor
(Color color) Sets the new color to the vertical guideline.setVerticalGuidelineColor
(javafx.scene.paint.Color color) Sets the new color to the vertical guideline.Sets the formatter of the vertical guideline label, i.e.setVerticalGuidelineLabelVisible
(boolean visible) Specifies whether the vertical guideline label should be drawn.setVerticalGuidelineSnapToGridLines
(boolean snapToGridLines) Specifies whether the vertical guideline should be snapped to grid lines.setVerticalGuidelineValuesVisible
(boolean visible) Specifies whether the legend values of the applicable visual sets should be drawn when a vertical guideline is shown.setVerticalGuidelineVisible
(boolean visible) Specifies whether the vertical guideline functionality should be enabled for the end users of this chart.setVerticalGuidelineWidth
(double width) Sets the new width to the vertical guideline, in pixels.showVerticalGuidelineDisplayed
(double position) Shows a vertical guideline at the specified X-axis position.Methods inherited from class com.amalgamasimulation.charts.Chart
addKeyPressedHandler, addKeyReleasedHandler, addMouseDragExitedHandler, addMouseDraggedHandler, addMouseDragOverHandler, addMouseDragReleasedHandler, addMouseEnteredHandlers, addMouseExitedHandler, addMousePressedHandler, addMouseReleasedHandler, addMouseScrollHandler, addRedrawFinishedHandler, addTextLabel, addTextLabel, clearKeyPressedHandlers, clearKeyReleasedHandlers, clearMouseDragExitedHandlers, clearMouseDraggedHandlers, clearMouseDragOverHandlers, clearMouseDragReleasedHandlers, clearMouseEnteredHandlers, clearMouseExitedHandlers, clearMousePressedHandlers, clearMouseReleasedHandlers, clearMouseScrollHandlers, clearRedrawFinishedHandlers, copyToClipboard, dispose, getBackgroundColor, getBottomMargin, getContentBackgroundColor, getGridLinesColor, getGridLinesWidth, getLeftMargin, getTitle, getTitleColor, getTitleFont, getTitleFontSize, getTopMargin, getVisualSetContainer, getXAxis, getYAxis, getZeroGridLineColor, getZeroGridLineWidth, initializeChartGroup, isDisposed, isGridLinesVisible, isRedrawInProgress, isShown, isTitleVisible, isVisible, isVisualSetVisible, isZeroGridLineVisible, redraw, removeKeyPressedHandler, removeKeyReleasedHandler, removeMouseDragExitedHandler, removeMouseDraggedHandler, removeMouseDragOverHandler, removeMouseDragReleasedHandler, removeMouseEnteredHandler, removeMouseExitedHandler, removeMousePressedHandler, removeMouseReleasedHandler, removeMouseScrollHandler, removeRedrawFinishedHandler, removeTextLabel, resizeChart, setBackgroundColor, setBackgroundColor, setBottomMargin, setContentBackgroundColor, setContentBackgroundColor, setContextMenuVisible, setCopyToClipboardContextMenuItemVisible, setGridLinesColor, setGridLinesColor, setGridLinesVisible, setGridLinesWidth, setLeftMargin, setTitle, setTitleColor, setTitleColor, setTitleFont, setTitleFontSize, setTitleVisible, setTopMargin, setVisibility, setVisualSetContainer, setVisualSetVisible, setZeroGridLineColor, setZeroGridLineColor, setZeroGridLineVisible, setZeroGridLineWidth, updateSize
-
Field Details
-
internalGanttChart
protected com.amalgamasimulation.charts.internals.charts.GanttChartInternal internalGanttChart
-
-
Constructor Details
-
AbstractGanttChart
public AbstractGanttChart()
-
-
Method Details
-
getChartInternal
public final com.amalgamasimulation.charts.internals.charts.GanttChartInternal getChartInternal()- Specified by:
getChartInternal
in classChart<IGanttChartVisualSet,
GanttVisualSetContainer>
-
setVerticalGuidelineLabelFormat
Sets the formatter of the vertical guideline label, i.e. the function that takes aDouble
value and produces aString
that should be drawn to represent this value. Redraws this chart- Parameters:
format
- new formatter of the vertical guideline label- Returns:
- reference to this object
- See Also:
-
getVerticalGuidelineLabelFormat
Returns the formatter of the vertical guideline label.- Returns:
- formatter of the vertical guideline label
-
setShowGanttChartRowMenuItemVisible
Adds a context menu element that controls the search and navigation for elements of the Y-axis.- Parameters:
visible
- new visibility of the menu element 'search and navigation'- Returns:
- reference to this object
-
addContextMenuItem
Adds the new context menu item to the end of the items list.- Parameters:
contextMenuItem
- new context menu item- Returns:
- reference to this object
-
removeContextMenuItem
Removes the context menu item.- Parameters:
contextMenuHandler
- removed context menu item- Returns:
- reference to this object
-
clearContextMenuItems
Removes all context menu items added by the 'addContextMenuItem' calls. Does not affect pre-installed items such as 'copy to clipboard'.- Returns:
- reference to this object
-
addMouseClickHandler
Adds the action to be executed every time the contents area is clicked.- Parameters:
handler
- new contents area click action- Returns:
- reference to this object
-
removeMouseClickHandler
Removes the contents area click action.- Parameters:
handler
- removed contents area click action- Returns:
- reference to this object
-
clearMouseClickHandlers
Removes all the contents area click actions.- Returns:
- reference to this object
-
setVerticalGuidelineVisible
Description copied from interface:IVerticalGuidelineOwner
Specifies whether the vertical guideline functionality should be enabled for the end users of this chart. This functionality allows the users to show and hide the vertical guideline by clicking on the chart contents area. Redraws this chart if visibility is changed.Vertical guideline functionality is enabled by default.
- Specified by:
setVerticalGuidelineVisible
in interfaceIVerticalGuidelineOwner<IGanttChartVisualSet,
GanttVisualSetContainer> - Parameters:
visible
-true
if vertical guideline functionality should be enabled,false
otherwise- Returns:
- reference to this object
-
setVerticalGuidelineLabelVisible
Description copied from interface:IVerticalGuidelineOwner
Specifies whether the vertical guideline label should be drawn. Istrue
by default. Redraws this chart if visibility is changed.- Specified by:
setVerticalGuidelineLabelVisible
in interfaceIVerticalGuidelineOwner<IGanttChartVisualSet,
GanttVisualSetContainer> - Parameters:
visible
- new vertical guideline label visibility- Returns:
- reference to this object
-
setVerticalGuidelineValuesVisible
Description copied from interface:IVerticalGuidelineOwner
Specifies whether the legend values of the applicable visual sets should be drawn when a vertical guideline is shown. The displayed values are the result of the intersection of the corresponding data elements with a vertical guideline. Istrue
by default. Redraws this chart if visibility is changed.- Specified by:
setVerticalGuidelineValuesVisible
in interfaceIVerticalGuidelineOwner<IGanttChartVisualSet,
GanttVisualSetContainer> - Parameters:
visible
-true
if the legend values should be drawn,false
otherwise- Returns:
- reference to this object
-
showVerticalGuidelineDisplayed
Description copied from interface:IVerticalGuidelineOwner
Shows a vertical guideline at the specified X-axis position. Redraws this chart.- Specified by:
showVerticalGuidelineDisplayed
in interfaceIVerticalGuidelineOwner<IGanttChartVisualSet,
GanttVisualSetContainer> - Parameters:
position
- specified X-axis position of the vertical guideline- Returns:
- reference to this object
-
setVerticalGuidelineColor
Description copied from interface:IVerticalGuidelineOwner
Sets the new color to the vertical guideline. Redraws this chart if color is changed.- Specified by:
setVerticalGuidelineColor
in interfaceIVerticalGuidelineOwner<IGanttChartVisualSet,
GanttVisualSetContainer> - Parameters:
color
- new vertical guideline color- Returns:
- reference to this object
-
setVerticalGuidelineColor
Description copied from interface:IVerticalGuidelineOwner
Sets the new color to the vertical guideline. Redraws this chart if color is changed.- Specified by:
setVerticalGuidelineColor
in interfaceIVerticalGuidelineOwner<IGanttChartVisualSet,
GanttVisualSetContainer> - Parameters:
color
- new vertical guideline color- Returns:
- reference to this object
-
setVerticalGuidelineWidth
Description copied from interface:IVerticalGuidelineOwner
Sets the new width to the vertical guideline, in pixels. Redraws this chart if width is changed.- Specified by:
setVerticalGuidelineWidth
in interfaceIVerticalGuidelineOwner<IGanttChartVisualSet,
GanttVisualSetContainer> - Parameters:
width
- new vertical guideline width, in pixels- Returns:
- reference to this object
-
isVerticalGuidelineVisible
public boolean isVerticalGuidelineVisible()Description copied from interface:IVerticalGuidelineOwner
Checks whether vertical guideline is drawn.- Specified by:
isVerticalGuidelineVisible
in interfaceIVerticalGuidelineOwner<IGanttChartVisualSet,
GanttVisualSetContainer> - Returns:
true
if vertical guideline is drawn,false
otherwise
-
isVerticalGuidelineLabelVisible
public boolean isVerticalGuidelineLabelVisible()Description copied from interface:IVerticalGuidelineOwner
Checks whether the vertical guideline label is drawn.- Specified by:
isVerticalGuidelineLabelVisible
in interfaceIVerticalGuidelineOwner<IGanttChartVisualSet,
GanttVisualSetContainer> - Returns:
true
if the vertical guideline label is drawn,false
otherwise
-
isVerticalGuidelineValuesVisible
public boolean isVerticalGuidelineValuesVisible()Description copied from interface:IVerticalGuidelineOwner
Checks whether the legend values are drawn.- Specified by:
isVerticalGuidelineValuesVisible
in interfaceIVerticalGuidelineOwner<IGanttChartVisualSet,
GanttVisualSetContainer> - Returns:
true
if the legend values are drawn,false
otherwise
-
getVerticalGuidelineColor
public javafx.scene.paint.Color getVerticalGuidelineColor()Description copied from interface:IVerticalGuidelineOwner
Returns the current color of the vertical guideline.- Specified by:
getVerticalGuidelineColor
in interfaceIVerticalGuidelineOwner<IGanttChartVisualSet,
GanttVisualSetContainer> - Returns:
- the current color of the vertical guideline
-
setVerticalGuidelineSnapToGridLines
Description copied from interface:IVerticalGuidelineOwner
Specifies whether the vertical guideline should be snapped to grid lines.- Specified by:
setVerticalGuidelineSnapToGridLines
in interfaceIVerticalGuidelineOwner<IGanttChartVisualSet,
GanttVisualSetContainer> - Parameters:
snapToGridLines
- new value of property vertical guideline snapped to grid lines- Returns:
- reference to this object
-
isVerticalGuidelineSnapToGridLines
public boolean isVerticalGuidelineSnapToGridLines()Description copied from interface:IVerticalGuidelineOwner
Checks whether vertical guideline is snapped to grid lines.- Specified by:
isVerticalGuidelineSnapToGridLines
in interfaceIVerticalGuidelineOwner<IGanttChartVisualSet,
GanttVisualSetContainer> - Returns:
- true if vertical guideline is snapped to grid lines
-
getVerticalGuidelineWidth
public double getVerticalGuidelineWidth()Description copied from interface:IVerticalGuidelineOwner
Returns the current width of the vertical guideline.- Specified by:
getVerticalGuidelineWidth
in interfaceIVerticalGuidelineOwner<IGanttChartVisualSet,
GanttVisualSetContainer> - Returns:
- the current width of the vertical guideline
-
hideVerticalGuideline
Description copied from interface:IVerticalGuidelineOwner
Hides the currently displayed vertical guideline. Redraws this chart. Does nothing if the vertical guideline is not currently displayed.- Specified by:
hideVerticalGuideline
in interfaceIVerticalGuidelineOwner<IGanttChartVisualSet,
GanttVisualSetContainer> - Returns:
- reference to this object
-
isVerticalGuidelineDisplayed
public boolean isVerticalGuidelineDisplayed()Description copied from interface:IVerticalGuidelineOwner
Checks whether vertical guideline is displayed.- Specified by:
isVerticalGuidelineDisplayed
in interfaceIVerticalGuidelineOwner<IGanttChartVisualSet,
GanttVisualSetContainer> - Returns:
- true if vertical guideline is displayed
-
getVerticalGuidelinePosition
public double getVerticalGuidelinePosition()Description copied from interface:IVerticalGuidelineOwner
Returns the current X-axis position of vertical guideline.- Specified by:
getVerticalGuidelinePosition
in interfaceIVerticalGuidelineOwner<IGanttChartVisualSet,
GanttVisualSetContainer> - Returns:
- the current X-axis position of vertical guideline
-
addVerticalGuidelineChangeHandler
Description copied from interface:IVerticalGuidelineOwner
Adds the action to be executed every time the vertical guideline visibility or position is changed.- Specified by:
addVerticalGuidelineChangeHandler
in interfaceIVerticalGuidelineOwner<IGanttChartVisualSet,
GanttVisualSetContainer> - Parameters:
handler
- new action to be executed every time the vertical guideline visibility or position is changed
-
removeVerticalGuidelineChangeHandler
Description copied from interface:IVerticalGuidelineOwner
Removes the vertical guideline visibility or position changed action.- Specified by:
removeVerticalGuidelineChangeHandler
in interfaceIVerticalGuidelineOwner<IGanttChartVisualSet,
GanttVisualSetContainer> - Parameters:
handler
- removed vertical guideline visibility or position changed action
-
clearVerticalGuidelineChangeHandlers
public void clearVerticalGuidelineChangeHandlers()Description copied from interface:IVerticalGuidelineOwner
Clear all the vertical guideline visibility or position changed actions.- Specified by:
clearVerticalGuidelineChangeHandlers
in interfaceIVerticalGuidelineOwner<IGanttChartVisualSet,
GanttVisualSetContainer>
-