public class PlotArea
extends org.eclipse.draw2d.Figure
Modifier and Type | Class and Description |
---|---|
(package private) class |
PlotArea.PlotMouseListener
Listener to mouse events, performs panning and some zooms Is very similar
to the Axis.AxisMouseListener, but unclear how easy/useful it would be to
base them on the same code.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
BACKGROUND_COLOR |
static int |
BUTTON1
Value of left click mouse button event which is equal to 1
|
static int |
BUTTON2
Value of middle click / mousewheel button event which is equal to 2
|
Constructor and Description |
---|
PlotArea(IXYGraph xyGraph)
Construct a plot area for the given graph with black foreground
and white background
|
PlotArea(IXYGraph xyGraph,
org.eclipse.swt.graphics.Color foreground,
org.eclipse.swt.graphics.Color background)
Construct a plot area for the given graph with given foreground and
background colors
|
Modifier and Type | Method and Description |
---|---|
void |
addAnnotation(Annotation annotation)
Add an annotation to the plot area.
|
void |
addAuxilliaryClickListener(org.eclipse.draw2d.MouseListener auxilliaryClickListener) |
void |
addAuxilliaryMotionListener(org.eclipse.draw2d.MouseMotionListener auxilliaryMotionListener) |
void |
addGrid(Grid grid)
Add a grid to the plot area.
|
void |
addPropertyChangeListener(java.beans.PropertyChangeListener listener) |
void |
addPropertyChangeListener(java.lang.String property,
java.beans.PropertyChangeListener listener) |
void |
addTrace(Trace trace)
Add a trace to the plot area.
|
void |
fireMouseDoubleClicked(org.eclipse.draw2d.MouseEvent me) |
void |
fireMouseDragged(org.eclipse.draw2d.MouseEvent me) |
void |
fireMouseEntered(org.eclipse.draw2d.MouseEvent me) |
void |
fireMouseExited(org.eclipse.draw2d.MouseEvent me) |
void |
fireMouseHover(org.eclipse.draw2d.MouseEvent me) |
void |
fireMouseMoved(org.eclipse.draw2d.MouseEvent me) |
void |
fireMousePressed(org.eclipse.draw2d.MouseEvent me) |
void |
fireMouseReleased(org.eclipse.draw2d.MouseEvent me) |
java.util.List<Annotation> |
getAnnotationList() |
java.util.List<Trace> |
getTraceList() |
IXYGraph |
getXYGraph() |
ZoomType |
getZoomType() |
boolean |
isShowBorder() |
protected void |
layout() |
protected void |
paintClientArea(org.eclipse.draw2d.Graphics graphics) |
boolean |
removeAnnotation(Annotation annotation)
Remove a annotation from the plot area.
|
void |
removeAuxilliaryClickListener(org.eclipse.draw2d.MouseListener auxilliaryClickListener) |
void |
removeAuxilliaryMotionListener(org.eclipse.draw2d.MouseMotionListener auxilliaryMotionListener) |
boolean |
removeGrid(Grid grid)
Remove a grid from the plot area.
|
void |
removePropertyChangeListener(java.beans.PropertyChangeListener listener) |
void |
removePropertyChangeListener(java.lang.String property,
java.beans.PropertyChangeListener listener) |
boolean |
removeTrace(Trace trace)
Remove a trace from the plot area.
|
void |
setBackgroundColor(org.eclipse.swt.graphics.Color bg) |
void |
setShowBorder(boolean showBorder) |
void |
setZoomType(ZoomType zoomType) |
void |
zoomInOut(boolean horizontally,
boolean vertically,
int mouseX,
int mouseY,
double factor)
Zoom 'in' or 'out' by a fixed factor
|
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, isOpaque, isRequestFocusEnabled, isShowing, isValid, isValidationRoot, isVisible, paint, paintBorder, paintChildren, paintFigure, primTranslate, remove, removeAll, removeAncestorListener, removeCoordinateListener, removeFigureListener, removeFocusListener, removeKeyListener, removeLayoutListener, removeListener, removeMouseListener, removeMouseMotionListener, removeNotify, repaint, repaint, repaint, requestFocus, revalidate, 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 static final java.lang.String BACKGROUND_COLOR
public static final int BUTTON1
public static final int BUTTON2
public PlotArea(IXYGraph xyGraph)
xyGraph
- public PlotArea(IXYGraph xyGraph, org.eclipse.swt.graphics.Color foreground, org.eclipse.swt.graphics.Color background)
xyGraph
- foreground
- color for foreground, can be null to inherit parent's colorbackground
- color for background, can be null to inherit parent's colorpublic 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 setBackgroundColor(org.eclipse.swt.graphics.Color bg)
setBackgroundColor
in interface org.eclipse.draw2d.IFigure
setBackgroundColor
in class org.eclipse.draw2d.Figure
public void addTrace(Trace trace)
trace
- the trace to be added.public boolean removeTrace(Trace trace)
trace
- public void addGrid(Grid grid)
grid
- the grid to be added.public boolean removeGrid(Grid grid)
grid
- the grid to be removed.public void addAnnotation(Annotation annotation)
annotation
- the annotation to be added.public boolean removeAnnotation(Annotation annotation)
annotation
- the annotation to be removed.protected void layout()
layout
in class org.eclipse.draw2d.Figure
protected void paintClientArea(org.eclipse.draw2d.Graphics graphics)
paintClientArea
in class org.eclipse.draw2d.Figure
public void setShowBorder(boolean showBorder)
showBorder
- the showBorder to setpublic boolean isShowBorder()
public void setZoomType(ZoomType zoomType)
zoomType
- the zoomType to setpublic ZoomType getZoomType()
public IXYGraph getXYGraph()
public void zoomInOut(boolean horizontally, boolean vertically, int mouseX, int mouseY, double factor)
horizontally
- along x axes?vertically
- along y axes?mouseX
- absolute X location of the mouse cursormouseY
- absolute Y location of the mouse cursorfactor
- Zoom factor. Positive to zoom 'in', negative 'out'.public java.util.List<Trace> getTraceList()
public java.util.List<Annotation> getAnnotationList()
public void addAuxilliaryMotionListener(org.eclipse.draw2d.MouseMotionListener auxilliaryMotionListener)
public void removeAuxilliaryClickListener(org.eclipse.draw2d.MouseListener auxilliaryClickListener)
public void removeAuxilliaryMotionListener(org.eclipse.draw2d.MouseMotionListener auxilliaryMotionListener)
public void addAuxilliaryClickListener(org.eclipse.draw2d.MouseListener auxilliaryClickListener)
public void fireMouseReleased(org.eclipse.draw2d.MouseEvent me)
public void fireMouseDoubleClicked(org.eclipse.draw2d.MouseEvent me)
public void fireMousePressed(org.eclipse.draw2d.MouseEvent me)
public void fireMouseMoved(org.eclipse.draw2d.MouseEvent me)
public void fireMouseHover(org.eclipse.draw2d.MouseEvent me)
public void fireMouseEntered(org.eclipse.draw2d.MouseEvent me)
public void fireMouseExited(org.eclipse.draw2d.MouseEvent me)
public void fireMouseDragged(org.eclipse.draw2d.MouseEvent me)