Package dataPlots.data
Class TDDataInfo
java.lang.Object
dataPlots.data.TDDataInfo
- Direct Known Subclasses:
ClickPlotInfo
,CPODPlotinfo
,D3PlotInfo
,DifarBearingPlotInfo
,DifarIntensityPlotInfo
,SpectrogramPlotInfo
,StandardBearingInfo
,StandardDataInfo
,WhistlePlotInfo
Information about a type of data that can be displayed on any of the plots.
Life is complicated since many data types can display many different things, e.g. amplitude / bearing / ici, etc.
Therefore getDataUnits can return multiple types of units
Life is even more complicated since data cannot only be identified by their units, e.g. three channels of accelerometer data in dtag data.
Life is complicated since many data types can display many different things, e.g. amplitude / bearing / ici, etc.
Therefore getDataUnits can return multiple types of units
Life is even more complicated since data cannot only be identified by their units, e.g. three channels of accelerometer data in dtag data.
- Author:
- Doug Gillespie
-
Field Summary
-
Constructor Summary
ConstructorDescriptionTDDataInfo
(TDDataProvider tdDataProvider, TDGraph tdGraph, PamDataBlock pamDataBlock) -
Method Summary
Modifier and TypeMethodDescriptionvoid
addDataUnits
(DataLineInfo dataLineInfo) Add a type of data unit to the list.void
Clear any residual drawing objects that get held between calls, e.g.void
drawData
(int plotNumber, Graphics g, Rectangle windowRect, int orientation, PamAxis timeAxis, long scrollStart, PamAxis graphAxis) Paint data into the graphics window.drawDataUnit
(PamDataUnit pamDataUnit, Graphics g, Rectangle windowRect, int orientation, PamAxis timeAxis, long scrollStart, PamAxis yAxis, int type) Draw a data unit.void
drawHighLightData
(int plotNumber, Graphics g, Rectangle windowRect, int orientation, PamAxis timeAxis, long scrollStart, PamAxis graphAxis) Draw highlighted data.boolean
editOptions
(Window frame) Edit options - generally involves throwing up a dialog of some sort.int
Get the datablock for this informationint
Short string names of the dimensions of the data.final String
A longer data name, more descriptive than the data units.final TDDataProvider
abstract Double
getDataValue
(PamDataUnit pamDataUnit) Gets a value for a specific data unit which should be in the same units as the scale information.getFixedScaleInformation
(int orientation) Return a hiding dialog component which will get incorporated into a larger tabbed sliding dialog.getScaleInformation
(int orientation, boolean autoScale) Get a shorter name for use in displays.Get an object that will be packed up with the serialised settings when information about a plot get's stored.abstract TDSymbolChooser
getToolTipText
(PamDataUnit pamDataUnit) boolean
hasAxisName
(String axisName) boolean
Has options that will result in a dialog.boolean
void
notifyModelChanged
(int changeType) Get notifications from the main controller.void
Called whenever a data line is removed from a graph, or when a graph is removed from a plot.void
selectDataLine
(DataLineInfo dataLine) Called when the user selects a specific data lineboolean
setCurrentAxisName
(String axisName) Set the current data units - this must be a String which matches one of the strings in dataLineInfos() or all will go horribly wrong.void
setFixedScaleInformation
(TDScaleInfo fixedScaleInformation) void
setShowing
(boolean isShowing) Set whether or not it's showing in current graph window.boolean
setStoredSettings
(Serializable storedSettings) Set settings which have been read back from storage (the psf file).void
timeRangeSpinnerChange
(double oldValue, double newValue) Called when the time range spinner on the main display panel changes.void
timeScrollRangeChanged
(long minimumMillis, long maximumMillis) Called in viewer mode when the time scroll range moves.void
timeScrollValueChanged
(long valueMillis) Called in viewer mode when the time scroller moves.
-
Field Details
-
UNITS_ANGLE
- See Also:
-
UNITS_TEMPERATURE
- See Also:
-
-
Constructor Details
-
TDDataInfo
-
-
Method Details
-
getDataBlock
Get the datablock for this information- Returns:
-
getDataValue
Gets a value for a specific data unit which should be in the same units as the scale information. This will then be converted into a plot position by the TDGraph.- Parameters:
pamDataUnit
-- Returns:
- data value or null if this data poit should not be plotted.
-
getDataLineInfos
Short string names of the dimensions of the data. This will be something like Bearing, Angle, Amplitude, ICI, etc. Each graph will only be able to contain data which have the same units.- Returns:
- name of the units for the data.
-
addDataUnits
Add a type of data unit to the list.- Parameters:
unitType
- String name of the data unit.
-
setCurrentAxisName
Set the current data units - this must be a String which matches one of the strings in dataLineInfos() or all will go horribly wrong.- Parameters:
AxisName
-
-
hasAxisName
- Parameters:
axisName
-- Returns:
- true if the data have a datalineinfo with the given name
-
getCurrentDataLine
- Returns:
- the name of the currently set data units.
-
getDataName
A longer data name, more descriptive than the data units. Note that a single data block may have many different types of data it can plot !
This is now taken only from the data provider so that they can remain matched up as settings are serialized and de-serialized.- Returns:
- a name for the data.
-
getShortName
Get a shorter name for use in displays. This is used because a lot of the default names are quite long since they are based on standard datablock names.- Returns:
- a short name for use in the display.
-
getDataProvider
- Returns:
- Get the data provider. References to this are needed when settings are serialised and de-serialised.
-
getScaleInformation
- Parameters:
orientation
-- Returns:
- Information about the scales of the data.
-
getFixedScaleInformation
- Returns:
- the fixedScaleInformation
-
setFixedScaleInformation
- Parameters:
fixedScaleInformation
- the fixedScaleInformation to set
-
getDataDimensions
public int getDataDimensions()- Returns:
- 1 or 2 for the data (lines are 1, things that will make a 3D plot, such as spectrograms, get 2.
-
getSymbolChooser
- Returns:
- a class containing functions to chose a symbol to plot.
-
getToolTipText
- Parameters:
pamDataUnit
- data unit- Returns:
- text to display in tooltip if mouse hovered over symbol
-
clearDraw
public void clearDraw()Clear any residual drawing objects that get held between calls, e.g. the point of the previous unit plotted which may have been held so that lines can be drawn between points. -
drawData
public void drawData(int plotNumber, Graphics g, Rectangle windowRect, int orientation, PamAxis timeAxis, long scrollStart, PamAxis graphAxis) Paint data into the graphics window.- Parameters:
plotNumber
- plot numberg
- graphicswindowRect
- Window rectangle to draw inorientation
- orientationgraphAxis
- graph data axis for scaling.pamAxis
- scroll start time in millisecondstScale
- time scale in pixels per millisecond.
-
drawHighLightData
public void drawHighLightData(int plotNumber, Graphics g, Rectangle windowRect, int orientation, PamAxis timeAxis, long scrollStart, PamAxis graphAxis) Draw highlighted data.- Parameters:
plotNumber
-g
-windowRect
-orientation
-timeAxis
-scrollStart
-graphAxis
-
-
drawDataUnit
public Polygon drawDataUnit(PamDataUnit pamDataUnit, Graphics g, Rectangle windowRect, int orientation, PamAxis timeAxis, long scrollStart, PamAxis yAxis, int type) Draw a data unit.- Parameters:
pamDataUnit
- data unit to drawg
- graphics handle to draw onwindowRect
-orientation
- orientation of the displaytimeAxis
- start time of the displayyAxis
- yAxis (used for scale information for the data point)type
- flag for which type of symbol to draw. e.g normal or highlighted.timeScale
- timescale in pixels per millisecond- Returns:
- polygon of area drawn on.
-
selectDataLine
Called when the user selects a specific data line- Parameters:
dataLine
-
-
getCurrentDataLineIndex
public int getCurrentDataLineIndex()- Returns:
- the currentDataLineIndex
-
hasOptions
public boolean hasOptions()Has options that will result in a dialog.- Returns:
- true if there are options.
-
editOptions
Edit options - generally involves throwing up a dialog of some sort.- Returns:
- true if options dialog OK button was pressed.
-
getHidingDialogComponent
Return a hiding dialog component which will get incorporated into a larger tabbed sliding dialog.- Returns:
- sliding dialog component.
-
getTdGraph
- Returns:
- the tdGraph
-
getStoredSettings
Get an object that will be packed up with the serialised settings when information about a plot get's stored.
The Object MUST implement serializable and ideally also cloneable or it will go belly up !
This only gets called when settings are to be saved so there is no need to keep parameters this returns up to date except right at settings save time (when this is called)- Returns:
- serializable object to save.
-
setStoredSettings
Set settings which have been read back from storage (the psf file). Assume these are of the right type and cast into whatever is needed !- Parameters:
storedSettings
-- Returns:
- true if all OK.
-
removeData
public void removeData()Called whenever a data line is removed from a graph, or when a graph is removed from a plot.
Is a good opportunity for the DataInfo to unsubscribe itself from any datablocks it might be observing. -
timeScrollValueChanged
public void timeScrollValueChanged(long valueMillis) Called in viewer mode when the time scroller moves.Most data won't need to do anything here since they are already subscribed to the scroller and will get their data loaded from psf automatically.
- Parameters:
valueMillis
- new scroll value in millis
-
timeScrollRangeChanged
public void timeScrollRangeChanged(long minimumMillis, long maximumMillis) Called in viewer mode when the time scroll range moves.Most data won't need to do anything here since they are already subscribed to the scroller and will get their data loaded from psf automatically.
- Parameters:
minimumMillis
- new minimum in millismaximumMillis
- new maximum in millis.
-
setShowing
public void setShowing(boolean isShowing) Set whether or not it's showing in current graph window.- Parameters:
isShowing
-
-
isShowing
public boolean isShowing()- Returns:
- the showing
-
timeRangeSpinnerChange
public void timeRangeSpinnerChange(double oldValue, double newValue) Called when the time range spinner on the main display panel changes.- Parameters:
oldValue
- old value (seconds)newValue
- new value (seconds)
-
notifyModelChanged
public void notifyModelChanged(int changeType) Get notifications from the main controller.- Parameters:
changeType
-
-