public class Annotation extends org.eclipse.draw2d.Figure implements IAxisListener, IDataProviderListener
Modifier and Type | Class and Description |
---|---|
static class |
Annotation.CursorLineStyle |
(package private) class |
Annotation.InfoLabelDragger |
(package private) class |
Annotation.Pointer |
Modifier and Type | Field and Description |
---|---|
protected ISample |
currentSnappedSample |
protected boolean |
pointerDragged |
protected Trace |
trace |
protected Axis |
xAxis |
protected double |
xValue |
protected Axis |
yAxis |
protected double |
yValue |
Constructor and Description |
---|
Annotation(java.lang.String name,
Axis xAxis,
Axis yAxis)
Construct a free annotation.
|
Annotation(java.lang.String name,
Trace trace)
Construct an annotation on a trace.
|
Modifier and Type | Method and Description |
---|---|
void |
addAnnotationListener(IAnnotationListener 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) |
boolean |
containsPoint(int x,
int y) |
void |
dataChanged(IDataProvider dataProvider)
This method will be notified by data provider whenever the data changed
in data provider
|
org.eclipse.swt.graphics.Color |
getAnnotationColor() |
org.eclipse.swt.graphics.RGB |
getAnnotationColorRGB() |
org.eclipse.swt.graphics.Font |
getAnnotationFont() |
Annotation.CursorLineStyle |
getCursorLineStyle() |
org.eclipse.swt.graphics.FontData |
getFontData() |
IAnnotationLabelProvider |
getLabelProvider() |
java.lang.String |
getName() |
Trace |
getTrace() |
Axis |
getXAxis() |
double |
getXValue() |
Axis |
getYAxis() |
double |
getYValue() |
boolean |
isFree() |
boolean |
isShowName() |
boolean |
isShowPosition() |
boolean |
isShowSampleInfo() |
protected void |
layout() |
protected void |
paintFigure(org.eclipse.draw2d.Graphics graphics) |
void |
remove() |
void |
setAnnotationColor(org.eclipse.swt.graphics.Color annotationColor) |
void |
setAnnotationFont(org.eclipse.swt.graphics.Font annotationFont) |
void |
setCurrentPosition(org.eclipse.draw2d.geometry.Point currentPosition,
boolean keepLabelPosition) |
void |
setCurrentPosition(org.eclipse.draw2d.geometry.Point currentPosition,
boolean keepLabelPosition,
boolean calcValueFromPosition) |
void |
setCurrentSnappedSample(ISample currentSnappedSample,
boolean keepLabelPosition) |
void |
setCursorLineStyle(Annotation.CursorLineStyle cursorLineStyle) |
void |
setdxdy(double dx,
double dy) |
void |
setFont(org.eclipse.swt.graphics.Font f) |
void |
setFree(Axis xAxis,
Axis yAxis)
Make the annotation free.
|
void |
setLabelProvider(IAnnotationLabelProvider labelProvider) |
void |
setLocation(double x,
double y)
Sets x an y location.
|
void |
setName(java.lang.String name) |
void |
setShowName(boolean showName) |
void |
setShowPosition(boolean showPosition) |
void |
setShowSampleInfo(boolean showSampleInfo) |
void |
setTrace(Trace trace) |
void |
setValues(double x,
double y)
Set the position of the annotation based on plot values
|
void |
setXAxis(Axis axis) |
void |
setXYGraph(IXYGraph xyGraph) |
void |
setYAxis(Axis axis) |
void |
toFront()
Sets annotation order to front
|
protected void |
updateToDefaultPosition()
move the annotation to the center of the plot area or trace.
|
void |
updateX0Y0Fromdxdy(org.eclipse.draw2d.geometry.Dimension size)
update (x0, y0) if it is unknown.
|
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addNotify, addPropertyChangeListener, addPropertyChangeListener, 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, 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, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setValid, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, useLocalCoordinates, validate
protected Axis xAxis
protected Axis yAxis
protected double xValue
protected double yValue
protected Trace trace
protected ISample currentSnappedSample
protected boolean pointerDragged
public Annotation(java.lang.String name, Trace trace)
name
- the name of the annotation.trace
- the trace which the annotation will snap to.public void remove()
public void addAnnotationListener(IAnnotationListener listener)
public boolean containsPoint(int x, int y)
containsPoint
in interface org.eclipse.draw2d.IFigure
containsPoint
in class org.eclipse.draw2d.Figure
protected void layout()
layout
in class org.eclipse.draw2d.Figure
protected void paintFigure(org.eclipse.draw2d.Graphics graphics)
paintFigure
in class org.eclipse.draw2d.Figure
public void updateX0Y0Fromdxdy(org.eclipse.draw2d.geometry.Dimension size)
size
- the label sizeprotected void updateToDefaultPosition()
public void setValues(double x, double y)
x
- Position as value on the X axisy
- Position as value on the Y axisfor setting the position based
on screen coordinates
public void setXAxis(Axis axis)
axis
- the xAxis to setpublic void setYAxis(Axis axis)
axis
- the yAxis to setpublic void setName(java.lang.String name)
name
- the name to setpublic void setFont(org.eclipse.swt.graphics.Font f)
setFont
in interface org.eclipse.draw2d.IFigure
setFont
in class org.eclipse.draw2d.Figure
public org.eclipse.swt.graphics.FontData getFontData()
public void setTrace(Trace trace)
trace
- the trace to setpublic void setFree(Axis xAxis, Axis yAxis)
xAxis
- yAxis
- public boolean isFree()
public void setShowName(boolean showName)
showName
- the showName to setpublic void setShowSampleInfo(boolean showSampleInfo)
showSampleInfo
- the showSampleInfo to setpublic void setShowPosition(boolean showPosition)
showPosition
- the showPosition to setpublic void setAnnotationColor(org.eclipse.swt.graphics.Color annotationColor)
annotationColor
- the annotationColor to setpublic void setAnnotationFont(org.eclipse.swt.graphics.Font annotationFont)
annotationFont
- the annotationFont to setpublic org.eclipse.swt.graphics.Font getAnnotationFont()
public void setCursorLineStyle(Annotation.CursorLineStyle cursorLineStyle)
cursorLineStyle
- the cursorLineStyle to setpublic void setCurrentPosition(org.eclipse.draw2d.geometry.Point currentPosition, boolean keepLabelPosition, boolean calcValueFromPosition)
currentPosition
- the currentPosition to setpublic void setCurrentPosition(org.eclipse.draw2d.geometry.Point currentPosition, boolean keepLabelPosition)
public void setCurrentSnappedSample(ISample currentSnappedSample, boolean keepLabelPosition)
currentSnappedSample
- the currentSnappedSample to setkeepLabelPosition
- 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 void dataChanged(IDataProvider dataProvider)
IDataProviderListener
dataChanged
in interface IDataProviderListener
public void setXYGraph(IXYGraph xyGraph)
xyGraph
- the xyGraph to setpublic void setdxdy(double dx, double dy)
public void setLocation(double x, double y)
x
- y
- public Axis getXAxis()
public Axis getYAxis()
public java.lang.String getName()
public double getXValue()
public double getYValue()
public Annotation.CursorLineStyle getCursorLineStyle()
public Trace getTrace()
public boolean isShowName()
public boolean isShowSampleInfo()
public boolean isShowPosition()
public org.eclipse.swt.graphics.Color getAnnotationColor()
public IAnnotationLabelProvider getLabelProvider()
public void setLabelProvider(IAnnotationLabelProvider labelProvider)
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 org.eclipse.swt.graphics.RGB getAnnotationColorRGB()
public void toFront()