Class PlotArea
java.lang.Object
org.eclipse.draw2d.Figure
org.eclipse.nebula.visualization.xygraph.figures.PlotArea
- All Implemented Interfaces:
org.eclipse.draw2d.IFigure
public class PlotArea
extends org.eclipse.draw2d.Figure
The plot area figure.
-
Nested Class Summary
Nested Classes Modifier and Type Class 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. -
Field Summary
Fields Modifier and Type Field Description static java.lang.String
BACKGROUND_COLOR
static int
BUTTON1
Value of left click mouse button event which is equal to 1static int
BUTTON2
Value of middle click / mousewheel button event which is equal to 2 -
Constructor Summary
Constructors Constructor Description PlotArea(IXYGraph xyGraph)
Construct a plot area for the given graph with black foreground and white backgroundPlotArea(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 -
Method Summary
Modifier and Type Method 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 factorMethods inherited from class org.eclipse.draw2d.Figure
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
-
Field Details
-
BACKGROUND_COLOR
public static final java.lang.String BACKGROUND_COLOR- See Also:
- Constant Field Values
-
BUTTON1
public static final int BUTTON1Value of left click mouse button event which is equal to 1- See Also:
- Constant Field Values
-
BUTTON2
public static final int BUTTON2Value of middle click / mousewheel button event which is equal to 2- See Also:
- Constant Field Values
-
-
Constructor Details
-
PlotArea
Construct a plot area for the given graph with black foreground and white background- Parameters:
xyGraph
-
-
PlotArea
public 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- Parameters:
xyGraph
-foreground
- color for foreground, can be null to inherit parent's colorbackground
- color for background, can be null to inherit parent's color
-
-
Method Details
-
addPropertyChangeListener
public void addPropertyChangeListener(java.beans.PropertyChangeListener listener)- Specified by:
addPropertyChangeListener
in interfaceorg.eclipse.draw2d.IFigure
- Overrides:
addPropertyChangeListener
in classorg.eclipse.draw2d.Figure
-
addPropertyChangeListener
public void addPropertyChangeListener(java.lang.String property, java.beans.PropertyChangeListener listener)- Specified by:
addPropertyChangeListener
in interfaceorg.eclipse.draw2d.IFigure
- Overrides:
addPropertyChangeListener
in classorg.eclipse.draw2d.Figure
-
removePropertyChangeListener
public void removePropertyChangeListener(java.beans.PropertyChangeListener listener)- Specified by:
removePropertyChangeListener
in interfaceorg.eclipse.draw2d.IFigure
- Overrides:
removePropertyChangeListener
in classorg.eclipse.draw2d.Figure
-
removePropertyChangeListener
public void removePropertyChangeListener(java.lang.String property, java.beans.PropertyChangeListener listener)- Specified by:
removePropertyChangeListener
in interfaceorg.eclipse.draw2d.IFigure
- Overrides:
removePropertyChangeListener
in classorg.eclipse.draw2d.Figure
-
setBackgroundColor
public void setBackgroundColor(org.eclipse.swt.graphics.Color bg)- Specified by:
setBackgroundColor
in interfaceorg.eclipse.draw2d.IFigure
- Overrides:
setBackgroundColor
in classorg.eclipse.draw2d.Figure
-
addTrace
Add a trace to the plot area.- Parameters:
trace
- the trace to be added.
-
removeTrace
Remove a trace from the plot area.- Parameters:
trace
-- Returns:
- true if this plot area contained the specified trace
-
addGrid
Add a grid to the plot area.- Parameters:
grid
- the grid to be added.
-
removeGrid
Remove a grid from the plot area.- Parameters:
grid
- the grid to be removed.- Returns:
- true if this plot area contained the specified grid
-
addAnnotation
Add an annotation to the plot area.- Parameters:
annotation
- the annotation to be added.
-
removeAnnotation
Remove a annotation from the plot area.- Parameters:
annotation
- the annotation to be removed.- Returns:
- true if this plot area contained the specified annotation
-
layout
protected void layout()- Overrides:
layout
in classorg.eclipse.draw2d.Figure
-
paintClientArea
protected void paintClientArea(org.eclipse.draw2d.Graphics graphics)- Overrides:
paintClientArea
in classorg.eclipse.draw2d.Figure
-
setShowBorder
public void setShowBorder(boolean showBorder)- Parameters:
showBorder
- the showBorder to set
-
isShowBorder
public boolean isShowBorder()- Returns:
- the showBorder
-
setZoomType
- Parameters:
zoomType
- the zoomType to set
-
getZoomType
- Returns:
- the active zoom type
-
getXYGraph
- Returns:
- xyGraph
-
zoomInOut
public void zoomInOut(boolean horizontally, boolean vertically, int mouseX, int mouseY, double factor)Zoom 'in' or 'out' by a fixed factor- Parameters:
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'.
-
getTraceList
- Returns:
- the traceList
-
getAnnotationList
- Returns:
- the annotationList
-
addAuxilliaryMotionListener
public void addAuxilliaryMotionListener(org.eclipse.draw2d.MouseMotionListener auxilliaryMotionListener) -
removeAuxilliaryClickListener
public void removeAuxilliaryClickListener(org.eclipse.draw2d.MouseListener auxilliaryClickListener) -
removeAuxilliaryMotionListener
public void removeAuxilliaryMotionListener(org.eclipse.draw2d.MouseMotionListener auxilliaryMotionListener) -
addAuxilliaryClickListener
public void addAuxilliaryClickListener(org.eclipse.draw2d.MouseListener auxilliaryClickListener) -
fireMouseReleased
public void fireMouseReleased(org.eclipse.draw2d.MouseEvent me) -
fireMouseDoubleClicked
public void fireMouseDoubleClicked(org.eclipse.draw2d.MouseEvent me) -
fireMousePressed
public void fireMousePressed(org.eclipse.draw2d.MouseEvent me) -
fireMouseMoved
public void fireMouseMoved(org.eclipse.draw2d.MouseEvent me) -
fireMouseHover
public void fireMouseHover(org.eclipse.draw2d.MouseEvent me) -
fireMouseEntered
public void fireMouseEntered(org.eclipse.draw2d.MouseEvent me) -
fireMouseExited
public void fireMouseExited(org.eclipse.draw2d.MouseEvent me) -
fireMouseDragged
public void fireMouseDragged(org.eclipse.draw2d.MouseEvent me)
-