public class XYGraph extends org.eclipse.draw2d.Figure implements IXYGraph
Modifier and Type | Field and Description |
---|---|
static org.eclipse.swt.graphics.RGB[] |
DEFAULT_TRACES_COLOR
Default colors for newly added item, used over when reaching the end.
|
protected java.util.Map<Axis,Legend> |
legendMap |
protected OperationsManager |
operationsManager |
protected PlotArea |
plotArea |
Axis |
primaryXAxis
Deprecated.
|
Axis |
primaryYAxis
Deprecated.
|
static java.lang.String |
PROPERTY_CONFIG
Deprecated.
|
static java.lang.String |
PROPERTY_XY_GRAPH_MEM
Deprecated.
|
static java.lang.String |
PROPERTY_ZOOMTYPE
Deprecated.
|
protected org.eclipse.draw2d.Label |
titleLabel |
protected boolean |
transparent |
protected java.util.List<Axis> |
xAxisList |
protected java.util.List<Axis> |
yAxisList |
bgColor, border, bounds, fgColor, flags, font, MAX_FLAG, maxSize, minSize, NO_MANAGER, prefSize, toolTip
Constructor and Description |
---|
XYGraph()
Constructor
|
XYGraph(IAxesFactory axesFactory)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addAnnotation(Annotation annotation)
Add an annotation
|
void |
addAxis(Axis axis)
Add an axis to the graph
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener) |
void |
addPropertyChangeListener(java.lang.String property,
java.beans.PropertyChangeListener listener) |
void |
addTrace(Trace trace)
Add a trace
|
protected PlotArea |
createPlotArea(IXYGraph xyGraph)
Warning: This method is called in the constructor to create a plot
area
|
void |
fireConfigChanged() |
java.util.List<Axis> |
getAxisList() |
org.eclipse.swt.graphics.Image |
getImage() |
org.eclipse.swt.graphics.Image |
getImage(org.eclipse.swt.graphics.Rectangle size) |
Legend |
getLegend(Trace trace) |
java.util.Map<Axis,Legend> |
getLegendMap() |
OperationsManager |
getOperationsManager() |
PlotArea |
getPlotArea() |
Axis |
getPrimaryXAxis() |
Axis |
getPrimaryYAxis() |
java.lang.String |
getTitle() |
org.eclipse.swt.graphics.Color |
getTitleColor() |
org.eclipse.swt.graphics.RGB |
getTitleColorRgb() |
org.eclipse.swt.graphics.Font |
getTitleFont() |
org.eclipse.swt.graphics.FontData |
getTitleFontData() |
java.util.List<Axis> |
getXAxisList() |
XYGraphMemento |
getXyGraphMem() |
java.util.List<Axis> |
getYAxisList() |
ZoomType |
getZoomType() |
boolean |
isOpaque() |
boolean |
isShowLegend() |
boolean |
isShowTitle() |
boolean |
isTransparent() |
protected void |
layout() |
void |
paintFigure(org.eclipse.draw2d.Graphics graphics) |
void |
performAutoScale()
Perform forced autoscale to all axes.
|
void |
performStagger()
Stagger all axes: Autoscale each axis so that traces on various axes
don't overlap
|
void |
removeAnnotation(Annotation annotation)
Remove an annotation
|
boolean |
removeAxis(Axis axis)
Remove an axis from the graph
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener) |
void |
removePropertyChangeListener(java.lang.String property,
java.beans.PropertyChangeListener listener) |
void |
removeTrace(Trace trace)
Remove a trace.
|
void |
setShowLegend(boolean showLegend) |
void |
setShowTitle(boolean showTitle) |
void |
setTitle(java.lang.String title) |
void |
setTitleColor(org.eclipse.swt.graphics.Color titleColor) |
void |
setTitleFont(org.eclipse.swt.graphics.Font titleFont) |
void |
setTransparent(boolean transparent) |
void |
setXyGraphMem(XYGraphMemento xyGraphMem) |
void |
setZoomType(ZoomType zoomType) |
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addListener, addMouseListener, addMouseMotionListener, addNotify, 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, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, paint, paintBorder, paintChildren, paintClientArea, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, 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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
add, add, add, add, addAncestorListener, addCoordinateListener, addFigureListener, addFocusListener, addKeyListener, addLayoutListener, addMouseListener, addMouseMotionListener, addNotify, containsPoint, containsPoint, erase, findFigureAt, findFigureAt, findFigureAt, findFigureAtExcluding, findMouseEventTargetAt, getBackgroundColor, getBorder, getBounds, getChildren, getClientArea, getClientArea, getClippingStrategy, getCursor, getFont, getForegroundColor, getInsets, getLayoutManager, getLocalBackgroundColor, getLocalForegroundColor, 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, isRequestFocusEnabled, isShowing, isVisible, paint, remove, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeMouseListener, removeMouseMotionListener, removeNotify, repaint, repaint, repaint, requestFocus, revalidate, setBackgroundColor, setBorder, setBounds, setClippingStrategy, setConstraint, setCursor, setEnabled, setFocusTraversable, setFont, setForegroundColor, setLayoutManager, setLocation, setMaximumSize, setMinimumSize, setOpaque, setParent, setPreferredSize, setRequestFocusEnabled, setSize, setSize, setToolTip, setVisible, translate, translateFromParent, translateToAbsolute, translateToParent, translateToRelative, validate
@Deprecated public static final java.lang.String PROPERTY_CONFIG
IXYGraph.PROPERTY_CONFIG
instead@Deprecated public static final java.lang.String PROPERTY_XY_GRAPH_MEM
IXYGraph.PROPERTY_XY_GRAPH_MEM
instead@Deprecated public static final java.lang.String PROPERTY_ZOOMTYPE
IXYGraph.PROPERTY_ZOOMTYPE
insteadpublic static final org.eclipse.swt.graphics.RGB[] DEFAULT_TRACES_COLOR
Very hard to find a long list of distinct colors. This list is definitely too short...
protected boolean transparent
protected org.eclipse.draw2d.Label titleLabel
protected java.util.List<Axis> xAxisList
protected java.util.List<Axis> yAxisList
protected PlotArea plotArea
@Deprecated public final Axis primaryXAxis
getPrimaryXAxis()
instead@Deprecated public final Axis primaryYAxis
getPrimaryYAxis()
insteadprotected OperationsManager operationsManager
public XYGraph()
public XYGraph(IAxesFactory axesFactory)
axesFactory
- The IAxesFactory
to use to create the primary axes for
the graph. Should not be null
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface org.eclipse.draw2d.IFigure
addPropertyChangeListener
in class org.eclipse.draw2d.Figure
public void addPropertyChangeListener(java.lang.String property, java.beans.PropertyChangeListener listener)
addPropertyChangeListener
in interface org.eclipse.draw2d.IFigure
addPropertyChangeListener
in class org.eclipse.draw2d.Figure
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface org.eclipse.draw2d.IFigure
removePropertyChangeListener
in class org.eclipse.draw2d.Figure
public void removePropertyChangeListener(java.lang.String property, java.beans.PropertyChangeListener listener)
removePropertyChangeListener
in interface org.eclipse.draw2d.IFigure
removePropertyChangeListener
in class org.eclipse.draw2d.Figure
public void fireConfigChanged()
fireConfigChanged
in interface IXYGraph
public XYGraphMemento getXyGraphMem()
getXyGraphMem
in interface IXYGraph
public void setXyGraphMem(XYGraphMemento xyGraphMem)
setXyGraphMem
in interface IXYGraph
protected PlotArea createPlotArea(IXYGraph xyGraph)
xyGraph
- public boolean isOpaque()
isOpaque
in interface org.eclipse.draw2d.IFigure
isOpaque
in class org.eclipse.draw2d.Figure
protected void layout()
layout
in class org.eclipse.draw2d.Figure
public void setZoomType(ZoomType zoomType)
setZoomType
in interface IXYGraph
zoomType
- the zoomType to setpublic ZoomType getZoomType()
getZoomType
in interface IXYGraph
public void setTitle(java.lang.String title)
public void setShowTitle(boolean showTitle)
setShowTitle
in interface IXYGraph
showTitle
- true if title should be shown; false otherwise.public boolean isShowTitle()
isShowTitle
in interface IXYGraph
public void setShowLegend(boolean showLegend)
setShowLegend
in interface IXYGraph
showLegend
- true if legend should be shown; false otherwise.public boolean isShowLegend()
isShowLegend
in interface IXYGraph
public void addAxis(Axis axis)
public boolean removeAxis(Axis axis)
removeAxis
in interface IXYGraph
axis
- public void addTrace(Trace trace)
public void removeTrace(Trace trace)
removeTrace
in interface IXYGraph
trace
- public void addAnnotation(Annotation annotation)
addAnnotation
in interface IXYGraph
annotation
- public void removeAnnotation(Annotation annotation)
removeAnnotation
in interface IXYGraph
annotation
- public void setTitleFont(org.eclipse.swt.graphics.Font titleFont)
setTitleFont
in interface IXYGraph
titleFont
- the titleFont to setpublic org.eclipse.swt.graphics.Font getTitleFont()
getTitleFont
in interface IXYGraph
public org.eclipse.swt.graphics.FontData getTitleFontData()
getTitleFontData
in interface IXYGraph
public void setTitleColor(org.eclipse.swt.graphics.Color titleColor)
setTitleColor
in interface IXYGraph
titleColor
- the titleColor to setpublic void paintFigure(org.eclipse.draw2d.Graphics graphics)
paintFigure
in interface IXYGraph
paintFigure
in class org.eclipse.draw2d.Figure
public void setTransparent(boolean transparent)
setTransparent
in interface IXYGraph
transparent
- the transparent to setpublic boolean isTransparent()
isTransparent
in interface IXYGraph
public PlotArea getPlotArea()
getPlotArea
in interface IXYGraph
public org.eclipse.swt.graphics.Image getImage()
public org.eclipse.swt.graphics.Color getTitleColor()
getTitleColor
in interface IXYGraph
public org.eclipse.swt.graphics.RGB getTitleColorRgb()
getTitleColorRgb
in interface IXYGraph
public java.lang.String getTitle()
public OperationsManager getOperationsManager()
getOperationsManager
in interface IXYGraph
public java.util.List<Axis> getXAxisList()
getXAxisList
in interface IXYGraph
public java.util.List<Axis> getYAxisList()
getYAxisList
in interface IXYGraph
public java.util.List<Axis> getAxisList()
getAxisList
in interface IXYGraph
public java.util.Map<Axis,Legend> getLegendMap()
getLegendMap
in interface IXYGraph
public void performAutoScale()
performAutoScale
in interface IXYGraph
public void performStagger()
performStagger
in interface IXYGraph
public org.eclipse.swt.graphics.Image getImage(org.eclipse.swt.graphics.Rectangle size)
trim
- a SWT Rectanglepublic Axis getPrimaryXAxis()
getPrimaryXAxis
in interface IXYGraph
public Axis getPrimaryYAxis()
getPrimaryYAxis
in interface IXYGraph