Class RangeRegionVisualSet<T>
java.lang.Object
com.amalgamasimulation.charts.visualsets.VisualSet<T>
com.amalgamasimulation.charts.visualsets.LabeledVisualSet<T>
com.amalgamasimulation.charts.visualsets.AbstractRegionVisualSet<T>
com.amalgamasimulation.charts.visualsets.RangeRegionVisualSet<T>
- Type Parameters:
T- visual set data elements type
- All Implemented Interfaces:
IBeginEndArgumentPropertyOwner<T>,IClipboardTextPropertyOwner<Pair<Double,,Double>> IMinMaxValuePropertyOwner,IUpdatePolicyPropertyOwner,IAbstractChartVisualSet,ILineChartVisualSet
public class RangeRegionVisualSet<T>
extends AbstractRegionVisualSet<T>
implements ILineChartVisualSet, IMinMaxValuePropertyOwner, IClipboardTextPropertyOwner<Pair<Double,Double>>
Visual set for drawing regions with limited ranges along Y-axis.
Can be drawn on AbstractLineChart.
Each region is defined by a pair of begin and end values on the X-axis and fills the full height of the chart's content area on the Y-axis.
- Author:
- Aleksey Kirillov
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassInternal class that represents visual element for region data element.Nested classes/interfaces inherited from class com.amalgamasimulation.charts.visualsets.AbstractRegionVisualSet
AbstractRegionVisualSet.AbstractRegionVisualElementNested classes/interfaces inherited from class com.amalgamasimulation.charts.visualsets.LabeledVisualSet
LabeledVisualSet.LabeledVisualElementNested classes/interfaces inherited from class com.amalgamasimulation.charts.visualsets.VisualSet
VisualSet.ContextMenuHandler<T>, VisualSet.UpdatePolicy, VisualSet.VisualElement -
Field Summary
Fields inherited from class com.amalgamasimulation.charts.visualsets.LabeledVisualSet
labelColorExtractors, labelFontSizeExtractors, labelTextExtractors, labelTextSidesListFields inherited from class com.amalgamasimulation.charts.visualsets.VisualSet
argumentExtractor, contentsToBeginArguments, contentsToEndArguments, contentsToVisualElements, contextMenuHandlers, dataElementsProvider, listeners, maxArgument, maxValueCache, minArgument, minValueCache, mouseEnterHandlers, mouseExitHandlers, mousePressedHandlers, mouseTransparent, name, needsUpdate, oldContentsList, tooltipTextExtractor, updatePolicy, visibilityChangeHandlers, visualElementsList -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaddContextMenuHandler(VisualSet.ContextMenuHandler<T> contextMenuHandler) Adds the action to be executed every time a context menu for given data element is called.addMouseEnterHandler(BiConsumer<T, javafx.scene.input.MouseEvent> handler) Adds the action to be executed every time mouse enters to any visual element borders.addMouseExitHandler(BiConsumer<T, javafx.scene.input.MouseEvent> handler) Adds the action to be executed every time the mouse exits the previously entered element's bounds.addMousePressedHandler(BiConsumer<T, javafx.scene.input.MouseEvent> handler) Adds the action to be executed every time a mouse button is pressed.addVisibilityChangeHandler(Consumer<VisibilityChangeDescriptor<? extends IAbstractChartVisualSet>> visibilityChangeHandler) Adds the action to be executed every time the visibility of this VisualSet is changed.createVisualElement(T contents) Creates a new instance ofVisualSet<T>.VisualElementcorresponding to the current VisualSet type.getClipboardText(Pair<Double, Double> object) Returns the text that will be copied to clipboard for the given object.doubleReturns the maximum Y-axis value for all data elements.doublegetMaxValue(T element) Returns the Y-axis max value for given data element.doubleReturns the minimum Y-axis value for all data elements.doublegetMinValue(T element) Returns the Y-axis min value for given data element.getVisualElements(boolean recalculationRequired) Returns the list of visual elements corresponding to current data elements.setBackgroundColor(Function<T, Color> backgroundColorExtractor) Sets the background color for each data element.setBorderColor(Function<T, Color> borderColorExtractor) Sets the border color for each data element.setBorderWidth(Function<T, Double> borderWidthExtractor) Sets the border width in pixels for each data element.Sets the conversion method from values of each plot data element into text that will be copied to clipboard.setLabelText(LabelSide labelSide, Function<? extends T, String> labelTextExtractor, Function<? extends T, Double> labelTextSizeExtractor, Function<? extends T, Color> labelTextColorExtractor) Sets the labels of the rectangles representing plot data elements.setMaxValue(Function<T, Double> maxValueExtractor) Sets the Y-axis max value for each data element.setMinValue(Function<T, Double> minValueExtractor) Sets the Y-axis min value for each data element.setMouseTransparent(boolean mouseTransparent) Sets the value of the property mouseTransparent.setTooltipText(Function<T, String> tooltipTextExtractor) Adds tooltip text to display when the mouse is hovered over a visual element representing given data element.setUpdatePolicy(VisualSet.UpdatePolicy updatePolicy) Sets the newVisualSet.UpdatePolicyi.e.Methods inherited from class com.amalgamasimulation.charts.visualsets.AbstractRegionVisualSet
getBackgroundColor, getBeginArgument, getBorderColor, getBorderWidth, getEndArgumentMethods inherited from class com.amalgamasimulation.charts.visualsets.LabeledVisualSet
getLabelColor, getLabelFontSize, getLabelSides, getLabelTextMethods inherited from class com.amalgamasimulation.charts.visualsets.VisualSet
addVisualElement, addVisualElement, addVisualSetChangeHandler, clearDependencies, getArgument, getContents, getContextMenuHandlers, getDataElements, getInjectionIndex, getMaxArgument, getMinArgument, getMouseEnterHandlers, getMouseExitHandlers, getMousePressedHandlers, getName, getTooltipText, getUpdatePolicy, getVisibilityChangeHandlers, getVisibleVisualElementIndex, getVisibleVisualElementsCount, isMouseTransparent, isNeedsUpdate, recalculateVisualElements, removeContextMenuHandler, removeMouseEnterHandler, removeMouseExitHandler, removeMousePressedHandler, removeVisibilityChangeHandler, removeVisualElement, removeVisualSetChangeHandler, sortVisualElements, toString, update, updateMinMaxArgumentsValuesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.amalgamasimulation.charts.visualsets.types.IAbstractChartVisualSet
addVisualSetChangeHandler, getContents, getMaxArgument, getMinArgument, getName, getUpdatePolicy, getVisibilityChangeHandlers, getVisibleVisualElementsCount, isMouseTransparent, removeVisibilityChangeHandler, removeVisualSetChangeHandler
-
Constructor Details
-
RangeRegionVisualSet
-
-
Method Details
-
setBackgroundColor
Description copied from class:AbstractRegionVisualSetSets the background color for each data element. The color may be different for different data elements.- Overrides:
setBackgroundColorin classAbstractRegionVisualSet<T>- Parameters:
backgroundColorExtractor- the background color extractor, i.e. method returning color depending on the data element- Returns:
- reference to this object
-
setBorderColor
Description copied from class:AbstractRegionVisualSetSets the border color for each data element. The color may be different for different data elements.- Overrides:
setBorderColorin classAbstractRegionVisualSet<T>- Parameters:
borderColorExtractor- the border color extractor, i.e. method returning color depending on the data element- Returns:
- reference to this object
-
setBorderWidth
Description copied from class:AbstractRegionVisualSetSets the border width in pixels for each data element. The width may be different for different data elements.- Overrides:
setBorderWidthin classAbstractRegionVisualSet<T>- Parameters:
borderWidthExtractor- the border width extractor, i.e. method returning width in pixels depending on the data element- Returns:
- reference to this object
-
setLabelText
public RangeRegionVisualSet<T> setLabelText(LabelSide labelSide, Function<? extends T, String> labelTextExtractor, Function<? extends T, Double> labelTextSizeExtractor, Function<? extends T, Color> labelTextColorExtractor) Description copied from class:LabeledVisualSetSets the labels of the rectangles representing plot data elements. The label of each rectangle is set independently of the labels on other sides of this rectangle or the labels on other rectangles. The label will not be displayed if the specified text is empty.- Overrides:
setLabelTextin classAbstractRegionVisualSet<T>- Parameters:
labelSide- theLabelSideof rectangle where the corresponding label will be drawnlabelTextExtractor- the text of the labellabelTextSizeExtractor- the font size of the labellabelTextColorExtractor- the color of the label- Returns:
- reference to this object
-
setTooltipText
Description copied from class:VisualSetAdds tooltip text to display when the mouse is hovered over a visual element representing given data element.- Overrides:
setTooltipTextin classAbstractRegionVisualSet<T>- Parameters:
tooltipTextExtractor- a function that specifies the rule for extracting a tooltip text from a data element- Returns:
- reference to this object
-
setUpdatePolicy
Description copied from interface:IAbstractChartVisualSetSets the newVisualSet.UpdatePolicyi.e. the VisualSet update control rule.- Specified by:
setUpdatePolicyin interfaceIAbstractChartVisualSet- Specified by:
setUpdatePolicyin interfaceIUpdatePolicyPropertyOwner- Overrides:
setUpdatePolicyin classVisualSet<T>- Parameters:
updatePolicy- newVisualSet.UpdatePolicyi.e. the VisualSet update control rule- Returns:
- reference to this object
-
addContextMenuHandler
public RangeRegionVisualSet<T> addContextMenuHandler(VisualSet.ContextMenuHandler<T> contextMenuHandler) Description copied from class:VisualSetAdds the action to be executed every time a context menu for given data element is called.- Overrides:
addContextMenuHandlerin classVisualSet<T>- Parameters:
contextMenuHandler- context menu call action- Returns:
- reference to this object
-
addMouseEnterHandler
public RangeRegionVisualSet<T> addMouseEnterHandler(BiConsumer<T, javafx.scene.input.MouseEvent> handler) Description copied from class:VisualSetAdds the action to be executed every time mouse enters to any visual element borders.- Overrides:
addMouseEnterHandlerin classVisualSet<T>- Parameters:
handler- new mouse enter action- Returns:
- reference to this object
-
addMouseExitHandler
public RangeRegionVisualSet<T> addMouseExitHandler(BiConsumer<T, javafx.scene.input.MouseEvent> handler) Description copied from class:VisualSetAdds the action to be executed every time the mouse exits the previously entered element's bounds.- Overrides:
addMouseExitHandlerin classVisualSet<T>- Parameters:
handler- new mouse exit action- Returns:
- reference to this object
-
addMousePressedHandler
public RangeRegionVisualSet<T> addMousePressedHandler(BiConsumer<T, javafx.scene.input.MouseEvent> handler) Description copied from class:VisualSetAdds the action to be executed every time a mouse button is pressed.- Overrides:
addMousePressedHandlerin classVisualSet<T>- Parameters:
handler- new mouse button pressed action- Returns:
- reference to this object
-
addVisibilityChangeHandler
public RangeRegionVisualSet<T> addVisibilityChangeHandler(Consumer<VisibilityChangeDescriptor<? extends IAbstractChartVisualSet>> visibilityChangeHandler) Description copied from interface:IAbstractChartVisualSetAdds the action to be executed every time the visibility of this VisualSet is changed.- Specified by:
addVisibilityChangeHandlerin interfaceIAbstractChartVisualSet- Overrides:
addVisibilityChangeHandlerin classVisualSet<T>- Parameters:
visibilityChangeHandler- visibility change action- Returns:
- reference to this object
-
setMouseTransparent
Description copied from interface:IAbstractChartVisualSetSets the value of the property mouseTransparent. If true, this VisualSet is completely transparent to mouse events. When choosing target for mouse event, VisualSets with mouseTransparent set to true won't be taken into account.- Specified by:
setMouseTransparentin interfaceIAbstractChartVisualSet- Overrides:
setMouseTransparentin classVisualSet<T>- Parameters:
mouseTransparent- new value of property mouseTransparent- Returns:
- reference to this object
-
setMinValue
Sets the Y-axis min value for each data element.- Parameters:
minValueExtractor- the Y-axis min value extractor, i.e. method returning Y-axis min value depending on the data element- Returns:
- reference to this object
-
setMaxValue
Sets the Y-axis max value for each data element.- Parameters:
maxValueExtractor- the Y-axis max value extractor, i.e. method returning Y-axis max value depending on the data element- Returns:
- reference to this object
-
getMinValue
Returns the Y-axis min value for given data element.- Parameters:
element- data element for which the Y-axis min value is being checked- Returns:
- the Y-axis begin value for given data element
-
getMaxValue
Returns the Y-axis max value for given data element.- Parameters:
element- data element for which the Y-axis max value is being checked- Returns:
- the Y-axis max value for given data element
-
getVisualElements
public List<RangeRegionVisualSet<T>.RangeRegionVisualElement> getVisualElements(boolean recalculationRequired) Description copied from interface:IAbstractChartVisualSetReturns the list of visual elements corresponding to current data elements. Cannot be changed by the user.- Specified by:
getVisualElementsin interfaceIAbstractChartVisualSet- Specified by:
getVisualElementsin interfaceILineChartVisualSet- Overrides:
getVisualElementsin classVisualSet<T>- Parameters:
recalculationRequired- flag of the need to recalculate the visual elements- Returns:
- the list of visual elements corresponding to current data elements
-
createVisualElement
Description copied from class:VisualSetCreates a new instance ofVisualSet<T>.VisualElementcorresponding to the current VisualSet type.- Specified by:
createVisualElementin classVisualSet<T>- Parameters:
contents- data element for which theVisualSet<T>.VisualElementis being checked- Returns:
- a new instance of
VisualSet<T>.VisualElementcorresponding to the current VisualSet type
-
getMinValue
public double getMinValue()Description copied from interface:IMinMaxValuePropertyOwnerReturns the minimum Y-axis value for all data elements. The minimum value is recalculated and cached at the moment the chart is redrawn. The method returns the value stored in the cache.- Specified by:
getMinValuein interfaceIMinMaxValuePropertyOwner- Returns:
- the minimum Y-axis value for all data elements
- See Also:
-
getMaxValue
public double getMaxValue()Description copied from interface:IMinMaxValuePropertyOwnerReturns the maximum Y-axis value for all data elements. The maximum value is recalculated and cached at the moment the chart is redrawn. The method returns the value stored in the cache.- Specified by:
getMaxValuein interfaceIMinMaxValuePropertyOwner- Returns:
- the maximum Y-axis value for all data elements
- See Also:
-
setClipboardText
public RangeRegionVisualSet<T> setClipboardText(Function<Pair<Double, Double>, String> clipboardTextExtractor) Description copied from interface:IClipboardTextPropertyOwnerSets the conversion method from values of each plot data element into text that will be copied to clipboard.- Specified by:
setClipboardTextin interfaceIClipboardTextPropertyOwner<T>- Parameters:
clipboardTextExtractor- an extractor that converts the value of each plot data element into text that will be copied to the clipboard- Returns:
- reference to this object
-
getClipboardText
Description copied from interface:IClipboardTextPropertyOwnerReturns the text that will be copied to clipboard for the given object.- Specified by:
getClipboardTextin interfaceIClipboardTextPropertyOwner<T>- Parameters:
object- object for which the clipboard text is being checked- Returns:
- the text that will be copied to clipboard for the given object
-