Class GanttChartCategoryYAxis
java.lang.Object
com.amalgamasimulation.charts.axes.AbstractAxis<GanttChartRow>
com.amalgamasimulation.charts.axes.GanttChartCategoryYAxis
- All Implemented Interfaces:
IAxisTitlePositionPropertyOwner,IAxisTitlePropertyOwner<GanttChartRow>,IScrollBarPropertyOwner
public class GanttChartCategoryYAxis
extends AbstractAxis<GanttChartRow>
implements IScrollBarPropertyOwner, IAxisTitlePropertyOwner<GanttChartRow>, IAxisTitlePositionPropertyOwner
Class that represents an Y-axis drawn on a
TimeGanttChart area. It
holds properties for axis ticks and labels along the axis. This axis does
allow ranging and navigation operations.- Author:
- Aleksey Kirillov
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.amalgamasimulation.charts.internals.charts.GanttChartInternalprotected com.amalgamasimulation.charts.internals.axes.CategoryYAxisInternal<GanttChartRow> -
Constructor Summary
ConstructorsConstructorDescriptionGanttChartCategoryYAxis(com.amalgamasimulation.charts.internals.charts.GanttChartInternal chartInternal, com.amalgamasimulation.charts.internals.axes.CategoryYAxisInternal<GanttChartRow> yAxisInternal) Constructs aGanttChartInternalcategory Y-axis with givenCategoryYAxisInternal -
Method Summary
Modifier and TypeMethodDescriptionaddClickHandler(Consumer<GanttChartRow> handler) Adds the action to be executed every time any element on the vertical axis is clicked.Removes all vertical axis click handlers.protected com.amalgamasimulation.charts.internals.axes.CategoryYAxisInternal<GanttChartRow> protected com.amalgamasimulation.charts.internals.charts.GanttChartInternalintReturns the index of the first currently displayedGanttChartRow.intReturns the count of the currently displayedGanttChartRow's.Returns the currentLeftMarginRule.getTitle()Returns the title of this axis, ornullif title has not been specified.javafx.scene.paint.ColorReturns the color of this axis title.javafx.scene.text.FontReturns the font of this axis title.intReturns the font size of this axis title.Returns theAxisTitlePositionthat specifies the the chart's title position.booleanChecks whether the scrollbar is currently displayed.booleanChecks whether the scrollbar should be drawn if scrolling the displayed rang of Y-axis is possible.booleanChecks whether this axis title should be drawn.booleanisValueDisplayed(GanttChartRow ganttChartRow) Checks if specifiedGanttChartRowis currently displayed.navigateTo(int elementIndex) Navigates Y-axis displayed range toGanttChartRowwith specified index.navigateToGanttChartRow(GanttChartRow ganttChartRow) Navigates Y-axis displayed range to specifiedGanttChartRow.navigateToGanttChartRow(String ganttChartRowName) Navigates Y-axis displayed range toGanttChartRowwith specified name.navigateToGanttChartRow(String ganttChartRowName, boolean caseSensitive) Navigates Y-axis displayed range toGanttChartRowwith specified name.removeClickHandler(Consumer<GanttChartRow> handler) Removes vertical axis click handler.setLeftMarginRule(LeftMarginRule yAxisWidthRule) Sets the newLeftMarginRule.setScrollBarVisible(boolean visible) Specifies whether the scrollbar should be drawn if scrolling the displayed rang of axis is possible.Sets the new title to this axis.setTitleColor(Color color) Sets the new color to this axis title.setTitleColor(javafx.scene.paint.Color color) Sets the new color to this axis title.setTitleFont(javafx.scene.text.Font font) Sets the new font to this axis title.setTitleFontSize(int fontSize) Sets the new font size to this axis title.setTitlePosition(AxisTitlePosition yAxisTitlePosition) Sets theAxisTitlePositionthat specifies the chart's title position.setTitleVisible(boolean visible) Specifies whether this axis title should be drawn.setTooltipText(Function<GanttChartRow, String> yAxisTooltipTextExtractor) Adds tooltip text to display when the mouse is hovered over a vertical axis element.setTooltipTextFont(Function<GanttChartRow, javafx.scene.text.Font> yAxisTooltipFontExtractor) Sets the new font to the tooltip text.setTooltipTextFontSize(Function<GanttChartRow, Integer> yAxisTooltipFontSizeExtractor) Sets the new font size to the tooltip text.Methods inherited from class com.amalgamasimulation.charts.axes.AbstractAxis
getLabelsColor, getLabelsFont, getLabelsFontSize, setGridLinesColor, setGridLinesColor, setGridLinesVisible, setGridLinesWidth, setLabelsColor, setLabelsColor, setLabelsFont, setLabelsFontSize
-
Field Details
-
chartInternal
protected com.amalgamasimulation.charts.internals.charts.GanttChartInternal chartInternal -
yAxisInternal
protected com.amalgamasimulation.charts.internals.axes.CategoryYAxisInternal<GanttChartRow> yAxisInternal
-
-
Constructor Details
-
GanttChartCategoryYAxis
public GanttChartCategoryYAxis(com.amalgamasimulation.charts.internals.charts.GanttChartInternal chartInternal, com.amalgamasimulation.charts.internals.axes.CategoryYAxisInternal<GanttChartRow> yAxisInternal) Constructs aGanttChartInternalcategory Y-axis with givenCategoryYAxisInternal- Parameters:
chartInternal-GanttChartInternalwhich is the owner of this objectyAxisInternal-CategoryYAxisInternalwhich is the internal axis logic aggregator
-
-
Method Details
-
getChartInternal
protected com.amalgamasimulation.charts.internals.charts.GanttChartInternal getChartInternal()- Specified by:
getChartInternalin classAbstractAxis<GanttChartRow>
-
getAxisInternal
protected com.amalgamasimulation.charts.internals.axes.CategoryYAxisInternal<GanttChartRow> getAxisInternal()- Specified by:
getAxisInternalin classAbstractAxis<GanttChartRow>
-
getTitlePosition
Description copied from interface:IAxisTitlePositionPropertyOwnerReturns theAxisTitlePositionthat specifies the the chart's title position.- Specified by:
getTitlePositionin interfaceIAxisTitlePositionPropertyOwner- Returns:
- this current
AxisTitlePosition
-
setTitlePosition
Description copied from interface:IAxisTitlePositionPropertyOwnerSets theAxisTitlePositionthat specifies the chart's title position. Redraws this axis and it's parent chart.- Specified by:
setTitlePositionin interfaceIAxisTitlePositionPropertyOwner- Parameters:
yAxisTitlePosition- newAxisTitlePositionthat specifies the chart's title position- Returns:
- reference to this object
-
setScrollBarVisible
Description copied from interface:IScrollBarPropertyOwnerSpecifies whether the scrollbar should be drawn if scrolling the displayed rang of axis is possible. True by default. If set to false, the scrollbar will never be drawn but the functionality of scrolling this axis will still remain. Redraws this axis and it's parent chart if visibility is changed.- Specified by:
setScrollBarVisiblein interfaceIScrollBarPropertyOwner- Parameters:
visible- flag setting if the scrollbar should be drawn if scrolling the displayed rang of axis is possible- Returns:
- reference to this object
- See Also:
-
isScrollBarVisible
public boolean isScrollBarVisible()Description copied from interface:IScrollBarPropertyOwnerChecks whether the scrollbar should be drawn if scrolling the displayed rang of Y-axis is possible.- Specified by:
isScrollBarVisiblein interfaceIScrollBarPropertyOwner- Returns:
trueif the scrollbar should be drawn if scrolling the displayed rang of Y-axis is possible,falseotherwise
-
isScrollBarDisplayed
public boolean isScrollBarDisplayed()Description copied from interface:IScrollBarPropertyOwnerChecks whether the scrollbar is currently displayed.- Specified by:
isScrollBarDisplayedin interfaceIScrollBarPropertyOwner- Returns:
trueif the scrollbar is currently displayed,falseotherwise
-
isValueDisplayed
Checks if specifiedGanttChartRowis currently displayed.- Parameters:
ganttChartRow-GanttChartRowto check- Returns:
- true if specified
GanttChartRowis currently displayed
-
getFirstDisplayedGanttChartRowIndex
public int getFirstDisplayedGanttChartRowIndex()Returns the index of the first currently displayedGanttChartRow.- Returns:
- the index of the first currently displayed
GanttChartRow
-
getGanttChartRowsCount
public int getGanttChartRowsCount()Returns the count of the currently displayedGanttChartRow's.- Returns:
- the count of the currently displayed
GanttChartRow's
-
setTooltipText
public GanttChartCategoryYAxis setTooltipText(Function<GanttChartRow, String> yAxisTooltipTextExtractor) Adds tooltip text to display when the mouse is hovered over a vertical axis element.- Parameters:
yAxisTooltipTextExtractor- new tooltip text extractor- Returns:
- reference to this object
-
setTooltipTextFont
public GanttChartCategoryYAxis setTooltipTextFont(Function<GanttChartRow, javafx.scene.text.Font> yAxisTooltipFontExtractor) Sets the new font to the tooltip text.- Parameters:
yAxisTooltipFontExtractor- new tooltip font extractor- Returns:
- reference to this object
-
setTooltipTextFontSize
public GanttChartCategoryYAxis setTooltipTextFontSize(Function<GanttChartRow, Integer> yAxisTooltipFontSizeExtractor) Sets the new font size to the tooltip text.- Parameters:
yAxisTooltipFontSizeExtractor- new tooltip font size extractor- Returns:
- reference to this object
-
setLeftMarginRule
Sets the newLeftMarginRule. The possible possible values are: FIXED, DYNAMIC_BY_SHOWED_CONTENT. DYNAMIC_BY_SHOWED_CONTENT rule automatically calculates the margin based on the length of the vertical axis element names. FIXED rule calculated margin based on leftMargin value. Redraws this chart.- Parameters:
yAxisWidthRule- new left margin calculation rule- Returns:
- reference to this object
- See Also:
-
getLeftMarginRule
Returns the currentLeftMarginRule.- Returns:
- the current
LeftMarginRule
-
addClickHandler
Adds the action to be executed every time any element on the vertical axis is clicked.- Parameters:
handler- new vertical axis click handler- Returns:
- reference to this object
-
removeClickHandler
Removes vertical axis click handler.- Parameters:
handler- removed vertical axis click handler- Returns:
- reference to this object
-
clearClickHandlers
Removes all vertical axis click handlers.- Returns:
- reference to this object
-
setTitle
Description copied from interface:IAxisTitlePropertyOwnerSets the new title to this axis. Redraws this axis and it's parent chart if title is changed.- Specified by:
setTitlein interfaceIAxisTitlePropertyOwner<GanttChartRow>- Parameters:
title- new axis title- Returns:
- reference to this object
- See Also:
-
setTitleVisible
Description copied from interface:IAxisTitlePropertyOwnerSpecifies whether this axis title should be drawn. Redraws this axis and it's parent chart if visibility is changed.- Specified by:
setTitleVisiblein interfaceIAxisTitlePropertyOwner<GanttChartRow>- Parameters:
visible- new axis title visibility- Returns:
- reference to this object
- See Also:
-
setTitleFont
Description copied from interface:IAxisTitlePropertyOwnerSets the new font to this axis title. Redraws this axis and it's parent chart if font is changed.- Specified by:
setTitleFontin interfaceIAxisTitlePropertyOwner<GanttChartRow>- Parameters:
font- new axis title font- Returns:
- reference to this object
- See Also:
-
setTitleFontSize
Description copied from interface:IAxisTitlePropertyOwnerSets the new font size to this axis title. Redraws this axis and it's parent chart if font size is changed.- Specified by:
setTitleFontSizein interfaceIAxisTitlePropertyOwner<GanttChartRow>- Parameters:
fontSize- new axis title font size- Returns:
- reference to this object
- See Also:
-
setTitleColor
Description copied from interface:IAxisTitlePropertyOwnerSets the new color to this axis title. Redraws this axis and it's parent chart if color is changed.- Specified by:
setTitleColorin interfaceIAxisTitlePropertyOwner<GanttChartRow>- Parameters:
color- new axis title color- Returns:
- reference to this object
- See Also:
-
setTitleColor
Description copied from interface:IAxisTitlePropertyOwnerSets the new color to this axis title. Redraws this axis and it's parent chart if color is changed.- Specified by:
setTitleColorin interfaceIAxisTitlePropertyOwner<GanttChartRow>- Parameters:
color- new axis title color- Returns:
- reference to this object
- See Also:
-
getTitleColor
public javafx.scene.paint.Color getTitleColor()Description copied from interface:IAxisTitlePropertyOwnerReturns the color of this axis title.- Specified by:
getTitleColorin interfaceIAxisTitlePropertyOwner<GanttChartRow>- Returns:
- the color of this axis title
-
getTitle
Description copied from interface:IAxisTitlePropertyOwnerReturns the title of this axis, ornullif title has not been specified.- Specified by:
getTitlein interfaceIAxisTitlePropertyOwner<GanttChartRow>- Returns:
- the title of this axis, or
nullif title has not been specified
-
isTitleVisible
public boolean isTitleVisible()Description copied from interface:IAxisTitlePropertyOwnerChecks whether this axis title should be drawn.- Specified by:
isTitleVisiblein interfaceIAxisTitlePropertyOwner<GanttChartRow>- Returns:
trueif this axis title should be drawn,falseotherwise
-
getTitleFont
public javafx.scene.text.Font getTitleFont()Description copied from interface:IAxisTitlePropertyOwnerReturns the font of this axis title.- Specified by:
getTitleFontin interfaceIAxisTitlePropertyOwner<GanttChartRow>- Returns:
- axis title font
-
getTitleFontSize
public int getTitleFontSize()Description copied from interface:IAxisTitlePropertyOwnerReturns the font size of this axis title.- Specified by:
getTitleFontSizein interfaceIAxisTitlePropertyOwner<GanttChartRow>- Returns:
- the font size of this axis title
-