Package dataPlotsFX.layout
Class TDDisplayFX
java.lang.Object
javafx.scene.Node
javafx.scene.Parent
javafx.scene.layout.Region
javafx.scene.layout.Pane
javafx.scene.layout.BorderPane
pamViewFX.fxNodes.PamBorderPane
dataPlotsFX.layout.TDDisplayFX
- All Implemented Interfaces:
javafx.css.Styleable
,javafx.event.EventTarget
The main display node for showing tdGraphs. Contains time axis, tdGraphs, time axis and control pane.
- Author:
- Jamie Macaulay
-
Property Summary
Properties inherited from class javafx.scene.layout.BorderPane
bottom, center, left, right, top
Properties inherited from class javafx.scene.layout.Region
background, border, cacheShape, centerShape, height, insets, maxHeight, maxWidth, minHeight, minWidth, opaqueInsets, padding, prefHeight, prefWidth, scaleShape, shape, snapToPixel, width
Properties inherited from class javafx.scene.Parent
needsLayout
Properties inherited from class javafx.scene.Node
accessibleHelp, accessibleRoleDescription, accessibleRole, accessibleText, blendMode, boundsInLocal, boundsInParent, cacheHint, cache, clip, cursor, depthTest, disabled, disable, effectiveNodeOrientation, effect, eventDispatcher, focused, focusTraversable, focusVisible, focusWithin, hover, id, inputMethodRequests, layoutBounds, layoutX, layoutY, localToParentTransform, localToSceneTransform, managed, mouseTransparent, nodeOrientation, onContextMenuRequested, onDragDetected, onDragDone, onDragDropped, onDragEntered, onDragExited, onDragOver, onInputMethodTextChanged, onKeyPressed, onKeyReleased, onKeyTyped, onMouseClicked, onMouseDragEntered, onMouseDragExited, onMouseDragged, onMouseDragOver, onMouseDragReleased, onMouseEntered, onMouseExited, onMouseMoved, onMousePressed, onMouseReleased, onRotate, onRotationFinished, onRotationStarted, onScrollFinished, onScroll, onScrollStarted, onSwipeDown, onSwipeLeft, onSwipeRight, onSwipeUp, onTouchMoved, onTouchPressed, onTouchReleased, onTouchStationary, onZoomFinished, onZoom, onZoomStarted, opacity, parent, pickOnBounds, pressed, rotate, rotationAxis, scaleX, scaleY, scaleZ, scene, style, translateX, translateY, translateZ, viewOrder, visible
-
Field Summary
Modifier and TypeFieldDescriptionstatic final double
The size of the data axis in pixels i.e it's width when horizontal and height when vertical.static long
The standard refresh rate in millisstatic final double
The size of the time axis in pixels i.e it's height when horizontal and width when vertical.Fields inherited from class javafx.scene.layout.Region
USE_COMPUTED_SIZE, USE_PREF_SIZE
Fields inherited from class javafx.scene.Node
BASELINE_OFFSET_SAME_AS_HEIGHT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
addDataBlock
(PamDataBlock dataBlock, TDGraphFX tdGraph) Add a data block to the display.Add a new graph to the time base displayCreate the old scroller, destroying an old one if it exists.Get the control pane.javafx.scene.control.Label
getOverlayMarkerAdpaters
(TDGraphFX tdGraphf) Returns a new list of overlay marker adapterslong
Get the scrollable range i.e the total amount of loaded data that can be scrolled throughdouble[]
Reference to tdControl.Get all TDGraphFX in the td displayGet the parameters for the tdGraph.The time axis.int
Index of time axis = 0 if time is horizontal, 1 if time is vertical.double
Get the length of the time axis in pixels.double
Get the number of pixels per milliseconddataPlotsFX.layout.TDDisplayFX.TimeRangeListener
Get the time range listener.Get the time scroller.long
Get the satrt time of the scroller.long
Get the visible range of the time axis in millis.long
Get the last wrap time in millis.long
getWrapMillis
(long scrollStart) Convenience class to get the total millis the wrap has progressed since the lastWrap occurred.double
Get the current wrap position in pixels.boolean
boolean
Check whether PG is running in real time.boolean
isViewer()
Check whether the display is being use din viewer mode or not.boolean
isWrap()
Convenience class to determine whether the wrap boolean has been to set to true or false in settings.boolean
Check whether the display is paused or not.void
notifyModelChanged
(int changeType) Notifications passed on from controlled unit.void
void
removeTDDataInfo
(TDDataInfoFX tdDataInfoFX, boolean remove) Remove a TDDataInfoFX from the display.void
removeTDGraph
(int iGraph) Remove one of the current graphs from the time displayvoid
Cycles through all the time data graphs and updates the plot display.void
repaintAll
(int flag) Cycles through all the time data graphs and updates the plot display.void
repaintAll
(long tm) Cycles through all the time data graphs and updates the plot display.void
repaintAll
(long tm, int flag) Cycles through all the time data graphs and updates the plot display.void
rotate()
Rotate the plot to be vertical->horizontal or horizontal->vertical.void
scrollDisplayEnd
(long milliSeconds) Called whenever there is a new master clock update.void
setWrapRequest
(boolean selected) A change in wrap mode has been requested.void
showControlPane
(boolean show) Show or hide the control pane.static void
sortGridContraints
(javafx.scene.layout.GridPane gridPane, javafx.geometry.Orientation orientation, int nPanes) Function to distribute spacing in a grid pane.void
Subscribe data blocks to the time scroller.void
zoomDisplay
(boolean b) Zoom into the display.Methods inherited from class pamViewFX.fxNodes.PamBorderPane
setBottomSpace, setLeftSpace, setRightSpace, setTopSpace
Methods inherited from class javafx.scene.layout.BorderPane
bottomProperty, centerProperty, clearConstraints, getAlignment, getBottom, getCenter, getContentBias, getLeft, getMargin, getRight, getTop, leftProperty, rightProperty, setAlignment, setBottom, setCenter, setLeft, setMargin, setRight, setTop, topProperty
Methods inherited from class javafx.scene.layout.Pane
getChildren
Methods inherited from class javafx.scene.layout.Region
backgroundProperty, borderProperty, cacheShapeProperty, centerShapeProperty, getBackground, getBorder, getClassCssMetaData, getCssMetaData, getHeight, getInsets, getMaxHeight, getMaxWidth, getMinHeight, getMinWidth, getOpaqueInsets, getPadding, getPrefHeight, getPrefWidth, getShape, getUserAgentStylesheet, getWidth, heightProperty, insetsProperty, isCacheShape, isCenterShape, isResizable, isScaleShape, isSnapToPixel, layoutInArea, maxHeight, maxHeightProperty, maxWidth, maxWidthProperty, minHeight, minHeightProperty, minWidth, minWidthProperty, opaqueInsetsProperty, paddingProperty, positionInArea, prefHeight, prefHeightProperty, prefWidth, prefWidthProperty, resize, scaleShapeProperty, setBackground, setBorder, setCacheShape, setCenterShape, setMaxHeight, setMaxSize, setMaxWidth, setMinHeight, setMinSize, setMinWidth, setOpaqueInsets, setPadding, setPrefHeight, setPrefSize, setPrefWidth, setScaleShape, setShape, setSnapToPixel, shapeProperty, snappedBottomInset, snappedLeftInset, snappedRightInset, snappedTopInset, snapPositionX, snapPositionY, snapSizeX, snapSizeY, snapSpaceX, snapSpaceY, snapToPixelProperty, widthProperty
Methods inherited from class javafx.scene.Parent
getBaselineOffset, getChildrenUnmodifiable, getStylesheets, isNeedsLayout, layout, lookup, needsLayoutProperty, queryAccessibleAttribute, requestLayout
Methods inherited from class javafx.scene.Node
accessibleHelpProperty, accessibleRoleDescriptionProperty, accessibleRoleProperty, accessibleTextProperty, addEventFilter, addEventHandler, applyCss, autosize, blendModeProperty, boundsInLocalProperty, boundsInParentProperty, buildEventDispatchChain, cacheHintProperty, cacheProperty, clipProperty, computeAreaInScreen, contains, contains, cursorProperty, depthTestProperty, disabledProperty, disableProperty, effectiveNodeOrientationProperty, effectProperty, eventDispatcherProperty, executeAccessibleAction, fireEvent, focusedProperty, focusTraversableProperty, focusVisibleProperty, focusWithinProperty, getAccessibleHelp, getAccessibleRole, getAccessibleRoleDescription, getAccessibleText, getBlendMode, getBoundsInLocal, getBoundsInParent, getCacheHint, getClip, getCursor, getDepthTest, getEffect, getEffectiveNodeOrientation, getEventDispatcher, getId, getInputMethodRequests, getLayoutBounds, getLayoutX, getLayoutY, getLocalToParentTransform, getLocalToSceneTransform, getNodeOrientation, getOnContextMenuRequested, getOnDragDetected, getOnDragDone, getOnDragDropped, getOnDragEntered, getOnDragExited, getOnDragOver, getOnInputMethodTextChanged, getOnKeyPressed, getOnKeyReleased, getOnKeyTyped, getOnMouseClicked, getOnMouseDragEntered, getOnMouseDragExited, getOnMouseDragged, getOnMouseDragOver, getOnMouseDragReleased, getOnMouseEntered, getOnMouseExited, getOnMouseMoved, getOnMousePressed, getOnMouseReleased, getOnRotate, getOnRotationFinished, getOnRotationStarted, getOnScroll, getOnScrollFinished, getOnScrollStarted, getOnSwipeDown, getOnSwipeLeft, getOnSwipeRight, getOnSwipeUp, getOnTouchMoved, getOnTouchPressed, getOnTouchReleased, getOnTouchStationary, getOnZoom, getOnZoomFinished, getOnZoomStarted, getOpacity, getParent, getProperties, getPseudoClassStates, getRotate, getRotationAxis, getScaleX, getScaleY, getScaleZ, getScene, getStyle, getStyleableParent, getStyleClass, getTransforms, getTranslateX, getTranslateY, getTranslateZ, getTypeSelector, getUserData, getViewOrder, hasProperties, hoverProperty, idProperty, inputMethodRequestsProperty, intersects, intersects, isCache, isDisable, isDisabled, isFocused, isFocusTraversable, isFocusVisible, isFocusWithin, isHover, isManaged, isMouseTransparent, isPickOnBounds, isPressed, isVisible, layoutBoundsProperty, layoutXProperty, layoutYProperty, localToParent, localToParent, localToParent, localToParent, localToParent, localToParentTransformProperty, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToScene, localToSceneTransformProperty, localToScreen, localToScreen, localToScreen, localToScreen, localToScreen, lookupAll, managedProperty, mouseTransparentProperty, nodeOrientationProperty, notifyAccessibleAttributeChanged, onContextMenuRequestedProperty, onDragDetectedProperty, onDragDoneProperty, onDragDroppedProperty, onDragEnteredProperty, onDragExitedProperty, onDragOverProperty, onInputMethodTextChangedProperty, onKeyPressedProperty, onKeyReleasedProperty, onKeyTypedProperty, onMouseClickedProperty, onMouseDragEnteredProperty, onMouseDragExitedProperty, onMouseDraggedProperty, onMouseDragOverProperty, onMouseDragReleasedProperty, onMouseEnteredProperty, onMouseExitedProperty, onMouseMovedProperty, onMousePressedProperty, onMouseReleasedProperty, onRotateProperty, onRotationFinishedProperty, onRotationStartedProperty, onScrollFinishedProperty, onScrollProperty, onScrollStartedProperty, onSwipeDownProperty, onSwipeLeftProperty, onSwipeRightProperty, onSwipeUpProperty, onTouchMovedProperty, onTouchPressedProperty, onTouchReleasedProperty, onTouchStationaryProperty, onZoomFinishedProperty, onZoomProperty, onZoomStartedProperty, opacityProperty, parentProperty, parentToLocal, parentToLocal, parentToLocal, parentToLocal, parentToLocal, pickOnBoundsProperty, pressedProperty, pseudoClassStateChanged, relocate, removeEventFilter, removeEventHandler, requestFocus, resizeRelocate, rotateProperty, rotationAxisProperty, scaleXProperty, scaleYProperty, scaleZProperty, sceneProperty, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, sceneToLocal, screenToLocal, screenToLocal, screenToLocal, setAccessibleHelp, setAccessibleRole, setAccessibleRoleDescription, setAccessibleText, setBlendMode, setCache, setCacheHint, setClip, setCursor, setDepthTest, setDisable, setEffect, setEventDispatcher, setFocusTraversable, setId, setInputMethodRequests, setLayoutX, setLayoutY, setManaged, setMouseTransparent, setNodeOrientation, setOnContextMenuRequested, setOnDragDetected, setOnDragDone, setOnDragDropped, setOnDragEntered, setOnDragExited, setOnDragOver, setOnInputMethodTextChanged, setOnKeyPressed, setOnKeyReleased, setOnKeyTyped, setOnMouseClicked, setOnMouseDragEntered, setOnMouseDragExited, setOnMouseDragged, setOnMouseDragOver, setOnMouseDragReleased, setOnMouseEntered, setOnMouseExited, setOnMouseMoved, setOnMousePressed, setOnMouseReleased, setOnRotate, setOnRotationFinished, setOnRotationStarted, setOnScroll, setOnScrollFinished, setOnScrollStarted, setOnSwipeDown, setOnSwipeLeft, setOnSwipeRight, setOnSwipeUp, setOnTouchMoved, setOnTouchPressed, setOnTouchReleased, setOnTouchStationary, setOnZoom, setOnZoomFinished, setOnZoomStarted, setOpacity, setPickOnBounds, setRotate, setRotationAxis, setScaleX, setScaleY, setScaleZ, setStyle, setTranslateX, setTranslateY, setTranslateZ, setUserData, setViewOrder, setVisible, snapshot, snapshot, startDragAndDrop, startFullDrag, styleProperty, toBack, toFront, toString, translateXProperty, translateYProperty, translateZProperty, usesMirroring, viewOrderProperty, visibleProperty
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface javafx.css.Styleable
getStyleableNode
-
Field Details
-
standardRefreshMillis
public static long standardRefreshMillisThe standard refresh rate in millis -
timeAxisSize
public static final double timeAxisSizeThe size of the time axis in pixels i.e it's height when horizontal and width when vertical.- See Also:
-
dataAxisSize
public static final double dataAxisSizeThe size of the data axis in pixels i.e it's width when horizontal and height when vertical.- See Also:
-
-
Constructor Details
-
TDDisplayFX
Constructor for the main JavaFX display.- Parameters:
tdControl
- - the TDControlFX.
-
-
Method Details
-
addTDGraph
Add a new graph to the time base display- Returns:
- the new TDGraph which has been added.
-
removeTDGraph
public void removeTDGraph(int iGraph) Remove one of the current graphs from the time display- Parameters:
iGraph
- - graph to remove.
-
sortGridContraints
public static void sortGridContraints(javafx.scene.layout.GridPane gridPane, javafx.geometry.Orientation orientation, int nPanes) Function to distribute spacing in a grid pane. Means rows, column take up 100% of the available space available to the grid pane. This function sets the column and row constraints so that each Node takes up an equal share of the column or row spacing depending on orientation.- Parameters:
gridPane
- - grid pane to sort column and row constraints for.orientation
- - Orientation of the grid pane.nPanes
- - number of panes within the grid pane to divide spacing between
-
rotate
public void rotate()Rotate the plot to be vertical->horizontal or horizontal->vertical. (depends on which one the display is currently). This is not a simple node rotation by 90 degrees- the display layout is changed to be used as vertical/horizontal. -
subscribeScrollDataBlocks
public void subscribeScrollDataBlocks()Subscribe data blocks to the time scroller.
seems like a daft call sequence, but the time scroller will only hold one copy of each block, so if a block is removed, it may be that it shouldn't be removed - so easer just to remake the entire list every time -
scrollDisplayEnd
public void scrollDisplayEnd(long milliSeconds) Called whenever there is a new master clock update.- Parameters:
milliSeconds
- - the master clock position.
-
repaintAll
public void repaintAll(long tm, int flag) Cycles through all the time data graphs and updates the plot display.- Parameters:
tm
- - if this paint within tm millis of last paint do not repaint.flag
- - a canvas repaint flag e.g. TDPlotPane.FRONT_CANAVAS.
-
repaintAll
public void repaintAll(long tm) Cycles through all the time data graphs and updates the plot display.- Parameters:
tm
- - if this paint within tm millis of last paint do not repaint.
-
repaintAll
public void repaintAll(int flag) Cycles through all the time data graphs and updates the plot display.- Parameters:
flag
- - a canvas repaint flag e.g. TDPlotPane.FRONT_CANAVAS.
-
repaintAll
public void repaintAll()Cycles through all the time data graphs and updates the plot display. -
createScroller
Create the old scroller, destroying an old one if it exists.- Returns:
- a PamScrollerFX for the time axis of the data plot.
-
getTimeScroller
Get the time scroller. This is essentially the GUI for controlling the time axis of the graph- Returns:
- the time scroller.
-
getTimeAxis
The time axis. This controls where data units are painted on the x (horizontal) axis of every tdGraph. Holds calculations for converting between time and pixel location.- Returns:
- time axis
-
getTimeAxisIndex
public int getTimeAxisIndex()Index of time axis = 0 if time is horizontal, 1 if time is vertical.- Returns:
- 0 fr hirizontal axis, 1 for vertical axis.
-
getTDControl
Reference to tdControl.- Returns:
- get tdControl.
-
getTDParams
Get the parameters for the tdGraph.- Returns:
- the parameters class for the graph.
-
getVisibleTime
public long getVisibleTime()Get the visible range of the time axis in millis.- Returns:
- the visible range i.e. what can been seen on the graph in millis
-
getTimePixPerMillis
public double getTimePixPerMillis()Get the number of pixels per millisecond -
getScrollableTime
public long getScrollableTime()Get the scrollable range i.e the total amount of loaded data that can be scrolled through- Returns:
- the scrollable range range i.e. what range if data is loaded in memory and can be scrolled through
-
getTimeStart
public long getTimeStart()Get the satrt time of the scroller.- Returns:
- the start time of the scroller
-
getTimePixels
public double getTimePixels()Get the length of the time axis in pixels.- Returns:
- the length of the axis in pixel.
-
getTDGraphs
Get all TDGraphFX in the td display- Returns:
- an array of the current tdgraphs displayed
-
getCSSSettingsResource
-
getTimeRangeListener
public dataPlotsFX.layout.TDDisplayFX.TimeRangeListener getTimeRangeListener()Get the time range listener. This listens for when scroll bar values change.- Returns:
- the time range listener for the scroll bar.
-
isViewer
public boolean isViewer()Check whether the display is being use din viewer mode or not.- Returns:
- true if running in viewer mode.
-
addDataBlock
Add a data block to the display. Creates a new TDgraph with a new TDDataInfoFX containing the data block. This is generally called externally.- Parameters:
tdGraph
- - the tdGraph to add the data block to. If null, then the datablock will be added to a new TDGraphFX.
-
removeTDDataInfo
Remove a TDDataInfoFX from the display.- Parameters:
tdDataInfoFX
- - the TDDataInfoFX to remove.
-
getControlPane
Get the control pane. This contains general settings controls for the entire display.- Returns:
- the control pane.
-
showControlPane
public void showControlPane(boolean show) Show or hide the control pane. The control pane contains general settings controls for the entire display.- Parameters:
show
- true to show the control pane.,
-
notifyModelChanged
public void notifyModelChanged(int changeType) Notifications passed on from controlled unit.- Parameters:
changeType
-
-
getWrapLastMillis
public long getWrapLastMillis()Get the last wrap time in millis. This is essentially time 0 in a wrapped display.- Returns:
- the last wrap time in millis.
-
getWrapMillis
public long getWrapMillis(long scrollStart) Convenience class to get the total millis the wrap has progressed since the lastWrap occurred.- Parameters:
scrollstart
- . The last visible scroll time. i.e. current scrolltime minus visible amount.- Returns:
- the time in millis since the last wrap
-
isWrap
public boolean isWrap()Convenience class to determine whether the wrap boolean has been to set to true or false in settings.- Returns:
- true if the display is in wrap mode.
-
getWrapPix
public double getWrapPix()Get the current wrap position in pixels.- Returns:
- the position of the wrap in pixels.
-
isRunning
public boolean isRunning()Check whether PG is running in real time.- Returns:
- true if running in real time
-
getOverlayMarkerAdpaters
Returns a new list of overlay marker adapters -
getSplitPane
-
setWrapRequest
public void setWrapRequest(boolean selected) A change in wrap mode has been requested.Note: This is used rather than changing the params directly from the wrap control button becuase that can cause a crash if repaitn is being called. Only in real time mode
- Parameters:
selected
- - true to request wrapping. False otherwise.
-
needPaused
public boolean needPaused()Check whether the display is paused or not.- Returns:
- true if the display is paused.
-
initializationComplete
public boolean initializationComplete() -
zoomDisplay
public void zoomDisplay(boolean b) Zoom into the display. Either zoom to a current overlay mark or zoom in on the time axis a pre defind amount;- Parameters:
b
- - to zoom in or out. True to zoom in.
-
getSplitHeights
public double[] getSplitHeights() -
getSoundOutputManager
- Returns:
- the soundOutputManager
-
getMousePositionData
public javafx.scene.control.Label getMousePositionData()- Returns:
- the mousePositionData
-
playbackUpdate
public void playbackUpdate()
-