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 classTrace.BaseLinestatic classTrace.ErrorBarTypestatic classTrace.PointStylestatic classTrace.TraceTypeThe 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 voidaddListener(ITraceListener listener)voidaxisAutoScaleChanged(Axis axis, boolean oldAutoScale, boolean newAutoScale)voidaxisForegroundColorChanged(Axis axis, org.eclipse.swt.graphics.Color oldColor, org.eclipse.swt.graphics.Color newColor)voidaxisLogScaleChanged(Axis axis, boolean old, boolean logScale)voidaxisRangeChanged(Axis axis, Range old_range, Range new_range)This event indicates a change in the axis' value rangevoidaxisRevalidated(Axis axis)This method will be notified by axis whenever the axis is revalidated.voidaxisTitleChanged(Axis axis, java.lang.String oldTitle, java.lang.String newTitle)voiddataChanged(IDataProvider dataProvider)This method will be notified by data provider whenever the data changed in data providervoiddispose()Remove figures and reset fieldsvoiddrawLine(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.voiddrawPoint(org.eclipse.draw2d.Graphics graphics, org.eclipse.draw2d.geometry.Point pos)Draw point with the pointStyle and size of the trace;intgetAreaAlpha()Trace.BaseLinegetBaseLine()IDataProvidergetDataProvider()intgetErrorBarCapWidth()org.eclipse.swt.graphics.ColorgetErrorBarColor()java.util.List<ISample>getHotSampleList()Hot Sample is the sample on the trace which has been drawn in plot area.intgetLineWidth()java.lang.StringgetName()intgetPointSize()Trace.PointStylegetPointStyle()IPointStyleProvidergetPointStyleProvider()org.eclipse.swt.graphics.ColorgetTraceColor()Trace.TraceTypegetTraceType()AxisgetXAxis()Trace.ErrorBarTypegetXErrorBarType()IXYGraphgetXYGraph()AxisgetYAxis()Trace.ErrorBarTypegetYErrorBarType()voidinit(Axis xAxis, Axis yAxis, IDataProvider dataProvider)Must be called if usingTrace(String)booleanisAntiAliasing()booleanisDrawYErrorInArea()booleanisErrorBarEnabled()protected voidpaintFigure(org.eclipse.draw2d.Graphics graphics)booleanremoveListener(ITraceListener listener)voidsetAntiAliasing(boolean antiAliasing)voidsetAreaAlpha(int areaAlpha)voidsetBaseLine(Trace.BaseLine baseLine)voidsetDataProvider(IDataProvider traceDataProvider)voidsetDrawYErrorInArea(boolean drawYErrorInArea)voidsetErrorBarCapWidth(int errorBarCapWidth)voidsetErrorBarColor(org.eclipse.swt.graphics.Color errorBarColor)voidsetErrorBarEnabled(boolean errorBarEnabled)voidsetLineWidth(int lineWidth)voidsetName(java.lang.String name)voidsetName(java.lang.String name, boolean fire)voidsetPointSize(int pointSize)voidsetPointStyle(Trace.PointStyle pointStyle)voidsetPointStyleProvider(IPointStyleProvider pointStyleProvider)voidsetTraceColor(org.eclipse.swt.graphics.Color traceColor)voidsetTraceType(Trace.TraceType traceType)voidsetXAxis(Axis axis)voidsetXErrorBarType(Trace.ErrorBarType errorBarType)voidsetXYGraph(IXYGraph xyGraph)voidsetYAxis(Axis axis)voidsetYErrorBarType(Trace.ErrorBarType errorBarType)java.lang.StringtoString()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:
paintFigurein 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:
toStringin classjava.lang.Object
-
dataChanged
Description copied from interface:IDataProviderListenerThis method will be notified by data provider whenever the data changed in data provider- Specified by:
dataChangedin interfaceIDataProviderListener
-
axisRevalidated
Description copied from interface:IAxisListenerThis method will be notified by axis whenever the axis is revalidated.- Specified by:
axisRevalidatedin interfaceIAxisListener
-
axisRangeChanged
Description copied from interface:IAxisListenerThis event indicates a change in the axis' value range- Specified by:
axisRangeChangedin 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, ornullto 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:
axisForegroundColorChangedin interfaceIAxisListener
-
axisTitleChanged
- Specified by:
axisTitleChangedin interfaceIAxisListener
-
axisAutoScaleChanged
- Specified by:
axisAutoScaleChangedin interfaceIAxisListener
-
axisLogScaleChanged
- Specified by:
axisLogScaleChangedin interfaceIAxisListener
-
dispose
public void dispose()Remove figures and reset fields
-