public class Trace extends org.eclipse.draw2d.Figure implements IDataProviderListener, IAxisListener
Modifier and Type | Class and 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.
|
Constructor and Description |
---|
Trace(java.lang.String name)
init(Axis, Axis, IDataProvider) needs to be called if a trace is
created with this constructor |
Trace(java.lang.String name,
Axis xAxis,
Axis yAxis,
IDataProvider dataProvider) |
Modifier and Type | Method and 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 range
|
void |
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 provider
|
void |
dispose()
Remove figures and reset fields
|
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.
|
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 using
Trace(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() |
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
public Trace(java.lang.String name)
init(Axis, Axis, IDataProvider)
needs to be called if a trace is
created with this constructorpublic Trace(java.lang.String name, Axis xAxis, Axis yAxis, IDataProvider dataProvider)
public void addListener(ITraceListener listener)
public boolean removeListener(ITraceListener listener)
public void setPointStyleProvider(IPointStyleProvider pointStyleProvider)
public IPointStyleProvider getPointStyleProvider()
public void init(Axis xAxis, Axis yAxis, IDataProvider dataProvider)
Trace(String)
xAxis
- yAxis
- dataProvider
- public void drawPoint(org.eclipse.draw2d.Graphics graphics, org.eclipse.draw2d.geometry.Point pos)
graphics
- pos
- public void drawLine(org.eclipse.draw2d.Graphics graphics, org.eclipse.draw2d.geometry.Point p1, org.eclipse.draw2d.geometry.Point p2)
graphics
- p1
- p2
- protected void paintFigure(org.eclipse.draw2d.Graphics graphics)
paintFigure
in class org.eclipse.draw2d.Figure
public void setXAxis(Axis axis)
axis
- the xAxis to setpublic Axis getXAxis()
public void setYAxis(Axis axis)
axis
- the yAxis to setpublic void setDataProvider(IDataProvider traceDataProvider)
traceDataProvider
- the traceDataProvider to setpublic Trace.TraceType getTraceType()
public void setTraceColor(org.eclipse.swt.graphics.Color traceColor)
traceColor
- Desired trace colorpublic org.eclipse.swt.graphics.Color getTraceColor()
public void setTraceType(Trace.TraceType traceType)
traceType
- the traceType to setpublic void setBaseLine(Trace.BaseLine baseLine)
baseLine
- the baseLine to setpublic void setPointStyle(Trace.PointStyle pointStyle)
pointStyle
- the pointStyle to setpublic void setLineWidth(int lineWidth)
lineWidth
- the lineWidth to setpublic void setPointSize(int pointSize)
pointSize
- the pointSize to setpublic void setAreaAlpha(int areaAlpha)
areaAlpha
- the areaAlpha to setpublic void setAntiAliasing(boolean antiAliasing)
antiAliasing
- the antiAliasing to setpublic void setName(java.lang.String name)
name
- the name of the trace to setpublic void setName(java.lang.String name, boolean fire)
name
- the name of the trace to setfire
- if true, a traceNameChanged event is firedpublic java.lang.String getName()
public int getPointSize()
public int getAreaAlpha()
public Axis getYAxis()
public java.lang.String toString()
toString
in class java.lang.Object
public void dataChanged(IDataProvider dataProvider)
IDataProviderListener
dataChanged
in interface IDataProviderListener
public void axisRevalidated(Axis axis)
IAxisListener
axisRevalidated
in interface IAxisListener
public void axisRangeChanged(Axis axis, Range old_range, Range new_range)
IAxisListener
axisRangeChanged
in interface IAxisListener
public IDataProvider getDataProvider()
public void setErrorBarEnabled(boolean errorBarEnabled)
errorBarEnabled
- the errorBarEnabled to setpublic void setYErrorBarType(Trace.ErrorBarType errorBarType)
errorBarType
- the yErrorBarType to setpublic void setXErrorBarType(Trace.ErrorBarType errorBarType)
errorBarType
- the xErrorBarType to setpublic void setDrawYErrorInArea(boolean drawYErrorInArea)
drawYErrorInArea
- the drawYErrorArea to setpublic void setErrorBarCapWidth(int errorBarCapWidth)
errorBarCapWidth
- the errorBarCapWidth to setpublic void setErrorBarColor(org.eclipse.swt.graphics.Color errorBarColor)
errorBarColor
- Desired color for error bars, or null
to use
trace colorpublic java.util.List<ISample> getHotSampleList()
public Trace.BaseLine getBaseLine()
public Trace.PointStyle getPointStyle()
public int getLineWidth()
public boolean isAntiAliasing()
public boolean isErrorBarEnabled()
public Trace.ErrorBarType getYErrorBarType()
public Trace.ErrorBarType getXErrorBarType()
public int getErrorBarCapWidth()
public org.eclipse.swt.graphics.Color getErrorBarColor()
public boolean isDrawYErrorInArea()
public void setXYGraph(IXYGraph xyGraph)
xyGraph
- the xyGraph to setpublic IXYGraph getXYGraph()
public void axisForegroundColorChanged(Axis axis, org.eclipse.swt.graphics.Color oldColor, org.eclipse.swt.graphics.Color newColor)
axisForegroundColorChanged
in interface IAxisListener
public void axisTitleChanged(Axis axis, java.lang.String oldTitle, java.lang.String newTitle)
axisTitleChanged
in interface IAxisListener
public void axisAutoScaleChanged(Axis axis, boolean oldAutoScale, boolean newAutoScale)
axisAutoScaleChanged
in interface IAxisListener
public void axisLogScaleChanged(Axis axis, boolean old, boolean logScale)
axisLogScaleChanged
in interface IAxisListener
public void dispose()