Package com.amalgamasimulation.charts
Class AbstractBarChart
java.lang.Object
com.amalgamasimulation.charts.Chart<IBarChartVisualSet,BarVisualSetContainer>
com.amalgamasimulation.charts.AbstractBarChart
- All Implemented Interfaces:
IVerticalGuidelineOwner<IBarChartVisualSet,BarVisualSetContainer>
- Direct Known Subclasses:
BarChart,HistogramChart
public abstract class AbstractBarChart
extends Chart<IBarChartVisualSet,BarVisualSetContainer>
implements IVerticalGuidelineOwner<IBarChartVisualSet,BarVisualSetContainer>
Abstract class for charts used to show statistical data by categories as well
as histograms.
- Author:
- Aleksey Kirillov
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.amalgamasimulation.charts.internals.charts.AbstractBarChartInternal -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddContextMenuItem(BarChartContextMenuItem contextMenuItem) Adds the new context menu item to the end of the items list.voidAdds 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.voidClear all the vertical guideline visibility or position changed actions.protected com.amalgamasimulation.charts.internals.charts.AbstractBarChartInternalReturns theLegendcurrently shown on this chart.javafx.scene.paint.ColorReturns the current color of the vertical guideline.doubleReturns the current X-axis position of vertical guideline.doubleReturns the current width of the vertical guideline.Hides the currently displayed vertical guideline.booleanChecks whether vertical guideline is displayed.booleanChecks whether the vertical guideline label is drawn.booleanChecks whether vertical guideline is snapped to grid lines.booleanChecks whether the legend values are drawn.booleanChecks whether vertical guideline is drawn.removeContextMenuItem(BarChartContextMenuItem contextMenuHandler) Removes the context menu item.voidRemoves the vertical guideline visibility or position changed action.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.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, getLeftMargin, getTitle, getTitleColor, getTitleFont, getTitleFontSize, getTopMargin, getVisualSetContainer, getXAxis, getYAxis, initializeChartGroup, isDisposed, isRedrawInProgress, isTitleVisible, isVisible, isVisualSetVisible, redraw, removeKeyPressedHandler, removeKeyReleasedHandler, removeMouseDragExitedHandler, removeMouseDraggedHandler, removeMouseDragOverHandler, removeMouseDragReleasedHandler, removeMouseEnteredHandler, removeMouseExitedHandler, removeMousePressedHandler, removeMouseReleasedHandler, removeMouseScrollHandler, removeRedrawFinishedHandler, removeTextLabel, resizeChart, setBackgroundColor, setBackgroundColor, setBottomMargin, setContentBackgroundColor, setContentBackgroundColor, setContextMenuVisible, setCopyToClipboardContextMenuItemVisible, setLeftMargin, setTitle, setTitleColor, setTitleColor, setTitleFont, setTitleFontSize, setTitleVisible, setTopMargin, setVisibility, setVisualSetContainer, setVisualSetVisible, updateSize
-
Field Details
-
internalBarChart
protected com.amalgamasimulation.charts.internals.charts.AbstractBarChartInternal internalBarChart
-
-
Constructor Details
-
AbstractBarChart
public AbstractBarChart()
-
-
Method Details
-
getChartInternal
protected com.amalgamasimulation.charts.internals.charts.AbstractBarChartInternal getChartInternal()- Specified by:
getChartInternalin classChart<IBarChartVisualSet,BarVisualSetContainer>
-
getLegend
Returns theLegendcurrently shown on this chart.- Returns:
- the
Legendcurrently shown on this chart
-
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
-
setVerticalGuidelineVisible
Description copied from interface:IVerticalGuidelineOwnerSpecifies 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:
setVerticalGuidelineVisiblein interfaceIVerticalGuidelineOwner<IBarChartVisualSet,BarVisualSetContainer> - Parameters:
visible-trueif vertical guideline functionality should be enabled,falseotherwise- Returns:
- reference to this object
-
setVerticalGuidelineLabelVisible
Description copied from interface:IVerticalGuidelineOwnerSpecifies whether the vertical guideline label should be drawn. Istrueby default. Redraws this chart if visibility is changed.- Specified by:
setVerticalGuidelineLabelVisiblein interfaceIVerticalGuidelineOwner<IBarChartVisualSet,BarVisualSetContainer> - Parameters:
visible- new vertical guideline label visibility- Returns:
- reference to this object
-
setVerticalGuidelineValuesVisible
Description copied from interface:IVerticalGuidelineOwnerSpecifies 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. Istrueby default. Redraws this chart if visibility is changed.- Specified by:
setVerticalGuidelineValuesVisiblein interfaceIVerticalGuidelineOwner<IBarChartVisualSet,BarVisualSetContainer> - Parameters:
visible-trueif the legend values should be drawn,falseotherwise- Returns:
- reference to this object
-
showVerticalGuidelineDisplayed
Description copied from interface:IVerticalGuidelineOwnerShows a vertical guideline at the specified X-axis position. Redraws this chart.- Specified by:
showVerticalGuidelineDisplayedin interfaceIVerticalGuidelineOwner<IBarChartVisualSet,BarVisualSetContainer> - Parameters:
position- specified X-axis position of the vertical guideline- Returns:
- reference to this object
-
setVerticalGuidelineColor
Description copied from interface:IVerticalGuidelineOwnerSets the new color to the vertical guideline. Redraws this chart if color is changed.- Specified by:
setVerticalGuidelineColorin interfaceIVerticalGuidelineOwner<IBarChartVisualSet,BarVisualSetContainer> - Parameters:
color- new vertical guideline color- Returns:
- reference to this object
-
setVerticalGuidelineColor
Description copied from interface:IVerticalGuidelineOwnerSets the new color to the vertical guideline. Redraws this chart if color is changed.- Specified by:
setVerticalGuidelineColorin interfaceIVerticalGuidelineOwner<IBarChartVisualSet,BarVisualSetContainer> - Parameters:
color- new vertical guideline color- Returns:
- reference to this object
-
setVerticalGuidelineWidth
Description copied from interface:IVerticalGuidelineOwnerSets the new width to the vertical guideline, in pixels. Redraws this chart if width is changed.- Specified by:
setVerticalGuidelineWidthin interfaceIVerticalGuidelineOwner<IBarChartVisualSet,BarVisualSetContainer> - Parameters:
width- new vertical guideline width, in pixels- Returns:
- reference to this object
-
isVerticalGuidelineVisible
public boolean isVerticalGuidelineVisible()Description copied from interface:IVerticalGuidelineOwnerChecks whether vertical guideline is drawn.- Specified by:
isVerticalGuidelineVisiblein interfaceIVerticalGuidelineOwner<IBarChartVisualSet,BarVisualSetContainer> - Returns:
trueif vertical guideline is drawn,falseotherwise
-
isVerticalGuidelineLabelVisible
public boolean isVerticalGuidelineLabelVisible()Description copied from interface:IVerticalGuidelineOwnerChecks whether the vertical guideline label is drawn.- Specified by:
isVerticalGuidelineLabelVisiblein interfaceIVerticalGuidelineOwner<IBarChartVisualSet,BarVisualSetContainer> - Returns:
trueif the vertical guideline label is drawn,falseotherwise
-
isVerticalGuidelineValuesVisible
public boolean isVerticalGuidelineValuesVisible()Description copied from interface:IVerticalGuidelineOwnerChecks whether the legend values are drawn.- Specified by:
isVerticalGuidelineValuesVisiblein interfaceIVerticalGuidelineOwner<IBarChartVisualSet,BarVisualSetContainer> - Returns:
trueif the legend values are drawn,falseotherwise
-
getVerticalGuidelineColor
public javafx.scene.paint.Color getVerticalGuidelineColor()Description copied from interface:IVerticalGuidelineOwnerReturns the current color of the vertical guideline.- Specified by:
getVerticalGuidelineColorin interfaceIVerticalGuidelineOwner<IBarChartVisualSet,BarVisualSetContainer> - Returns:
- the current color of the vertical guideline
-
getVerticalGuidelineWidth
public double getVerticalGuidelineWidth()Description copied from interface:IVerticalGuidelineOwnerReturns the current width of the vertical guideline.- Specified by:
getVerticalGuidelineWidthin interfaceIVerticalGuidelineOwner<IBarChartVisualSet,BarVisualSetContainer> - Returns:
- the current width of the vertical guideline
-
setVerticalGuidelineSnapToGridLines
Description copied from interface:IVerticalGuidelineOwnerSpecifies whether the vertical guideline should be snapped to grid lines.- Specified by:
setVerticalGuidelineSnapToGridLinesin interfaceIVerticalGuidelineOwner<IBarChartVisualSet,BarVisualSetContainer> - 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:IVerticalGuidelineOwnerChecks whether vertical guideline is snapped to grid lines.- Specified by:
isVerticalGuidelineSnapToGridLinesin interfaceIVerticalGuidelineOwner<IBarChartVisualSet,BarVisualSetContainer> - Returns:
- true if vertical guideline is snapped to grid lines
-
hideVerticalGuideline
Description copied from interface:IVerticalGuidelineOwnerHides the currently displayed vertical guideline. Redraws this chart. Does nothing if the vertical guideline is not currently displayed.- Specified by:
hideVerticalGuidelinein interfaceIVerticalGuidelineOwner<IBarChartVisualSet,BarVisualSetContainer> - Returns:
- reference to this object
-
isVerticalGuidelineDisplayed
public boolean isVerticalGuidelineDisplayed()Description copied from interface:IVerticalGuidelineOwnerChecks whether vertical guideline is displayed.- Specified by:
isVerticalGuidelineDisplayedin interfaceIVerticalGuidelineOwner<IBarChartVisualSet,BarVisualSetContainer> - Returns:
- true if vertical guideline is displayed
-
getVerticalGuidelinePosition
public double getVerticalGuidelinePosition()Description copied from interface:IVerticalGuidelineOwnerReturns the current X-axis position of vertical guideline.- Specified by:
getVerticalGuidelinePositionin interfaceIVerticalGuidelineOwner<IBarChartVisualSet,BarVisualSetContainer> - Returns:
- the current X-axis position of vertical guideline
-
addVerticalGuidelineChangeHandler
Description copied from interface:IVerticalGuidelineOwnerAdds the action to be executed every time the vertical guideline visibility or position is changed.- Specified by:
addVerticalGuidelineChangeHandlerin interfaceIVerticalGuidelineOwner<IBarChartVisualSet,BarVisualSetContainer> - Parameters:
handler- new action to be executed every time the vertical guideline visibility or position is changed
-
removeVerticalGuidelineChangeHandler
Description copied from interface:IVerticalGuidelineOwnerRemoves the vertical guideline visibility or position changed action.- Specified by:
removeVerticalGuidelineChangeHandlerin interfaceIVerticalGuidelineOwner<IBarChartVisualSet,BarVisualSetContainer> - Parameters:
handler- removed vertical guideline visibility or position changed action
-
clearVerticalGuidelineChangeHandlers
public void clearVerticalGuidelineChangeHandlers()Description copied from interface:IVerticalGuidelineOwnerClear all the vertical guideline visibility or position changed actions.- Specified by:
clearVerticalGuidelineChangeHandlersin interfaceIVerticalGuidelineOwner<IBarChartVisualSet,BarVisualSetContainer>
-