Class Trace
java.lang.Object
org.eclipse.draw2d.Figure
org.eclipse.nebula.visualization.xygraph.figures.Trace
- All Implemented Interfaces:
org.eclipse.draw2d.IFigure
,IDataProviderListener
,IAxisListener
public class Trace extends org.eclipse.draw2d.Figure implements IDataProviderListener, IAxisListener
The trace figure.
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Trace.BaseLine
static class
Trace.ErrorBarType
static class
Trace.PointStyle
static class
Trace.TraceType
The way how the trace will be drawn. -
Field Summary
-
Constructor Summary
Constructors Constructor Description Trace(java.lang.String name)
init(Axis, Axis, IDataProvider)
needs to be called if a trace is created with this constructorTrace(java.lang.String name, Axis xAxis, Axis yAxis, IDataProvider dataProvider)
-
Method Summary
Modifier and Type Method Description void
addListener(ITraceListener listener)
void
axisAutoScaleChanged(Axis axis, boolean oldAutoScale, boolean newAutoScale)
void
axisForegroundColorChanged(Axis axis, org.eclipse.swt.graphics.Color oldColor, org.eclipse.swt.graphics.Color newColor)
void
axisLogScaleChanged(Axis axis, boolean old, boolean logScale)
void
axisRangeChanged(Axis axis, Range old_range, Range new_range)
This event indicates a change in the axis' value rangevoid
axisRevalidated(Axis axis)
This method will be notified by axis whenever the axis is revalidated.void
axisTitleChanged(Axis axis, java.lang.String oldTitle, java.lang.String newTitle)
void
dataChanged(IDataProvider dataProvider)
This method will be notified by data provider whenever the data changed in data providervoid
dispose()
Remove figures and reset fieldsvoid
drawLine(org.eclipse.draw2d.Graphics graphics, org.eclipse.draw2d.geometry.Point p1, org.eclipse.draw2d.geometry.Point p2)
Draw line with the line style and line width of the trace.void
drawPoint(org.eclipse.draw2d.Graphics graphics, org.eclipse.draw2d.geometry.Point pos)
Draw point with the pointStyle and size of the trace;int
getAreaAlpha()
Trace.BaseLine
getBaseLine()
IDataProvider
getDataProvider()
int
getErrorBarCapWidth()
org.eclipse.swt.graphics.Color
getErrorBarColor()
java.util.List<ISample>
getHotSampleList()
Hot Sample is the sample on the trace which has been drawn in plot area.int
getLineWidth()
java.lang.String
getName()
int
getPointSize()
Trace.PointStyle
getPointStyle()
IPointStyleProvider
getPointStyleProvider()
org.eclipse.swt.graphics.Color
getTraceColor()
Trace.TraceType
getTraceType()
Axis
getXAxis()
Trace.ErrorBarType
getXErrorBarType()
IXYGraph
getXYGraph()
Axis
getYAxis()
Trace.ErrorBarType
getYErrorBarType()
void
init(Axis xAxis, Axis yAxis, IDataProvider dataProvider)
Must be called if usingTrace(String)
boolean
isAntiAliasing()
boolean
isDrawYErrorInArea()
boolean
isErrorBarEnabled()
protected void
paintFigure(org.eclipse.draw2d.Graphics graphics)
boolean
removeListener(ITraceListener listener)
void
setAntiAliasing(boolean antiAliasing)
void
setAreaAlpha(int areaAlpha)
void
setBaseLine(Trace.BaseLine baseLine)
void
setDataProvider(IDataProvider traceDataProvider)
void
setDrawYErrorInArea(boolean drawYErrorInArea)
void
setErrorBarCapWidth(int errorBarCapWidth)
void
setErrorBarColor(org.eclipse.swt.graphics.Color errorBarColor)
void
setErrorBarEnabled(boolean errorBarEnabled)
void
setLineWidth(int lineWidth)
void
setName(java.lang.String name)
void
setName(java.lang.String name, boolean fire)
void
setPointSize(int pointSize)
void
setPointStyle(Trace.PointStyle pointStyle)
void
setPointStyleProvider(IPointStyleProvider pointStyleProvider)
void
setTraceColor(org.eclipse.swt.graphics.Color traceColor)
void
setTraceType(Trace.TraceType traceType)
void
setXAxis(Axis axis)
void
setXErrorBarType(Trace.ErrorBarType errorBarType)
void
setXYGraph(IXYGraph xyGraph)
void
setYAxis(Axis axis)
void
setYErrorBarType(Trace.ErrorBarType errorBarType)
java.lang.String
toString()
Methods inherited from class org.eclipse.draw2d.Figure
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, containsPoint, containsPoint, erase, findDescendantAtExcluding, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, findMouseEventTargetInDescendantsAt, fireCoordinateSystemChanged, fireFigureMoved, fireMoved, firePropertyChange, firePropertyChange, firePropertyChange, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getClippingStrategy, getCursor, getFlag, getFont, getForegroundColor, getInsets, getLayoutManager, getListeners, getLocalBackgroundColor, getLocalFont, getLocalForegroundColor, getLocation, getMaximumSize, getMinimumSize, getMinimumSize, getParent, getPreferredSize, getPreferredSize, getSize, getToolTip, getUpdateManager, handleFocusGained, handleFocusLost, handleKeyPressed, handleKeyReleased, handleMouseDoubleClicked, handleMouseDragged, handleMouseEntered, handleMouseExited, handleMouseHover, handleMouseMoved, handleMousePressed, handleMouseReleased, hasFocus, internalGetEventDispatcher, intersects, invalidate, invalidateTree, isCoordinateSystem, isEnabled, isFocusTraversable, isMirrored, isMouseEventTarget, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, layout, paint, paintBorder, paintChildren, paintClientArea, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, removePropertyChangeListener, removePropertyChangeListener, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setChildrenDirection, setChildrenEnabled, setChildrenOrientation, setClippingStrategy, setConstraint, setCursor, setEnabled, setFlag, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates, validate
-
Constructor Details
-
Trace
public Trace(java.lang.String name)init(Axis, Axis, IDataProvider)
needs to be called if a trace is created with this constructor -
Trace
-
-
Method Details
-
addListener
-
removeListener
-
setPointStyleProvider
-
getPointStyleProvider
-
init
Must be called if usingTrace(String)
- Parameters:
xAxis
-yAxis
-dataProvider
-
-
drawPoint
public void drawPoint(org.eclipse.draw2d.Graphics graphics, org.eclipse.draw2d.geometry.Point pos)Draw point with the pointStyle and size of the trace;- Parameters:
graphics
-pos
-
-
drawLine
public void drawLine(org.eclipse.draw2d.Graphics graphics, org.eclipse.draw2d.geometry.Point p1, org.eclipse.draw2d.geometry.Point p2)Draw line with the line style and line width of the trace.- Parameters:
graphics
-p1
-p2
-
-
paintFigure
protected void paintFigure(org.eclipse.draw2d.Graphics graphics)- Overrides:
paintFigure
in classorg.eclipse.draw2d.Figure
-
setXAxis
- Parameters:
axis
- the xAxis to set
-
getXAxis
- Returns:
- the xAxis
-
setYAxis
- Parameters:
axis
- the yAxis to set
-
setDataProvider
- Parameters:
traceDataProvider
- the traceDataProvider to set
-
getTraceType
- Returns:
- the traceType
-
setTraceColor
public void setTraceColor(org.eclipse.swt.graphics.Color traceColor)- Parameters:
traceColor
- Desired trace color
-
getTraceColor
public org.eclipse.swt.graphics.Color getTraceColor()- Returns:
- the traceColor
-
setTraceType
- Parameters:
traceType
- the traceType to set
-
setBaseLine
- Parameters:
baseLine
- the baseLine to set
-
setPointStyle
- Parameters:
pointStyle
- the pointStyle to set
-
setLineWidth
public void setLineWidth(int lineWidth)- Parameters:
lineWidth
- the lineWidth to set
-
setPointSize
public void setPointSize(int pointSize)- Parameters:
pointSize
- the pointSize to set
-
setAreaAlpha
public void setAreaAlpha(int areaAlpha)- Parameters:
areaAlpha
- the areaAlpha to set
-
setAntiAliasing
public void setAntiAliasing(boolean antiAliasing)- Parameters:
antiAliasing
- the antiAliasing to set
-
setName
public void setName(java.lang.String name)- Parameters:
name
- the name of the trace to set
-
setName
public void setName(java.lang.String name, boolean fire)- Parameters:
name
- the name of the trace to setfire
- if true, a traceNameChanged event is fired
-
getName
public java.lang.String getName()- Returns:
- the name of the trace
-
getPointSize
public int getPointSize()- Returns:
- the pointSize
-
getAreaAlpha
public int getAreaAlpha()- Returns:
- the areaAlpha
-
getYAxis
- Returns:
- the yAxis
-
toString
public java.lang.String toString()- Overrides:
toString
in classjava.lang.Object
-
dataChanged
Description copied from interface:IDataProviderListener
This method will be notified by data provider whenever the data changed in data provider- Specified by:
dataChanged
in interfaceIDataProviderListener
-
axisRevalidated
Description copied from interface:IAxisListener
This method will be notified by axis whenever the axis is revalidated.- Specified by:
axisRevalidated
in interfaceIAxisListener
-
axisRangeChanged
Description copied from interface:IAxisListener
This event indicates a change in the axis' value range- Specified by:
axisRangeChanged
in interfaceIAxisListener
-
getDataProvider
- Returns:
- the traceDataProvider
-
setErrorBarEnabled
public void setErrorBarEnabled(boolean errorBarEnabled)- Parameters:
errorBarEnabled
- the errorBarEnabled to set
-
setYErrorBarType
- Parameters:
errorBarType
- the yErrorBarType to set
-
setXErrorBarType
- Parameters:
errorBarType
- the xErrorBarType to set
-
setDrawYErrorInArea
public void setDrawYErrorInArea(boolean drawYErrorInArea)- Parameters:
drawYErrorInArea
- the drawYErrorArea to set
-
setErrorBarCapWidth
public void setErrorBarCapWidth(int errorBarCapWidth)- Parameters:
errorBarCapWidth
- the errorBarCapWidth to set
-
setErrorBarColor
public void setErrorBarColor(org.eclipse.swt.graphics.Color errorBarColor)- Parameters:
errorBarColor
- Desired color for error bars, ornull
to use trace color
-
getHotSampleList
Hot Sample is the sample on the trace which has been drawn in plot area.- Returns:
- the hotPointList
-
getBaseLine
- Returns:
- the baseLine
-
getPointStyle
- Returns:
- the pointStyle
-
getLineWidth
public int getLineWidth()- Returns:
- the lineWidth
-
isAntiAliasing
public boolean isAntiAliasing()- Returns:
- the antiAliasing
-
isErrorBarEnabled
public boolean isErrorBarEnabled()- Returns:
- the errorBarEnabled
-
getYErrorBarType
- Returns:
- the yErrorBarType
-
getXErrorBarType
- Returns:
- the xErrorBarType
-
getErrorBarCapWidth
public int getErrorBarCapWidth()- Returns:
- the errorBarCapWidth
-
getErrorBarColor
public org.eclipse.swt.graphics.Color getErrorBarColor()- Returns:
- Color used for error bars or 'area'
-
isDrawYErrorInArea
public boolean isDrawYErrorInArea()- Returns:
- the drawYErrorInArea
-
setXYGraph
- Parameters:
xyGraph
- the xyGraph to set
-
getXYGraph
- Returns:
- the xyGraph
-
axisForegroundColorChanged
public void axisForegroundColorChanged(Axis axis, org.eclipse.swt.graphics.Color oldColor, org.eclipse.swt.graphics.Color newColor)- Specified by:
axisForegroundColorChanged
in interfaceIAxisListener
-
axisTitleChanged
- Specified by:
axisTitleChanged
in interfaceIAxisListener
-
axisAutoScaleChanged
- Specified by:
axisAutoScaleChanged
in interfaceIAxisListener
-
axisLogScaleChanged
- Specified by:
axisLogScaleChanged
in interfaceIAxisListener
-
dispose
public void dispose()Remove figures and reset fields
-