Interface IVectorTrace
- All Superinterfaces:
org.eclipse.january.INameable,ITrace
- All Known Implementing Classes:
VectorTrace
A vector trace can be added to a 1D or 2D plot to show a vector map over
the top. It requires a 3D dataset where the first two coordinates are the
position in x and y and the third coordinate is a size two argument. This
represents a magnitude and angle (anti-clockwise from 12 O'Clock) in radians
for the vector arrow.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumstatic enumstatic enum -
Method Summary
Modifier and TypeMethodDescriptionint[]Get the rgb values for the arrow color.Get the way the arrow pointing should be done.How to color the arrowsorg.eclipse.swt.graphics.PaletteDataInstead of a fixed color the arrow may use a palette.List<org.eclipse.january.dataset.IDataset> getAxes()int[]Get the rgb values for the circle color.intThe maximum size of the arrow in screen pixels.double[]Get the percentage threshold for clipping outliers in the magnitudeUsed when the values of the vectors are normalized to the maximum arrow size.booleanIs direction data in radiansvoidrepaint()Call to redraw the image, normally the same as repaint on Figure.voidsetArrowColor(int... rgb) Set the rgb values for the arrow color.voidsetArrowConfiguration(IVectorTrace.ArrowConfiguration arrowPosition) Set the way the arrow pointing should be done.voidsetArrowHistogram(IVectorTrace.ArrowHistogram arrowHistogram) How to color the arrowsvoidsetArrowPalette(org.eclipse.swt.graphics.PaletteData jet) Instead of a fixed color the arrow may use a palette.voidsetCircleColor(int... rgb) Set the rgb values for the circle color.booleansetData(org.eclipse.january.dataset.IDataset vectors, List<org.eclipse.january.dataset.IDataset> axes) Call to set image datavoidsetMaximumArrowSize(int screenPixels) The maximum size of the arrow in screen pixels.voidsetPercentageThreshold(double[] percentageThreshold) Set the percentage threshold for clipping outliers in the magnitudevoidsetRadians(boolean isRadians) Set whether the direction data is radians (false for degrees)voidUsed when the values of the vectors are normalized to the maximum arrow size.Methods inherited from interface org.eclipse.january.INameable
getName, setNameMethods inherited from interface org.eclipse.dawnsci.plotting.api.trace.ITrace
dispose, getData, getDataName, getRank, getUserObject, initialize, is3DTrace, isUserTrace, isVisible, setDataName, setUserObject, setUserTrace, setVisible
-
Method Details
-
setArrowConfiguration
Set the way the arrow pointing should be done.- Parameters:
arrowPosition-
-
getArrowConfiguration
IVectorTrace.ArrowConfiguration getArrowConfiguration()Get the way the arrow pointing should be done.- Parameters:
arrowPosition-
-
setMaximumArrowSize
void setMaximumArrowSize(int screenPixels) The maximum size of the arrow in screen pixels. Default is 20.- Parameters:
screenPixels-
-
getMaximumArrowSize
int getMaximumArrowSize()The maximum size of the arrow in screen pixels. Default is 20.- Parameters:
screenPixels-
-
setArrowColor
void setArrowColor(int... rgb) Set the rgb values for the arrow color. By default the arrow is drawn black.- Parameters:
rgb-
-
getArrowColor
int[] getArrowColor()Get the rgb values for the arrow color. By default the arrow is drawn black.- Parameters:
rgb-
-
setArrowPalette
void setArrowPalette(org.eclipse.swt.graphics.PaletteData jet) Instead of a fixed color the arrow may use a palette. If the palette is set the arrowColor is ignored providing the ArrowHistogram has been set to a non-fixed type.- Parameters:
jet-
-
getArrowPalette
org.eclipse.swt.graphics.PaletteData getArrowPalette()Instead of a fixed color the arrow may use a palette. If the palette is set the arrowColor is ignored providing the ArrowHistogram has been set to a non-fixed type. -
setCircleColor
void setCircleColor(int... rgb) Set the rgb values for the circle color. By default the circle is drawn black.- Parameters:
rgb-
-
getCircleColor
int[] getCircleColor()Get the rgb values for the circle color. By default the circle is drawn black.- Parameters:
rgb-
-
setData
boolean setData(org.eclipse.january.dataset.IDataset vectors, List<org.eclipse.january.dataset.IDataset> axes) Call to set image data- Parameters:
vectors- a 3D dataset [x,y,2] where the first two coordinates are the position in x and y and the third coordinate is a size two argument. This represents a magnitude and angle for the vector arrow.axes- or null.- Returns:
- false if could not set data
-
getAxes
List<org.eclipse.january.dataset.IDataset> getAxes()- Returns:
- the axes used to look up the position which the vector should be drawn.
-
repaint
void repaint()Call to redraw the image, normally the same as repaint on Figure. -
setVectorNormalization
Used when the values of the vectors are normalized to the maximum arrow size.- Parameters:
type-
-
getVectorNormalization
IVectorTrace.VectorNormalization getVectorNormalization()Used when the values of the vectors are normalized to the maximum arrow size.- Returns:
- VectorNormalizationType
-
getArrowHistogram
IVectorTrace.ArrowHistogram getArrowHistogram()How to color the arrows- Returns:
-
setArrowHistogram
How to color the arrows -
getPercentageThreshold
double[] getPercentageThreshold()Get the percentage threshold for clipping outliers in the magnitude- Returns:
- percentages
-
setPercentageThreshold
void setPercentageThreshold(double[] percentageThreshold) Set the percentage threshold for clipping outliers in the magnitude -
isRadians
boolean isRadians()Is direction data in radians- Returns:
-
setRadians
void setRadians(boolean isRadians) Set whether the direction data is radians (false for degrees)- Parameters:
isRadians-
-