Package com.amalgamasimulation.charts
Class AbstractLineChart
java.lang.Object
com.amalgamasimulation.charts.Chart<ILineChartVisualSet,LineVisualSetContainer>
com.amalgamasimulation.charts.AbstractLineChart
- All Implemented Interfaces:
IVerticalGuidelineOwner<ILineChartVisualSet,
LineVisualSetContainer>
- Direct Known Subclasses:
NumericLineChart
,TimeLineChart
public abstract class AbstractLineChart
extends Chart<ILineChartVisualSet,LineVisualSetContainer>
implements IVerticalGuidelineOwner<ILineChartVisualSet,LineVisualSetContainer>
Used to show linear plots or clouds of points in two-dimensional coordinates.
- Author:
- Aleksey Kirillov
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.amalgamasimulation.charts.internals.charts.LineChartInternal
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddContextMenuItem
(LineChartContextMenuItem contextMenuItem) Adds the new context menu item to the end of the items list.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.void
Clear all the vertical guideline visibility or position changed actions.final com.amalgamasimulation.charts.internals.charts.LineChartInternal
abstract Legend
<ILineChartVisualSet, com.amalgamasimulation.charts.internals.charts.LineChartInternal> Returns theLegend
currently shown on this chart.javafx.scene.paint.Color
Returns the current color of the vertical guideline.Return 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
(LineChartContextMenuItem contextMenuHandler) Removes the context menu item.void
Removes 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.Sets the formatter to 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
-
internalLineChart
protected com.amalgamasimulation.charts.internals.charts.LineChartInternal internalLineChart
-
-
Constructor Details
-
AbstractLineChart
public AbstractLineChart()
-
-
Method Details
-
getChartInternal
public final com.amalgamasimulation.charts.internals.charts.LineChartInternal getChartInternal()- Specified by:
getChartInternal
in classChart<ILineChartVisualSet,
LineVisualSetContainer>
-
getLegend
public abstract Legend<ILineChartVisualSet,com.amalgamasimulation.charts.internals.charts.LineChartInternal> getLegend()Returns theLegend
currently shown on this chart.- Returns:
- the
Legend
currently shown on this chart
-
setVerticalGuidelineLabelFormat
Sets the formatter to 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 vertical guideline label formatter- Returns:
- reference to this object
- See Also:
-
getVerticalGuidelineLabelFormat
Return the formatter of the vertical guideline label.- Returns:
- the formatter of the vertical guideline label
-
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: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<ILineChartVisualSet,
LineVisualSetContainer> - 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<ILineChartVisualSet,
LineVisualSetContainer> - 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<ILineChartVisualSet,
LineVisualSetContainer> - 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<ILineChartVisualSet,
LineVisualSetContainer> - 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<ILineChartVisualSet,
LineVisualSetContainer> - 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<ILineChartVisualSet,
LineVisualSetContainer> - 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<ILineChartVisualSet,
LineVisualSetContainer> - 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<ILineChartVisualSet,
LineVisualSetContainer> - 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<ILineChartVisualSet,
LineVisualSetContainer> - 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<ILineChartVisualSet,
LineVisualSetContainer> - 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<ILineChartVisualSet,
LineVisualSetContainer> - Returns:
- the current color of the vertical guideline
-
getVerticalGuidelineWidth
public double getVerticalGuidelineWidth()Description copied from interface:IVerticalGuidelineOwner
Returns the current width of the vertical guideline.- Specified by:
getVerticalGuidelineWidth
in interfaceIVerticalGuidelineOwner<ILineChartVisualSet,
LineVisualSetContainer> - 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<ILineChartVisualSet,
LineVisualSetContainer> - 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<ILineChartVisualSet,
LineVisualSetContainer> - 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<ILineChartVisualSet,
LineVisualSetContainer> - Returns:
- the current X-axis position of vertical guideline
-
setVerticalGuidelineSnapToGridLines
Description copied from interface:IVerticalGuidelineOwner
Specifies whether the vertical guideline should be snapped to grid lines.- Specified by:
setVerticalGuidelineSnapToGridLines
in interfaceIVerticalGuidelineOwner<ILineChartVisualSet,
LineVisualSetContainer> - 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<ILineChartVisualSet,
LineVisualSetContainer> - Returns:
- true if vertical guideline is snapped to grid lines
-
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<ILineChartVisualSet,
LineVisualSetContainer> - 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<ILineChartVisualSet,
LineVisualSetContainer> - 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<ILineChartVisualSet,
LineVisualSetContainer>
-