Class VerticalGridLineVisualSet<T>
java.lang.Object
com.amalgamasimulation.visualsets.VisualSet<T>
com.amalgamasimulation.visualsets.AbstractGridLineVisualSet<T>
com.amalgamasimulation.visualsets.VerticalGridLineVisualSet<T>
- Type Parameters:
T- visual set data elements type
- All Implemented Interfaces:
IClipboardTextPropertyOwner<String>,IUpdatePolicyPropertyOwner,IAbstractChartVisualSet,IGanttChartVisualSet,ILineChartVisualSet
public class VerticalGridLineVisualSet<T>
extends AbstractGridLineVisualSet<T>
implements ILineChartVisualSet, IGanttChartVisualSet, IClipboardTextPropertyOwner<String>
Visual set for drawing triangle markers.
Usually used to indicate some events on the time-relative X-axis.
- Author:
- Aleksey
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassInternal class that represents visual element for vertical grid data element.Nested classes/interfaces inherited from class com.amalgamasimulation.visualsets.AbstractGridLineVisualSet
AbstractGridLineVisualSet.AbstractGridLineVisualElement, AbstractGridLineVisualSet.GridLineLabelPosition, AbstractGridLineVisualSet.GridLineLabelSideNested classes/interfaces inherited from class com.amalgamasimulation.visualsets.VisualSet
VisualSet.ContextMenuHandler<T>, VisualSet.UpdatePolicy, VisualSet.VisualElement -
Field Summary
FieldsModifier and TypeFieldDescriptionFields inherited from class com.amalgamasimulation.visualsets.AbstractGridLineVisualSet
labelColorExtractor, labelFontSizeExtractor, labelTextExtractor, labelTextPositionExtractor, labelTextSideExtractor, lineColorExtractor, lineWidthExtractorFields inherited from class com.amalgamasimulation.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, MouseEvent> handler) Adds the action to be executed every time mouse enters to any visual element borders.addMouseExitHandler(BiConsumer<T, MouseEvent> handler) Adds the action to be executed every time the mouse exits the previously entered element's bounds.addMousePressedHandler(BiConsumer<T, 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(String object) Returns the text that will be copied to clipboard for the given object.getVisualElements(boolean recalculationRequired) Returns the list of visual elements corresponding to current data elements.booleanReturns the value of the property includeWhenCopyingToClipboard.setClipboardText(Function<String, String> clipboardTextExtractor) Sets the conversion method from values of each plot data element into text that will be copied to clipboard.setIncludeWhenCopyingToClipboard(Supplier<Boolean> includeWhenCopyingToClipboard) Sets the supplier of the property includeWhenCopyingToClipboard.setLabelText(Function<T, String> labelTextExtractor, Function<T, Double> labelTextSizeExtractor, Function<T, Color> labelTextColorExtractor, Function<T, AbstractGridLineVisualSet.GridLineLabelPosition> labelTextPositionExtractor, Function<T, AbstractGridLineVisualSet.GridLineLabelSide> labelTextSideExtractor) Sets the labels of the grid lines representing plot data elements.setLineColor(Function<T, Color> lineColorExtractor) Sets the line color of the lines representing plot data elements.setLineWidth(Function<T, Double> lineWidthExtractor) Sets the width of the grid lines representing plot data elements, in pixels.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.visualsets.AbstractGridLineVisualSet
getLabelColor, getLabelFontSize, getLabelText, getLabelTextPosition, getLabelTextSide, getLineColor, getLineWidth, getValueMethods inherited from class com.amalgamasimulation.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, updateMinMaxArguments, updateMinMaxArgumentsValuesMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.amalgamasimulation.visualsets.types.IAbstractChartVisualSet
addVisualSetChangeHandler, getContents, getMaxArgument, getMinArgument, getName, getUpdatePolicy, getVisibilityChangeHandlers, getVisibleVisualElementsCount, isMouseTransparent, removeVisibilityChangeHandler, removeVisualSetChangeHandler
-
Field Details
-
clipboardTextExtractor
-
includeWhenCopyingToClipboard
-
-
Constructor Details
-
VerticalGridLineVisualSet
public VerticalGridLineVisualSet(String name, Supplier<List<T>> dataElementsProvider, Function<T, Double> argumentExtractor) Constructs a VerticalGridLineVisualSet with given name, data elements and arguments extractor, i.e. a function that specifies the rule for extracting an argument from a data element.- Parameters:
name- visual set name is used to sort and name the visual sets on the chartdataElementsProvider- data elements list provider. The provider is invalidated every time the chart is beging redrawnargumentExtractor- a function that specifies the rule for extracting an argument from a data element
-
-
Method Details
-
setLineColor
Description copied from class:AbstractGridLineVisualSetSets the line color of the lines representing plot data elements. The color of each element is set independently of the color of other elements. Transparent and semi-transparent colors are allowed.- Overrides:
setLineColorin classAbstractGridLineVisualSet<T>- Parameters:
lineColorExtractor- new line color of the plot- Returns:
- reference to this object
-
setLineWidth
Description copied from class:AbstractGridLineVisualSetSets the width of the grid lines representing plot data elements, in pixels. The width of each grid line is set independently of the width of other grid lines.- Overrides:
setLineWidthin classAbstractGridLineVisualSet<T>- Parameters:
lineWidthExtractor- new line width of the plot, in pixels- 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 classAbstractGridLineVisualSet<T>- Parameters:
tooltipTextExtractor- a function that specifies the rule for extracting a tooltip text from a data element- Returns:
- reference to this object
-
setClipboardText
public VerticalGridLineVisualSet<T> setClipboardText(Function<String, 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
-
setLabelText
public VerticalGridLineVisualSet<T> setLabelText(Function<T, String> labelTextExtractor, Function<T, Double> labelTextSizeExtractor, Function<T, Color> labelTextColorExtractor, Function<T, AbstractGridLineVisualSet.GridLineLabelPosition> labelTextPositionExtractor, Function<T, AbstractGridLineVisualSet.GridLineLabelSide> labelTextSideExtractor) Description copied from class:AbstractGridLineVisualSetSets the labels of the grid lines representing plot data elements. The label of each grid line is set independently of the labels of other grid lines. The label will not be displayed if the specified text is empty.- Overrides:
setLabelTextin classAbstractGridLineVisualSet<T>- Parameters:
labelTextExtractor- the text of the labellabelTextSizeExtractor- the font size of the labellabelTextColorExtractor- the color of the labellabelTextPositionExtractor- theAbstractGridLineVisualSet.GridLineLabelPositionof the labellabelTextSideExtractor- theAbstractGridLineVisualSet.GridLineLabelSideof the label- Returns:
- reference to this object
-
addContextMenuHandler
public VerticalGridLineVisualSet<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
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
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
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 VerticalGridLineVisualSet<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
-
getVisualElements
public List<VerticalGridLineVisualSet<T>.VerticalGridLineVisualElement> 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 interfaceIGanttChartVisualSet- 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
-
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
-
setIncludeWhenCopyingToClipboard
public VerticalGridLineVisualSet<T> setIncludeWhenCopyingToClipboard(Supplier<Boolean> includeWhenCopyingToClipboard) Description copied from interface:IClipboardTextPropertyOwnerSets the supplier of the property includeWhenCopyingToClipboard. If true, this VisualSet is included when chart's data is copying to clipboard.- Specified by:
setIncludeWhenCopyingToClipboardin interfaceIClipboardTextPropertyOwner<T>- Parameters:
includeWhenCopyingToClipboard- new supplier of property includeWhenCopyingToClipboard- Returns:
- reference to this object
-
isIncludeWhenCopyingToClipboard
public boolean isIncludeWhenCopyingToClipboard()Description copied from interface:IClipboardTextPropertyOwnerReturns the value of the property includeWhenCopyingToClipboard. this VisualSet is included when chart's data is copying to clipboard.- Specified by:
isIncludeWhenCopyingToClipboardin interfaceIClipboardTextPropertyOwner<T>- Returns:
- the value of the property includeWhenCopyingToClipboard
-